7.3.1 : With an interactive job
Start an interactive job with the following command:
1 |
> srun -p skylake -n 1 -c 4 -t 3:00:00 --mem=10GB --reservation=grayscottcpu --pty bash |
You need first to identify the node where you are running the interactive job. You can use the command hostname to get the name of the node.
On your machine set up the port forwarding. Set the port forwarding in your ssh config file in adding the following lines
Host <hostname> User <username> Identityfile <path to your private key> ProxyJump mesocentre.univ-amu.fr LocalForward <distant port> localhost:<local port>
For the local port you can choose any available port on your local machine. User ports are between 1024 and 49151. We recommend using ports above 8000 to avoid conflicts with other services.
To activate the port forwarding, you can use the following command:
1 |
$ ssh <hostname> -N |
Then you can run the code server in the interactive job with the following command:
1 |
apptainer run --bind build:/build --writable-tmpfs introduction_cpp_algorithms_alpine_micromamba_code_server_latest.sif micromamba run code-server
|
And you can connect to the code server on your laptop at the following url: http://localhost:
With interactive job, if you end the ssh session (closing the terminal, or disconnecting from the mesocentre), the code sever will stop running. You can avoid this by using screen or tmux to keep the code server running even if you close the terminal.
Or use the following method to run the code server with a job submission.