-
Notifications
You must be signed in to change notification settings - Fork 152
Development Env and Release CI/CD - Part 3 #1848
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
Development Env and Release CI/CD - Part 3 #1848
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome. A lot of moving parts in here but made sense to me. Just a couple of minor questions.
.github/workflows/mobilecoin-workflow-dev-update-block-version.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor naming nits, but nothing that I would require holding up the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only reviewed up to (and including) dev-reset
in .github/workflows/mobilecoin-dev-cd-yaml
All reviewed, only minor nits
Motivation
Breaking this work up into multiple parts to hopefully make this easier to review.
The main goal for refactoring the release workflow was to enable block_version 0 -> block_version 1 testing.
CI/CD "improvements"
In this PR
Add Github actions workflows to do block version upgrade testing.
.github/workflows
Naming
Since we have multiple projects in the monorepo, I've done a simple namespacing of the workflows to try and keep things organized. Names follow this pattern.
mobilecoin
- these are workflows for testing core mobilecoin funtions.dev
- these workflows interact with CD for the dynamic "dev" environments used for integration testing.workflow|dispatch
- type of workflow.<description>
The workflows here take advantage of workflow_call (reusable workflows) and workflow_dispatch (manual workflows) to keep things DRYish and allow us to run steps manually, like reset and redeploy to a dev namespace. In general the main workflows triggered by pushes call the "dispatch" workflows that and they use the "workflow" events.
Base workflows triggered by github events.
.github/workflows/mobilecoin-dev-cd.yaml
- Main workflow triggered on pushes, drives build and publishing of artifacts..github/workflows/mobilecoin-dev-delete.yaml
- Workflow run on branch delete events to clean up old dev environments.Dispatch (manual) events.
.github/workflows/mobilecoin-dispatch-dev-delete.yaml
- Delete a dev environment (cluster namespace).github/workflows/mobilecoin-dispatch-dev-deploy.yaml
- Deploy a dev environment (apps to the cluster namespace).github/workflows/mobilecoin-dispatch-dev-reset.yaml
- Reset an existing dev environment (delete all data in a namespace).github/workflows/mobilecoin-dispatch-dev-test.yaml
- Run Integration tests (fog-distribution, fog-test-client, mobilecoind python).github/workflows/mobilecoin-dispatch-dev-update-consensus.yaml
- Update consensus config and restart pods.Reusable Workflows.
.github/workflows/mobilecoin-workflow-dev-delete.yaml
- Delete a dev environment (cluster namespace).github/workflows/mobilecoin-workflow-dev-deploy.yaml
- Deploy a dev environment (apps to the cluster namespace).github/workflows/mobilecoin-workflow-dev-reset.yaml
- Reset an existing dev environment (delete all data in a namespace).github/workflows/mobilecoin-workflow-dev-test.yaml
- Run Integration tests (fog-distribution, fog-test-client, mobilecoind python).github/workflows/mobilecoin-workflow-dev-update-block-version.yaml
- Update consensus config and restart pods.Build image
The build is using a dockerhub based image that includes rust and all the usual targets pre-installed. We reference this with the sha256 identifier so we can guarantee the image and build environment is consistent. I worked to create a minimal image needed to build our apps, but I'm sure we will need more tools as we integrate other CI actions.
This image is automatically built and published when we update https://github.com/mobilecoinofficial/docker-rust-sgx-base
Caching
This build takes advantage of cargo and binary caching for rebuilds. It generates the cache keys based on hashes of .proto, Cargo., .rs or .go files as appropriate. Cache should be shared with the default branch.
Custom Actions
Most of the Kubernetes interactions are powered by a custom action here: https://github.com/mobilecoinofficial/gha-k8s-toolbox
Artifacts
mobilecoin
org.👾 Environment Info 👾
job/step in the main CD workflow.Caveat :)
I think I have all the required repo config set up, but there's a pretty good chance this will need a follow up or two to make everything functional. It was tested and working on the fork, but its really hard to test the CI/CD system without committing code.
Future Work