Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #85 from MAAP-Project/update-ssh-info
Browse files Browse the repository at this point in the history
Start ssh service, fix namespace
  • Loading branch information
mayadebellis authored Feb 22, 2021
2 parents 8ae4d23 + 33d440d commit a1f1352
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ env | grep _ >> /etc/environment
export PATH=$PATH:/opt/conda/bin
cp /root/.bashrc ~/.bash_profile

service ssh start
jupyter lab --ip=0.0.0.0 --port=3100 --allow-root --NotebookApp.token='' --LabApp.base_url=$PREVIEW_URL --no-browser --debug
3 changes: 2 additions & 1 deletion show_ssh_info/show_ssh_info/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def get(self):
host = os.environ.get('KUBERNETES_SERVICE_HOST')
host_port = os.environ.get('KUBERNETES_PORT_443_TCP_PORT')
workspace_id = os.environ.get('CHE_WORKSPACE_ID')
namespace = os.environ.get('CHE_WORKSPACE_NAMESPACE')

with open ("/var/run/secrets/kubernetes.io/serviceaccount/token", "r") as t:
token=t.read()
Expand All @@ -96,7 +97,7 @@ def get(self):
'Authorization': 'Bearer ' + token,
}

request_string = 'https://' + host + ':' + host_port + '/api/v1/namespaces/' + workspace_id + '/services/ws'
request_string = 'https://' + host + ':' + host_port + '/api/v1/namespaces/' + namespace + '-' + workspace_id + '/services/ws'
response = requests.get(request_string, headers=headers, verify=False)

data = response.json()
Expand Down

0 comments on commit a1f1352

Please sign in to comment.