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

ci: updating runner image to support cross compilation #622

Merged
merged 2 commits into from
Jul 16, 2024
Merged
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
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

[alias]
dremac = "zigbuild --bin dre --release --target x86_64-apple-darwin"
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.github
.pytest_cache
.vscode
bazel*
bin
dashboard
docs
k8s
linear-jira
node-labels
pylib
release-controller
replica-releases
rs
scripts
target
tools
trusted-neuron-alerts
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ checkpoint*

# mkdocs
.cache

# Created by zigbuild
.intentionally-empty-file*
14 changes: 3 additions & 11 deletions Cargo.Bazel.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "4a6bc91f724363b615928d9a2dba8822b5d9c444065dfa889058897281c98d8c",
"checksum": "be974b7fc92bfbfc7ffdc5895ee9b7070b1b6d54d1b7c3a3cd1604141467fd3c",
"crates": {
"actix-codec 0.5.2": {
"name": "actix-codec",
Expand Down Expand Up @@ -28488,35 +28488,29 @@
],
"crate_features": {
"common": [
"elf",
"errno",
"general",
"ioctl",
"no_std"
],
"selects": {
"aarch64-unknown-linux-gnu": [
"elf",
"errno",
"prctl",
"std",
"system"
],
"arm-unknown-linux-gnueabi": [
"elf",
"errno",
"prctl",
"std",
"system"
],
"armv7-unknown-linux-gnueabi": [
"elf",
"errno",
"prctl",
"std",
"system"
],
"i686-unknown-linux-gnu": [
"elf",
"errno",
"prctl",
"std",
"system"
Expand All @@ -28532,8 +28526,6 @@
"system"
],
"x86_64-unknown-linux-gnu": [
"elf",
"errno",
"prctl",
"std",
"system"
Expand Down
18 changes: 17 additions & 1 deletion docker/runner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ RUN apt-get update && \
apt-get upgrade -y && \
apt-get install ca-certificates curl git-all gcc g++ clang pkg-config make sudo docker.io build-essential \
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev liblzma-dev libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl -y
xz-utils tk-dev libffi-dev liblzma-dev python-openssl protobuf-compiler -y

RUN curl -L https://ziglang.org/builds/zig-linux-x86_64-0.14.0-dev.321+888708ec8.tar.xz | tar -xJ && \
mv zig-linux-x86_64-0.14.0-dev.321+888708ec8 /zig
ENV PATH="$PATH:/zig"

RUN curl -L https://github.com/roblabla/MacOSX-SDKs/releases/download/13.3/MacOSX13.3.sdk.tar.xz | tar xJ
ENV SDKROOT=/MacOSX13.3.sdk/

RUN mkdir -p openssl && \
curl -o openssl/openssl-1.1.1w.tar.gz -L https://www.openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz && \
Expand Down Expand Up @@ -56,3 +63,12 @@ RUN chown -R runner:runner /home/runner
ENV HOME=/home/runner
USER runner
WORKDIR /home/runner

# Rust version should align with one in `rust-toolchain.toml` and `WORKSPACE.bazel`
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.79.0-x86_64-unknown-linux-gnu -t x86_64-apple-darwin --no-update-default-toolchain
ENV PATH="/home/runner/.cargo/bin:$PATH"

ENV PATH="$PATH:/home/runner/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/"
ENV CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=rust-lld

RUN cargo install cargo-zigbuild
2 changes: 0 additions & 2 deletions docker/runner.Dockerfile.dockerignore

This file was deleted.

Loading