forked from ML4GW/amplfi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapptainer.def
44 lines (34 loc) · 1.04 KB
/
apptainer.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Bootstrap: docker
From: mambaorg/micromamba:1.5
Stage: build
%files
./amplfi /opt/amplfi/amplfi
pyproject.toml /opt/amplfi/pyproject.toml
poetry.lock /opt/amplfi/poetry.lock
conda-lock.yml /opt/amplfi/conda-lock.yml
%post
mkdir -p /cvmfs /hdfs /gpfs /ceph /hadoop
# install git for pip installation from github
apt-get update
apt-get install -y --no-install-recommends git
apt-get clean
# activate micromamba and create environment from lockfile
/bin/bash /root/.bashrc
micromamba create -p /env -f /opt/amplfi/conda-lock.yml
cd /opt/amplfi
micromamba run -p /env python -m pip install -e .
# initialize our shell so that we can execute
# commands in our environment at run time
micromamba shell init --shell=bash --root-prefix=~/micromamba
# set path, and add it to /etc/profile
# so that it will be set if login shell
# is invoked
export PATH=/env/bin:$PATH
echo export PATH=$PATH >> /etc/profile
%environment
export PATH=/env/bin:$PATH
%runscript
#!/bin/bash
eval "$(micromamba shell hook --shell bash)"
micromamba activate /env
exec "$@"