add job to build Lotus docker image and push it to AWS ECR private (or public) repo #5394
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is adding a CircleCI job for building a Lotus docker image to be used with the canary nodes deployments and other purposes.
TODO
lotus-dev
AWS ECR private (or public) repo on AWSAWS IAM permissions
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,AWS_REGION
,AWS_ECR_ACCOUNT_URL
env vars to CircleCI projectPolicy for AWS user should be something along the lines of: https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html (full access or power user)
If public registry is used, additional policy permissions necessary:
Public vs private registry
At the moment the
circleci/aws-ecr
orb doesn't support public registries, maybe it is worth to not use it altogether so that we have full control over thedocker
commands and build and push as many images as we need. I have already added example steps for that.For the time being I am building only a
lotus-dev
image to be used for canaries - specifically adding a-dev
suffix to not confuse this image repository with production / stable / release images..circleci/config.yml
- doesn't usecircleci/aws-ecr
orb and pushes to public ECR registry.Open questions
Public vs private registry - There is nothing private about these images, so we might as well use the AWS public ECR registry. This means getting rid of the
circleci/aws-ecr
orb at the moment, but I think that's fine.Resolution: Use public registry
Build frequency - the idea behind this PR is to build an image for every commit in the Lotus repo, so that devs can quickly spin up canaries on-demand with the image.
Resolution: for now start with build for every commit, if this gets too much, we can scale down.
Build artifacts - at the moment I am building only
lotus-dev
image. We might need more images (stats
,chainwatch
,opencl
, etc.) for other projects.Resolution: for now we can bundle all binaries in the same image.
Consider adding Docker layer caching on CircleCI https://circleci.com/docs/2.0/docker-layer-caching/ in a future PR
Related