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

CNS-140,CNS-150: dockerize lavad build and execution #235

Merged
merged 7 commits into from
Jan 26, 2023

Conversation

orenl-lava
Copy link
Contributor

@orenl-lava orenl-lava commented Jan 11, 2023

Update the Makefile and intorduce Dockerfile to improve lavad build.

Notable make targets (for all targets - see Makefile):

make build - local build (output in ./build/)
make test - run unit-tests
make lint - run the linter

make docker-build - local build with docker image (host arch)

make build-images - build and produce docker images (all archs)
make build-image-amd64 - build and produce docker image (linux/amd64)
make build-image-amd64 - build and produce docker image (linux/arm64)

Other notable changes:

  • See Makefile for options to turn on/off via LAVA_BUILD_OPTIONS variable
  • Use LAVA_BUILD_OPTIONS="static" to build static binary
  • Use LAVA_BUILD_OPTIONS="static,release" to build static binary for release

Also updated .dockerignore (notably, added .git/ to avoid the cost). Anyway, the copy only affects the builder stage in docker - nothing is copied to the final image.

Also updates .gitignote (primarily some cleanup).

  • Please check if the PR fulfills these requirements
  • Commit message follows the Contribution Guidelines
  • Tests ran locally and added/modified if needed
  • Docs have been added/updated, if applicable
  • If applicable - JIRA ticket ID was added
  • What kind of change does this PR introduce? (Bug fix, feature, unit tests, docs update, ...)

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • Please describe what manual tests you ran, if applicable

  • Other information:

@orenl-lava orenl-lava requested a review from ranlavanet January 11, 2023 15:33
@orenl-lava orenl-lava force-pushed the CNS-150-dockerize-lavad-build branch 5 times, most recently from e70ae4e to 426ed5e Compare January 17, 2023 14:42
@orenl-lava orenl-lava changed the title CNS-150: dockerize lavad build CNS-150: dockerize lavad build and execution Jan 17, 2023
@orenl-lava orenl-lava changed the title CNS-150: dockerize lavad build and execution CNS-140,CNS-150: dockerize lavad build and execution Jan 17, 2023
Update the Makefile and intorduce Dockerfile to improve lavad build.

Notable make targets (for all targets - see Makefile):

  make build			- local build (output in ./build/)
  make test			- run unit-tests
  make lint			- run the linter

  make docker-build		- local build with docker image (host arch)

  make build-images		- build and produce docker images (all archs)
  make build-image-amd64	- build and produce docker image (linux/amd64)
  make build-image-amd64	- build and produce docker image (linux/arm64)

Other notable changes:

- See Makefile for options to turn on/off via LAVA_BUILD_OPTIONS variable
- Use LAVA_BUILD_OPTIONS="static" to build static binary
- Use LAVA_BUILD_OPTIONS="static,release" to build static binary for release

Also updated .dockerignore (notably, added .git/ to avoid the cost). Anyway,
the copy only affects the builder stage in docker - nothing is copied to the
final image.

Also updates .gitignote (primarily some cleanup).
@orenl-lava orenl-lava force-pushed the CNS-150-dockerize-lavad-build branch from 426ed5e to 5a48ecc Compare January 17, 2023 18:56
Update the Dockerfile to generate docker image that can run lava node.
(Implemented using the artifacts in docker/ directory.)

To start a lava node in a container, run the command:
    docker-compose --profile node --env-file env -f docker/docker-compose.yml up

Edit the file `env` to adjust the (external) ports used by this node (see that
file for the defaults).

It will execute the script `start_node.sh` (from docker/), which follows
the instructions for starting a node (with cosmovisor).
@orenl-lava orenl-lava force-pushed the CNS-150-dockerize-lavad-build branch from 5a48ecc to 62cd4c3 Compare January 18, 2023 09:36
docker/start_node.sh Show resolved Hide resolved
SeanZoR
SeanZoR previously approved these changes Jan 18, 2023
Update the Dockerfile to generate docker image that can run lava portal.
(Implemented using the artifacts in docker/ directory.)

To start a lava portal in a container, run the command:
    docker-compose --profile portal --env-file env -f docker/docker-compose.yml up

Edit the file `env` to adjust the portal parameters used by this portal (see that
file for the defaults).

It will execute the script `start_portal.sh` (from docker/), which follows
the instructions for starting a portal. If needed, it will also do stake-client
(including if the stake amount is to be raised).
Propagete LAVA_BUILD_OPTIONS env var and GIT_CLONE build-arg to the docker
build. This ensures that the build in docker indeeds generates the release.

Also allow user to select release version using LAVA_VERSION env variable.

Add examples in the Makefile for how to run.
Fix use of LAVA_BULID_OPTIONS in Dockerfile's call to 'make'.
Build cosmovisor independent of the builder stage (image).
Document the env variables of the Makefile, and unused options.
Update the Dockerfile to generate docker image that can run lava provider.
(Implemented using the artifacts in docker/ directory.)

To start a lava provider in a container, run the command:
    docker-compose --profile provider \
        --env-file docker/env -f docker/docker-compose.yml up

Edit the file `env` to adjust the portal parameters used by this provider (see
that file for the defaults).

It will execute the script `start_provider.sh` (from docker/), which follows
the instructions for starting a provider. If needed, it will also execute the
stake-provider (including if the stake amount is to be raised).
@Yaroms Yaroms merged commit 51dacd5 into main Jan 26, 2023
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