From f11ebe06bb64083ef983842803782ebcc4b0845e Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Fri, 1 Apr 2022 19:22:17 +0200 Subject: [PATCH] Dockerfile cleanup & PYROS_DOCKER_UPDATE auto updates guitastro (git pull) --- Dockerfile | 48 ++++++++++++++++++++++++++++++++++++++---------- docker/PYROS_DOCKER_UPDATE | 9 +++++++++ 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b78365..cc03a79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,11 @@ FROM ubuntu:20.04 ARG uid + +################ +# Mysql client # +################ + RUN apt-get update && apt-get upgrade -y RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata @@ -31,29 +36,41 @@ RUN apt-get install -y \ nano vim \ git -# Python3.8 & pip + + +################ +# Python & pip # +################ RUN apt-get install -y python3.8 RUN apt-get install -y python3.8-dev RUN apt-get install -y python3-pip RUN cd /usr/bin && ln -s python3 python RUN python -m pip install --upgrade pip -# For guitastro # DEV only # for dot => PNG diagrams generation with pyreverse (pylint) RUN apt-get install -y graphviz graphviz-dev -# Guitastro + + +############# +# GUITASTRO # +############# + +# +# Guitastro C/C++ dependencies +# + +# - ASTROMETRY.NET (in order to process images locally, without having to send (big) images to astrometry.net) RUN apt-get install -y \ - # - ASTROMETRY.NET (in order to process images locally, without having to send (big) images to astrometry.net) astrometry.net astrometry-data-tycho2 \ #astrometry-data-2mass \ # - PIL python3-tk \ python3-pil python3-pil.imagetk -# - INDI => for Guitastro +# - INDI # https://indilib.org/get-indi/download-ubuntu.html # For apt-add-repository : 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 # Obligatoire ? #RUN pip install --user --install-option="--prefix=" pyindi-client -# - ASTAP (Astrometry) => for Guitastro +# - ASTAP (Astrometry) # Download .deb file from https://www.hnsky.org/astap.htm RUN apt-get install -y wget RUN wget https://www.hnsky.org/astap_amd64.deb RUN apt-get install -y ./astap_amd64.deb RUN rm ./astap_amd64.deb -# - PYLON (Cameras BASLER) => for Guitastro +# - PYLON (Cameras BASLER) # https://www.baslerweb.com/en/products/software/basler-pylon-camera-software-suite/ # (you will have to fill a form to be able to download) # pylon_6.3.0.23157_x86_64_setup.tar.gz @@ -103,6 +120,7 @@ RUN apt-get update && apt-get upgrade -y # apt install spyder # apt install graphviz libgraphviz-dev +# - Graphic layer # Add a VNC server to have local graphic windows # When you run this container, a VNC server will be created automatically. # 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"] #RUN x11vnc -create -forever + + + # Get IRAP self signed certificate 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 +################################# +# PyROS user (better than root) # +################################# + RUN echo "$uid" > test.txt # Adding new user (pyros_user) and creating his home folder RUN useradd --create-home --shell /bin/bash pyros_user --uid $uid @@ -127,18 +152,18 @@ WORKDIR /home/pyros_user/app # Switch from root to pyros_user USER pyros_user -#RUN python -m pip3 install --user --upgrade pip -#RUN pip install --user --upgrade pip #RUN pip install --user wheel # TODO: pourquoi numpy ??? A virer ? #RUN pip install --user numpy + + # Copy local host machine files to image COPY --chown=pyros_user:pyros_user . . # Copy some aliases RUN cp .bash_aliases .. #RUN mv .bash_aliases .. -#COPY --chown=pyros_user:pyros_user .bash_aliases .. + # Adding local/bin to path to avoid pip warning ENV PATH "$PATH:/home/pyros_user/.local/bin" @@ -155,6 +180,9 @@ RUN pip install --user click # - But we can at least use it to generate all the requirements*.txt files in a far better format RUN pip install --user pip-tools + + # Installing packages required for PyROS RUN pip install --user -r ./install/requirements.txt RUN pip install --user -r ./install/requirements_dev.txt + diff --git a/docker/PYROS_DOCKER_UPDATE b/docker/PYROS_DOCKER_UPDATE index 81cafc8..207aa78 100755 --- a/docker/PYROS_DOCKER_UPDATE +++ b/docker/PYROS_DOCKER_UPDATE @@ -6,6 +6,15 @@ then echo "db_pyros or pyros weren't running, starting them..." ./PYROS_DOCKER_START.bat fi + +# Update source code +# - GuitastroGuitastro +echo "Updating Guitastro source code" +(cd ../vendor/guitastro/ ; git pull) +# - PyROS +echo "Updating PyROS source code" git pull + +# Update BD, doc, ... docker exec -it pyros python3 pyros.py update -- libgit2 0.21.2