Skip to content

Commit

Permalink
Update GHA workflows (#696)
Browse files Browse the repository at this point in the history
Notably, the new workflows use Node 20 instead of Node 16 which might
improve stability.
  • Loading branch information
aaronmondal committed Mar 3, 2024
1 parent 8dd786a commit b0fcac8
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
nix-installer-tag: v0.16.1

- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
uses: >- # Custom commit, last pinned at 2024-03-03.
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788
- name: Test image
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
nix-installer-tag: v0.16.1

- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
uses: >- # Custom commit, last pinned at 2024-03-03.
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788
- name: Build hello_lre with LRE toolchain.
run: >
Expand Down Expand Up @@ -62,8 +62,8 @@ jobs:
nix-installer-tag: v0.16.1

- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
uses: >- # Custom commit, last pinned at 2024-03-03.
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788
- name: Start Kubernetes cluster (Infra)
run: >
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,36 @@ on:
jobs:
docker-compose-compiles-nativelink:
# The type of runner that the job will run on.
runs-on: ubuntu-22.04
runs-on: large-ubuntu-22.04
strategy:
matrix:
# Which OS versions we will test on.
os_version: [ 20.04, 22.04 ]
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Checkout
uses: >- # v4.1.1
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Docker Buildx
uses: >- # v3.1.0
docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
- name: Build Nativelink image
uses: >- # v5.1.0
docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: .
file: ./deployment-examples/docker-compose/Dockerfile
build-args: |
OPT_LEVEL=opt
OS_VERSION=${{ matrix.os_version }}
ADDITIONAL_SETUP_WORKER_CMD=DEBIAN_FRONTEND=noninteractive apt-get install -y gcc g++ lld pkg-config python3
ADDITIONAL_SETUP_WORKER_CMD=apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y gcc g++ lld pkg-config python3
load: true # This brings the build into `docker images` from buildx.
tags: trace_machina/nativelink:latest
- uses: docker/build-push-action@v4

- name: Build builder image
uses: >- # v5.1.0
docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: .
file: ./deployment-examples/docker-compose/Dockerfile
Expand Down Expand Up @@ -72,12 +80,17 @@ jobs:
# Which OS versions we will test on.
os_version: [ 20.04, 22.04 ]
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- name: Checkout
uses: >- # v4.1.1
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Docker Buildx
uses: >- # v3.1.0
docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
- name: Build image
uses: >- # v5.1.0
docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: .
file: ./deployment-examples/docker-compose/Dockerfile
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ jobs:
nix-installer-tag: v0.16.1

- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
uses: >- # Custom commit, last pinned at 2024-03-03.
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788
- name: Mount bazel cache
uses: >- # v3.3.2
actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: "~/.cache/bazel"
key: ${{ runner.os }}-bazel-nix
# TODO(aaronmondal): Reenable after https://github.com/TraceMachina/nativelink/pull/690
# - name: Mount bazel cache
# uses: >- # v3.3.2
# actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
# with:
# path: "~/.cache/bazel"
# key: ${{ runner.os }}-bazel-nix

- name: Invoke Bazel build in Nix shell
run: |
Expand Down Expand Up @@ -75,8 +76,8 @@ jobs:
nix-installer-tag: v0.16.1

- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
uses: >- # Custom commit, last pinned at 2024-03-03.
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788
- name: Invoke Cargo build in Nix shell
run: >
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
nix-installer-tag: v0.16.1

- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
uses: >- # Custom commit, last pinned at 2024-03-03.
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788
- name: Run pre-commit hooks
run: nix flake check
4 changes: 2 additions & 2 deletions .github/workflows/tagged_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
nix-installer-tag: v0.16.1

- name: Cache Nix derivations
uses: >- # Custom commit, last pinned at 2023-11-17.
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1
uses: >- # Custom commit, last pinned at 2024-03-03.
DeterminateSystems/magic-nix-cache-action@742d8701e54851d2136f71b61d31382a4f4d0788
- name: Test image
run: |
Expand Down
9 changes: 6 additions & 3 deletions deployment-examples/docker-compose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ RUN apt update && \
gcc \
g++ \
ca-certificates && \
npm install -g @bazel/bazelisk

npm install -g @bazel/bazelisk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Build the binary.
FROM dependencies AS builder
Expand All @@ -51,7 +52,9 @@ COPY --from=builder /root/nativelink-bin /usr/local/bin/nativelink
# Install runtime packages.
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
ca-certificates
ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ARG ADDITIONAL_SETUP_WORKER_CMD
RUN bash -ueo pipefail -c "${ADDITIONAL_SETUP_WORKER_CMD}"

Expand Down

0 comments on commit b0fcac8

Please sign in to comment.