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

Add multiplatform linux build to CI #1372

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,35 @@ jobs:
linux:
name: Build - Linux
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: linux-aarch64
target: aarch64-unknown-linux-gnu
- name: linux
target: x86_64-unknown-linux-gnu
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up docker buildx
uses: docker/setup-buildx-action@v2
- name: Build docker image
uses: docker/build-push-action@v3
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: ./ci/docker
push: false
load: true
tags: volta
- name: Compile and package Volta
run: docker run --volume ${PWD}:/root/workspace --workdir /root/workspace --rm --init --tty volta /root/workspace/ci/build-linux.sh volta-linux
- uses: actions-rs/toolchain@master
with:
profile: minimal
toolchain: 1.63
override: true
- name: Cargo Cache
uses: Swatinem/rust-cache@v2
- name: Install cross
run: cargo install cross
- name: Build
run: cross build --release --target ${{ matrix.target }}
- name: Create artifact
run: tar -czvf volta-${{ matrix.name }}.tar.gz volta volta-shim volta-migrate
Comment on lines +32 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not on a machine right now where I can cleanly check, but does this change the glibc dependency for the standard linux build? The Docker system setup right now is built intentionally to support running on an old version of glibc.

For the ARM build, since we haven't supported it in the past, it's not a big deal to use a more recent version, but for the existing linux build we've been committed to backwards compatibility.

Copy link

@this-is-tobi this-is-tobi Apr 22, 2023

Choose a reason for hiding this comment

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

I have never done any development in Rust so it would take me a long time to do a good analysis but I can try to make a proposal.

Could QEMU be used in Github actions with another step to build a second linux builder image (linux/arm64 platform) and then use this image with the docker run --platform flag to build volta for both architectures?

EDIT : I didn't mention this but it would result in a change to the base image in the Dockerfile (cern/slc6-base) as it's an amd64 image, but I don't know why you're using that image so I can't say if that's something possible.

working-directory: target/${{ matrix.target }}/release
- name: Upload release artifact
uses: actions/upload-artifact@v3
with:
name: linux
path: target/release/volta-linux.tar.gz
name: ${{ matrix.name }}
path: target/${{ matrix.target }}/release/volta-${{ matrix.name }}.tar.gz

macos:
name: Build - MacOS
Expand Down Expand Up @@ -146,6 +154,11 @@ jobs:
with:
name: linux
path: release
- name: Fetch Linux (ARM) artifact
uses: actions/download-artifact@v2
with:
name: linux-aarch64
path: release
- name: Fetch MacOS artifact
uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -186,6 +199,15 @@ jobs:
asset_path: ./release/volta-linux.tar.gz
asset_name: volta-${{ steps.release_info.outputs.version }}-linux.tar.gz
asset_content_type: application/gzip
- name: Upload Linux (ARM) artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/volta-linux-aarch64.tar.gz
asset_name: volta-${{ steps.release_info.outputs.version }}-linux-aarch64.tar.gz
asset_content_type: application/gzip
- name: Upload MacOS artifact
uses: actions/upload-release-asset@v1
env:
Expand Down
2 changes: 2 additions & 0 deletions dev/unix/volta-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ parse_os_info() {
Linux)
if [ "$arch" == "x86_64" ]; then
echo "linux"
elif [ "$arch" == "aarch64" ]; then
echo "linux-aarch64"
else
error "Releases for non x64 architectures are not currently supported."
Copy link

Choose a reason for hiding this comment

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

Thank you for this. Might be worth updating the message as well

Copy link
Author

Choose a reason for hiding this comment

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

Hi @Fydon would you point me which message I need to update?

Copy link

@Fydon Fydon Jan 8, 2024

Choose a reason for hiding this comment

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

Sure. For macOS there is no error text, so perhaps the same is true for Linux when ARM64 is supported. Otherwise the error message should be something like "Only x64 and ARM64 architectures are currently supported". I believe that x64 is x86_64 and not all architectures ending in 64.

return 1
Expand Down