Running PyCharm Workspaces
Introduction
| PyCharm Workspaces may require at least 2GiB of free RAM. Read more. |
Submitting a PyCharm Workspace
$ ssh bhn20 (1)
$ runai-bgu submit pycharm \ (2)
-n my-workspace \ (3)
-c 2 \ (4)
-m 4Gi \ (5)
-g 0.1 \ (6)
| 1 | Configure SSH connection to bhn20 |
| 2 | Specifies it is a PyCharm. |
| 3 | Specifies the name of the job. |
| 4 | Allocates 2 CPU cores. |
| 5 | Allocates 4GiB of memory*. |
| 6 | Specifies the GPU allocation(Whole or fractions). If you do not need GPU, do not use this flag. |
You can also use a predefined resource template. Check out the guide for the template CLI Introduction.
$ runai-bgu submit pycharm \ (1)
-n my-workspace (2)
--ut workspace-user (3)
| 1 | Submit a pycharm workload |
| 2 | Specify the job name |
| 3 | Use the --ut specify the user template |
$ runai-bgu submit pycharm \ (1)
-n my-workspace (2)
--ug workspace-group (3)
| 1 | Submit a pycharm workload |
| 2 | Specify the job name |
| 3 | Use the --ug specify the group template |
Wait for Job to Start
The CLI will display messages about the job creation and port-forwarding status.
$ ssh bhn20 (1)
$ runai-bgu submit pycharm -n my-workspace --ut workspace (2)
Waiting for workload to appear...
Waiting for workload to run...
SSH workspace pycharm is running. Setting up port forwarding to port <port-number>... (3)
| 1 | Configure SSH connection to bhn20
manual.adoc[runai-bgu] |
| 2 | The port number is displayed in the terminal output after the SSH connection is established. Need to be set in the PyCharm Remote Development setup. |
Ending or Pausing Your Session
When you are done with your work or need to step away: When using workspaces the user has two choices when leaving the computer:
-
Disconnect and delete the workspace: Use this method when the workspace is not necessary anymore and can be deleted.
Example 5. Disconnect and delete workspace.In the terminal session where
runai-bguis running, type:$ stopallThis will halt the port-forwarding and delete your workspace
-
Background execution: Use this method when there is code running in the background/you are planning to return soon.
| Keep in mind that if your workspace has GPUs allocated to it, the workspace will be deleted automatically after ~6 hours with no use of the GPU. |
In the terminal session where runai-bgu is running, type:
$ stop
This halts port-forwarding but keeps the job running.
| Jobs in this state will be counted in you monthly bill. |
Resuming your workspace
To resume your workspace, if the job is still running, re-do the steps from the submission command including the submission command.
If the job was stopped, you can resume it by running:
$ runai-bgu resume {job-name}
Then, re-do the steps from the submission command including the submission command.