ci: workflow to build and publish the stacks-node image used internally for integration tests
PR against master branch so that the github "run workflow" UI is available.
The API pulls a pre-built image for the stacks-node, used for both local development and in CI tests. Currently, it's pulling from another repo:
https://github.com/hirosystems/stacks-blockchain-api/blob/5ee9d34f5ba0757fb91ec355304fc8df5ceb80d8/stacks-blockchain/docker/Dockerfile#L2
This PR creates a workflow dispatch to build and publish the testing stacks-node docker image. Once merged, a follow-up PR will change the above code to use the image produced by this repo.
Cross-compilation optimizations are implemented to build both x86 and arm64 images (without taking several hours).
Image tags use the short git commit hash -- this can be improved later once the stacks-blockchain next branch stabilizes (e.g. with an RC).
See demo run here: https://github.com/hirosystems/stacks-blockchain-api/actions/runs/3759601436/jobs/6389358450
the only difference possibly being the supported platforms.
Yep that's the primary difference (arm64 in particular).
If the workflow in the stacks-blockchain repo does not currently fit your need, it may make more sense to modify it in the origin repo rather than maintain an orphaned build process in a separate repository. Additionally, if this is for integration testing we should try to use the same images built and published from the stacks-blockchain repo if possible for them to be considered valid.
Yeah, I think that makes sense. One barrier here would be that even with the cross-arch compilation technique used in this PR, it still adds around 15 minutes to the build time for the image (and we'd still want it building imagines on each branch, at least for now). Perhaps the blockchain repo maintainers would be alright with that though. I'll try to get a PR out on that repo, then we can re-consider this PR if that doesn't pan out.
Perhaps the blockchain repo maintainers would be alright with that though. I'll try to get a PR out on that repo, then we can re-consider this PR if that doesn't pan out.
If I'm not mistaken, I think jwiley has already completed this work here: https://github.com/stacks-network/stacks-blockchain/pull/3199 I believe he's planning on merging it after 2.1 considering its size. If you're able to hold off until then, I believe it should work for you. If not, then I think this PR would be a good workaround in the short-term with the intention to switch over once jwiley's PR is merged.
We're still blocked on upstream adding ARM64 support. And we might also need this workflow for the upcoming Stacks v2.2 release. Leaving this PR as-is for now.
This should be re-addressed closer to Stacks 3.0 release to see if cross-platform stacks-node images are available from core repo
@zone117x Are we still waiting for this one?