-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbabs-input-overlay-helper.def
More file actions
59 lines (53 loc) · 1.77 KB
/
babs-input-overlay-helper.def
File metadata and controls
59 lines (53 loc) · 1.77 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Bootstrap: docker
From: ubuntu:22.04
%labels
Author babs
Description BABS helper image for overlay-mode DataLad operations
%post
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends \
bash \
ca-certificates \
coreutils \
datalad \
git \
git-annex \
gnupg \
lsb-release \
python3 \
python3-pip \
sed \
util-linux
# Try to provide Apptainer/Singularity in the helper image. We normalize on
# "singularity" because participant_job.sh calls singularity.
# 1) Default repos (e.g. Neurodebian, or distro that ships apptainer).
if apt-cache show apptainer >/dev/null 2>&1; then
apt-get install -y --no-install-recommends apptainer && \
ln -sf /usr/bin/apptainer /usr/local/bin/singularity || true
elif apt-cache show singularity-container >/dev/null 2>&1; then
apt-get install -y --no-install-recommends singularity-container || true
fi
# 2) Fallback: install from official Apptainer PPA when not in default repos.
if ! command -v singularity >/dev/null 2>&1 && ! command -v apptainer >/dev/null 2>&1; then
( set +e
apt-get install -y --no-install-recommends software-properties-common
add-apt-repository -y ppa:apptainer/ppa
apt-get update
apt-get install -y --no-install-recommends apptainer
ln -sf /usr/bin/apptainer /usr/local/bin/singularity
) || true
fi
apt-get clean
rm -rf /var/lib/apt/lists/*
%environment
export LC_ALL=C
export LANG=C
%test
set -e
command -v bash
command -v datalad
command -v git
command -v git-annex
command -v singularity || command -v apptainer