-
Notifications
You must be signed in to change notification settings - Fork 0
/
Singularity
executable file
·44 lines (33 loc) · 1.03 KB
/
Singularity
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
Bootstrap:docker
From:ubuntu:latest
%labels
MAINTAINER Chunhua Zhou
%environment
CODE_DIR=/opt
export CODE_DIR
%files
#copy files into container /opt directory
text_translate.py /opt
%post
echo "This section is performed after you bootstrap to build the image."
#install needed base packages
apt-get update
apt-get install -y vim nano
apt-get install -y python-dev python-pip python-setuptools
#install needed python packages
pip install translate
%runscript
echo "This code executed when you run the image!"
exec python /opt/text_translate.py
%help
#This provides help to users of the container
A base Ubuntu Singularity container with a basic Python installation and the "translate" package
To run the example script:
>singularity run <image_name>.img"
Or to run python on your own external script:
>singularity exec <image_name>.img python <your_script_name>.py
which is equivalent to running "python [arguments]"
%test
# Sanity check that the container is operating
# Check python version
/usr/bin/python --version