1+ apiVersion : argoproj.io/v1alpha1
2+ kind : ClusterWorkflowTemplate
3+ metadata :
4+ name : Calibrate4DSTEM
5+ labels :
6+ workflows.diamond.ac.uk/science-group-imaging : " true"
7+ annotations :
8+ workflows.argoproj.io/title : Calibrate 4D STEM data
9+ workflows.argoproj.io/description : |
10+ A utility which takes in a 4D STEM data set and outs the approximate real space pixel size, measured camera length and scan rotation (based off dpc).
11+ workflows.diamond.ac.uk/repository : " https://github.com/DiamondLightSource/imaging-workflows"
12+ workflows.diamond.ac.uk/parameter-schema : |
13+ {{- .Files.Get "schema/Calibrate4DSTEMSchema.json" | nindent 6 }}
14+ workflows.diamond.ac.uk/ui-schema : |
15+ {{- .Files.Get "schema/Calibrate4DSTEMUISchema.json" | nindent 6 }}
16+ spec :
17+ entrypoint : mount-files
18+ arguments :
19+ parameters :
20+ - name : visitdir
21+ valueFrom :
22+ configMapKeyRef :
23+ name : sessionspaces
24+ key : data_directory
25+ volumeClaimTemplates :
26+ - metadata :
27+ name : tmp
28+ spec :
29+ accessModes :
30+ - ReadWriteOnce
31+ resources :
32+ requests :
33+ storage : 2Gi
34+ storageClassName : netapp
35+
36+ templates :
37+ - name : calibration-notebook
38+ steps :
39+ - - name : copy-notebook
40+ template : mount-files
41+ - - name : run-notebook
42+ template : notebook
43+
44+ - name : mount-files
45+ script :
46+ image : debian:stable-slim
47+ volumeMounts :
48+ - name : tmp
49+ mountPath : /tmp
50+ - name : session
51+ mountPath : " {{`{{ workflow.parameters.visitdir }}`}}"
52+ command : [bash]
53+ source : |
54+ OUTPUT="{{`{{workflow.parameters.visitdir}}`}}"/processing/workflows/
55+ mkdir -p $OUTPUT
56+ echo "something!"
57+ echo '{{ .Files.Get "notebooks/Ptycho_calibration.ipynb" | b64enc }}' | base64 -d > $OUTPUT/Ptycho_calibration.ipynb
58+
59+ - name : notebook
60+ inputs :
61+ parameters :
62+ - name : sample
63+ value : " {{`{{workflow.parameters.sample}}`}}"
64+ - name : timestamp
65+ value : " {{`{{workflow.parameters.timestamp}}`}}"
66+ - name : outpath
67+ value : " {{`{{workflow.parameters.outpath}}`}}"
68+ - name : thresh_lower
69+ value : " {{`{{workflow.parameters.thresh_lower}}`}}"
70+ - name : thresh_upper
71+ value : " {{`{{workflow.parameters.thresh_upper}}`}}"
72+ script :
73+ image : gitlab.diamond.ac.uk:5050/scisoft/ptychography/dimtools/mib2x
74+ volumeMounts :
75+ - name : session
76+ mountPath : " {{`{{ workflows.parameters.visitdir }}`}}"
77+ - name : tmp
78+ mountPath : /tmp
79+ - name : software
80+ mountPath : /dls_sw/e02/medipix_mask
81+ command : [bash]
82+ source : |
83+ ERROR_TXT="raise error"
84+ ERROR_STR="An error occured within the notebook. Please open the output file to check"
85+ OUTPUT="{{`{{workflow.parameters.visitdir}}`}}"/processing/workflows/
86+ python -m papermill "{{`{{workflow.parameters.visitdir}}`}}"/processing/workflows/Ptycho_calibration.ipynb $OUTPUT/Calibrate-notebook.ipynb \
87+ -p visit "{{`{{ workflow.parameters.visitdir }}`}}"
88+ -p sample "{{`{{ workflows.parameters.sample }}`}}"
89+ -p timestamp "{{`{{workflows.parameters.timestamp}}`}}"
90+ -p maskpath /software/29042024_12bitmask2.h5
91+ -p outpath "{{`{{workflows.parameters.outpath}}`}}"
92+ -p lower "{{`{{workflows.parameters.thresh_lower}}`}}"
93+ -p upper "{{`{{workflows.parameters.thresh_upper}}`}}"
94+ > $OUTPUT/papermill.log 2>&1
95+
96+ python -m jupyter nbconvert $OUTPUT/Calibrate-notebook.ipynb \
97+ --to html
98+
99+ outputs :
100+ artifacts :
101+ - name : phase-output
102+ path : " {{`{{ inputs.parameters.outpath }}`}}/phase-output.html"
103+ archive :
104+ none : {}
105+ - name : notebook-log
106+ path : " {{`{{ inputs.parameters.outpath }}`}}/papermill.log"
107+ archive :
108+ none : {}
109+ podSpecPatch : |
110+ containers:
111+ - name: main
112+ resources:
113+ requests:
114+ cpu: 10
115+ memory: 30Gi
116+ limits:
117+ cpu: 10
118+ memory: 30Gi
119+
120+
0 commit comments