Skip to content
Snippets Groups Projects
Commit 1f55c86f authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

prepared container for v2.0.1

parent b85e0fd2
No related branches found
No related tags found
1 merge request!4Container now includes proper environment setup
......@@ -56,6 +56,7 @@ eic_builder_singularity:
tags:
- sodium dind
only:
- staging
- tags
when: manual
script:
......@@ -75,6 +76,7 @@ eic_singularity:
tags:
- sodium dind
only:
- staging
- tags
script:
- cp containers/release/eic.def .
......
......@@ -15,33 +15,80 @@ cd eic_container
modelefile will be installed to `$PREFIX/../../etc/modulefiles`.
You can use the `-v` flag to select the version you want to deploy, or omit the
flag if you want to install the master build. The recommended stable
release version is `v2.0.0`.
release version is `v2.0.1`.
```bash
./deploy.py -v 2.0.0 <PREFIX>
./deploy.py -v 2.0.1 <PREFIX>
```
Available flags:
```bash
-v VERSION, --version VERSION
(opt.) project version. Default: current git branch/tag.
(opt.) project version. Default: current version (in repo).
-b BIND_PATHS, --bind-path BIND_PATHS
(opt.) extra bind paths for singularity.
-m MODULE_PATH, --module-path MODULE_PATH
(opt.) Root module path where you want to install a
modulefile. D: <prefix>/../../etc/modulefiles
-l, --local Local deploy, will not install the modulefiles (you will have
to run the launcher scripts from their relative paths).
-f, --force Force-overwrite already downloaded container with the same name.
--install-builder BUILDER
(opt.) Install fat builder image, instead of normal
slim image
```
3. To use the container: load the modulefile, and then use the included apps as if
they are native apps on your system!
3. To use the container in installed mode, you can load the modulefile,
and then use the included apps as if they are native apps on your system!
```bash
module load eic_container
```
4. To use the container in local mode, you can run the runscripts (under `$PREFIX/bin`)
manually.
4. (Advanced) If you need to add additional bind directives for the internal singularity container,
you can add them with the `-b` flag. Run `./deploy.py -h` to see a list of all
supported options.
Usage
-----
### A. Running the singularity development environment with modulefiles
1. Add the installed modulefile to your module path, e.g.,
```bash
module use <prefix>/../../etc/modulefiles
```
2. Load the eic container
```bash
module load eic_container
```
3. To start a shell in the container environment, do
```bash
eic-shell
```
### B. Running the singularity development locally (without modulefiles)
1. This is assuming you deployed with the `-l` flag to a prefix `$PREFIX`:
```bash
./deploy.py $PREFIX
```
2. To start a shell in the container environment, do
```bash
$PREFIX/bin/eic-shell
```
### C. Using the docker container for your CI purposes
1. To load the container environment in your run scripts, you can
- launch the script or program using `eic-shell`,
- or `source /etc/eic-env.sh` at the start of your commands.
2. If using this container as a basis for a new container, you can direction access
the full container environment from a docker `RUN` shell command with no further
action needed. For the most optimal experience, you can install your software to
`/opt/view` to fully integrate with the existing environment. Depending on your
use case, installation to `/usr/local` may also work, but this might require you
to write and run additional environment scripts.
......@@ -24,7 +24,7 @@ GROUP_NAME='containers'
PROJECT_NAME='eic_container'
IMAGE_ROOT='eic'
PROGRAMS = [('eic_shell', '/usr/bin/bash'),
PROGRAMS = ['eic-shell',
'root',
'ipython']
......@@ -45,7 +45,7 @@ if __name__ == "__main__":
'-v', '--version',
dest='version',
default=project_version(),
help='(opt.) project version. Default: current git branch/tag.')
help='(opt.) project version. Default: current version (in repo).')
parser.add_argument(
'-f', '--force',
action='store_true',
......@@ -60,6 +60,12 @@ if __name__ == "__main__":
'-m', '--module-path',
dest='module_path',
help='(opt.) Root module path where you want to install a modulefile. D: <prefix>/../../etc/modulefiles')
parser.add_argument(
'-l', '--local',
action='store_true',
dest='local',
help='Local deploy, will not install the modulefiles (you will have to run'
'the launchers scripts from their relative paths).')
parser.add_argument(
'--install-builder',
dest='builder',
......@@ -100,7 +106,10 @@ if __name__ == "__main__":
libexecdir = '{}/libexec'.format(args.prefix)
root_prefix = os.path.abspath('{}/..'.format(args.prefix))
moduledir = '{}/{}'.format(args.module_path, PROJECT_NAME)
for dir in [bindir, libdir, libexecdir, moduledir]:
dirs = [bindir, libdir, libexecdir]
if not args.local:
dirs.append(moduledir)
for dir in dirs:
print(' -', dir)
smart_mkdir(dir)
......@@ -123,7 +132,8 @@ if __name__ == "__main__":
print('WARNING: Container found at', container)
print(' ---> run with -f to force a re-download')
make_modulefile(PROJECT_NAME, version, moduledir, bindir)
if not args.local:
make_modulefile(PROJECT_NAME, version, moduledir, bindir)
## configure the application launchers
print('Configuring applications launchers: ')
......
......@@ -32,7 +32,7 @@ def smart_mkdir(dir):
def project_version():
'''Return the project version based on the current git branch/tag.'''
## Shell command to get the current git version
git_version_cmd = 'git symbolic-ref -q --short HEAD || git describe --tags --exact-match'
## Shell command to get the current project version
version_cmd = 'cat VERSION'
## Strip will remove the leading \n character
return os.popen(git_version_cmd).read().strip()
return os.popen(version_cmd).read().strip()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment