Newer
Older
## Table of Contents
1. [Introduction](#introduction)
2. [Install container platforms](#install-container-platforms)
1. [Install Docker](#install-docker)
2. [Install Podman](#install-podman)
3. [Install Apptainer (singularity)](#install-apptainer-singularity)
3. [Get a pre-built image](#get-a-pre-built-image)
1. [Using Docker and Podman](#using-docker-and-podman)
2. [Using Apptainer](#using-apptainer-singularity)
4. [Run the image as container](#run-the-image-as-container)
1. [Using Docker](#using-docker)
2. [Using Podman](#using-podman)
3. [Using Apptainer](#using-apptainer-singularity-1)
5. [Test inside the container](#test-inside-the-container)
6. [Troubleshooting tips](#troubleshooting-tips)
## 1. Introduction
In order to run the pre-built image with the binaries used for ILDG activities as a container or to build from the source, it is required to have one of the container platform installed.
If you never tried any container platform on your machine before and not sure which container platform to install, the recommended option is to go with `docker` installation.
## 2. Install container platforms
If you have one of the container platforms already running on your machine. You may skip the below steps and move to the next [section](#get-a-pre-built-image).
### Install Docker
- Follow the instructions provided in this [link](https://docs.docker.com/engine/install/). As the overview page loads, one must choose their desired operating system from the `left menu` to follow the OS specific instructions to complete the installation procedure.
- Once the docker is installed, `optionally` one can also configure Linux hosts to work better with Docker. Click [here](https://docs.docker.com/engine/install/linux-postinstall/) for the post installation steps.
- After the successful installation, running `docker --version` should display the version you installed. The recommended version at the time of writing the instruction is `Docker version 24.0.1`
- Optionally one can also verify the docker installation by running a simple `Hello-world` container, refer this [link](https://docker-curriculum.com/#hello-world) for the same.
### Install Podman
- If you are using any `Red Hat` based `Linux derivatives`, you would have the podman installed by default.
- If you insist to install on other platforms, Follow the instructions provided in this [link](https://podman.io/docs/installation).
### Install Apptainer (singularity)
- Follow the instructions provided in this [link](https://apptainer.org/docs/admin/main/installation.html#) to install the binaries. As the overview page loads, one must choose their desired operating system from the left menu to follow the OS specific instructions to complete the installation.
- It is always recommended to have the latest binaries installed. When this document was written the latest version of apptainer was `v1.1.8`.
- If the latest binaries are not available in the package registry, one can use this [link](https://github.com/apptainer/apptainer/releases/tag/v1.1.8) to download it directly from Github.
- If you prefer to install it from source,use the instructions from [this](https://github.com/apptainer/apptainer/blob/main/INSTALL.md) link.
- After the successful installation, To check the version of container platform (either apptainer or
singularity)installed on your machine, run `<platform> --version`.
```bash
docker pull gitlab.desy.de:5555/ildg/hands-on/workshop-image:latest
```
```bash
apptainer pull docker://gitlab.desy.de:5555/ildg/hands-on/workshop-image:latest
```
```bash
docker run -it -v $HOME/.globus:/root/.globus gitlab.desy.de:5555/ildg/hands-on/workshop-image:latest
```
```bash
docker run -it -v $HOME/.globus:/root/.globus:Z gitlab.desy.de:5555/ildg/hands-on/workshop-image:latest
```
## 5. Test inside the container:
To test if everyhting works;
- Try accessing one of the ILDG service using `curl`.
```bash
curl -X 'GET' 'https://idefix-vm10.zeuthen.desy.de/ildg/mdc/info' -H 'accept: */*'
```
>You must get the `200 OK` along with the `json` response.
- Try running `grid-proxy-init` to generate a new proxy certificate. If you encounter any error, Take a look at [Troubleshooting Tips](#6-troubleshooting-tips).
- If the above command runs without an error, you should be able to run `voms-proxy-info` and see the certificate information.
- `update-crl.sh` needs to be executed at least every 2 days to update the trust-store.
## 6. Troubleshooting Tips
**Q: How to run the pre-built image in Mac computers with Apple silicon?**
**A:** `docker run --platform linux/amd64 -it -v $HOME/.globus:/root/.globus gitlab.desy.de:5555/ildg/hands-on/workshop-image:latest`
**Q: How can i run the docker commands without `sudo`**
**A:** `sudo usermod -aG docker $USER`. Log out and log back in for the changes to take affect.