Skip to content

Publish standalone regtest image #1481

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

Merged

Conversation

zone117x
Copy link
Member

@zone117x zone117x commented Dec 8, 2022

Follow up to the standalone regtest image implemented in #1476

... new standalone regtest dockerfile which is epoch 2.1 capable. This is intended to be used in CI/local testing as an alternative to the existing standalone docker image (which uses a mocknet stacks-node that is non-functional for epoch 2.1 testing).

This PR adds a workflow_dispatch (manually triggered CI) config to build the new image.

  • Multi-platform images are built (for both arm64 and x86).
  • This currently uses git commit SHAs for building both the API and stacks-node, so the git tag-based version reporting (/v2/info and /extended/v1/status) will show the commit hashes but the branch/version will be stubbed. This can be fixed once the Stacks 2.1 related branches on the blockchain repo and API repo become more stabilized.
  • The docker image tag is currently ${date YYYYMMDDHH}-${STACKS_API_SHA}-${BLOCKCHAIN_SHA} -- this can also be improved later once the repo branches stabilize.
    • The datetime is included to give a human readable idea of a "version", until actual version tags are stable and ready to use.
  • Several techniques are used to reduce docker build time, which otherwise would take several hours for multi-platform stacks-node and API building:
    • The stacks-node binary is cross-compiled on the runner host and then copied into the docker image during build.
    • Cargo's new multi-target build feature is used.
    • A rust-specific github caching action is used.
    • Docker-registry caching is enabled.
  • Despite the above speedups, a "cold build" (no cache hits) can take ~1 hour, so later on, this workflow should probably only be enabled on merge to a release branch.

Currently, this workflow must be ran with this blockchain commit: stacks-network/stacks-core@b16e121

See example of running this workflow: https://github.com/hirosystems/stacks-blockchain-api/actions/runs/3648003869/jobs/6161211248

And the image it published: https://hub.docker.com/layers/hirosystems/stacks-blockchain-api-standalone-regtest/2022120812-88f446b-b16e121/images/sha256-726d8b52bdea017ed3f46f1341da755f288b4a94caace5a017a2799a56914bc0?context=explore

@zone117x zone117x requested a review from CharlieC3 December 8, 2022 12:56
Copy link
Member

@CharlieC3 CharlieC3 left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

with:
images: hirosystems/${{ github.event.repository.name }}-standalone-regtest
tags: |
type=raw,value=latest,enable=false
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended to be disabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I think latest implies more stability than we have right now, probably can enable once the next couple PRs that this depends on are merged.

@zone117x zone117x merged commit bd5a771 into feat/stacks-2.1-standalone Dec 8, 2022
@zone117x zone117x deleted the feat/standalone-regtest-image-ci branch December 8, 2022 15:12
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.

2 participants