This example project can be used as a starting point for building your own project.
The OCCAM user interface is based on GitLab; we encourage use of the GitLab repository for your code, but you need only to use the image registry if you don;t want to do so.
The OCCAM user interface is based on GitLab; we encourage use of the OCCAM GitLab repository for your code, but you need only to use the image registry if you don't want to do so.
**Please note that directly running a container is currently supported only for single-node, single-step computations. Multi-node MPI applications and pipelines need some more massaging.**
## Obtaining an account
You already have an account on the system, otherwise you would not be able to see this page.
...
...
@@ -12,5 +14,28 @@ In OCCAM, all user software is run in *containers*. Even if this is not technica
There are several implementations of software containers; in OCCAM we currently use Docker containers, an industry-standard tool to build, manage and run containers on Linux. You can find the full documentation at the Docker site , e.g. here: https://docs.docker.com/learn/, but you will need only very basic knowledge of it (pointers to relevant documentation will be provided wherever needed).
**Jargon alert:** what you will build and upload is not a container but an *image*; a *container* is a running instance of an image, more or less like a *process* is a running *program*.
In order to build and upload the image, you will have to install Docker in your machine. Please download and install from https://store.docker.com/search?offering=community&type=edition; yes, you can build and run Linux containers on MacOS and Windows, and they will run on OCCAM.
## Image build workflow
The basic workflow is the following:
1. You build and test the image on your machine by writinga a ``Dockerfile`` and using standard Docker commands;
1. You upload the build image on the OCCAM image registry (only images from there can be run on OCCAM);
1. You login on the OCCAM access node and copy all input files somewhere in your home directory;
1. You use OCCAM special commands to run your container in the cluster.
In the following, you will be guided through these steps to build and run the example image.
## Building the image
Building an image means picking a base image and adding all the pieces and configurations needed to run your applications, much like you would do on a new workstation. The base image typically contains just the OS, but there exist images with preinstalled software (for example, R). You can find official Docker images you can use as base images at the Docker Store: https://store.docker.com/search?q=&source=verified&type=image
If the Linux distribution is not important, we suggest using CentOS 7. This is the OS of choice in this example.
First, you will need to copy all the relevant files to a directory in your machine, then write a Dockerfile to tell Docker how to build the container. In this example, the Dockerfile is provided. In this example there is only one file, the Python script that computes the Mandelbrot set, with the unimaginative name of ``mandelbrot.py``
If you're familiar with git, you can get both the files (script and Dockerfile) by cloning this project's repository: