Skip to content

Commit

Permalink
added doc in README.md to test submit with token
Browse files Browse the repository at this point in the history
  • Loading branch information
skoulouzis committed Sep 11, 2023
1 parent e2d7de7 commit 6fa1f67
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ conda install -c conda-forge tilt
conda install -c conda-forge minikube
```

Follow step 3 of the [minikube ingress-dns setup guide](https://minikube.sigs.k8s.io/docs/handbook/addons/ingress-dns/).

For Ubuntu 20.04, before step 3, you need to install resolvconf:

```shell
sudo apt install resolvconf
```
Follow step 3 section 'Linux OS with Network Manager' of the [minikube ingress-dns setup guide](https://minikube.sigs.k8s.io/docs/handbook/addons/ingress-dns/).


#### Add secrets
Expand Down Expand Up @@ -217,6 +211,12 @@ echo -n $ARGO_TOKEN | base64 -w 0
)
```

## Test Submit Workflow

```shell
curl -X POST "http://paas.minikube.test/vre-api-test/api/workflows/submit/" -H "Authorization: Token ${accessToken}" -H "Content-Type: application/json" -d "@vreapis/tests/resources/workflows/submit_workflow_req_body.json"
```


# Authorization

Expand Down
3 changes: 0 additions & 3 deletions vre-panel/.env.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
API_BASE_PATH=/vre-api-test/api
FRONTEND_BASE_PATH=/vreapp


NEXTAUTH_URL=https://paas.minikube.test/vreapp/api/auth
Empty file added vreapis/tests/__init__.py
Empty file.
58 changes: 58 additions & 0 deletions vreapis/tests/resources/workflows/submit_workflow_req_body.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"vlab": "laserfarm",
"workflow_payload": {
"workflow": {
"apiVersion": "argoproj.io/v1alpha1",
"kind": "Workflow",
"metadata": {
"generateName": "n-a-a-vre-dev-user-name-at-domain-com-",
"labels": {
"vlab_slug": "laserfarm"
}
},
"spec": {
"entrypoint": "n-a-a-vre-dev-user-name-at-domain-com",
"arguments": {
"parameters": null
},
"templates": [
{
"name": "n-a-a-vre-dev-user-name-at-domain-com",
"dag": {
"tasks": [
{
"name": "process-a-list-dev-user-name-at-domain-com-0942899",
"template": "process-a-list-dev-user-name-at-domain-com-0942899-tmp"
}
]
}
},
{
"name": "process-a-list-dev-user-name-at-domain-com-0942899-tmp",
"outputs": {
"parameters": [
{
"name": "b_list_886fb14",
"valueFrom": {
"path": "/tmp/b_list_886fb14.json"
}
}
]
},
"container": {
"image": "qcdis/process-a-list-dev-user-name-at-domain-com",
"imagePullPolicy": "Always",
"command": [
"/bin/bash",
"-c"
],
"args": [
"source /venv/bin/activate; python process-a-list-dev-user-name-at-domain-com.py --id \"886fb14\";"
]
}
}
]
}
}
}
}
4 changes: 4 additions & 0 deletions vreapis/workflows/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ def submit(self, request, *args, **kwargs):
call_url = argo_api_wf_url + '/' + namespace

workflow = request.data['workflow_payload']
if not workflow:
return Response({'message': 'Workflow payload not set'}, status=400)
vlab_slug = request.data['vlab']
if not vlab_slug:
return Response({'message': 'Virtual Lab not set'}, status=400)

if not argo_api_token:
return Response({'message': 'Argo API token not set'}, status=500)
Expand Down

0 comments on commit 6fa1f67

Please sign in to comment.