Skip to content

Commit 2d394ab

Browse files
committed
fix(auth): updates other template to keycloak standards
1 parent bb4ec11 commit 2d394ab

2 files changed

Lines changed: 420 additions & 349 deletions

File tree

src/python_interface_to_workflows/workflow_definitions/create_example_template.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from hera.shared import global_config
24
from hera.workflows import (
35
DAG,
@@ -10,13 +12,13 @@
1012
from hera.workflows import models as m
1113
from hera.workflows.archive import NoneArchiveStrategy
1214

13-
global_config.host = "https://argo-workflows.staging.workflows.diamond.ac.uk/"
14-
global_config.token = ""
15-
global_config.image = "python:3.10"
15+
global_config.host = os.environ.get("HOST")
16+
global_config.image = str(os.environ.get("IMAGE"))
17+
global_config.token = os.environ.get("TOKEN")
1618

1719

1820
@script(
19-
image="python:3.10",
21+
image=str(os.environ.get("IMAGE")),
2022
command=["python"],
2123
volume_mounts=[m.VolumeMount(name="tmpdir", mount_path="/tmp")],
2224
)
@@ -33,7 +35,7 @@ def install_dependencies():
3335

3436
@script(
3537
command=["python"],
36-
image="python:3.10",
38+
image=str(os.environ.get("IMAGE")),
3739
outputs=Parameter(
3840
name="out-parameters", value_from=m.ValueFrom(path="/tmp/parameters.json")
3941
),
@@ -74,7 +76,7 @@ def generate_parameters(
7476

7577
@script(
7678
command=["/tmp/venv/bin/python"],
77-
image="python:3.10",
79+
image=str(os.environ.get("IMAGE")),
7880
volume_mounts=[m.VolumeMount(name="tmpdir", mount_path="/tmp")],
7981
outputs=[
8082
Parameter(
@@ -125,7 +127,7 @@ def create_pattern(
125127

126128
@script(
127129
command=["/tmp/venv/bin/python"],
128-
image="python:3.10",
130+
image=str(os.environ.get("IMAGE")),
129131
volume_mounts=[m.VolumeMount(name="tmpdir", mount_path="/tmp")],
130132
outputs=Artifact(
131133
name="hdf5output",
@@ -155,7 +157,7 @@ def to_hdf5(paths: str):
155157
with Workflow(
156158
generate_name="hera-example-", # when running on graphql this should be name
157159
entrypoint="workflowentry",
158-
namespace="ks10000-3",
160+
namespace=str(os.environ("NAMESPACE")),
159161
api_version="argoproj.io/v1alpha1",
160162
kind="Workflow", # ClusterWorkflowTemplate", when on graphql
161163
labels={"workflows.diamond.ac.uk/science-group-examples": "true"},

0 commit comments

Comments
 (0)