-
Notifications
You must be signed in to change notification settings - Fork 4
Devbox
Devbox is a way of doing development on a remote server. We do this to provide protection for development of codes that require enhanced security.
Each user will develop inside of a docker container on a remote server. Once you are connected over SSH to the devbox your development environment should be similar to developing inside of a VM.
Administrators will provide you with information about how to connect to your devbox. Development will be done over SSH.
Since connecting to your devbox will be done over SSH it is a good idea to use the screen program so you don't lose your session if you lose your connection.
Here is how you can use screen:
- ssh
screen
- Do your work
- When you are done you can leave your programs running (ex. emacs)
and enter
C-shft-^ d
(this is pressing control key, shift key, and caret key all at the same time then releasing them and pressing d). That will detach you from the current screen session and you can exit the SSH connection. Alternatively, you can terminate (quit) your terminal window without logging out. - If you exited screen as in the step above or your connection was
dropped unexpectedly then you can ssh back into the machine and
reconnect to your running session with
screen -r -d
. This will bring your terminal back to where you left off.
In order to create a comfortable development environment you will want to edit some dotfiles. These are:
-
~/.netrc
: Here you can put your git credentials so you can work with our repos. This file is ephemeral. If your devbox is restarted you will need to edit this file again. -
~/jupyter/bashrc
: Here you can put any custom configuration that you normally add to~/.post_bivio_bashrc
. This file is persistent across restarts of your devbox. -
~/jupyter/bin
: Here you can put any executable programs you may want to use. This file is persistent across restarts of your devbox.
Since devbox is based on docker containers only files placed in certain locations that are mounted into the container from the host will persist between restarts of the container. The docker containers should be long-running so you won't lose files regularly. But, anything that you absolutely don't want to lose should be placed in following locations:
-
~/jupyter
: Treat this like you would normally treat your home directory. -
~/src
: Treat this like you would treat~/src
on your development VM. All work on Sirepo and related repos should be done in here.
To connect to the devbox using VSCode you will need to use the Remote Development using SSH feature.
Make sure you have installed the Remote Development extension pack then you can add the host to VSCode:
- Open VSCode and enter
cmd+shft+p
- Enter
remote-ssh:add new SSH Host
- Enter the SSH command the administrator provided to connect to the devbox (same one you use in your terminal)
- Enter the password the administrator provided.