Parallel Works

pw vscode

pw vscode

Open VS Code connected to a remote resource

Synopsis

Open Visual Studio Code connected to a remote resource via SSH.

This configures VS Code's Remote-SSH extension to connect through the Parallel Works platform and launches VS Code.

Requires the code CLI on your PATH and the Remote-SSH extension installed in VS Code.

Resource names can be specified in the following formats:

  • pw://username/name - a resource owned by another user
  • pw://name - managed cluster by name in your organization
  • name - short format where the username defaults to yours
  • workspace - your user workspace

By default VS Code opens on the cluster's login node. To open it on a compute node instead, pick one of:

  • --environment schedules a new worker on a compute environment and opens VS Code on its node once the scheduler starts it. Pass --param to set the environment's scheduling parameters, and run pw environments get to see which parameters it accepts.
  • --worker opens on the node of a worker you already have, as listed by pw workers ls. This skips the queue.
  • --jump-node opens on a compute node by hostname.

Worker sessions connect through the worker's own SSH server on the compute node, authenticated by your platform-registered key. Clusters whose agent is too old to run one, and --jump-node, instead go through the login node to the node's system SSH daemon, which must accept your key on its own.

A worker scheduled this way outlives the editor. Release it with pw workers delete when you are done.

pw vscode [flags] <resource> [path]

Examples

  pw vscode my-cluster
  
  # Open VS Code in a specific directory
  pw vscode my-cluster /home/user/project
  
  # Open VS Code on another user's resource
  pw vscode pw://Jake.Thayne/my-cluster
  
  # Schedule a compute node and open VS Code on it
  pw vscode --environment gpu-large my-hpc
  
  # Schedule with environment parameters
  pw vscode --environment gpu-large --param numNodes=2 my-hpc
  
  # Open VS Code on the compute node running a worker
  pw vscode --worker 60c72b2f9b1e8d001c8e4f3a my-hpc
  
  # Open VS Code on a compute node by hostname, via the login node
  pw vscode --jump-node node-0002 my-hpc

Options

      --environment string   Schedule a new worker on this compute environment, by name or ID, and open on its node
  -h, --help                 help for vscode
      --jump-node string     Open on this compute node by hostname, jumping through the login node to the node's system SSH daemon
      --param stringArray    Scheduling parameter for --environment as key=value (repeatable)
      --partition string     Scheduler partition for a new worker, for use without --environment
      --worker string        Open on the compute node running this worker, by ID

Options inherited from parent commands

      --context string         The context to use. Overrides PW_CONTEXT environment variable and current context from config.
      --platform-host string   The Parallel Works ACTIVATE platform host to use. Overrides PW_PLATFORM_HOST environment variable and the current context's server.
  -v, --verbose                Enable verbose logging

SEE ALSO

  • pw - The Parallel Works ACTIVATE CLI