|
3 | 3 | Application Packages are generally deployed to cloud platforms, but there are |
4 | 4 | also ways to run CWL files and complete Application Packages locally. |
5 | 5 |
|
| 6 | +## Understanding and debugging xcengine container images |
| 7 | + |
| 8 | +### The base image |
| 9 | + |
| 10 | +When generating a container image, xcengine uses a |
| 11 | +[micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) |
| 12 | +image as a base. If you need to investigate or |
| 13 | +debug an xcengine image, or if you're just curious about its structure, you may |
| 14 | +find the [micromamba-docker |
| 15 | +documentation](https://micromamba-docker.readthedocs.io/) useful. |
| 16 | + |
| 17 | +### Entry points |
| 18 | + |
| 19 | +xcengine sets a custom entry point to run its own runner script, so any commands |
| 20 | +provided when running a container from an xcengine image with `docker run` |
| 21 | +will be applied as arguments to the xcengine runner. For instance, for an |
| 22 | +image tagged `myimage:1`, the `--server` parameter can be used like this: |
| 23 | + |
| 24 | +`docker run myimage:1 --server` |
| 25 | + |
| 26 | +This would run the xcengine runner script with the `--server` option, which |
| 27 | +starts an xcube server and viewer instance. |
| 28 | + |
| 29 | +To explore or debug a container image, it's often useful to start a container |
| 30 | +with an interactive shell. To do this with an xcengine image, it's not enough |
| 31 | +to provide a path to a shell as a command, since this path will just be passed |
| 32 | +as a parameter to the xcengine runner script. You need to set the entry point |
| 33 | +as well, like this: |
| 34 | + |
| 35 | +`docker --rm -it --entrypoint /usr/local/bin/_entrypoint.sh myimage:1 bash` |
| 36 | + |
| 37 | +This resets the entry point to the usual micromamba-docker entry point, which |
| 38 | +sets up the Python environment, then runs bash within that environment. |
| 39 | + |
| 40 | +### The Dockerfile and environment file |
| 41 | + |
| 42 | +To aid reproducibility, the Dockerfile and environment file used to set up the |
| 43 | +container image are both included in the image itself, in the `/tmp` |
| 44 | +directory. The rest of the code and configuration for the image is in the |
| 45 | +`/home/mambauser` directory. In combination with the publicly available |
| 46 | +micromamba base image, each xcengine image thus contains the resources |
| 47 | +necessary to reproduce its own build process. |
| 48 | + |
6 | 49 | ## Running with cwltool |
7 | 50 |
|
8 | 51 | [cwltool](https://www.commonwl.org/user_guide/introduction/quick-start.html) |
|
0 commit comments