Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation 2.0 #37

Open
jpuerto-psc opened this issue May 12, 2022 · 1 comment
Open

Documentation 2.0 #37

jpuerto-psc opened this issue May 12, 2022 · 1 comment
Assignees
Labels
I Infrastructure

Comments

@jpuerto-psc
Copy link
Collaborator

Create sphinx docs to more fully encapsulate all of the different functionality available

@jpuerto-psc
Copy link
Collaborator Author

You would connect to the websocket for that job and read the connection_details for the url_path and url_domain, that will be the URL for the JupyterLab UI:

{
  "current_job_details": {
    "message": "Webserver ready.", 
    "proxy_details": {"path": "/passthrough/172dfcbbdab3/47/lab?token=TOKEN", "port": 8888, "hostname": "localhost"},
    "connection_details": {"url_path": "/passthrough/172dfcbbdab3/47/lab?token=TOKEN", "url_domain": "https://workspaces-pt.dev.hubmapconsortium.org/"}
  },
  "request_job_details": {}
}

and

    document.cookie = 'token=xxxx'
    let socket = new WebSocket("wss://ws-workspaces-api.dev.hubmapconsortium.org/jobs/47/",[]);fetch('https://workspaces-api.dev.hubmapconsortium.org/job_types/').catch(error => {
      console.error('Error:', error);
    })socket.onopen = function(e) {
      alert("[open] Connection established");
      alert("Sending to server");
    };socket.onmessage = function(event) {
        console.log(event.data)
    };socket.onclose = function(event) {
      if (event.wasClean) {
        alert(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
      } else {
        // e.g. server process killed or network down
        // event.code is usually 1006 in this case
        alert('[close] Connection died');
      }
    };socket.onerror = function(error) {
      alert(`[error] ${error.message}`);
    };

@jpuerto-psc jpuerto-psc added the I Infrastructure label Jul 27, 2022
@jpuerto-psc jpuerto-psc self-assigned this Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I Infrastructure
Projects
None yet
Development

No branches or pull requests

1 participant