Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions examples/conventional-templates/dawn-powder-calibration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata:
name: dawn-powder-calibration
labels:
workflows.diamond.ac.uk/science-group-examples: "true"
annotations:
workflows.argoproj.io/title: DAWN Powder calibration
workflows.argoproj.io/description: |
Runs the DAWN command-line powder calibration tool from a given config JSON file. All file paths used
in the config must be in the same directory as the config file (or within a sub-directory).
(https://diamondlightsource.atlassian.net/wiki/spaces/DT/pages/1378465/Command-Line+Powder+Calibration)

workflows.diamond.ac.uk/parameter-schema.confpath : |
{
"type": "string",
"minLength": 1,
"default": "/path/to/config.json"
}
workflows.diamond.ac.uk/parameter-schema.fixparam : |
{
"type": "string",
"oneOf": [
{
"const": "",
"title": "Nothing fixed"
},
{
"const": "-fixedWavelength",
"title": "Fixed wavelength"
},
{
"const": "-fixedDistance",
"title": "Fixed distance"
}
],
"default": ""
}
workflows.diamond.ac.uk/parameter-schema.fixvalue: |
{
"type": "number",
"minimum": 0,
}
workflows.diamond.ac.uk/ui-schema: |
{
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"label": "Path to the config JSON file",
"scope": "#/properties/confpath"
},
{
"type": "Control",
"label": "Fix wavelength or distance?",
"scope": "#/properties/fixparam"
},
{
"type": "Control",
"label": "Wavelength (Angstrom)",
"scope": "#/properties/fixvalue",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/fixparam",
"schema": { "const": "-fixedWavelength"}
}
}
},
{
"type": "Control",
"label": "Distance (mm)",
"scope": "#/properties/fixvalue",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/fixparam",
"schema": { "const": "-fixedDistance"}
}
}
}
]
}
spec:
entrypoint: calibration-entry
arguments:
parameters:
- name: confpath
value: ""
- name: fixparam
value: ""
- name: fixvalue
value: 0

templates:
- name: calibration-entry
dag:
tasks:
- name: parse-config-path
template: parse-config-path

- name: run-calibration
dependencies: [parse-config-path]
template: run-calibration
arguments:
parameters:
- name: mount-dir-path
value: "{{tasks.parse-config-path.outputs.result}}"

- name: run-calibration
inputs:
parameters:
- name: mount-dir-path
script:
env:
- name: JAVA_TOOL_OPTIONS
value: "-Duser.name=dawn -Duser.home=/tmp/"
image: ghcr.io/dawnscience/dawn:latest
volumeMounts:
- name: config-dir
mountPath: "{{ inputs.parameters.mount-dir-path }}"
- name: tmp-dir
mountPath: /tmp
workingDir: /tmp-dir
command: [/bin/bash]
source: |
fixflag=""
if [ {{ workflow.parameters.fixparam }} != "" ]; then
fixflag="{{ workflow.parameters.fixparam }} {{ workflow.parameters.fixvalue}}"
fi
/dawn_workspace/dawn $fixflag -configuration /tmp -consoleLog -noSplash -data @none \
-application uk.ac.diamond.scisoft.diffraction.powder.application.powdercalibrate \
-path {{ workflow.parameters.confpath }}

podSpecPatch: |
containers:
- name: main
resources:
requests:
memory: 4Gi
limits:
memory: 4Gi
volumes:
- name: config-dir
hostPath:
path: "{{ inputs.parameters.mount-dir-path }}"
type: Directory
- name: tmp-dir
emptyDir: {}

outputs:
artifacts:
- name: dawn-logs
path: /tmp/dawn-dawn.log
archive:
none: {}

- name: parse-config-path
script:
image: busybox
command: [/bin/sh, "-c"]
args:
- echo {{ workflow.parameters.confpath }} | sed 's![^/]*$!!'