Skip to content

Commit f820dd5

Browse files
authored
update workflows (#1863)
* update workflows * fix aarch build for indexify server release packages * fix validation error * fix build * fix path * fix
1 parent 9fc70cb commit f820dd5

File tree

3 files changed

+70
-96
lines changed

3 files changed

+70
-96
lines changed

.github/workflows/publish_indexify_server.yaml

Lines changed: 34 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -66,104 +66,69 @@ jobs:
6666
path: /tmp/release/
6767
- name: Name Artifacts
6868
run: |
69-
mv /tmp/release/indexify-server-darwin-arm64/indexify-server /tmp/release/indexify-server-${{ needs.extract-version.outputs.version }}-darwin-arm64
7069
mv /tmp/release/indexify-server-linux-amd64/indexify-server /tmp/release/indexify-server-${{ needs.extract-version.outputs.version }}-linux-amd64
71-
mv /tmp/release/indexify-server-deb-linux-amd64/indexify-server_${{ needs.extract-version.outputs.version }}-1_amd64.deb /tmp/release/indexify-server-${{ needs.extract-version.outputs.version }}-linux-amd64.deb
70+
mv /tmp/release/indexify-server-linux-aarch64/indexify-server /tmp/release/indexify-server-${{ needs.extract-version.outputs.version }}-linux-aarch64
7271
7372
- name: Create GitHub Release
74-
id: create_release
7573
uses: softprops/action-gh-release@v2
7674
with:
7775
tag_name: 'v${{ needs.extract-version.outputs.version }}'
7876
prerelease: ${{ github.event.inputs.prerelease }}
7977
target_commitish: ${{ inputs.ref }}
80-
81-
- name: Upload Linux Binary
82-
uses: actions/upload-release-asset@v1
83-
with:
84-
upload_url: ${{ steps.create_release.outputs.upload_url }}
85-
asset_path:
86-
/tmp/release/indexify-server-${{
87-
needs.extract-version.outputs.version }}-linux-amd64
88-
asset_name:
89-
indexify-server-${{ needs.extract-version.outputs.version
90-
}}-linux-amd64
91-
asset_content_type: application/octet-stream
92-
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
- name: Upload Linux Deb Package for amd64
95-
uses: actions/upload-release-asset@v1
96-
with:
97-
upload_url: ${{ steps.create_release.outputs.upload_url }}
98-
asset_path:
99-
/tmp/release/indexify-server-${{
100-
needs.extract-version.outputs.version }}-linux-amd64.deb
101-
asset_name:
102-
indexify-server-${{ needs.extract-version.outputs.version
103-
}}-linux-amd64.deb
104-
asset_content_type: application/octet-stream
105-
env:
106-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107-
- name: Upload macOS Binary
108-
uses: actions/upload-release-asset@v1
109-
with:
110-
upload_url: ${{ steps.create_release.outputs.upload_url }}
111-
asset_path:
112-
/tmp/release/indexify-server-${{
113-
needs.extract-version.outputs.version }}-darwin-arm64
114-
asset_name:
115-
indexify-server-${{ needs.extract-version.outputs.version
116-
}}-darwin-arm64
117-
asset_content_type: application/octet-stream
118-
env:
119-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120-
- name: install reprepro
121-
run: sudo apt-get update && sudo apt-get install -y reprepro
122-
123-
- name: Run reprepro
124-
run: |
125-
ls /tmp/release/
126-
(cd .repo && reprepro includedeb buster /tmp/release/*.deb)
127-
(cd .repo && reprepro includedeb focal /tmp/release/*.deb)
128-
(cd .repo && reprepro includedeb jammy /tmp/release/*.deb)
129-
# (cd .repo && reprepro includedeb noble /tmp/release/*.deb)
130-
ls .repo/
131-
132-
- uses: ryand56/r2-upload-action@latest
133-
with:
134-
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
135-
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
136-
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
137-
r2-bucket: ${{ secrets.R2_BUCKET }}
138-
source-dir: server/.repo/
139-
destination-dir: ./repo
78+
files: |
79+
/tmp/release/indexify-server-${{ needs.extract-version.outputs.version }}-linux-amd64
80+
/tmp/release/indexify-server-${{ needs.extract-version.outputs.version }}-linux-aarch64
14081
14182
build-and-push-docker-images:
14283
name: Build and Push Docker Images
14384
runs-on: namespace-profile-indexify-builder
14485
needs:
86+
- build-release-packages
14587
- extract-version
14688
- create-release
14789
steps:
14890
- uses: actions/checkout@v4
14991
with:
15092
ref: ${{ inputs.ref }}
15193

94+
- name: Download Artifacts
95+
uses: actions/download-artifact@v4
96+
with:
97+
path: /tmp/docker-binaries/
98+
99+
- name: Prepare binaries for Docker build
100+
run: |
101+
# Docker buildx uses amd64 and arm64 for TARGETARCH
102+
# Copy and rename binaries to match Docker's architecture naming
103+
# Note: We're already in ./server directory due to defaults.run.working-directory
104+
ls -la /tmp/docker-binaries/
105+
cp /tmp/docker-binaries/indexify-server-linux-amd64/indexify-server ./indexify-server-amd64
106+
cp /tmp/docker-binaries/indexify-server-linux-aarch64/indexify-server ./indexify-server-arm64
107+
ls -la ./indexify-server-*
108+
chmod +x ./indexify-server-amd64 ./indexify-server-arm64
109+
110+
- name: Set up Docker Buildx
111+
uses: docker/setup-buildx-action@v3
112+
152113
- name: Login to Docker Hub
153114
uses: docker/login-action@v3
154115
with:
155116
username: ${{ secrets.DOCKERHUB_USERNAME }}
156117
password: ${{ secrets.DOCKERHUB_TOKEN }}
157-
- run: |
158-
docker buildx build --platform=linux/amd64 --push . -t tensorlake/indexify-server:latest -f dockerfiles/Dockerfile.release_server;
159118

160-
tag="";
119+
- name: Build and push multi-platform Docker images
120+
run: |
121+
# Build and push latest tag with multi-platform support
122+
docker buildx build --platform=linux/amd64,linux/arm64 --push . -t tensorlake/indexify-server:latest -f dockerfiles/Dockerfile.release_server
123+
124+
# Build and push version tags
125+
tag=""
161126
for i in $(echo ${{ needs.extract-version.outputs.version }} | tr '.' '\n')
162127
do
163128
if [[ $tag == "" ]]; then
164-
tag="$i";
129+
tag="$i"
165130
else
166-
tag="$tag.$i";
131+
tag="$tag.$i"
167132
fi
168-
docker buildx build --platform=linux/amd64 --push . -t tensorlake/indexify-server:$tag -f dockerfiles/Dockerfile.release_server;
133+
docker buildx build --platform=linux/amd64,linux/arm64 --push . -t tensorlake/indexify-server:$tag -f dockerfiles/Dockerfile.release_server
169134
done

.github/workflows/wf_build_indexify_server_release_packages.yaml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818

1919
jobs:
2020
build-linux-amd64-package:
21-
name: Build x86_64 Linux Package
21+
name: Build x86_64 Linux Binary
2222
runs-on: ubuntu-latest-xlarge
2323
steps:
2424
- uses: actions/checkout@v4
@@ -34,34 +34,43 @@ jobs:
3434
~/.cargo/registry
3535
~/.cargo/git
3636
37-
- run: cargo install cargo-deb
3837
- run: cargo build --release
39-
- run: cargo deb --no-build --no-strip --target x86_64-unknown-linux-gnu
4038

4139
- uses: actions/upload-artifact@v4
4240
with:
4341
name: indexify-server-linux-amd64
4442
path: target/release/indexify-server
4543
if-no-files-found: error
4644

47-
build-macos-package:
48-
name: Build macOS Package
49-
runs-on: macos-14-xlarge
45+
build-linux-arm64-package:
46+
name: Build Aarch64 Linux Binary
47+
runs-on: ubuntu-latest-xlarge
5048
steps:
5149
- uses: actions/checkout@v4
5250
with:
5351
ref: ${{ inputs.ref }}
54-
- run: NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
55-
- run: brew install protobuf
56-
- run: rustup update
57-
- run: rustup toolchain install nightly --component rustfmt
58-
- run: rustup target add aarch64-apple-darwin
59-
- run: cargo +nightly fmt --check
60-
- run: make package-ui
61-
- run: cargo build --release
52+
53+
- run: sudo apt update && sudo apt install -y protobuf-compiler gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
54+
55+
- uses: actions-rust-lang/setup-rust-toolchain@v1
56+
with:
57+
cache-directories: |
58+
target
59+
~/.cargo/registry
60+
~/.cargo/git
61+
62+
- run: rustup target add aarch64-unknown-linux-gnu
63+
64+
- name: Build for ARM64
65+
env:
66+
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
67+
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
68+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
69+
run: cargo build --release --target aarch64-unknown-linux-gnu
70+
6271
- uses: actions/upload-artifact@v4
6372
with:
64-
name: indexify-server-darwin-arm64
65-
path: target/release/indexify-server
73+
name: indexify-server-linux-aarch64
74+
path: target/aarch64-unknown-linux-gnu/release/indexify-server
6675
if-no-files-found: error
6776

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
FROM ubuntu:22.04
22

3-
RUN apt update
4-
5-
RUN apt install -y lsb-release ca-certificates apt-transport-https
6-
7-
RUN update-ca-certificates
8-
9-
RUN echo "deb [trusted=yes] https://cf-repo.diptanu-6d5.workers.dev/repo $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/indexify-repo.list && \
10-
apt-get update -y && \
11-
apt-get install -y indexify-server && \
12-
apt-get -y clean
3+
RUN apt-get update && \
4+
apt-get install -y ca-certificates && \
5+
update-ca-certificates && \
6+
apt-get clean && \
7+
rm -rf /var/lib/apt/lists/*
138

149
WORKDIR /indexify
1510

16-
ENTRYPOINT [ "indexify-server" ]
11+
# The binary will be copied in during the Docker build via buildx
12+
# The TARGETARCH build arg is automatically set by Docker buildx
13+
ARG TARGETARCH
14+
COPY --chmod=755 indexify-server-${TARGETARCH} /indexify/indexify-server
15+
16+
ENTRYPOINT [ "/indexify/indexify-server" ]

0 commit comments

Comments
 (0)