Skip to content

Commit 5f1897e

Browse files
committed
fix(api): fixes code based on comments
1 parent ca94c99 commit 5f1897e

6 files changed

Lines changed: 9 additions & 21 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@
5353
"--env-file",
5454
"src/.env"
5555
],
56-
"forwardPorts": [
57-
5173
58-
],
59-
"portsAttributes": {
60-
"5173": {
61-
"onAutoForward": "ignore"
62-
}
63-
},
6456
"mounts": [
6557
// Mount in the user terminal config folder so it can be edited
6658
{

src/copier_template/.devcontainer/devcontainer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
"--env-file",
5454
"src/.env"
5555
],
56-
"forwardPorts": [
57-
5173
58-
],
5956
"mounts": [
6057
// Mount in the user terminal config folder so it can be edited
6158
{

src/copier_template/src/README.md.jinja

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Setting up a development environment
2-
1. Build the dev container
3-
2. run "uv lock" to generate the uv.lock file
4-
3. Create .env in this folder (with the path src/.env) containing the following variables:
2+
1. run "uv lock" to generate the uv.lock file
3+
2. Create .env in this folder (with the path src/.env) containing the following variables:
54

6-
HOST=https://argo-workflows.workflows.diamond.ac.uk/ (to submit to the production repo)
7-
IMAGE= (usually python 3.10)
8-
TOKEN=
5+
HOST=https://argo-workflows.workflows.diamond.ac.uk/ (to submit to the production cluster)
6+
DEFAULT_IMAGE= (usually python 3.10)
97
NAMESPACE= (the cluster you wish to run the templates on)
10-
AUTH=
118

9+
3. Build the dev container
1210

1311
# Submitting a workflow to Argo
1412
1. At the start of your workflow definition file, add:

src/copier_template/src/{{ project_name }}/submit_to_argo.py.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ from {{project_name}}.auth.keycloak_checker import set_token_env_variable
1010

1111

1212
def submit_workflow_to_argo(w: Workflow):
13-
set_token_env_variable(staging=True)
13+
set_token_env_variable()
1414
dotenv.load_dotenv(dotenv_path="src/.env", override=True)
1515
w.namespace = os.environ.get("NAMESPACE")
1616
w.workflows_service = WorkflowsService(
1717
host=str(os.environ.get("HOST")).strip("'"),
1818
token=str(os.environ.get("TOKEN")).strip("'"),
1919
)
20+
global_config.image = str(os.environ.get("DEFAULT_IMAGE"))
2021
submitted_w = cast(m.Workflow, w.create())
2122
name = submitted_w.metadata.name
2223
namespace = submitted_w.metadata.namespace

src/python_interface_to_workflows/auth/keycloak_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def set_token_env_variable(staging: bool) -> str:
2020
port = 5173
2121
case False:
2222
keycloak_openid = KeycloakOpenID(
23-
client_id="workflows-dashboard",
23+
client_id="workflows-cli",
2424
server_url="https://identity.diamond.ac.uk/",
2525
realm_name="dls",
2626
client_secret_key="",

src/python_interface_to_workflows/submit_to_argo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def submit_workflow_to_argo(w: Workflow):
1717
host=str(os.environ.get("HOST")).strip("'"),
1818
token=str(os.environ.get("TOKEN")).strip("'"),
1919
)
20-
global_config.image = str(os.environ.get("IMAGE"))
20+
global_config.image = str(os.environ.get("DEFAULT_IMAGE"))
2121
submitted_w = cast(m.Workflow, w.create())
2222
name = submitted_w.metadata.name
2323
namespace = submitted_w.metadata.namespace

0 commit comments

Comments
 (0)