-
Notifications
You must be signed in to change notification settings - Fork 1
/
oplab_pipeline.def
66 lines (59 loc) · 3 KB
/
oplab_pipeline.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Bootstrap: docker
From: python:3.9-slim-bullseye
%labels
Author [email protected]
Version v0.0.1
%help
This is a singularity container for oplab_pipeline (auv_nav, auv_cal and correct_images)
%files
# Copy the oplab_pipeline folder to the container
. /opt/oplab_pipeline_git
%post -c /bin/bash
apt-get update && apt-get -y install python3-opencv llvm procps gnupg2 ffmpeg
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu buster main" > /etc/apt/sources.list.d/ros-latest.list'
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# Install system libraries and non-python dependencies
apt-get update && apt-get -y install ros-noetic-ros-core python3-cv-bridge \
libsm6 libxext6 && rm -rf /var/lib/apt/lists/*
# Upgrade pip, setuptools and prepare the environment
python -m pip install --no-cache-dir --upgrade pip setuptools virtualenv
# Create the virtual environment and activate the virtual environment
cd /opt \
&& python -m venv oplab_pipeline_env \
&& source oplab_pipeline_env/bin/activate \
&& source /opt/ros/noetic/setup.bash
# Install the python dependencies, change folder to the copied git folder and install the python package
cd /opt/oplab_pipeline_git \
&& python -m pip install --no-cache-dir -r requirements.txt \
&& python -m pip install --extra-index-url https://rospypi.github.io/simple/ rosbag \
&& python -m pip install --extra-index-url https://rospypi.github.io/simple/ roslz4 \
&& python -m pip install --no-cache-dir .
%runscript
echo ""
echo " \033[94m ● ● \033[0m Ocean Perception"
echo " \033[94m ● \033[93m▲ \033[0m University of Southampton"
echo ""
echo " Copyright (C) 2020 University of Southampton "
echo " This program comes with ABSOLUTELY NO WARRANTY."
echo " This is free software, and you are welcome to "
echo " redistribute it. "
echo ""
echo "This is an oplab_pipeline SIF image container"
echo "Run the pipeline using the following command:"
echo " - singularity exec oplab_pipeline.sif auv_nav ARGS"
echo " - singularity exec oplab_pipeline.sif auv_cal ARGS"
echo " - singularity exec oplab_pipeline.sif correct_images ARGS"
echo ""
echo "NOTE: if running on your own machine, the flag"
echo " -B /run/shm:/run/shm"
echo " is required to share the shared memory between the container"
echo " and the host. Example:"
echo " - singularity exec -B /run/shm:/run/shm oplab_pipeline.sif auv_nav ARGS"
echo " - singularity exec -B /run/shm:/run/shm oplab_pipeline.sif auv_cal ARGS"
echo " - singularity exec -B /run/shm:/run/shm oplab_pipeline.sif correct_images ARGS"
echo ""
echo "For more information, check https://oplab-pipeline.readthedocs.io/"
%environment
export PATH=/opt/oplab_pipeline_env/bin:$PATH
export LANG=C.UTF-8
export LC_ALL=C.UTF-8