forked from kubeflow/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-pet-record-job.jsonnet
45 lines (41 loc) · 1.29 KB
/
create-pet-record-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
43
44
45
local env = std.extVar("__ksonnet/environments");
local params = std.extVar("__ksonnet/params").components["create-pet-record-job"];
local k = import "k.libsonnet";
// This job converts our dataset to TFRecord format which is what TensorFlow
// Object Detection API uses
local createPetRecordJob = {
apiVersion: "batch/v1",
kind: "Job",
metadata: {
name: params.name,
namespace: env.namespace,
},
spec: {
template: {
spec: {
containers: [{
name: "create-tf-record",
image: params.image,
imagePullPolicy: "IfNotPresent",
command: ["python", "/models/research/object_detection/dataset_tools/create_pet_tf_record.py"],
args: ["--label_map_path=/models/research/object_detection/data/pet_label_map.pbtxt",
"--data_dir=" + params.dataDirPath,
"--output_dir=" + params.outputDirPath],
volumeMounts: [{
mountPath: params.mountPath,
name: "pets-data",
},],
},],
volumes: [{
name: "pets-data",
persistentVolumeClaim: {
claimName: params.pvc,
},
},],
restartPolicy: "Never",
},
},
backoffLimit: 4,
},
};
std.prune(k.core.v1.list.new([createPetRecordJob,]))