Skip to content

Commit 5351c41

Browse files
committed
feat(native/cubesql): Build for ARM64 linux GNU
Signed-off-by: Dmitry Patsura <talk@dmtry.me>
1 parent 33c6292 commit 5351c41

File tree

7 files changed

+69
-38
lines changed

7 files changed

+69
-38
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ jobs:
5858
env:
5959
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6060
timeout-minutes: 60
61-
name: Build native ${{ matrix.node-version }}-${{ matrix.image }}
61+
name: Build native Linux ${{ matrix.node-version }} ${{ matrix.target }}
6262
strategy:
6363
matrix:
6464
node-version: [12, 14, 16, 17]
65-
image: ["stretch"]
65+
target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
6666
fail-fast: false
6767
container:
68-
image: node:${{ matrix.node-version }}-${{ matrix.image }}
68+
image: cubejs/rust-cross:${{ matrix.target }}-10052021
6969

7070
steps:
7171
- name: Checkout
@@ -76,6 +76,11 @@ jobs:
7676
toolchain: nightly-2021-07-04
7777
override: true
7878
components: rustfmt
79+
target: ${{ matrix.target }}
80+
- name: Install Node.js ${{ matrix.node-version }}
81+
uses: actions/setup-node@v1
82+
with:
83+
node-version: ${{ matrix.node-version }}
7984
- name: Get yarn cache directory path
8085
id: yarn-cache-dir-path
8186
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -90,11 +95,15 @@ jobs:
9095
key: ${{ runner.os }}-workspace-main-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
9196
restore-keys: |
9297
${{ runner.os }}-workspace-main-${{ matrix.node-version }}-
98+
- name: Install Yarn
99+
run: npm install -g yarn
93100
- name: Set Yarn version
94101
run: yarn policies set-version v1.22.5
95102
- name: Yarn install
96103
run: CUBESTORE_SKIP_POST_INSTALL=true yarn install --frozen-lockfile
97104
- name: Build native
105+
env:
106+
CARGO_BUILD_TARGET: ${{ matrix.target }}
98107
run: cd packages/cubejs-backend-native && npm run native:build-release
99108
- name: Upload artifact
100109
uses: nick-invision/retry@v2
@@ -112,7 +121,7 @@ jobs:
112121
timeout-minutes: 60
113122
env:
114123
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115-
name: Build native ${{ matrix.node-version }}-${{ matrix.os-version }}
124+
name: Build ${{ matrix.os-version }} ${{ matrix.node-version }}
116125
strategy:
117126
matrix:
118127
node-version: [12.x, 14.x, 16.x, 17.x]

.github/workflows/rust-cubesql.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- 'master'
1212
pull_request:
1313
paths:
14-
- '.github/workflows/push-native.yml'
14+
- '.github/workflows/rust-cubesql.yml'
1515
- 'packages/cubejs-backend-native/**'
1616
- 'rust/cubesql/**'
1717
- 'rust/cubesql/**'
@@ -45,14 +45,14 @@ jobs:
4545
needs: [precheck]
4646
runs-on: ubuntu-20.04
4747
timeout-minutes: 60
48-
name: Build native ${{ matrix.node-version }}-${{ matrix.image }}
48+
name: Build Linux GNU ${{ matrix.node-version }}.x ${{ matrix.target }}
4949
strategy:
5050
matrix:
5151
node-version: [12, 14, 16, 17]
52-
image: ["stretch"]
52+
target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
5353
fail-fast: false
5454
container:
55-
image: node:${{ matrix.node-version }}-${{ matrix.image }}
55+
image: cubejs/rust-cross:${{ matrix.target }}-10052021
5656

5757
steps:
5858
- name: Checkout
@@ -63,6 +63,11 @@ jobs:
6363
toolchain: nightly-2021-07-04
6464
override: true
6565
components: rustfmt
66+
target: ${{ matrix.target }}
67+
- name: Install Node.js ${{ matrix.node-version }}
68+
uses: actions/setup-node@v1
69+
with:
70+
node-version: ${{ matrix.node-version }}
6671
- name: Get yarn cache directory path
6772
id: yarn-cache-dir-path
6873
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -77,20 +82,28 @@ jobs:
7782
key: ${{ runner.os }}-workspace-main-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
7883
restore-keys: |
7984
${{ runner.os }}-workspace-main-${{ matrix.node-version }}-
85+
- name: Install Yarn
86+
run: npm install -g yarn
8087
- name: Set Yarn version
8188
run: yarn policies set-version v1.22.5
8289
- name: Yarn install
8390
run: CUBESTORE_SKIP_POST_INSTALL=true yarn install --frozen-lockfile
8491
- name: Build native
92+
env:
93+
CARGO_BUILD_TARGET: ${{ matrix.target }}
94+
run: cd packages/cubejs-backend-native && yarn run native:build
95+
- name: Test native
96+
if: (matrix.target == 'x86_64-unknown-linux-gnu')
8597
env:
8698
CUBEJS_NATIVE_INTERNAL_DEBUG: true
87-
run: cd packages/cubejs-backend-native && yarn run native:build && yarn run test:unit
99+
run: cd packages/cubejs-backend-native && yarn run test:unit
88100

