Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/packages/vre-panel/t…
Browse files Browse the repository at this point in the history
…ypescript-5.4.5
  • Loading branch information
skoulouzis authored May 12, 2024
2 parents 3ee7d85 + 9941af9 commit 0822771
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 184 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ jobs:
module_mapping_url: ${{ vars.MODULE_MAPPING_URL }}
search_api_endpoint: ${{ vars.SEARCH_API_ENDPOINT }}
registry_url: ${{ vars.REGISTRY_URL }}
argo_url: ${{ vars.ARGO_URL }}
debug: ${{ vars.DEBUG }}
secrets:
argo_api_token: ${{ secrets.ARGO_API_TOKEN }}
cell_github_token: ${{ secrets.CELL_GITHUB_TOKEN }}
naavre_api_token: ${{ secrets.NAAVRE_API_TOKEN }}
search_api_token: ${{ secrets.SEARCH_API_TOKEN }}
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/test-build wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
api_endpoint:
required: true
type: string
argo_url:
required: true
type: string
cell_github:
required: true
type: string
Expand All @@ -34,8 +31,6 @@ on:
required: true
type: string
secrets:
argo_api_token:
required: true
cell_github_token:
required: true
naavre_api_token:
Expand All @@ -54,8 +49,6 @@ env:
MODULE_MAPPING_URL: ${{ inputs.module_mapping_url }}
SEARCH_API_ENDPOINT: ${{ inputs.search_api_endpoint }}
SEARCH_API_TOKEN: ${{ secrets.search_api_token }}
ARGO_URL: ${{ inputs.ARGO_URL }}
ARGO_API_TOKEN: ${{ secrets.ARGO_API_TOKEN }}
ASYNC_TEST_TIMEOUT: 30
DEBUG: ${{ inputs.debug }}

Expand Down Expand Up @@ -115,16 +108,6 @@ jobs:
concatenated_error_message="$concatenated_error_message SEARCH_API_TOKEN not set"
vars_not_set=1
fi
if [ -z "ARGO_URL" ]; then
echo "ARGO_URL not set"
concatenated_error_message="$concatenated_error_message ARGO_URL not set"
vars_not_set=1
fi
if [ -z "ARGO_API_TOKEN" ]; then
echo "ARGO_API_TOKEN not set"
concatenated_error_message="$concatenated_error_message ARGO_API_TOKEN not set"
vars_not_set=1
fi
if [ -z "$DEBUG" ]; then
echo "DEBUG not set"
concatenated_error_message="$concatenated_error_message DEBUG not set"
Expand Down
91 changes: 0 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,94 +162,3 @@ docker build -t n-a-a-vre .
```commandline
docker run -it -p 8888:8888 --env-file ~/Downloads/notbooks/docker_VARS n-a-a-vre /bin/bash -c "source /venv/bin/activate && /tmp/init_script.sh && jupyter lab --debug --watch --NotebookApp.token='' --NotebookApp.ip='0.0.0.0' --NotebookApp.allow_origin='*' --collaborative"
```


# Argo Workflows

## Generate Token

```shell
kubectl apply -f - <<EOF
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: vre-api
namespace: argo
rules:
- verbs:
- get
- watch
- patch
apiGroups:
- ''
resources:
- pods
- verbs:
- get
- watch
apiGroups:
- ''
resources:
- pods/log
- verbs:
- create
apiGroups:
- ''
resources:
- pods/exec
- verbs:
- list
- watch
- create
- get
- update
- delete
apiGroups:
- argoproj.io
resources:
- workflowtasksets
- workflowartifactgctasks
- workflowtemplates
- workflows
- verbs:
- patch
apiGroups:
- argoproj.io
resources:
- workflowtasksets/status
- workflowartifactgctasks/status
- workflows/status
EOF
```

```shell
kubectl create sa vre-api -n argo
```

```shell
kubectl create rolebinding vre-api --role=vre-api --serviceaccount=argo:vre-api -n argo
```

```shell
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
namespace: argo
name: vre-api.service-account-token
annotations:
kubernetes.io/service-account.name: vre-api
type: kubernetes.io/service-account-token
EOF
```

```shell
ARGO_TOKEN="Bearer $(kubectl get secret vre-api.service-account-token -n argo -o=jsonpath='{.data.token}' | base64 --decode)"
```

```shell
echo -n $ARGO_TOKEN | base64 -w 0
```



