Python alternative to creating and running argo workflows in the Data Analysis Platform
This provides a copier template and demonstrating how to use Hera to rewrite workflows using python.
| What | Where |
|---|---|
| Source | https://github.com/DiamondLightSource/python-interface-to-workflows |
| Docker | docker run ghcr.io/diamondlightsource/python-interface-to-workflows:latest |
| Releases | https://github.com/DiamondLightSource/python-interface-to-workflows/releases |
mkdir new_directory_path
cd new_directory_path
git init
git remote add origin {origin ssh}
git branch -M main
cd ..then either:
git clone git@github.com:DiamondLightSource/python-interface-to-workflows.git
copier copy {this_repo's_path} {new_directory_path}or:
copier copy git@github.com:DiamondLightSource/python-interface-to-workflows.git .
code .Then:
- create a .env file in src
- run uv lock
- rebuild and reopen in container
To submit your yaml files in a notebook, append the following:
from python_workflow_submitter.submit_workflow import submit_workflow_yaml
await submit_workflow_yaml("example.yaml")Alternatively:
import asyncio
import os
from python_workflow_submitter.submit_workflow import submit_workflow_yaml
asyncio.run(submit_workflow_yaml("example.yaml", visit=os.environ.get("VISIT")))