Skip to content

Commit

Permalink
feat(ci): Build binary that run on anolis aarch64 (#67)
Browse files Browse the repository at this point in the history
* try to release on aarch64

* fix

* correct path

* without docker cache and rootles

* change the base image

* try again

* correct protoc link

* correct path

* fix ring problems

* try fix building croaring

* cc

* rustflags

* anolis

* full features

* hadoop aarch64

* rollback tags
  • Loading branch information
zuston authored Feb 13, 2025
1 parent fca77d2 commit 713eb18
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 10 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,36 @@ on:
- "v*.*.*"

jobs:
linux-aarch64:
name: aarch64
runs-on: ubuntu-22.04-arm

steps:
- uses: actions/checkout@v4

- uses: prompt/actions-commit-hash@v3
id: commit
#
# - uses: ScribeMD/[email protected]
# if: steps.cache.outputs.cache-hit != 'true'
#
# - uses: ScribeMD/[email protected]
# if: steps.cache.outputs.cache-hit != 'true'
# with:
# key: docker-centos7-${{ hashFiles('dev/centos7/aarch64/Dockerfile') }}

- name: Build
run: |
docker compose -f dev/centos7/aarch64/docker-compose.yml up
- name: Upload
uses: actions/upload-artifact@v4
with:
name: uniffle-worker-linux-aarch64
path: target-docker/release/uniffle-worker

linux-x86_64:
name: Build Snapshot
name: x86_64
runs-on: ubuntu-22.04

steps:
Expand All @@ -22,12 +50,11 @@ jobs:
- uses: ScribeMD/[email protected]
if: steps.cache.outputs.cache-hit != 'true'
with:
key: docker-centos7-${{ hashFiles('dev/centos7/Dockerfile') }}
key: docker-centos7-${{ hashFiles('dev/centos7/x86_64/Dockerfile') }}

- name: Build
run: |
sed -i 's/docker-compose -f/docker compose -f/g' ./release.sh
./release.sh
docker compose -f dev/centos7/x86_64/docker-compose.yml up
- name: Upload
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ hdrhistogram = "7.5.4"
libc = "0.2.169"
allocator-api2 = "0.2"
bytesize = {version = "1.2.0", features = ["serde"]}
cc = "1.2.13"

[dependencies.logforth]
version = "0.19.1"
Expand Down
33 changes: 33 additions & 0 deletions dev/centos7/aarch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM docker.io/openanolis/anolisos:8

RUN yum install -y libzip unzip wget cmake openssl-devel llvm clang-devel clang krb5-workstation git gcc gcc-c++

# install rust nightly toolchain
RUN curl https://sh.rustup.rs > /rustup-init
RUN chmod +x /rustup-init
# Note: Specify the correct target for aarch64
RUN /rustup-init -y --default-toolchain nightly-2024-10-01-aarch64-unknown-linux-gnu

# install java
RUN yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
# Note: Update JAVA_HOME path for aarch64
RUN echo 'export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk"' >> ~/.bashrc

# install protoc
# Note: Download the aarch64 version of protoc
RUN wget -O /protobuf-21.7-linux-aarch64.zip https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protoc-21.7-linux-aarch_64.zip
RUN mkdir /protobuf-bin && (cd /protobuf-bin && unzip /protobuf-21.7-linux-aarch64.zip)
RUN echo 'export PATH="$PATH:/protobuf-bin/bin"' >> ~/.bashrc

# attach libjvm.so
# Note: Update the library path for aarch64
RUN echo 'export LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/aarch64/server:${LD_LIBRARY_PATH}' >> ~/.bashrc

# setup hadoop env
RUN curl -LsSf https://dlcdn.apache.org/hadoop/common/hadoop-3.3.5/hadoop-3.3.5-aarch64.tar.gz | tar zxf - -C /root
RUN echo "export HADOOP_HOME=/root/hadoop-3.3.5" >> ~/.bashrc
RUN echo "export CLASSPATH=$(${HADOOP_HOME}/bin/hadoop classpath --glob)" >> ~/.bashrc
RUN echo "export HDRS_NAMENODE=default" >> ~/.bashrc
RUN echo "export HDRS_WORKDIR=/tmp/hdrs/" >> ~/.bashrc

RUN echo "export RUST_BACKTRACE=1" >> ~/.bashrc
13 changes: 13 additions & 0 deletions dev/centos7/aarch64/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3"

services:
build-release:
build: ../aarch64
volumes:
- ~/.m2:/root/.m2:rw
- ~/.sbt:/root/.sbt:rw
- ~/.cargo/git:/root/.cargo/git:rw
- ~/.cargo/registry:/root/.cargo/registry:rw
- ./../../../:/R1:rw
- ./../../../target-docker:/R1/target:rw
command: "bash -c 'source ~/.bashrc && cd /R1 && cargo build --features hdrs,logforth,memory-prof --release'"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: "3"

services:
build-release:
build: ./centos7
build: ../x86_64
volumes:
- ~/.m2:/root/.m2:rw
- ~/.sbt:/root/.sbt:rw
- ~/.cargo/git:/root/.cargo/git:rw
- ~/.cargo/registry:/root/.cargo/registry:rw
- ./../:/R1:rw
- ./../target-docker:/R1/target:rw
- ./../../../:/R1:rw
- ./../../../target-docker:/R1/target:rw
# environment:
# RUSTFLAGS: "-C target-cpu=skylake"
command: "bash -c 'source ~/.bashrc && cd /R1 && cargo build --features hdrs,logforth,memory-prof --release'"
3 changes: 0 additions & 3 deletions release.sh

This file was deleted.

0 comments on commit 713eb18

Please sign in to comment.