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 Linux Arm64 builds #494

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Setup pre-commit
- name: Install pre-commit
Expand Down
117 changes: 54 additions & 63 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
# For pushes to main, build binaries and store them as artifacts (also upload Docker images)
# For pushes to main with tags, also make a GitHub release.
push:
branches:
- main
tags:
- "v*"
# branches:
# - main
# tags:
# - "v*"

jobs:
build_binary:
Expand All @@ -16,15 +16,18 @@ jobs:

strategy:
matrix:
build: [linux, macos, win-msvc]
build: [linux-x86_64, linux-aarch_64, osx-x86_64, win64]
include:
- build: linux
- build: linux-x86_64
os: ubuntu-20.04 # We can update to 22.04 once we're comfortable dropping libssl 1.x support
target: x86_64-unknown-linux-gnu
- build: macos
- build: linux-aarch_64
os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
- build: osx-x86_64
os: macos-latest
target: x86_64-apple-darwin
- build: win-msvc
- build: win64
os: windows-latest
target: x86_64-pc-windows-msvc

Expand All @@ -33,40 +36,24 @@ jobs:
# Taken from https://github.com/apache/arrow-datafusion/blob/master/.github/workflows/rust.yml
shell: bash
run: |
if [ "${{ matrix.build }}" = "win-msvc" ]; then
mkdir -p $HOME/d/protoc
cd $HOME/d/protoc
export PROTO_ZIP="protoc-21.4-win64.zip"
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/$PROTO_ZIP
unzip $PROTO_ZIP
echo "$HOME/d/protoc/bin" >> $GITHUB_PATH
export PATH=$PATH:$HOME/d/protoc/bin
protoc.exe --version
mkdir -p $HOME/d/protoc
cd $HOME/d/protoc
export PROTO_ZIP="protoc-21.4-${{ matrix.build }}.zip"
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/$PROTO_ZIP
unzip $PROTO_ZIP
echo "$HOME/d/protoc/bin" >> $GITHUB_PATH
export PATH=$PATH:$HOME/d/protoc/bin

if [ "${{ matrix.build }}" = "win64" ]; then
protoc.exe --version
vcpkg integrate install
vcpkg.exe install openssl:x64-windows-static-md
elif [ "${{ matrix.build }}" = "linux" ]; then
mkdir -p $HOME/d/protoc
cd $HOME/d/protoc
export PROTO_ZIP="protoc-21.4-linux-x86_64.zip"
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/$PROTO_ZIP
unzip $PROTO_ZIP
echo "$HOME/d/protoc/bin" >> $GITHUB_PATH
export PATH=$PATH:$HOME/d/protoc/bin
protoc --version
else
mkdir -p $HOME/d/protoc
cd $HOME/d/protoc
export PROTO_ZIP="protoc-21.4-osx-x86_64.zip"
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/$PROTO_ZIP
unzip $PROTO_ZIP
echo "$HOME/d/protoc/bin" >> $GITHUB_PATH
export PATH=$PATH:$HOME/d/protoc/bin
protoc --version
fi

- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: |
rustup toolchain install nightly --profile minimal
rustup default nightly
Expand Down Expand Up @@ -114,23 +101,23 @@ jobs:
fi

- name: Login to DockerHub (Linux only)
if: matrix.build == 'linux'
uses: docker/login-action@v2
if: matrix.build == 'linux-x86_64' || matrix.build == 'linux-aarch_64'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Test building and invoking the Docker image (Linux only)
if: matrix.build == 'linux'
if: matrix.build == 'linux-x86_64' || matrix.build == 'linux-aarch_64'
run: |
DOCKER_BUILDKIT=1 docker build . -t splitgraph/seafowl:test
docker run --rm splitgraph/seafowl:test --version

- name: Determine Docker tags (Linux only)
if: matrix.build == 'linux'
if: matrix.build == 'linux-x86_64' || matrix.build == 'linux-aarch_64'
id: meta
# https://github.com/docker/metadata-action
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
splitgraph/seafowl
Expand All @@ -142,20 +129,20 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Build and push Docker image (Linux only)
if: matrix.build == 'linux'
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Upload binaries as artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT }}
path: ${{ env.SOURCE }}
# - name: Build and push Docker image (Linux only)
# if: matrix.build == 'linux-x86_64' || matrix.build == 'linux-aarch_64'
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
#
# - name: Upload binaries as artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.ARTIFACT }}
# path: ${{ env.SOURCE }}

github_release:
name: Perform GitHub release
Expand All @@ -173,7 +160,7 @@ jobs:

# Checkout required to access the release-notes.py script
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Generate release notes
run: |
./.github/workflows/release-notes.py --tag ${{ env.RELEASE_VERSION }} --output notes-${{ env.RELEASE_VERSION }}.md
Expand All @@ -186,16 +173,20 @@ jobs:

- name: Package artifacts
run: |
chmod +x artifacts/seafowl-nightly-x86_64-unknown-linux-gnu/seafowl artifacts/seafowl-nightly-x86_64-apple-darwin/seafowl
chmod +x artifacts/seafowl-nightly-x86_64-unknown-linux-gnu/seafowl \
artifacts/seafowl-nightly-aarch_64-unknown-linux-gnu/seafowl \
artifacts/seafowl-nightly-x86_64-apple-darwin/seafowl
tar -C artifacts/seafowl-nightly-x86_64-unknown-linux-gnu -czf seafowl-${{ env.RELEASE_VERSION }}-x86_64-unknown-linux-gnu.tar.gz seafowl
tar -C artifacts/seafowl-nightly-aarch_64-unknown-linux-gnu -czf seafowl-${{ env.RELEASE_VERSION }}-aarch_64-unknown-linux-gnu.tar.gz seafowl
tar -C artifacts/seafowl-nightly-x86_64-apple-darwin -czf seafowl-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin.tar.gz seafowl
cd artifacts/seafowl-nightly-x86_64-pc-windows-msvc && zip -r ../../seafowl-${{ env.RELEASE_VERSION }}-x86_64-pc-windows-msvc.zip seafowl.exe

- name: Upload release archive
uses: softprops/action-gh-release@v1
with:
files: |
seafowl-${{ env.RELEASE_VERSION }}-x86_64-unknown-linux-gnu.tar.gz
seafowl-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin.tar.gz
seafowl-${{ env.RELEASE_VERSION }}-x86_64-pc-windows-msvc.zip
body_path: notes-${{ env.RELEASE_VERSION }}.md
# - name: Upload release archive
# uses: softprops/action-gh-release@v1
# with:
# files: |
# seafowl-${{ env.RELEASE_VERSION }}-x86_64-unknown-linux-gnu.tar.gz
# seafowl-${{ env.RELEASE_VERSION }}-aarch_64-unknown-linux-gnu.tar.gz
# seafowl-${{ env.RELEASE_VERSION }}-x86_64-apple-darwin.tar.gz
# seafowl-${{ env.RELEASE_VERSION }}-x86_64-pc-windows-msvc.zip
# body_path: notes-${{ env.RELEASE_VERSION }}.md
Loading