Skip to content
Open
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
12 changes: 5 additions & 7 deletions .github/actions/rust-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ inputs:
install-deps:
description: 'Install system dependencies (protoc, cmake, etc.)'
default: 'true'
sccache:
description: 'Enable sccache'
default: 'true'
mold:
description: 'Use mold linker'
default: 'true'
Expand Down Expand Up @@ -45,7 +42,8 @@ runs:

- name: Rust cache
uses: Swatinem/rust-cache@v2

- name: Run sccache
if: inputs.sccache == 'true'
uses: mozilla-actions/sccache-action@v0.0.9
with:
# Only write the cache from main so PR/dependabot branches restore
# main's warm dependency cache instead of evicting it. This is the fix
# for the 10GB GHA cache thrashing that caused cold compiles every run.
save-if: ${{ github.ref == 'refs/heads/main' }}
4 changes: 0 additions & 4 deletions .github/workflows/audit-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

jobs:
audit:
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ concurrency:
cancel-in-progress: true

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
# Trim debug info in CI only (local dev profiles are untouched): smaller
# target dir, faster codegen/linking, and a lighter cache to store/restore.
CARGO_PROFILE_DEV_DEBUG: line-tables-only
CARGO_PROFILE_TEST_DEBUG: line-tables-only

jobs:
check:
Expand Down Expand Up @@ -102,7 +104,6 @@ jobs:
with:
components: rustfmt
install-deps: 'false'
sccache: 'false'
mold: 'false'
- name: Rustfmt Check
uses: actions-rust-lang/rustfmt@v1
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ jobs:
PROFILE=release
CI=${{ env.CI }}
push: true
# layer caching
cache-from: type=gha
cache-to: type=gha,mode=max,ignore-error=true
# Layer caching via the registry (no 10GB GHA-cache cap), so the
# cargo-chef `cook` layer stays warm instead of being evicted and
# forcing a ~12min dependency rebuild. Only main writes the cache;
# other branches restore it read-only and can't evict it.
cache-from: type=registry,ref=ghcr.io/meteroid-oss/${{ matrix.image_type.name }}:buildcache
cache-to: ${{ github.ref == 'refs/heads/main' && format('type=registry,ref=ghcr.io/meteroid-oss/{0}:buildcache,mode=max,image-manifest=true,ignore-error=true', matrix.image_type.name) || '' }}
# https://github.com/docker/build-push-action/issues/900
provenance: false
outputs: type=image,name=ghcr.io/meteroid-oss/${{ matrix.image_type.name }},push-by-digest=true,name-canonical=true,push=true,store=true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openapi-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ concurrency:
cancel-in-progress: true

env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
# Trim debug info in CI only: faster codegen/linking, lighter cache.
CARGO_PROFILE_DEV_DEBUG: line-tables-only

jobs:
openapi:
Expand Down
5 changes: 5 additions & 0 deletions modules/metering/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ RUN wget https://github.com/rui314/mold/releases/download/v${MOLD_VERSION}/mold-
tar xvfz mold*.tar.gz && \
mv mold*-linux/bin/* /usr/local/bin && \
mv mold*-linux/libexec/* /usr/libexec && \
ln -sf /usr/local/bin/mold /usr/local/bin/ld.mold && \
rm -rf mold*

# Link with mold. The .cargo/config.toml mold config is .dockerignored so it
# never reaches the build; wire it here or these builds link with slow default ld.
ENV RUSTFLAGS="-Clink-arg=-fuse-ld=mold"

# Install protoc
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTO_VERSION}/protoc-${PROTO_VERSION}-linux-${PROTO_ARCH}.zip && \
unzip protoc*.zip && \
Expand Down
5 changes: 5 additions & 0 deletions modules/meteroid/api.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ RUN wget https://github.com/rui314/mold/releases/download/v${MOLD_VERSION}/mold-
tar xvfz mold*.tar.gz && \
mv mold*-linux/bin/* /usr/local/bin && \
mv mold*-linux/libexec/* /usr/libexec && \
ln -sf /usr/local/bin/mold /usr/local/bin/ld.mold && \
rm -rf mold*

# Link with mold. The .cargo/config.toml mold config is .dockerignored so it
# never reaches the build; wire it here or these builds link with slow default ld.
ENV RUSTFLAGS="-Clink-arg=-fuse-ld=mold"

# Install protoc
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTO_VERSION}/protoc-${PROTO_VERSION}-linux-${PROTO_ARCH}.zip && \
unzip protoc*.zip && \
Expand Down
5 changes: 5 additions & 0 deletions modules/meteroid/scheduler.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN apt-get update && \
tar xvfz mold*.tar.gz && \
mv mold*-linux/bin/* /usr/local/bin && \
mv mold*-linux/libexec/* /usr/libexec && \
ln -sf /usr/local/bin/mold /usr/local/bin/ld.mold && \
rm -rf mold*; \
# Install protoc
wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTO_VERSION}/protoc-${PROTO_VERSION}-linux-${PROTO_ARCH}.zip && \
Expand All @@ -33,6 +34,10 @@ RUN apt-get update && \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Link with mold. The .cargo/config.toml mold config is .dockerignored so it
# never reaches the build; wire it here or these builds link with slow default ld.
ENV RUSTFLAGS="-Clink-arg=-fuse-ld=mold"

COPY --from=planner /opt/src/recipe.json recipe.json

ARG PROFILE
Expand Down
Loading