89101
native:
90102
needs: [precheck]
91103
runs-on: ${{ matrix.os-version }}
92104
timeout-minutes: 60
93-
name: Build native ${{ matrix.node-version }}-${{ matrix.os-version }}
105+
name: Build ${{ matrix.os-version }} ${{ matrix.node-version }}
106+
94107
strategy:
95108
matrix:
96109
node-version: [12.x, 14.x, 16.x, 17.x]

rust/cubestore/Cross.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ image = "cubejs/rust-cross:x86_64-pc-windows-gnu-10052021"
1111
xargo = false
1212

1313
[target.x86_64-unknown-linux-gnu]
14-
image = "cubejs/rust-cross:x86_64-unknown-linux-gnu-stretch-10052021"
14+
image = "cubejs/rust-cross:x86_64-unknown-linux-gnu-10052021"
1515
xargo = false
1616

1717
[target.x86_64-unknown-linux-musl]

rust/cubestore/cross/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,26 @@ Keep in mind:
2020
export CROSS_VERSION=10052021
2121

2222
#docker build -t cubejs/rust-cross:x86_64-apple-darwin-$CROSS_VERSION -f x86_64-apple-darwin.Dockerfile .
23-
docker build -t cubejs/rust-cross:x86_64-pc-windows-msvc-$CROSS_VERSION -f x86_64-pc-windows-msvc.Dockerfile .
24-
docker build -t cubejs/rust-cross:x86_64-pc-windows-gnu-$CROSS_VERSION -f x86_64-pc-windows-gnu.Dockerfile .
25-
docker build -t cubejs/rust-cross:x86_64-unknown-linux-gnu-buster-$CROSS_VERSION -f x86_64-unknown-linux-gnu-buster.Dockerfile .
26-
docker build -t cubejs/rust-cross:x86_64-unknown-linux-gnu-stretch-$CROSS_VERSION -f x86_64-unknown-linux-gnu-stretch.Dockerfile .
27-
docker build -t cubejs/rust-cross:x86_64-unknown-linux-musl-$CROSS_VERSION -f x86_64-unknown-linux-musl.Dockerfile .
28-
docker build -t cubejs/rust-cross:aarch64-unknown-linux-gnu-$CROSS_VERSION -f aarch64-unknown-linux-gnu.Dockerfile .
23+
docker buildx build --platform linux/amd64 -t cubejs/rust-cross:x86_64-pc-windows-msvc-$CROSS_VERSION -f x86_64-pc-windows-msvc.Dockerfile .
24+
docker buildx build --platform linux/amd64 -t cubejs/rust-cross:x86_64-pc-windows-gnu-$CROSS_VERSION -f x86_64-pc-windows-gnu.Dockerfile .
25+
docker buildx build --platform linux/amd64 -t cubejs/rust-cross:x86_64-unknown-linux-gnu-$CROSS_VERSION -f x86_64-unknown-linux-gnu-stretch.Dockerfile .
26+
docker buildx build --platform linux/amd64 -t cubejs/rust-cross:x86_64-unknown-linux-musl-$CROSS_VERSION -f x86_64-unknown-linux-musl.Dockerfile .
27+
docker buildx build --platform linux/amd64 -t cubejs/rust-cross:aarch64-unknown-linux-gnu-$CROSS_VERSION -f aarch64-unknown-linux-gnu.Dockerfile .
28+
29+
# Experimental
30+
docker buildx build --platform linux/amd64 -t cubejs/rust-cross:x86_64-unknown-linux-gnu-buster-$CROSS_VERSION -f x86_64-unknown-linux-gnu-buster.Dockerfile .
2931

