Skip to content

Commit 56a49e2

Browse files
jiridanekopenshift-merge-bot[bot]
authored andcommitted
RHOAIENG-16076: fix(gha): move the trivy db to the lvm volume as to not run out of disk space
When I was testing this in the all-in-one PR, I had 4096 MB reserved on /. I did not realize that trivy relied on that disk space. ``` build (codeserver-ubi9-python-3.11) / build System.IO.IOException: No space left on device : '/home/runner/runners/2.320.0/_diag/Worker_20241125-163906-utc.log' Unhandled exception. System.IO.IOException: No space left on device : '/home/runner/runners/2.320.0/_diag/Worker_20241125-163906-utc.log' at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset) at System.IO.Strategies.BufferedFileStreamStrategy.FlushWrite() at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.Diagnostics.TextWriterTraceListener.Flush() at GitHub.Runner.Common.HostTraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id) at GitHub.Runner.Common.HostTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message) at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message) at GitHub.Runner.Worker.Worker.RunAsync(String pipeIn, String pipeOut) at GitHub.Runner.Worker.Program.MainAsync(IHostContext context, String[] args) System.IO.IOException: No space left on device : '/home/runner/runners/2.320.0/_diag/Worker_20241125-163906-utc.log' at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset) at System.IO.Strategies.BufferedFileStreamStrategy.FlushWrite() at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.Diagnostics.TextWriterTraceListener.Flush() at GitHub.Runner.Common.HostTraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id) at GitHub.Runner.Common.HostTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message) at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message) at GitHub.Runner.Common.Tracing.Error(Exception exception) at GitHub.Runner.Worker.Program.MainAsync(IHostContext context, String[] args) at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset) at System.IO.Strategies.BufferedFileStreamStrategy.FlushWrite() at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.Diagnostics.TextWriterTraceListener.Flush() at System.Diagnostics.TraceSource.Flush() at GitHub.Runner.Common.TraceManager.Dispose(Boolean disposing) at GitHub.Runner.Common.TraceManager.Dispose() at GitHub.Runner.Common.HostContext.Dispose(Boolean disposing) at GitHub.Runner.Common.HostContext.Dispose() at GitHub.Runner.Worker.Program.Main(String[] args) ```
1 parent 7265949 commit 56a49e2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
# GitHub image registry used for storing $(CONTAINER_ENGINE)'s cache
2626
CACHE: "ghcr.io/${{ github.repository }}/workbench-images/build-cache"
2727
TRIVY_VERSION: 0.57.1
28+
TRIVY_VULNDB: "/home/runner/.local/share/containers/trivy_db"
2829
# Targets (and their folder) that should be scanned using FS instead of IMAGE scan due to resource constraints
2930
TRIVY_SCAN_FS_JSON: '{}'
3031

@@ -164,17 +165,17 @@ jobs:
164165
- name: Pre-pull Trivy vulnerabilities DB
165166
if: ${{ steps.resolve-target.outputs.target }}
166167
run: |
167-
mkdir trivy_db
168+
mkdir ${TRIVY_VULNDB}
168169
podman run --rm \
169170
--env PODMAN_SOCK \
170-
-v ${PWD}/trivy_db:/cache \
171+
-v ${TRIVY_VULNDB}:/cache \
171172
docker.io/aquasec/trivy:$TRIVY_VERSION \
172173
--cache-dir /cache \
173174
image \
174175
--download-db-only
175176
podman run --rm \
176177
--env PODMAN_SOCK \
177-
-v ${PWD}/trivy_db:/cache \
178+
-v ${TRIVY_VULNDB}:/cache \
178179
docker.io/aquasec/trivy:$TRIVY_VERSION \
179180
--cache-dir /cache \
180181
image \
@@ -233,7 +234,7 @@ jobs:
233234
podman run --rm \
234235
$PODMAN_ARGS \
235236
-v ${REPORT_FOLDER}:/report \
236-
-v ${PWD}/trivy_db:/cache \
237+
-v ${TRIVY_VULNDB}:/cache \
237238
docker.io/aquasec/trivy:$TRIVY_VERSION \
238239
--cache-dir /cache \
239240
$SCAN_TYPE \

0 commit comments

Comments
 (0)