Skip to content

Using the Fermibottle Container

Don Horner edited this page May 9, 2023 · 7 revisions

Using the container

  1. A long string of numbers and letters should be printed to your screen from the create command. This is your CONTAINER ID. You can use this directly. Also you can use the container NAME docker assigned. Look it up with docker ps -a
  2. Start and enter the container with docker start CONTAINER_ID_OR_NAME. Be sure to replace CONTAINER_ID_OR_NAME with your container's ID or its Name.
  3. Attach to the running container with docker attach CONTAINER_ID_OR_NAME.
  4. Welcome to FermiBottle! You can exit the container and shut it down by typing exit into the container's terminal. Or you can leave the container running in the background with Ctrl-p + Ctrl-q.
  5. If you shut down a container, return to it with docker start CONTAINER_ID_OR_NAME && docker attach CONTAINER_ID_OR_NAME.
  6. If a container is already running, reattach to a it (get into the command line) with docker attach CONTAINER_ID_OR_NAME.
  7. The shared directory is in the container at /data.

Bonus Step! Launch a second shell.

Many people prefer to use multiple terminal shell instances when performing an analysis.

In a separate terminal window on your host machine you can connect to a running fermibottle container with the command docker exec -it CONTAINER_ID_OR_NAME su - fermi. Be sure it's running first!

The Shared Directory

Sharing files between your host machine and the docker container is handled by a shared directory. Any files in the shared directory are shared between both the host machine and the container. Both can read, write and change files found there.

The shared directory is created for you automatically when you run the docker create ... command described in the installation instructions. On your host the shared directory is the directory you were in when you ran docker create. On the container the shared directory is available in /data.

If you do all of your work in the container from within /data that work will automatically be saved and available on the host machine.

While the contents of the shared directory are visible in the container, the path of the shared directory is not. For example, if your the host machine has shared the /Users/EnricoFermi/work directory with the container, the contents of /Users/EnricoFermi/work will appear in /data within the container. But the full path /Users/EnricoFermi/work will not exist exist within the container.

Using the Fermitools

The Fermitools are now distributed via the Conda package manager. The tools have already been set up in the Fermibottle container however in order to use them you must activate the appropriate Conda environment. The default environment you will be dropped into upon starting the container will be named base and can be identified by the console prompt. Initially it will look like:

(base) [fermi@58b73fe14391 ~]$

where (base) is the default conda environment, fermi is the username, and 58b73fe14391 is a local container ID. Your container ID will be different. The $ is the traditional marker noting the end of the prompt, and the start of the user's place to type commands.

Activating the tools

In order to activate the environment which contains the Fermitools use the command

conda activate fermi

Once the environment is activated you will notice that your console prompt has changed to indicate that the fermi environment is now active. It should look something like this:

(fermi) [fermi@58b73fe14391 ~]$

When you wish to change environments you must deactivate the fermi environment first. You can do this with the command

conda deactivate

Jupyter Notebooks

Run a jupyter notebook from within the container with

notebook.

That command is an alias provided for you. It is equivalent to jupyter notebook --ip 00.00.00.00 --no-browser.

You cannot have more than one jupyter notebook running at a time in FermiBottle by default. Forward more ports during the create step if you want to run more notebooks.

Using the GBM Data Tools

Like the Fermitools, the GBM Data Tools are available in a conda environment that you activate using the command:

conda activate fermigbm

Once the environment is activated you will notice that your console prompt has changed to indicate that the fermigbm environment is now active. It should look something like this:

(fermigbm) [fermi@58b73fe14391 ~]$

When you wish to change environments you must deactivate the fermigbm environment first. You can do this with the command:

conda deactivate

The GBM Data Tools provide a series of tutorial in Jupyter notebooks, you can access these by running the command:

gbm-demos

and pasting the URL into a broswer as described above. As noted above, you cannot have more than one notebook server running at a time in FermiBottle by default. If you were running a Fermitools Jupyter notebook, you need to quit it. If you still have problems, try quitting and restarting the FermiBottle container.

The gbm-demos command will bring up a list of notebook files. You can start with the index.ipynb notebook.