-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython_script.yaml
44 lines (42 loc) · 1.13 KB
/
python_script.yaml
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
apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata:
name: mmg-test-python
spec:
entrypoint: mmg-test-python
arguments:
parameters:
- name: visitdir
valueFrom:
configMapKeyRef:
name: sessionspaces
key: data_directory
volumes:
- name: session
hostPath:
path: "{{ workflow.parameters.visitdir }}"
type: Directory
templates:
- name: mmg-test-python
inputs:
parameters:
- name: scanno
value: 1057496
- name: python-code
value: |
print(f"Scan command: {cmd}")
script:
image: ghcr.io/diamondlightsource/magnetic-materials-workflows:0.1.0-rc2
volumeMounts:
- name: session
mountPath: "{{ workflow.parameters.visitdir }}"
command: ["python"]
source: |
import numpy as np
import hdfmap
filename = '{{workflow.parameters.visitdir}}/{{inputs.parameters.scanno}}.nxs'
print(filename)
scan = hdfmap.NexusLoader(filename)
print(scan)
cmd = scan('scan_command')
{{inputs.parameters.python-code}}