Commit f11ebe06bb64083ef983842803782ebcc4b0845e
1 parent
d7a4c851
Exists in
dev
Dockerfile cleanup & PYROS_DOCKER_UPDATE auto updates guitastro (git pull)
Showing
2 changed files
with
47 additions
and
10 deletions
Show diff stats
Dockerfile
@@ -20,6 +20,11 @@ FROM ubuntu:20.04 | @@ -20,6 +20,11 @@ FROM ubuntu:20.04 | ||
20 | ARG uid | 20 | ARG uid |
21 | 21 | ||
22 | 22 | ||
23 | + | ||
24 | +################ | ||
25 | +# Mysql client # | ||
26 | +################ | ||
27 | + | ||
23 | RUN apt-get update && apt-get upgrade -y | 28 | RUN apt-get update && apt-get upgrade -y |
24 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata | 29 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata |
25 | 30 | ||
@@ -31,29 +36,41 @@ RUN apt-get install -y \ | @@ -31,29 +36,41 @@ RUN apt-get install -y \ | ||
31 | nano vim \ | 36 | nano vim \ |
32 | git | 37 | git |
33 | 38 | ||
34 | -# Python3.8 & pip | 39 | + |
40 | + | ||
41 | +################ | ||
42 | +# Python & pip # | ||
43 | +################ | ||
35 | RUN apt-get install -y python3.8 | 44 | RUN apt-get install -y python3.8 |
36 | RUN apt-get install -y python3.8-dev | 45 | RUN apt-get install -y python3.8-dev |
37 | RUN apt-get install -y python3-pip | 46 | RUN apt-get install -y python3-pip |
38 | RUN cd /usr/bin && ln -s python3 python | 47 | RUN cd /usr/bin && ln -s python3 python |
39 | RUN python -m pip install --upgrade pip | 48 | RUN python -m pip install --upgrade pip |
40 | 49 | ||
41 | -# For guitastro | ||
42 | 50 | ||
43 | # DEV only | 51 | # DEV only |
44 | # for dot => PNG diagrams generation with pyreverse (pylint) | 52 | # for dot => PNG diagrams generation with pyreverse (pylint) |
45 | RUN apt-get install -y graphviz graphviz-dev | 53 | RUN apt-get install -y graphviz graphviz-dev |
46 | 54 | ||
47 | -# Guitastro | 55 | + |
56 | + | ||
57 | +############# | ||
58 | +# GUITASTRO # | ||
59 | +############# | ||
60 | + | ||
61 | +# | ||
62 | +# Guitastro C/C++ dependencies | ||
63 | +# | ||
64 | + | ||
65 | +# - ASTROMETRY.NET (in order to process images locally, without having to send (big) images to astrometry.net) | ||
48 | RUN apt-get install -y \ | 66 | RUN apt-get install -y \ |
49 | - # - ASTROMETRY.NET (in order to process images locally, without having to send (big) images to astrometry.net) | ||
50 | astrometry.net astrometry-data-tycho2 \ | 67 | astrometry.net astrometry-data-tycho2 \ |
51 | #astrometry-data-2mass \ | 68 | #astrometry-data-2mass \ |
52 | # - PIL | 69 | # - PIL |
53 | python3-tk \ | 70 | python3-tk \ |
54 | python3-pil python3-pil.imagetk | 71 | python3-pil python3-pil.imagetk |
55 | 72 | ||
56 | -# - INDI => for Guitastro | 73 | +# - INDI |
57 | # https://indilib.org/get-indi/download-ubuntu.html | 74 | # https://indilib.org/get-indi/download-ubuntu.html |
58 | # For apt-add-repository : | 75 | # For apt-add-repository : |
59 | RUN apt-get install -y software-properties-common | 76 | RUN apt-get install -y software-properties-common |
@@ -72,14 +89,14 @@ RUN apt-get install -y gsc kstars-bleeding libindi1 indi-bin swig libz3-dev libc | @@ -72,14 +89,14 @@ RUN apt-get install -y gsc kstars-bleeding libindi1 indi-bin swig libz3-dev libc | ||
72 | # Obligatoire ? | 89 | # Obligatoire ? |
73 | #RUN pip install --user --install-option="--prefix=" pyindi-client | 90 | #RUN pip install --user --install-option="--prefix=" pyindi-client |
74 | 91 | ||
75 | -# - ASTAP (Astrometry) => for Guitastro | 92 | +# - ASTAP (Astrometry) |
76 | # Download .deb file from https://www.hnsky.org/astap.htm | 93 | # Download .deb file from https://www.hnsky.org/astap.htm |
77 | RUN apt-get install -y wget | 94 | RUN apt-get install -y wget |
78 | RUN wget https://www.hnsky.org/astap_amd64.deb | 95 | RUN wget https://www.hnsky.org/astap_amd64.deb |
79 | RUN apt-get install -y ./astap_amd64.deb | 96 | RUN apt-get install -y ./astap_amd64.deb |
80 | RUN rm ./astap_amd64.deb | 97 | RUN rm ./astap_amd64.deb |
81 | 98 | ||
82 | -# - PYLON (Cameras BASLER) => for Guitastro | 99 | +# - PYLON (Cameras BASLER) |
83 | # https://www.baslerweb.com/en/products/software/basler-pylon-camera-software-suite/ | 100 | # https://www.baslerweb.com/en/products/software/basler-pylon-camera-software-suite/ |
84 | # (you will have to fill a form to be able to download) | 101 | # (you will have to fill a form to be able to download) |
85 | # pylon_6.3.0.23157_x86_64_setup.tar.gz | 102 | # pylon_6.3.0.23157_x86_64_setup.tar.gz |
@@ -103,6 +120,7 @@ RUN apt-get update && apt-get upgrade -y | @@ -103,6 +120,7 @@ RUN apt-get update && apt-get upgrade -y | ||
103 | # apt install spyder | 120 | # apt install spyder |
104 | # apt install graphviz libgraphviz-dev | 121 | # apt install graphviz libgraphviz-dev |
105 | 122 | ||
123 | +# - Graphic layer | ||
106 | # Add a VNC server to have local graphic windows | 124 | # Add a VNC server to have local graphic windows |
107 | # When you run this container, a VNC server will be created automatically. | 125 | # When you run this container, a VNC server will be created automatically. |
108 | # You must bind a host port to the container’s port 5900 – this is the port the VNC server will be exposed on | 126 | # You must bind a host port to the container’s port 5900 – this is the port the VNC server will be exposed on |
@@ -113,9 +131,16 @@ CMD ["x11vnc", "-create", "-forever"] | @@ -113,9 +131,16 @@ CMD ["x11vnc", "-create", "-forever"] | ||
113 | #RUN x11vnc -create -forever | 131 | #RUN x11vnc -create -forever |
114 | 132 | ||
115 | 133 | ||
134 | + | ||
135 | + | ||
136 | + | ||
116 | # Get IRAP self signed certificate | 137 | # Get IRAP self signed certificate |
117 | RUN echo | openssl s_client -connect gitlab.irap.omp.eu:443 -servername gitlab.irap.omp.eu 2>/dev/null | openssl x509 > /etc/ssl/certs/gitlab.irap.omp.eu.crt | 138 | RUN echo | openssl s_client -connect gitlab.irap.omp.eu:443 -servername gitlab.irap.omp.eu 2>/dev/null | openssl x509 > /etc/ssl/certs/gitlab.irap.omp.eu.crt |
118 | 139 | ||
140 | +################################# | ||
141 | +# PyROS user (better than root) # | ||
142 | +################################# | ||
143 | + | ||
119 | RUN echo "$uid" > test.txt | 144 | RUN echo "$uid" > test.txt |
120 | # Adding new user (pyros_user) and creating his home folder | 145 | # Adding new user (pyros_user) and creating his home folder |
121 | RUN useradd --create-home --shell /bin/bash pyros_user --uid $uid | 146 | RUN useradd --create-home --shell /bin/bash pyros_user --uid $uid |
@@ -127,18 +152,18 @@ WORKDIR /home/pyros_user/app | @@ -127,18 +152,18 @@ WORKDIR /home/pyros_user/app | ||
127 | # Switch from root to pyros_user | 152 | # Switch from root to pyros_user |
128 | USER pyros_user | 153 | USER pyros_user |
129 | 154 | ||
130 | -#RUN python -m pip3 install --user --upgrade pip | ||
131 | -#RUN pip install --user --upgrade pip | ||
132 | #RUN pip install --user wheel | 155 | #RUN pip install --user wheel |
133 | # TODO: pourquoi numpy ??? A virer ? | 156 | # TODO: pourquoi numpy ??? A virer ? |
134 | #RUN pip install --user numpy | 157 | #RUN pip install --user numpy |
135 | 158 | ||
159 | + | ||
160 | + | ||
136 | # Copy local host machine files to image | 161 | # Copy local host machine files to image |
137 | COPY --chown=pyros_user:pyros_user . . | 162 | COPY --chown=pyros_user:pyros_user . . |
138 | # Copy some aliases | 163 | # Copy some aliases |
139 | RUN cp .bash_aliases .. | 164 | RUN cp .bash_aliases .. |
140 | #RUN mv .bash_aliases .. | 165 | #RUN mv .bash_aliases .. |
141 | -#COPY --chown=pyros_user:pyros_user .bash_aliases .. | 166 | + |
142 | 167 | ||
143 | # Adding local/bin to path to avoid pip warning | 168 | # Adding local/bin to path to avoid pip warning |
144 | ENV PATH "$PATH:/home/pyros_user/.local/bin" | 169 | ENV PATH "$PATH:/home/pyros_user/.local/bin" |
@@ -155,6 +180,9 @@ RUN pip install --user click | @@ -155,6 +180,9 @@ RUN pip install --user click | ||
155 | # - But we can at least use it to generate all the requirements*.txt files in a far better format | 180 | # - But we can at least use it to generate all the requirements*.txt files in a far better format |
156 | RUN pip install --user pip-tools | 181 | RUN pip install --user pip-tools |
157 | 182 | ||
183 | + | ||
184 | + | ||
158 | # Installing packages required for PyROS | 185 | # Installing packages required for PyROS |
159 | RUN pip install --user -r ./install/requirements.txt | 186 | RUN pip install --user -r ./install/requirements.txt |
160 | RUN pip install --user -r ./install/requirements_dev.txt | 187 | RUN pip install --user -r ./install/requirements_dev.txt |
188 | + |
docker/PYROS_DOCKER_UPDATE
@@ -6,6 +6,15 @@ then | @@ -6,6 +6,15 @@ then | ||
6 | echo "db_pyros or pyros weren't running, starting them..." | 6 | echo "db_pyros or pyros weren't running, starting them..." |
7 | ./PYROS_DOCKER_START.bat | 7 | ./PYROS_DOCKER_START.bat |
8 | fi | 8 | fi |
9 | + | ||
10 | +# Update source code | ||
11 | +# - GuitastroGuitastro | ||
12 | +echo "Updating Guitastro source code" | ||
13 | +(cd ../vendor/guitastro/ ; git pull) | ||
14 | +# - PyROS | ||
15 | +echo "Updating PyROS source code" | ||
9 | git pull | 16 | git pull |
17 | + | ||
18 | +# Update BD, doc, ... | ||
10 | docker exec -it pyros python3 pyros.py update | 19 | docker exec -it pyros python3 pyros.py update |
11 | 20 |