Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add devnets in CI #9183

Closed
clevinson opened this issue Apr 22, 2021 · 5 comments
Closed

Add devnets in CI #9183

clevinson opened this issue Apr 22, 2021 · 5 comments
Assignees

Comments

@clevinson
Copy link
Contributor

As described in #9129, we should set up a github action that spins up a docker-based devnet (we can reuse the localnet setup in the Makefile) either just on master or every PR.

We'll need to look into lightweight hosting providers, perhaps Heroku review apps may be the way to go: https://devcenter.heroku.com/articles/github-integration-review-apps#review-apps-and-docker.

@clevinson
Copy link
Contributor Author

Unfortunately, i'm not sure if heroku review apps actually can satisfy our needs here. Heroku in general is mostly meant for single container applications when using heroku's Container Registry and/or Docker Deploys.

Heroku does have some support for deploying multiple images as part of a larger App / Pipeline (e.g. a web & worker setup), but it seems we don't have control over what ports are exposed (see Heroku's documentation on docker deploys)... so I don't think we can feasibly have a 4-node devnet spun up via heroku at all.

One alternative that i've thought about would be using Amazon ECS (elastic container registry), together with our existing Docker Compose functionality (akin to the make localnet-start command). I've been looking at a blog post on Using docker compose with Amazon ECS, together with the documentation for Amazon ECS "Deploy Task Definition" for Github Actions.

Is using something like ECS for this overkill? Are there other alternatives we should be considering here?

I'll continue prototyping with some of this stuff on Regen Ledger (as we have the same needs there), but would be good to see what the broader SDK community things of this as well.

@clevinson clevinson self-assigned this Apr 22, 2021
@clevinson clevinson mentioned this issue Apr 22, 2021
2 tasks
@aaronc
Copy link
Member

aaronc commented Apr 22, 2021

Why is docker a requirement? We should just try the golang buildpack: https://devcenter.heroku.com/articles/go-support

@aaronc
Copy link
Member

aaronc commented Apr 22, 2021

We want to spin up multiple nodes which should be possible in a single golang process. Maybe we can't expose enough ports idk

@clevinson
Copy link
Contributor Author

clevinson commented Apr 23, 2021

Using docker seemed like it would be easier, seeing as we already have a perfectly suitable docker-compose.yml file ready for this use case.

Putting hte docker conversation aside, in the Heroku docs on Private Space Runtime Networking, it seems that heroku still will only expose port 80 for incoming requests, and forward those to the port designated by the $PORT env variable in the dyno process.

I've been assuming that our requirements include exposing ports for all main APIs (e.g. Tendermint RPC, gRPC, REST), as the point of having devnet in CI is to make manaul testing against a live devnet easier. I'm not sure how we can proceed then with Heroku, unless we do some workaround where we have several heroku dynos each acting like a web service listening on port 80, serving as reverse proxy to the corresponding ports (26657, 9090, 1317...) on a 4-node golang process running the testnet in a Heroku "Private Space". This seems a bit hacky. Maybe i'm missing a more obvious strategy here?

@aaronc
Copy link
Member

aaronc commented Apr 23, 2021

Okay let's try another solution then.

@clevinson clevinson added this to the v0.43 milestone May 11, 2021
@clevinson clevinson modified the milestones: v0.43, v0.44 Jun 9, 2021
mergify bot pushed a commit that referenced this issue Jun 29, 2021
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰
v    Before smashing the submit button please review the checkboxes.
v    If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description

ref: #9183 

After some more recent conversations w/ @aaronc, I decided to go back to his original proposal of setting up a subcommand for running in-process testnets. 

This PR splits the `simd testnet` command into two subcommands:
- `simd testnet start` which starts an in-process n-node testnet
- `simd testnet init-files` which sets up configuration & genesis files for an n-node testnet to be run as separate processes (one per node, most likely via Docker Compose)


---

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

- [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - **n/a**
- [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [x] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - **see #9411**
- [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code).
- [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md`
- [x] Re-reviewed `Files changed` in the Github PR explorer
- [ ] Review `Codecov Report` in the comment section below once CI passes
@github-actions github-actions bot added the stale label Sep 8, 2021
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this issue May 22, 2023
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰
v    Before smashing the submit button please review the checkboxes.
v    If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description

ref: cosmos#9183 

After some more recent conversations w/ @aaronc, I decided to go back to his original proposal of setting up a subcommand for running in-process testnets. 

This PR splits the `simd testnet` command into two subcommands:
- `simd testnet start` which starts an in-process n-node testnet
- `simd testnet init-files` which sets up configuration & genesis files for an n-node testnet to be run as separate processes (one per node, most likely via Docker Compose)


---

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

- [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - **n/a**
- [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [x] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - **see cosmos#9411**
- [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code).
- [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md`
- [x] Re-reviewed `Files changed` in the Github PR explorer
- [ ] Review `Codecov Report` in the comment section below once CI passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants