Skip to content

Commit a0d1db7

Browse files
committed
Don't use built-in docker support
We need to delete stuff on the host. If we use the built-in support, our job starts in the docker container and we can't clean up stuff to make space on the host volume.
1 parent cf15662 commit a0d1db7

File tree

1 file changed

+62
-17
lines changed

1 file changed

+62
-17
lines changed

.github/workflows/ci_linux.yml

Lines changed: 62 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
build:
2525
name: Build / ${{ matrix.variance.name }}
2626
runs-on: ${{ matrix.variance.runner }}
27-
container:
28-
image: ${{ matrix.variance.image }}
2927
strategy:
3028
fail-fast: false
3129
matrix:
@@ -108,34 +106,81 @@ jobs:
108106
env:
109107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110108

109+
- name: Pull build image
110+
run: docker pull ${{ matrix.variance.image }}
111+
112+
- name: Set container name
113+
run: echo "CONTAINER_NAME=ci-build-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.variance.runner }}" >> $GITHUB_ENV
114+
115+
- name: Start build container
116+
run: |
117+
docker create --name "$CONTAINER_NAME" \
118+
-v "$PWD":/workspace \
119+
-w /workspace \
120+
-e RUST_LOG \
121+
-e RUST_BACKTRACE \
122+
${{ matrix.variance.image }} \
123+
sleep infinity
124+
docker start "$CONTAINER_NAME"
125+
111126
- name: Verify CUDA, Rust installation
112127
run: |
113-
nvcc --version
114-
rustup show
128+
docker exec "$CONTAINER_NAME" bash -lc 'set -euo pipefail
129+
nvcc --version
130+
rustup show
131+
'
115132
116133
- name: Rustfmt
117-
run: cargo fmt --all -- --check
134+
run: |
135+
docker exec "$CONTAINER_NAME" bash -lc 'set -euo pipefail
136+
cargo fmt --all -- --check
137+
'
118138
119139
- name: Build all bindings
120-
run: cargo build --all-features -p cust_raw
140+
run: |
141+
docker exec "$CONTAINER_NAME" bash -lc 'set -euo pipefail
142+
cargo build --all-features -p cust_raw
143+
'
121144
122145
- name: Build workspace
123-
run: cargo build --workspace --exclude "optix*" --exclude "path-tracer" --exclude "denoiser" --exclude "ex0*" --exclude "cudnn*"
146+
run: |
147+
docker exec "$CONTAINER_NAME" bash -lc 'set -euo pipefail
148+
cargo build --workspace \
149+
--exclude "optix*" \
150+
--exclude "path-tracer" \
151+
--exclude "denoiser" \
152+
--exclude "ex0*" \
153+
--exclude "cudnn*"
154+
'
124155
125156
- name: Clippy
126-
env:
127-
RUSTFLAGS: -Dwarnings
128-
run: cargo clippy --workspace --exclude "optix*" --exclude "path-tracer" --exclude "denoiser" --exclude "ex0*" --exclude "cudnn*"
129-
130-
# Don't currently test because many tests rely on the system having a CUDA GPU
131-
# - name: Test
132-
# run: cargo test --workspace
157+
run: |
158+
docker exec "$CONTAINER_NAME" bash -lc 'set -euo pipefail
159+
export RUSTFLAGS=-Dwarnings
160+
cargo clippy --workspace \
161+
--exclude "optix*" \
162+
--exclude "path-tracer" \
163+
--exclude "denoiser" \
164+
--exclude "ex0*" \
165+
--exclude "cudnn*"
166+
'
133167
134168
- name: Check documentation
135-
env:
136-
RUSTDOCFLAGS: -Dwarnings
137-
run: cargo doc --workspace --all-features --document-private-items --no-deps --exclude "optix*" --exclude "path-tracer" --exclude "denoiser" --exclude "ex0*" --exclude "cudnn*" --exclude "cust_raw"
169+
run: |
170+
docker exec "$CONTAINER_NAME" bash -lc 'set -euo pipefail
171+
export RUSTDOCFLAGS=-Dwarnings
172+
cargo doc --workspace --all-features --document-private-items --no-deps \
173+
--exclude "optix*" \
174+
--exclude "path-tracer" \
175+
--exclude "denoiser" \
176+
--exclude "ex0*" \
177+
--exclude "cudnn*" \
178+
--exclude "cust_raw"
179+
'
138180
181+
- name: Stop build container
182+
run: |
183+
docker rm -f "$CONTAINER_NAME" || true
139184
- name: Prepare artifact details
140185
id: artifact_details
141186
run: |

0 commit comments

Comments
 (0)