3032
#docker push cubejs/rust-cross:x86_64-apple-darwin
3133
docker push cubejs/rust-cross:x86_64-pc-windows-msvc-$CROSS_VERSION
3234
docker push cubejs/rust-cross:x86_64-pc-windows-gnu-$CROSS_VERSION
33-
docker push cubejs/rust-cross:x86_64-unknown-linux-gnu-buster-$CROSS_VERSION
34-
docker push cubejs/rust-cross:x86_64-unknown-linux-gnu-stretch-$CROSS_VERSION
35+
docker push cubejs/rust-cross:x86_64-unknown-linux-gnu-$CROSS_VERSION
3536
docker push cubejs/rust-cross:x86_64-unknown-linux-musl-$CROSS_VERSION
3637
docker push cubejs/rust-cross:aarch64-unknown-linux-gnu-$CROSS_VERSION
3738

39+
# Experimental
40+
docker push cubejs/rust-cross:x86_64-unknown-linux-gnu-buster-$CROSS_VERSION
41+
3842
# Verify versions
39-
docker run --rm -it cubejs/rust-cross:x86_64-unknown-linux-gnu-stretch-$CROSS_VERSION cc --version
43+
docker run --rm -it cubejs/rust-cross:x86_64-unknown-linux-gnu-$CROSS_VERSION cc --version
4044
docker run --rm -it cubejs/rust-cross:x86_64-unknown-linux-gnu-buster-$CROSS_VERSION cc --version
4145
```

rust/cubestore/cross/x86_64-unknown-linux-gnu-buster.Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
FROM debian:buster-slim
22

3-
RUN apt-get update && apt-get -y upgrade && \
4-
apt-get install -y curl pkg-config wget gnupg git apt-transport-https ca-certificates && \
5-
echo 'deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main' >> /etc/apt/sources.list && \
6-
curl -JL http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \
7-
apt-get update && \
8-
apt-get install -y llvm-9 clang-9 libclang-9-dev clang-9 make;
3+
RUN apt-get update && apt-get -y upgrade \
4+
&& apt-get install -y software-properties-common pkg-config wget gnupg git apt-transport-https ca-certificates \
5+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
6+
&& add-apt-repository "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" \
7+
&& apt-get update \
8+
&& apt-get install -y llvm-9 clang-9 libclang-9-dev clang-9 make \
9+
&& rm -rf /var/lib/apt/lists/*;
910

1011
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
1112
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100

rust/cubestore/cross/x86_64-unknown-linux-gnu-stretch.Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
FROM debian:stretch-slim
22

3-
RUN apt-get update && apt-get -y upgrade && \
4-
apt-get install -y curl pkg-config wget gnupg git apt-transport-https ca-certificates && \
5-
echo 'deb https://apt.llvm.org/stretch/ llvm-toolchain-stretch-9 main' >> /etc/apt/sources.list && \
6-
curl -JL http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \
7-
apt-get update && \
8-
apt-get install -y llvm-9 clang-9 libclang-9-dev clang-9 make;
3+
RUN apt-get update \
4+
&& apt-get -y upgrade \
5+
&& apt-get install -y software-properties-common pkg-config wget gnupg git apt-transport-https ca-certificates \
6+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
7+
&& add-apt-repository "deb https://apt.llvm.org/stretch/ llvm-toolchain-stretch-9 main" \
8+
&& apt-get update \
9+
&& apt-get install -y llvm-9 clang-9 libclang-9-dev clang-9 make \
10+
&& rm -rf /var/lib/apt/lists/*;
911

1012
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
1113
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100

rust/cubestore/cross/x86_64-unknown-linux-musl.Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
# https://github.com/rust-embedded/cross/blob/master/docker/Dockerfile.x86_64-unknown-linux-musl
33
FROM rustembedded/cross:x86_64-unknown-linux-musl
44

5-
RUN apt-get update && apt-get -y upgrade && \
6-
apt-get install -y curl pkg-config wget musl-tools libc6-dev apt-transport-https ca-certificates && \
7-
echo 'deb https://apt.llvm.org/focal/ llvm-toolchain-focal-9 main' >> /etc/apt/sources.list && \
8-
curl -JL http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - && \
9-
apt-get update && \
10-
apt-get install -y llvm-9 clang-9 libclang-9-dev clang-9 make;
5+
RUN apt-get update \
6+
&& apt-get -y upgrade \
7+
&& apt-get install -y software-properties-common pkg-config wget musl-tools libc6-dev apt-transport-https ca-certificates \
8+
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
9+
&& add-apt-repository "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-9 main" \
10+
&& apt-get update \
11+
&& apt-get install -y llvm-9 clang-9 libclang-9-dev clang-9 make \
12+
&& rm -rf /var/lib/apt/lists/*;
1113

1214
RUN ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm && \
1315
ln -s /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic && \

0 commit comments

Comments
 (0)