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

feat: add containerized localnet #439

Merged
merged 15 commits into from
Sep 1, 2023
Merged

feat: add containerized localnet #439

merged 15 commits into from
Sep 1, 2023

Conversation

jlehtimaki
Copy link
Contributor

Currently users are not able to run their Archway localnet in containers by using docker-compose
This PR will propose the following changes to fix these issues:

  • Add Makefile command make localnet to start the containerized localnet with latest tagged image.
  • Add Makefile command make localnet-continue to start the shutdown archway-node-1 container
  • Rename Dockerfile.debug to Dockerfile.dev which describes better the use case of the container. This also changes the deployed container image name to archwayd-dev instead of archwayd-debug
  • Add few new packages to the dev image jq and bash which are used in the localnet.sh script
  • Update dev image to alpine:3.18
  • Change the localnet.sh so that it will work with containerized environments as well

this script is no longer working and has been deprecated by scripts/localnet.sh
- change to use bash script instead of sh to allow more refined syntax
- set archwayd process to listen all addresses instead of localhost
- set BINARY path dependent on whether using containers or local
- use image based on TAG env variable, make file will set the tag automatically
- enable 26656 also
- change to use the new scripts path
- Update image version to alpine 3.18
- rename the debug image to dev
- add bash and jq for dev purposes
@jlehtimaki jlehtimaki requested review from a team as code owners August 31, 2023 06:40
@jlehtimaki jlehtimaki force-pushed the localnet_enhancements branch 2 times, most recently from 21a1999 to 13dbe6b Compare August 31, 2023 06:49
Copy link
Contributor

@shahbazn shahbazn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran with the following diff

diff --git a/docker-compose.yaml b/docker-compose.yaml
index ab781ee..78cd0df 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -3,7 +3,7 @@ version: "3"

 services:
   node:
-    image: ghcr.io/archway-network/archwayd-dev:${TAG}
+    image: ghcr.io/archway-network/archwayd-debug:latest
     entrypoint:
       - sh
       - /opt/localnet.sh

and got the following error

❯ make localnet
# TAG=v4.0.0 docker-compose up
docker-compose up
WARN[0000] The "CONTINUE" variable is not set. Defaulting to a blank string.
[+] Running 0/1
 ⠿ node Error                                                                                                                                                                1.2s
Error response from daemon: manifest unknown
make: *** [localnet] Error 18

How can I test this flow?

scripts/localnet.sh Show resolved Hide resolved
Makefile Show resolved Hide resolved
@jlehtimaki
Copy link
Contributor Author

Note! that to test this out you need to change the docker-compose.yaml image from dev to debug because currently they don't exist.

@shahbazn
Copy link
Contributor

shahbazn commented Sep 1, 2023

Note! that to test this out you need to change the docker-compose.yaml image from dev to debug because currently they don't exist.

Test and it works.

Lets also please add docs to README.md to explain various methods of running the local networks

Copy link
Contributor

@shahbazn shahbazn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jlehtimaki jlehtimaki merged commit 6e03b38 into main Sep 1, 2023
7 checks passed
@jlehtimaki jlehtimaki deleted the localnet_enhancements branch September 1, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants