forked from kubeflow/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
decompress-data-job.jsonnet
42 lines (39 loc) · 1.41 KB
/
decompress-data-job.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local env = std.extVar("__ksonnet/environments");
local params = std.extVar("__ksonnet/params").components["decompress-data-job"];
local k = import "k.libsonnet";
local decompressDataJob(namespace, name, pvc, pathToFile, mountPath) = {
apiVersion: "batch/v1",
kind: "Job",
metadata: {
name: name,
namespace: namespace,
},
spec: {
template: {
spec: {
containers: [{
name: "decompress-data",
image: "ubuntu:16.04",
imagePullPolicy: "IfNotPresent",
command: ["tar", "--no-same-owner", "-xzvf", pathToFile, "-C", mountPath],
volumeMounts: [{
mountPath: mountPath,
name: "pets-data",
},],
},],
volumes: [{
name: "pets-data",
persistentVolumeClaim: {
claimName: pvc,
},
},],
restartPolicy: "Never",
},
},
backoffLimit: 4,
},
};
std.prune(k.core.v1.list.new([
decompressDataJob(env.namespace, params.name + "-dataset", params.pvc, params.pathToDataset, params.mountPath),
decompressDataJob(env.namespace, params.name + "-annotations", params.pvc, params.pathToAnnotations, params.mountPath),
decompressDataJob(env.namespace, params.name + "-model", params.pvc, params.pathToModel, params.mountPath)]))