Skip to content

Commit d52e824

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents ce6fa69 + 9e11f0a commit d52e824

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Snyk scan for training‑runtime Dockerfiles
2+
# push to main, nightly 03:00 UTC, fork PRs after label `run‑snyk`
3+
# Fails on High/Critical CVEs
4+
name: Snyk Dockerfile Scan
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request_target:
9+
types: [ labeled ]
10+
schedule:
11+
- cron: '0 3 * * *'
12+
jobs:
13+
snyk-scan:
14+
if: |
15+
github.event_name == 'schedule' ||
16+
github.event_name == 'push' ||
17+
(github.event_name == 'pull_request_target' &&
18+
contains(github.event.pull_request.labels.*.name, 'run-snyk'))
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
# for pull_request_target scan the PR head commit
24+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
25+
- uses: snyk/actions/setup@master
26+
with:
27+
token: ${{ secrets.SNYK_TOKEN }}
28+
- name: Scan Dockerfiles
29+
shell: bash
30+
run: |
31+
set -euo pipefail
32+
find images/runtime/training -name Dockerfile | while read f; do
33+
snyk iac test "$f" --severity-threshold=high
34+
done

tests/kfto/kfto_mnist_training_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ func createKFTOPyTorchMnistJob(test Test, namespace string, config corev1.Config
169169
Name: "tmp-volume",
170170
MountPath: "/tmp",
171171
},
172+
{
173+
Name: "shm-volume",
174+
MountPath: "/dev/shm",
175+
},
172176
},
173177
Resources: corev1.ResourceRequirements{
174178
Requests: corev1.ResourceList{
@@ -199,6 +203,14 @@ func createKFTOPyTorchMnistJob(test Test, namespace string, config corev1.Config
199203
EmptyDir: &corev1.EmptyDirVolumeSource{},
200204
},
201205
},
206+
{
207+
Name: "shm-volume",
208+
VolumeSource: corev1.VolumeSource{
209+
EmptyDir: &corev1.EmptyDirVolumeSource{
210+
Medium: corev1.StorageMediumMemory,
211+
},
212+
},
213+
},
202214
},
203215
RestartPolicy: corev1.RestartPolicyOnFailure,
204216
},
@@ -253,6 +265,10 @@ func createKFTOPyTorchMnistJob(test Test, namespace string, config corev1.Config
253265
Name: "tmp-volume",
254266
MountPath: "/tmp",
255267
},
268+
{
269+
Name: "shm-volume",
270+
MountPath: "/dev/shm",
271+
},
256272
},
257273
Resources: corev1.ResourceRequirements{
258274
Requests: corev1.ResourceList{
@@ -283,6 +299,14 @@ func createKFTOPyTorchMnistJob(test Test, namespace string, config corev1.Config
283299
EmptyDir: &corev1.EmptyDirVolumeSource{},
284300
},
285301
},
302+
{
303+
Name: "shm-volume",
304+
VolumeSource: corev1.VolumeSource{
305+
EmptyDir: &corev1.EmptyDirVolumeSource{
306+
Medium: corev1.StorageMediumMemory,
307+
},
308+
},
309+
},
286310
},
287311
RestartPolicy: corev1.RestartPolicyOnFailure,
288312
},

tests/kfto/kfto_training_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ func createKFTOPyTorchJob(test Test, namespace string, config corev1.ConfigMap,
237237
Name: "output-volume",
238238
MountPath: "/mnt/output",
239239
},
240+
{
241+
Name: "shm-volume",
242+
MountPath: "/dev/shm",
243+
},
240244
},
241245
Resources: corev1.ResourceRequirements{
242246
Requests: corev1.ResourceList{
@@ -281,6 +285,14 @@ func createKFTOPyTorchJob(test Test, namespace string, config corev1.ConfigMap,
281285
},
282286
},
283287
},
288+
{
289+
Name: "shm-volume",
290+
VolumeSource: corev1.VolumeSource{
291+
EmptyDir: &corev1.EmptyDirVolumeSource{
292+
Medium: corev1.StorageMediumMemory,
293+
},
294+
},
295+
},
284296
},
285297
},
286298
},
@@ -390,6 +402,10 @@ func createKFTOPyTorchJob(test Test, namespace string, config corev1.ConfigMap,
390402
Name: "tmp-volume",
391403
MountPath: "/tmp",
392404
},
405+
{
406+
Name: "shm-volume",
407+
MountPath: "/dev/shm",
408+
},
393409
},
394410
Resources: corev1.ResourceRequirements{
395411
Requests: corev1.ResourceList{
@@ -426,6 +442,14 @@ func createKFTOPyTorchJob(test Test, namespace string, config corev1.ConfigMap,
426442
EmptyDir: &corev1.EmptyDirVolumeSource{},
427443
},
428444
},
445+
{
446+
Name: "shm-volume",
447+
VolumeSource: corev1.VolumeSource{
448+
EmptyDir: &corev1.EmptyDirVolumeSource{
449+
Medium: corev1.StorageMediumMemory,
450+
},
451+
},
452+
},
429453
},
430454
},
431455
},

0 commit comments

Comments
 (0)