Skip to content

Commit

Permalink
feat: argo refactored and working
Browse files Browse the repository at this point in the history
* feat: a working refactor of argo

* fix: still working through dag tasks

* feat: composite steps added

* feat: Fully working deep nested argo workflows
  • Loading branch information
vijayvammi authored Jan 22, 2025
1 parent 57aeb48 commit 17b6d02
Show file tree
Hide file tree
Showing 16 changed files with 802 additions and 1,431 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ COPY . /app
WORKDIR /app

RUN uv python install && \
uv sync --index https://artifactory.astrazeneca.net/api/pypi/pypi-virtual/simple/ --frozen --all-extras
uv sync --index https://artifactory.astrazeneca.net/api/pypi/pypi-virtual/simple/ --all-extras

ENV PATH="/app/.venv/bin:$PATH"
36 changes: 36 additions & 0 deletions examples/11-jobs/scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
You can execute this pipeline by:
python examples/01-tasks/scripts.py
The command can be anything that can be executed in a shell.
The stdout/stderr of the execution is captured as execution log and stored in the catalog.
For example:
.catalog
└── seasoned-perlman-1355
└── hello.execution.log
"""

from runnable import Job, ShellTask


def main():
# If this step executes successfully, the pipeline will terminate with success
hello_task = ShellTask(
name="hello",
command="echo 'Hello World!'",
terminate_with_success=True,
)

job = Job(name="hello", task=hello_task)

job.execute()

return job


if __name__ == "__main__":
main()
22 changes: 2 additions & 20 deletions examples/11-jobs/scripts.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,2 @@
dag:
description: |
This is a sample pipeline with one step that
executes a shell command.
You can run this pipeline by:
runnable execute -f examples/01-tasks/scripts.yaml
For example:
.catalog
└── seasoned-perlman-1355
└── hello.execution.log
start_at: shell
steps:
shell:
type: task
command_type: shell
command: echo "hello world!!" # The path is relative to the root of the project.
next: success
type: shell
command: echo "hello world!!" # The path is relative to the root of the project.
18 changes: 18 additions & 0 deletions examples/configs/argo-config-az.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pipeline-executor:
type: "argo" # (1)
config:
pvc_for_runnable: runnable
argoWorkflow:
metadata:
generateName: "argo-" # (2)
namespace: enterprise-mlops
spec:
serviceAccountName: "default-editor"
templateDefaults:
image: harbor.csis.astrazeneca.net/mlops/runnable:latest # (2)


run-log-store: # (4)
type: chunked-fs
# config:
# log_folder: /mnt/run_log_store
50 changes: 0 additions & 50 deletions examples/configs/argo-config-full.yaml

This file was deleted.

20 changes: 10 additions & 10 deletions examples/configs/argo-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
pipeline-executor:
type: "argo" # (1)
config:
image: harbor.csis.astrazeneca.net/mlops/runnable:latest # (2)
service_account_name: default-editor
persistent_volumes: # (3)
- name: magnus-volume
mount_path: /mnt
pvc_for_runnable: runnable
argoWorkflow:
metadata:
generateName: "argo-" # (2)
namespace: enterprise-mlops
spec:
serviceAccountName: "default-editor"
templateDefaults:
image: harbor.csis.astrazeneca.net/mlops/runnable:latest # (2)


run-log-store: # (4)
type: chunked-fs
# config:
# log_folder: /mnt/run_log_store

catalog:
type: file-system
# config:
# catalog_location: /mnt/catalog
6 changes: 3 additions & 3 deletions examples/configs/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ pipeline-executor:
type: local # (1)

run-log-store:
type: buffered # (2)
type: file-system

catalog:
type: do-nothing # (3)
type: file-system # (3)

secrets:
type: do-nothing # (4)
type: env-secrets # (4)
Loading

0 comments on commit 17b6d02

Please sign in to comment.