File: deb2apptainer.1

package info (click to toggle)
devscripts 2.25.15
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 8,528 kB
  • sloc: perl: 26,530; sh: 11,698; python: 4,428; makefile: 363
file content (141 lines) | stat: -rw-r--r-- 4,119 bytes parent folder | download | duplicates (3)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.TH "DEB2APPTAINER" "1" "February 2024" "" ""
.hy
.SH NAME
.PP
\f[B]deb2apptainer\f[R] - Build a Singularity/Apptainer image with given
Debian packages
.SH SYNOPSIS
.PP
\f[B]deb2apptainer\f[R] [\f[B]-hB\f[R]][\f[B]-c\f[R] \f[I]CMD\f[R]]
[\f[B]-f\f[R] \f[I]FROM\f[R]][\f[B]-n\f[R] \f[I]NAME\f[R]]
[\f[B]-o\f[R] \f[I]DIR\f[R]][\f[B]-p\f[R] \f[I]PRE_SCRIPT\f[R]]
[\f[B]-s\f[R] \f[I]POST_SCRIPT\f[R]] \f[I]packages\f[R]
.br
\f[B]deb2singularity\f[R] [\f[B]-hB\f[R]][\f[B]-c\f[R] \f[I]CMD\f[R]]
[\f[B]-f\f[R] \f[I]FROM\f[R]][\f[B]-n\f[R] \f[I]NAME\f[R]]
[\f[B]-o\f[R] \f[I]DIR\f[R]][\f[B]-p\f[R] \f[I]PRE_SCRIPT\f[R]]
[\f[B]-s\f[R] \f[I]POST_SCRIPT\f[R]] \f[I]packages\f[R]
.SH DESCRIPTION
.PP
\f[B]deb2apptainer\f[R] is a simple script which takes as input a list
of Debian packages and generates automatically a Singularity/Apptainer
container including these packages.
A set of \f[I]freedesktop.org\f[R] desktop launchers are also generated
based on the .desktop and icon files found in the packages.
In addition, a desktop launcher is created to start the container in a
Terminal.
.PP
This tool is suited for deploying applications as containers, as well as
for testing Debian packages in a sandbox.
.SH OPTIONS
.TP
\f[B]-B\f[R]
do NOT build the image (default is to build).
A \f[I]build\f[R] script is generated in the DIR target directory.
.TP
\f[B]-c EXEC\f[R]
Command to run in the container (default to \f[I]/bin/bash\f[R]).
.TP
\f[B]-f FROM\f[R]
Distribution is to be used (default to \f[I]debian:stable\f[R]).
.TP
\f[B]-h\f[R]
Show this help
.TP
\f[B]-n NAME\f[R]
Name of the image (default is built from the package list).
.TP
\f[B]-o DIR\f[R]
Use given directory DIR for the build (default is in /tmp).
.TP
\f[B]-p PRE_SCRIPT\f[R]
Execute the given script \f[I]PRE_SCRIPT\f[R] before packages install.
.TP
\f[B]-s POST_SCRIPT\f[R]
Execute the given script \f[I]POST_SCRIPT\f[R] after packages install.
.TP
\f[B]packages\f[R]
The package list can be any Debian package, as well as local .deb files.
.SH FILES
.IP \[bu] 2
DIR/README
.IP \[bu] 2
DIR/image.def
.IP \[bu] 2
DIR/image.sif
.IP \[bu] 2
DIR/launchers/
.IP \[bu] 2
DIR/icons/
.IP \[bu] 2
DIR/build
.IP \[bu] 2
DIR/start
.SH NOTES
.PP
You obviously require to have \f[I]apptainer\f[R] installed.
.PP
Get the Debian package at: -
https://apptainer.org/docs/admin/main/installation.html#install-debian-packages
.PP
Usual commands typically used to handle Apptainer/Singularity containers
are:
.TP
\f[B]build\f[R]
apptainer build image.sif
.TP
\f[B]run\f[R]
apptainer run image.sif apptainer run \[en]nv image.sif # with NVIDIA
GPU pass-through
.TP
\f[B]info\f[R]
apptainer inspect image.sif
.TP
\f[B]header\f[R]
apptainer sif header image.sif
.TP
\f[B]data\f[R]
apptainer sif list image.sif
.SH EXAMPLES
.TP
Create a Singularity/Apptainer container with package \f[I]x11-apps\f[R] in directory \f[I]/tmp/xeyes\f[R], and launch \f[I]xeyes\f[R]:
.IP \[bu] 2
deb2apptainer -o /tmp/xeyes x11-apps
.IP \[bu] 2
/tmp/xeyes/start xeyes
.RS
.PP
A Desktop launcher is created as
/tmp/xeyes/launchers/x11-apps-terminal.desktop
.RE
.TP
Create a Singularity/Apptainer container with \f[I]x11-apps\f[R] and \f[I]meshlab\f[R]
deb2apptainer x11-apps meshlab
.TP
Create a Singularity/Apptainer container making sure software channels are active:
.IP \[bu] 2
echo \[lq]sed -i `s/main/main contrib non-free/g'
/etc/apt/sources.list\[rq] > pre.sh
.IP \[bu] 2
deb2apptainer -p pre.sh x11-apps
.TP
Create a Singularity/Apptainer container based on specific Debian version, and make use of the GPU:
.IP \[bu] 2
echo \[lq]echo `deb http://deb.debian.org/debian bullseye main contrib
non-free' >> /etc/apt/sources.list\[rq] > pre-script.sh
.IP \[bu] 2
deb2apptainer -n pyhst2 -f debian:bullseye -p pre-script.sh -o
/tmp/apptainer-pyhst2/ python3-pyhst2-cuda nvidia-smi
nvidia-cuda-toolkit
.IP \[bu] 2
apptainer run \[en]nv /tmp/apptainer-pyhst2/pyhst2.sif nvidia-smi
\[ga]\[ga]\[ga]
.SH AUTHORS
.PP
Emmanuel Farhi (emmanuel.farhi\[at]synchrotron-soleil.fr)
.SH SEE ALSO
.PP
deb2docker(1), distrobox-create(1), distrobox-enter(1), docker(1),
apptainer(1)
.SH AUTHORS
Emmanuel Farhi.