Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
icare
STDPipe
Commits
00f271d6
Commit
00f271d6
authored
Jun 06, 2022
by
karpov-sv
Browse files
Simplify the Docker image building, and make it run Jupyter notebook as an entry point
parent
f187e0dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
66 deletions
+53
-66
.github/workflows/test_docker_build.yaml
.github/workflows/test_docker_build.yaml
+3
-3
Dockerfile
Dockerfile
+45
-55
docker-compose.yaml
docker-compose.yaml
+1
-2
setup.py
setup.py
+4
-6
No files found.
.github/workflows/test_docker_build.yaml
View file @
00f271d6
...
...
@@ -27,6 +27,6 @@ jobs:
run
:
|
docker build -t stdpipe/stdpipe . && docker push stdpipe/stdpipe
-
name
:
Start containers
run
:
|
docker-compose up -d
#
- name: Start containers
#
run: |
#
docker-compose up -d
Dockerfile
View file @
00f271d6
ARG
SCAMP_version=v2.6.7
ARG
SWARP_version=2.38.0
ARG
Sextractor_version=2.25.0
ARG
PSFEX_version=3.21.1
# Building image from
# Building image from
FROM
ubuntu:20.04
LABEL
maintainer="
Michael Coughlin <cough052@umn.edu
>"
LABEL
maintainer="
Sergey Karpov <karpov.sv@gmail.com
>"
# Create a variable corresponding to the name of the new user that will be created inside the Docker.
ENV
USR newuser
ENV
USERNAME newuser
# Create new user
RUN
useradd
-ms
/bin/bash
${
USERNAME
}
#
Set
up
working directory
#
Set
the
working directory
WORKDIR
/home
# Create new user
RUN
useradd
-ms
/bin/bash
${
USR
}
# Fix for tzdata which is pulled by some dependencies
ARG
DEBIAN_FRONTEND=noninteractive
ENV
TZ=Europe/Prague
ARG
SCAMP_version
ARG
SWARP_version
ARG
Sextractor_version
ARG
PSFEX_version
# Install updates to base image, install packages, and remove from cache
#
Create astromatic folder, and install all needed astromatic software and
hotpants
#
First download and build cfitsio and the cdsclient used by SCAMP
# Install
all p
ython packages
. numpy 1.19.0 is the latest dependency compatible with tensorflow 2.3.1
#
Install
hotpants
#
Install Jupyter
# Install
some P
ython packages
# All done in one line to limit docker size
RUN
\
apt-get update
\
&&
apt-get
install
software-properties-common
-y
\
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt-get update \
&& apt-get install -y --no-install-recommends wget curl vim build-essential ca-certificates libtool libatlas3-base libatlas-base-dev libplplot-dev libfftw3-dev libcurl4-openssl-dev autoconf automake git unzip gfortran python3.9 python3.9-dev python3-pip \
&& apt-get install -y --no-install-recommends libcfitsio-dev sextractor scamp psfex swarp \
&& rm -rf /var/lib/apt/lists/* \
&& git clone https://github.com/acbecker/hotpants.git \
&& cd hotpants \
&& make \
&& cp hotpants /usr/local/bin/ \
&& cd .. \
&& rm -fr astromatic hotpants cfitsio-* cdsclient-* \
&& python3.9 -m pip install --upgrade pip \
&& python3.9 -m pip install setuptools cmake \
&& python3.9 -m pip install scikit-build \
&& python3.9 -m pip install numpy scipy matplotlib astropy pandas shapely requests h5py scikit-image lacosmic hjson voevent-parse xmltodict astroML photutils keras keras-vis cython regions opencv-python-headless astroscrappy astroquery tqdm
RUN
\
git clone https://github.com/karpov-sv/stdpipe.git
\
&&
cd
stdpipe
\
&&
python3.9 setup.py
install
\
&&
rm
-fr
/home/newuser/.cache/pip
\
&&
rm
-fr
/root/.cache/pip
\
&&
rm
-fr
/root/.cache/
*
\
&&
rm
-fr
/tmp/
*
\
&&
apt-get autoremove
--purge
-y
#&& apt-get purge -y gfortran gfortran-7 git-man libgfortran-7-dev libgfortran4
apt-get update
\
&&
apt-get
install
-y
--no-install-recommends
build-essential ca-certificates libtool libcfitsio-dev autoconf automake git unzip python3-pip
\
sextractor scamp psfex swarp
\
jupyter jupyter-notebook jupyter-nbextension-jupyter-js-widgets python3-ipywidgets
\
&&
rm
-rf
/var/lib/apt/lists/
*
\
&&
git clone https://github.com/acbecker/hotpants.git
\
&&
cd
hotpants
\
&&
make
\
&&
cp
hotpants /usr/local/bin/
\
&&
cd
..
\
&&
rm
-fr
hotpants
\
&&
python3
-m
pip
install
--upgrade
pip
\
&&
python3
-m
pip
install
setuptools
# Install STDPipe
RUN
\
git clone https://github.com/karpov-sv/stdpipe.git
\
&&
cd
stdpipe
\
&&
python3
-m
pip
install
-e
.
\
&&
rm
-fr
/home/newuser/.cache/pip
\
&&
rm
-fr
/root/.cache/pip
\
&&
rm
-fr
/root/.cache/
*
\
&&
rm
-fr
/tmp/
*
\
&&
apt-get autoremove
--purge
-y
# switch ownership
# (all commands are root until a USER command changes that)
USER
${USR}
# Set the working directory
WORKDIR
/home/${USR}
USER
${USERNAME}
# change ownership from root to USR:
#
Create directory to link on volume with host machine
RUN
chown
-R
${
US
R
}
:
${
USR
}
/home/
${
US
R
}
\
&&
mkdir
/home/
${
US
R
}
/stdpipe/
#
Create
`stdpipe`
directory to link on volume with host machine
RUN
chown
-R
${
US
ERNAME
}
:
${
USERNAME
}
/home/
${
US
ERNAME
}
\
&&
mkdir
/home/
${
US
ERNAME
}
/stdpipe/
# Add local bin to PATH
ENV
PATH="/home/${US
R
}/.local/bin:$PATH"
ENV
PATH="/home/${US
ERNAME
}/.local/bin:$PATH"
# Change working directory to stdpipe
WORKDIR
/home/${US
R
}/stdpipe
WORKDIR
/home/${US
ERNAME
}/stdpipe
# define entrypoint which is the default executable at launch
ENTRYPOINT
["bash"]
ENTRYPOINT
["jupyter", "notebook", "--no-browser", "--ip=0.0.0.0", "--NotebookApp.token=''"]
EXPOSE
8888
docker-compose.yaml
View file @
00f271d6
...
...
@@ -4,5 +4,4 @@ services:
stdpipe
:
image
:
stdpipe/stdpipe
ports
:
-
"
9000:5000"
-
"
9001:5001"
-
"
9000:8888"
setup.py
View file @
00f271d6
...
...
@@ -6,12 +6,10 @@ from setuptools import setup, find_packages
__version__
=
'0.1'
requirements
=
[
'configargparse'
,
'numpy'
,
'scipy'
,
'astropy>=4.1'
,
'matplotlib'
,
'pandas'
,
'astroquery>0.4.1'
,
'sep'
,
'photutils'
,
...
...
@@ -28,14 +26,14 @@ setup(
description
=
'Simple Transient Detection Pipeline'
,
author
=
'Sergey Karpov'
,
author_email
=
'karpov.sv@gmail.com'
,
url
=
''
,
url
=
'
https://github.com/karpov-sv/stdpipe
'
,
install_requires
=
requirements
,
packages
=
[
'stdpipe'
],
package_data
=
{
'stdpipe'
:[
'data/*'
]},
include_package_data
=
True
,
extras_require
=
{
"example"
:
[
'astroscrappy'
,
],
"example"
:
[
'astroscrappy'
,
],
},
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment