Skip to content

Open the IDE in the browser#

An environment of kind IDE runs VS Code in the browser — code-server, VS Code's open-source build — inside its container. Its editor, terminals and debugger run in the container, on the machine's GPUs; your browser shows them. Nothing needs installing on your computer or in your image: the machine brings the IDE.

Before you begin#

  • An IDE environment (Create and change a runtime: Kind → IDE, or astra env create <name> --kind ide).
  • To be its owner, one of the people it is shared with, or an admin of the workspace: its terminals are a shell in the container, so an IDE is given as SSH is.
  • An image built on glibc 2.28 or newer with libstdc++: every preset, Debian, Ubuntu, RHEL and NGC images. Alpine (musl) images cannot run it (Troubleshooting).
  • A Linux machine (amd64 or arm64) to run it on.

Open it#

  1. Open Hesperus → Environments and press Open IDE on its row, or Open IDE on its page.
  2. A stopped environment is started. The page shows its state and why it waits: The editor opens at an address of its own once its machine says it is ready, in this tab. The first IDE on a machine waits a minute longer: the machine downloads the IDE once.
  3. Once it is ready, the tab goes to the editor at the environment's own address, full page.

$ astra env open code
code was stopped: starting it (the page waits until its editor is ready)
Opened https://console.astralyx.cloud/o/<org>/w/<workspace>/environments/<cluster>/code/ide

It opens the console's Open IDE page in your browser, which signs the editor in as you are in the console — no link passes through your terminal. --print prints the address instead of opening a browser. On an environment of kind shell it refuses: code has no browser IDE (it is a shell runtime): astra ssh code, or make one with astra env create <name> --kind ide.

POST $CONSOLE/clusters/<cluster>/runtime-links with {"runtime": "code"} answers a link into the IDE (url) at the environment's own address (origin). It works once, within a minute, for you only; the browser that follows it is signed in to that address for 8 hours. path chooses where it opens (default /, or /?folder=/content/projects/app). The environment must be on a machine (409 RUNTIME_NOT_RUNNING otherwise: start it first).

$ curl -fsS -X POST "$CONSOLE/clusters/<cluster>/runtime-links" -H "Authorization: Bearer $ASTRAEUS_TOKEN" \
    -H 'content-type: application/json' -d '{"runtime": "code"}' | jq -r .url
https://r-4f1c9a0b2d7e83a65c10.<runtime domain>/__astralyx/enter?ticket=ast_rtt_…

ASTRAEUS_TOKEN and CONSOLE are set as in Create and change a runtime.

The editor is served at an address of its own, r-<id>.<domain>, never the console's: what a container serves is code, and it must not run with your console session. See Addresses of their own. Your browser is signed in to that address for 8 hours; after that, press Open IDE once more.

What it opens#

  • The folder: your home on its drive, /content/home/<user>, unless the environment was made with another Folder (--folder, ide.folder; an absolute path, made at start when missing).
  • Who you are in it: the environment's login user (Run as, --user; default root). Its terminals are shells in the container as that user, with the image's PATH and CUDA's variables. With SSH on, a terminal over SSH lands in the same home.
  • Settings, keybindings and extensions are kept in your home on the drive (.local/share/code-server): they are there after a restart.

Extensions#

Extensions come from Open VSX. The Microsoft Marketplace is not available, so Microsoft's own extensions that are only there — Pylance, the Remote extensions, C# Dev Kit — are not either. Open VSX has alternatives: basedpyright for Python type checking, for example. Install them from the Extensions view as usual.

Idle and closing#

An open IDE window counts as someone connected, as an open SSH session does, for as long as it is open: VS Code keeps talking to its server even when you do not type. Close the tab when you are done, and the environment stops after its idle time (60 minutes unless set), freeing its GPUs. Open IDE starts it again.