9 changes: 2 additions & 7 deletions docker/docker_VARS
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ SEARCH_API_ENDPOINT=http://HOST/api/
SEARCH_API_TOKEN=TOKEN
CELL_GITHUB=https://github.com/ORG/NAME
CELL_GITHUB_TOKEN=TOKEN
ARGO_WF_SPEC_SERVICEACCOUNT="executor"
JUPYTERHUB_SINGLEUSER_APP="jupyter_server.serverapp.ServerApp"
REGISTRY_URL=
ARGO_URL=https://HOST:32443/ess-22-argowf
ARGO_API_TOKEN="Bearer TOKEN"
KEYCLOAK_SERVER_URL=https://HOST:32443/auth
KEYCLOAK_CLIENT_ID=ID
KEYCLOAK_CLIENT_SECRET_KEY=KEY
KEYCLOAK_REALM=RELM
SECRET_KEY=KEY
9 changes: 2 additions & 7 deletions docker/export_VARS
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ export SEARCH_API_ENDPOINT=http://HOST/api/
export SEARCH_API_TOKEN=TOKEN
export CELL_GITHUB=https://github.com/ORG/NAME
export CELL_GITHUB_TOKEN=TOKEN
export ARGO_WF_SPEC_SERVICEACCOUNT="executor"
export JUPYTERHUB_SINGLEUSER_APP="jupyter_server.serverapp.ServerApp"
export REGISTRY_URL=
export ARGO_URL=https://HOST:32443/ess-22-argowf
export ARGO_API_TOKEN="Bearer TOKEN"
export KEYCLOAK_SERVER_URL=https://HOST:32443/auth
export KEYCLOAK_CLIENT_ID=ID
export KEYCLOAK_CLIENT_SECRET_KEY=KEY
export KEYCLOAK_REALM=RELM
export SECRET_KEY=KEY
2 changes: 2 additions & 0 deletions jupyterlab_vre/dataset_search/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ async def post(self, *args, **kwargs):
self.check_environment_variables()
access_token = os.environ['NAAVRE_API_TOKEN']
api_endpoint = os.getenv('API_ENDPOINT')
vre_api_verify_ssl = (os.getenv('VRE_API_VERIFY_SSL', 'true').lower() == 'true')
resp = requests.get(
f"{api_endpoint}/api/dataprods/",
verify=vre_api_verify_ssl,
headers={
'Authorization': f"Token {access_token}",
'Content-Type': 'application/json'
Expand Down
8 changes: 5 additions & 3 deletions jupyterlab_vre/experiment_manager/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,12 @@ async def post(self, *args, **kwargs):

try:
access_token = os.environ['NAAVRE_API_TOKEN']
vre_api_verify_ssl = os.getenv('VRE_API_VERIFY_SSL', 'true')
vre_api_verify_ssl = (os.getenv('VRE_API_VERIFY_SSL', 'true').lower() == 'true')
logger.info('Workflow submission request: ' + str(json.dumps(req_body, indent=2)))
session = requests.Session()
session.verify = vre_api_verify_ssl

resp = requests.post(
f"{api_endpoint}/api/workflows/submit/",
verify=vre_api_verify_ssl,
data=json.dumps(req_body),
headers={
'Authorization': f"Token {access_token}",
Expand Down Expand Up @@ -192,9 +191,11 @@ async def get(self, *args, **kwargs):
self.check_environment_variables()
api_endpoint = os.getenv('API_ENDPOINT')
access_token = os.environ['NAAVRE_API_TOKEN']
vre_api_verify_ssl = (os.getenv('VRE_API_VERIFY_SSL', 'true').lower() == 'true')
# This is a bug. If we don't do this, the workflow status is not updated.
resp = requests.get(
f"{api_endpoint}/api/workflows/",
verify=vre_api_verify_ssl,
headers={
'Authorization': f"Token {access_token}",
'Content-Type': 'application/json'
Expand All @@ -210,6 +211,7 @@ async def get(self, *args, **kwargs):
sleep(0.3)
resp = requests.get(
f"{api_endpoint}/api/workflows/{workflow_id}/",
verify=vre_api_verify_ssl,
headers={
'Authorization': f"Token {access_token}",
'Content-Type': 'application/json'
Expand Down
2 changes: 0 additions & 2 deletions jupyterlab_vre/templates/R_cell_template.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ opt = parse_args(OptionParser(option_list=option_list))

{{ cell.original_source }}



{% if cell.outputs|length > 0 %}
# capturing outputs
{% for out in cell.outputs %}
Expand Down
52 changes: 0 additions & 52 deletions jupyterlab_vre/tests/test_argo.py

This file was deleted.

1 change: 0 additions & 1 deletion jupyterlab_vre/tests/test_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ def test_env_vars(self):
self.assertIsNotNone(os.environ.get('MODULE_MAPPING_URL'))
self.assertIsNotNone(os.environ.get('SEARCH_API_ENDPOINT'))
self.assertIsNotNone(os.environ.get('SEARCH_API_TOKEN'))
self.assertIsNotNone(os.environ.get('ARGO_URL'))
1 change: 0 additions & 1 deletion jupyterlab_vre/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

cells_path = os.path.join(str(Path.home()), 'NaaVRE', 'cells')


def delete_text(file_path, text_to_delete):
# Read the file
with open(file_path, 'r') as file:
Expand Down
2 changes: 1 addition & 1 deletion packages/notebook-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@types/node": "20.2.5",
"@types/react-star-rating-component": "1.4.1",
"@types/react-star-rating-component": "1.4.4",
"rimraf": "5.0.5",
"typescript": "5.3.2"
},
Expand Down

0 comments on commit 0822771

Please sign in to comment.