You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

1. FAQ

1.1. General

1.1.1. How to make data available inside Docker container?

Docker allows to mount host directories under specified paths in the container. The syntax is:

docker run -v "HOST_PATH:CONTAINER_PATH" IMAGE

The directory is mounted in read-write mode. The container will be able to read files already present inside and all written data will be stored there and accessible in the host, even when the container is no longer working.

For example:

  • To run PostgreSQL container with database files stored persistently on the host under /data:

    docker run -v "/data:/var/lib/postgres/data" postgres
    
  • To run IMAS Docker container with host's /home/user/imasdb as the pulse files database inside the container:

    docker run -v "/home/user/imasdb:/home/imas/public/imasdb" imas/ual
    

Important! The HOST_PATH component needs to be an absolute path. If you want to mount a relative path, you can use shell to expand it e.g.:

docker run -v "$(pwd):/data" example

1.2.1. Do we have a list of the environment variables that are used by the 'service' actors like ualinit? Do we need additional (non-database) variables?

The IMAS Docker images come pre-loaded with environment variables. When the imas/ual container starts, it loads IMAS and uda modules. Then it executes imasdb test.

In addition, for imas/kepler and imas/fc2k the following modules are also loaded: Kepler, Keplertools and fc2k. Then a local Kepler installation named default is loaded.

1.2.2. Do we need special structure (like public/imasdb/jet/3/0) or this can be whatever folder but defined as special environment variable?

The special structure is required. UAL low-level codes depend on it and it cannot be easily changed.

When using imas/ual on a local computer, it is advisable to have directories like this:

imasdb/
└── test
    └── 3
        └── 0
            ├── ids_10001.characteristics
            ├── ids_10001.datafile
            └── ids_10001.tree

Then you can mount it using -v "$(pwd)/imasdb:/home/imas/public/imasdb"

1.2.3. Can we mount the whole structure recursively (like public will point to public with all it's stucture), or do wee need to mount each level?

Directory mounting works recursively. When you have x/y/z directories and you mount x, then all its descendants (x/y and x/y/z) will be available.

Important! Take special care with symbolic links as these are not dereferenced by Docker. If you have a symbolic link x/y/z -> /host/path, then it will be seen inside the container still as a symbolic link. When trying to read it inside container, the engine will try to access /host/path in the scope of the container file system (which is probably not what you want).

1.2.4. Is it possible to run Docker on the Gateway at all?

Docker as the execution engine is not supported. You can run uDocker or Singularity. The first one almost works like a 1-to-1 replacement of Docker. The second one has its own container image format (but there are converters available) and a bit different design. For example, in Singularity, your host's $HOME is automatically mounted as container's $HOME.


  • No labels