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

Automated Builds via GitHub Actions #30

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lukechilds
Copy link
Contributor

This PR adds two automated builds via GitHub Actions.

On every tag that matches v*.*.* the Docker images will be built for amd64 and arm64 and pushed to Docker Hub.

You need to add three secrets at https://github.com/L2-Technology/sensei/settings/secrets/actions:

DOCKER_USERNAME Your Docker Hub username
DOCKER_PASSWORD You Docker Hub password or ideally API token
DOCKER_HUB_USER The Docker Hub account the image will be published as $DOCKER_HUB_USER/sensei under. Can be your Docker Hub account or an org you have push access to.

On every push the Docker images will be built for amd64 and arm64 but not pushed to check the Docker images are still building correctly against each commit.

This is not yet tested, the builds are still running on my fork. Note the job takes a very long time since the use of buildx runs the non-native platform builds inside a VM for the respective platforms. Running a native amd64 build on GitHub Actions takes ~20 mins. The virtaulised arm64 build has been running for 1hr40m and has still not completed. If build time becomes an issue we could transition the builds to use Rust's cross compilation tooling so non-native platform builds are cross-compiled natively instead of in a virtual environment. This would probably get the total build time down to ~20 mins but would be a bit more involved.

@lukechilds
Copy link
Contributor Author

lukechilds commented Apr 5, 2022

Can confirm the builds work, it took 2h 36m to complete: https://github.com/lukechilds/sensei/actions/runs/2091432483

Multiarch image was succesfully built and pushed to Docker Hub: https://hub.docker.com/layers/sensei/lukechilds/sensei/v0.0.3/images/sha256-ad3e0a1679abb6bcf0af16d928b931e23cd74520074c826577419d707c0b58ab?context=explore

Have some half working code swapping out virtualised cross platform builds for native Rust cross-compilation which reduces build time to ~10 minutes but the binaries don't appear to run and I haven't figured out exactly what's wrong with it.

In the mean time this PR is fully tested and working, if a little slow.

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.

1 participant