From 448b134716079e7727610247f158c1e514ed449a Mon Sep 17 00:00:00 2001 From: gnthibault Date: Tue, 29 Aug 2023 18:42:53 +0200 Subject: [PATCH 01/21] Massive software upgrade -- starting compatibility with macOS --- README.md | 12 ++++++++++++ requirements.txt | 26 +++++++++++++------------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ef22abf..608feb5 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,18 @@ Quick overview of what you will be able to see and manage through this project # Install +## System requirements when using macOS +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +brew install python@3.9 +brew install virtualenv +brew install graphviz +export GRAPHVIZ_DIR="$(brew --prefix graphviz)" +export C_INCLUDE_PATH=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers +export CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers +pip install pygraphviz --global-option=build_ext --global-option="-I$GRAPHVIZ_DIR/include" --global-option="-L$GRAPHVIZ_DIR/lib" +``` + ## System requirements when using ubuntu ```bash sudo apt-add-repository ppa:mutlaqja/ppa diff --git a/requirements.txt b/requirements.txt index 92913cb..c22644b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,32 +1,32 @@ -astroalign==1.0.4 -astroplan==0.8 -astropy==4.1 -astroquery==0.4.1 +astroalign==2.4.2 +astroplan==0.9 +astropy==5.3.2 +astroquery==0.4.6 erdantic==0.6.0 -influxdb-client==1.35.0 +influxdb-client==1.37.0 gcn-kafka==0.3.0 +graphviz==0.20.1 lxml==4.9.1 ntplib==0.3.4 -matplotlib==3.3.4 +matplotlib==3.7.2 meshcat==0.3.2 numpy==1.22.0 -opencv-python==4.3.0.36 -photutils==1.0.2 +opencv-python==4.8.0.76 +photutils==1.9.0 pyaml==20.4.0 pydantic==2.2.1 pydantic-core==2.6.1 -pygraphviz==1.6 +#pygraphviz==1.6 PyLaTeX==1.3.2 pymongo==3.11.3 paho-mqtt==1.6.1 -pyserial==3.4 +#pyserial==3.4 pytz==2021.3 pyzmq==25.1.0 -rawpy==0.16.0 requests==2.31.0 rinohtype==0.3.1 -sep==1.1.1 -serial==0.0.97 +sep==1.2.1 +#serial==0.0.97 Sphinx==1.8.1 transitions==0.7.1 tzwhere==3.0.3 From f0552e12e3f798a192bf867f681eb3b8a7da1f16 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Wed, 30 Aug 2023 22:21:31 +0200 Subject: [PATCH 02/21] WIP --- utils/database.py | 124 +++++++++++++++++++++++++++++++++++++++++++++ utils/datamodel.py | 5 +- 2 files changed, 128 insertions(+), 1 deletion(-) diff --git a/utils/database.py b/utils/database.py index 75f2a62..16d603b 100644 --- a/utils/database.py +++ b/utils/database.py @@ -9,6 +9,9 @@ from warnings import warn import weakref +# DB +from sqlmodel import Field, Session, SQLModel, create_engine, select + # Local from Service.HostTimeService import HostTimeService from utils import serializers as json_util @@ -122,6 +125,127 @@ def clear_current(self, type): """ raise NotImplementedError +############################################################################### +# SQLite implementation +############################################################################### + +class TransactionalFileDB(metaclass=abc.ABCMeta): + def __init__(self, db_name=None, collection_names=list(), logger=None, + serv_time=HostTimeService(), **kwargs): + """ + Init base class for db instances. + + Args: + db_name: Name of the database, typically panoptes or + panoptes_testing. + collection_names (list of str): Names of the valid collections. + logger: (Optional) logger to use for warnings. + """ + super().__init__(db_name=db_name, **kwargs) + self.db_folder = db_name + self.sqlite_file_path = os.path.join(self.db_folder, "database.db") + # Set up storage directory. + self._storage_dir = self.db_folder + os.makedirs(self._storage_dir, exist_ok=True) + self.engine = None + self.create_db_and_tables() + + def create_db_and_tables(self): + sqlite_url = f"sqlite:///{self.sqlite_file_path}" + connect_args = {"check_same_thread": False} + self.engine = create_engine(sqlite_url, echo=True, connect_args=connect_args) + SQLModel.metadata.create_all(self.engine) + + def _warn(self, *args, **kwargs): + if self.logger: + self.logger.warning(*args, **kwargs) + else: + warn(*args) + + def validate_collection(self, collection): + if collection not in self.collection_names: + msg = f"Collection type {collection} not available" + self._warn(msg) + # Can't import utils.error earlier + from utils.error import InvalidCollection + raise InvalidCollection(msg) + + @abc.abstractclassmethod + def insert_current(self, collection, obj, store_permanently=True): + """Insert an object into both the `current` collection and the + collection provided. + + Args: + collection (str): Name of valid collection within the db. + obj (dict or str): Object to be inserted. + store_permanently (bool): Whether to also update the collection, + defaults to True. + + Returns: + str: identifier of inserted record. If `store_permanently` is True, + will be the identifier of the object in the `collection`, + otherwise will be the identifier of object in the `current` + collection. These may or may not be the same. + Returns None if unable to insert into the collection. + """ + raise NotImplementedError + + @abc.abstractclassmethod + def insert(self, collection, obj): + """Insert an object into the collection provided. + + The `obj` to be stored in a collection should include the `type` + and `date` metadata as well as a `data` key that contains the actual + object data. If these keys are not provided then `obj` will be wrapped + in a corresponding object that does contain the metadata. + + Args: + collection (str): Name of valid collection within the db. + obj (dict or str): Object to be inserted. + + Returns: + str: identifier of inserted record in `collection`. + Returns None if unable to insert into the collection. Can be + considered as an object_id + """ + raise NotImplementedError + + @abc.abstractclassmethod + def get_current(self, collection): + """Returns the most current record for the given collection + + Args: + collection (str): Name of the collection to get most current from + + Returns: + dict|None: Current object of the collection or None. + """ + raise NotImplementedError + + @abc.abstractclassmethod + def find(self, collection, obj_id): + """Find an object by it's identifier. + + Args: + collection (str): Collection to search for object. + obj_id (ObjectID|str): Record identifier returned earlier by insert + or insert_current. + + Returns: + dict|None: Object matching identifier or None. + """ + raise NotImplementedError + + @abc.abstractclassmethod + def clear_current(self, type): + """Clear the current record of a certain type + + Args: + type (str): The type of entry in the current collection that + should be cleared. + """ + raise NotImplementedError + ############################################################################### # MongoDB implementation diff --git a/utils/datamodel.py b/utils/datamodel.py index 847ea63..7c917be 100644 --- a/utils/datamodel.py +++ b/utils/datamodel.py @@ -1,7 +1,10 @@ from datetime import datetime from enum import Enum -from typing import List, Optional from pydantic import BaseModel +from sqlmodel import Field, Session, SQLModel, create_engine, select +from typing import List, Optional + +# TODO TN: https://sqlmodel.tiangolo.com/tutorial/fastapi/simple-hero-api/ class Sequence(BaseModel): id: str From 9739089ae285acde3a264dd37dde24ceba5caa21 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Fri, 15 Sep 2023 16:19:14 +0200 Subject: [PATCH 03/21] Adds info related to onstep --- infrastructure/onstep_info.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 infrastructure/onstep_info.txt diff --git a/infrastructure/onstep_info.txt b/infrastructure/onstep_info.txt new file mode 100644 index 0000000..df2cb9e --- /dev/null +++ b/infrastructure/onstep_info.txt @@ -0,0 +1,25 @@ +https://onstep.groups.io/g/main/wiki/26586#AXIS1 --> AXIS1_LIMIT_MIN et MAX et pareil pour AXIS2 + +AXIS1_LIMIT_MIN + + Default Value: -180 + Other Values: -90 to -270 or -360 (degrees) + Notes: Minimum Hour Angle for Equatorial Mount modes (to -270 degrees) or minimum Azimuth for AltAzm mode (to -360 degrees.) + Reminder: + To disable limits in Azimuth (unlimited range) set to -360 and also set AXIS1_LIMIT_MAX to 360. + During tracking and gotos if a limit is broken motion is stopped by canceling any goto and turning tracking off. Keep in mind that up to SLEW_RAPID_STOP_DIST (Config.h) distance should be allowed for to stop the motors/mount once the limit is detected. + +LIMIT_SENSE + + Default Value: OFF + Other Values: OFF, ON, ON_PULLUP, ON_PULLDOWN + Notes: Limit sense switches can be wired so several can be used where any switch change causes OnStep to stop tracking and slews (allowing for SLEW_RAPID_STOP_DIST.) This is most often implemented as a panic switch the user can press and/or lever switches on the mount axes. + Associated Options: + LIMIT_SENSE_STATE + Default Value: LOW + Other Values: LOW, HIGH + Notes: + Use LOW for NO (normally open) switches. If multiple switches of this type are used wired them in parallel. + Use HIGH for NC (normally closed) switches. If multiple switches of this type are used wired them in series. + Reminder: For my recent PCB designs this input DOES have a pullup resistor along with a bypass capacitor to provide basic ESD protection. + From e253ac665469430b0df41bcc0a6648623a7e87a9 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Tue, 16 Jan 2024 18:13:51 +0100 Subject: [PATCH 04/21] WIP --- conf_files/indi_driver_conf/Shelyak Spox_config.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf_files/indi_driver_conf/Shelyak Spox_config.xml b/conf_files/indi_driver_conf/Shelyak Spox_config.xml index efdb410..460a324 100644 --- a/conf_files/indi_driver_conf/Shelyak Spox_config.xml +++ b/conf_files/indi_driver_conf/Shelyak Spox_config.xml @@ -1,5 +1,5 @@ - + Off @@ -7,12 +7,12 @@ On - + 1000 - + On @@ -29,7 +29,7 @@ Off - + On @@ -46,7 +46,7 @@ Off - + On From 152208d6c35943813b87c5b222f43ba0450cec1a Mon Sep 17 00:00:00 2001 From: gnthibault Date: Tue, 16 Jan 2024 23:07:17 +0100 Subject: [PATCH 05/21] WIP docker --- docker/Dockerfile | 89 +++++++++++++++++++++++++++++ docker/build_images.sh | 123 ++++++++++++++++++++++++++++++++++++++++ docker/requirements.txt | 34 +++++++++++ 3 files changed, 246 insertions(+) create mode 100644 docker/Dockerfile create mode 100755 docker/build_images.sh create mode 100644 docker/requirements.txt diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..dcc5d9c --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,89 @@ +ARG BASE_IMAGE=ubuntu:24.04 +FROM ${BASE_IMAGE} + +# prevent keyboard related user input to be asked for +ENV DEBIAN_FRONTEND noninteractive +# Useless docker cache for pip +ENV PIP_NO_CACHE_DIR=1 + +RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommends \ + libcfitsio-dev \ + libnova-dev \ + libz3-dev \ + python3-pip \ + python3 \ + python3-dev \ + python3-numpy-dev \ + python3-six \ + software-properties-common \ + swig && \ + apt-get clean + +RUN apt-add-repository ppa:mutlaqja/ppa && apt-get --assume-yes --quiet install --no-install-recommends \ + gsc \ + libindi1 \ + indi-bin \ + kstars-bleeding + +RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no-install-recommends \ + phd2 + +# apt-transport-https \ +# bash-completion \ +# build-essential \ +# ca-certificates \ +# curl \ +# git \ +# gnupg \ +# libfreetype6-dev \ +# openssh-client \ +# software-properties-common \ +# astrometry-data-4208-4219\ +# extra-cmake-modules\ +# gpsd\ +# indi-full\ +# kdelibs5-dev\ +# kdoctools-dev\ +# kstars-bleeding\ +# libastrometry*\ +# libboost-dev\ +# libboost-regex-dev\ +# libcfitsio-dev\ +# libcurl4-openssl-dev\ +# libfftw3-dev\ +# libftdi-dev\ +# libftdi1-dev\ +# libgphoto2-dev\ +# libgps-dev\ +# libgraphviz-dev \ +# libgsl-dev\ +# libindi-dev\ +# libindi1\ +# libjpeg-dev\ +# libnova*\ +# libogg-dev\ +# libpython3-dev\ +# libqt5svg5-dev\ +# libqt5websockets5-dev\ +# libraw-dev\ +# librtlsdr-dev\ +# libtheora-dev\ +# libtiff-dev\ +# libusb-1.0-0-dev\ +# libwxgtk3.0-dev\ +# qttools5-dev-tools\ +# swig3.0\ +# wcslib-dev\ +# xplanet\ +# zlib1g-dev\ +# wget && \ + + +# Python stuff +COPY requirements.txt . +RUN pip install -r requirements.txt + +# Build with +# ./build_images.sh latest linux/amd64 +# launch with +# docker run --user $(id -u):$(id -g) -it --rm -v /main/machine/volume:/docker/mount/point --net host gnthibault/remote_observatory:latest diff --git a/docker/build_images.sh b/docker/build_images.sh new file mode 100755 index 0000000..e68b3a1 --- /dev/null +++ b/docker/build_images.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +DOCKER_URL_REPO="gnthibault" +DOCKER_BASE_IMAGE="ubuntu:24.04" +DOCKER_ARM64_BASE_IMAGE="arm64v8/ubuntu:24.04" + + +docker_clean() { + echo "-- DOCKER BUILD -- Now performs cleaning" + + # Now clean all exited containers + echo "-- (Cleaning exited containers)" + docker container prune --filter "until=24h" -f + #for docker_hash in $(docker ps --quiet --filter=status=exited); + #do + # docker rm -f $docker_hash + #done + + # Now clean all dangling images + echo "-- (Cleaning dangling image)" + docker image prune -a --filter "until=4h" -f + #for docker_hash in $(docker images --quiet --filter=unused=true); + #do + # docker rmi -f $docker_hash + #done + + # Now clean all dangling volume + echo "-- (Cleaning associated ressources (volumes, network)" + docker volume prune -f + docker network prune --filter "until=24h" -f + #for volume in $(docker volume ls -qf 'dangling=true'); + #do + # docker volume rm $volume + #done +} + +docker_tag() { + #$1 is the image name + #$2 is the actual tag + echo "--docker tag $1:$2 $DOCKER_URL_REPO/$1:$2" + docker tag $1:$2 $DOCKER_URL_REPO/$1:$2 +} + +docker_push() { + #$1 is the image name + #$2 is the actual tag + echo "--docker push $DOCKER_URL_REPO/$1:$2" + docker push $DOCKER_URL_REPO/$1:$2 +} + +docker_build () { + #$1 the image name + #$2 the directory where Dockerfile is located + #$3 the tag + #"$4": the docker build options, note the "" are importants + IMAGE_NAME=$1:$3 + #remove leading and trailing double quote + PARAMETERS=$(sed -e 's/^"//' -e 's/"$//' <<<"$4") + PARAMETERS="$PARAMETERS --no-cache=true" + echo "--docker build $PARAMETERS -t $IMAGE_NAME $2" + docker build $PARAMETERS -t $IMAGE_NAME $2 # 2>&1 >/dev/null +} + +process_build() { + #$1 the image name + #$2 is the target ARCH parameter + #$3 the (git) tag to be checked out and embedded in the image + + # define path and image name + NAME=$1 + TAG=$2 + TARGET_ARCH=$3 + + # Specify CPU/GPU related build parameters + if [ TARGET_ARCH = "linux/arm64" ] + then + DOCKER_BASE_IMAGE=$DOCKER_ARM64_BASE_IMAGE + else + DOCKER_BASE_IMAGE=$DOCKER_BASE_IMAGE + fi + + # Now build the actual production image + echo "-- DOCKER BUILD -- Now building image" + # Takes at input, the tag ($1) and directory ($2) whether it should embed + # a copy of the codebase $3 + docker_build $NAME . $TAG \ + "\"--build-arg BASE_IMAGE=$DOCKER_BASE_IMAGE\ + --build-arg PYTHON_REQ=PYTHON_REQ_FILE\ + --platform $TARGET_ARCH\"" + + # tag the freshly generated image + docker_tag $NAME $TAG + #push the tagged image to our repo + docker_push $NAME $TAG + + + production_builder $NAME . $TARGET_ARCH + echo "-- DOCKER BUILD -- Finished building image" + + +} + +# Main script +if [[ -n "$1" ]]; then + img_name="remote_observatory" + image_tag=$1 +else + echo "Missing argument 1, please specify either a tag or latest" + exit +fi + +if [[ -n "$2" ]]; then + target_arch=$2 +else + echo "Missing argument 2, please specify either linux/amd64 or linux/arm64" + exit +fi + +#Make sure the script fails if one non zero error code is returned +set -e + +# Perform actual work +process_build $img_name $image_tag $target_arch \ No newline at end of file diff --git a/docker/requirements.txt b/docker/requirements.txt new file mode 100644 index 0000000..4e42d84 --- /dev/null +++ b/docker/requirements.txt @@ -0,0 +1,34 @@ +astroalign==2.4.2 +astroplan==0.9 +astropy==5.3.2 +astroquery==0.4.6 +erdantic==0.6.0 +influxdb-client==1.37.0 +gcn-kafka==0.3.0 +graphviz==0.20.1 +lxml==4.9.1 +ntplib==0.3.4 +matplotlib==3.7.2 +meshcat==0.3.2 +numpy==1.22.0 +opencv-python==4.8.0.76 +photutils==1.9.0 +pyaml==20.4.0 +pydantic==2.2.1 +pydantic-core==2.6.1 +pygraphviz==1.6 +pyindi-client== +PyLaTeX==1.3.2 +pymongo==3.11.3 +paho-mqtt==1.6.1 +#pyserial==3.4 +pytz==2021.3 +pyzmq==25.1.0 +requests==2.31.0 +rinohtype==0.3.1 +sep==1.2.1 +#serial==0.0.97 +Sphinx==1.8.1 +transitions==0.7.1 +tzwhere==3.0.3 +watchdog==0.8.3 \ No newline at end of file From 6dc28e0f4e7fa397260fdfb87dbe60cc1c52fe9b Mon Sep 17 00:00:00 2001 From: gnthibault Date: Fri, 19 Jan 2024 00:19:18 +0100 Subject: [PATCH 06/21] Fixed issue with pyenv config in docker --- README.md | 7 +++ docker/Dockerfile | 104 ++++++++++++++++++++++++++++++++--------- docker/build_images.sh | 18 ++++--- 3 files changed, 100 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 608feb5..f0ce16a 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,13 @@ sudo apt-get install \ pip install -r requirements.txt ``` +## Build and use docker for development (for macos dev for instance) + +```console + cd ./docker + ./build_images.sh latest linux/amd64 +``` + ## Building the nice reporting / latex reports ```bash sudo apt-get update diff --git a/docker/Dockerfile b/docker/Dockerfile index dcc5d9c..5dc4d2d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,30 +3,93 @@ FROM ${BASE_IMAGE} # prevent keyboard related user input to be asked for ENV DEBIAN_FRONTEND noninteractive + # Useless docker cache for pip ENV PIP_NO_CACHE_DIR=1 +# Generic install / utilities RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommends \ - libcfitsio-dev \ - libnova-dev \ - libz3-dev \ - python3-pip \ - python3 \ - python3-dev \ - python3-numpy-dev \ - python3-six \ - software-properties-common \ - swig && \ - apt-get clean + git \ + libz3-dev \ + python3 \ + python3-dev \ + python3-numpy-dev \ + python3-pip \ + python3-six \ + software-properties-common \ + vim && \ + apt-get clean + +# pyenv dependencies +RUN apt-get --assume-yes --quiet install --no-install-recommends \ + build-essential \ + curl \ + libbz2-dev \ + libffi-dev \ + liblzma-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + llvm \ + make \ + python3-openssl \ + tk-dev \ + wget \ + xz-utils \ + zlib1g-dev + +## Indi dependencies for pre-packages binaries +#RUN apt-add-repository ppa:mutlaqja/ppa && apt-get --assume-yes --quiet install --no-install-recommends \ +# gsc \ +# libcfitsio-dev \ +# libnova-dev \ +# libindi1 \ +# indi-bin \ +# kstars-bleeding \ +# swig +# +## OpenPhd2 might later be replaced by a fork from @gnthibault +#RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no-install-recommends \ +# phd2 +# +## Dependencies for nice reporting / latex reports +#RUN apt-get --assume-yes --quiet install --no-install-recommends \ +# texlive-latex-recommended \ +# texlive-publishers \ +# texlive-bibtex-extra \ +# texlive-science + +# Using bash for lower level scripting from now-on +SHELL ["/bin/bash", "-l", "-c"] +RUN echo 'export PS1="\u@\h \w> "' | cat - /root/.profile > temp && mv temp /root/.profile + +# Python environment +RUN curl https://pyenv.run | bash +RUN echo 'export PYENV_ROOT=/root/.pyenv' >> /root/.bashrc +RUN echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> /root/.bashrc +RUN echo 'eval "$(pyenv init -)"' >> /root/.bashrc +RUN pyenv install -v 3.11.7 +RUN pyenv global 3.11.7 + +# Python virtual environment +ENV VIRTUAL_ENV=/opt/obs_venv +RUN source /root/.bashrc && python -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" -RUN apt-add-repository ppa:mutlaqja/ppa && apt-get --assume-yes --quiet install --no-install-recommends \ - gsc \ - libindi1 \ - indi-bin \ - kstars-bleeding +# Python packages +COPY requirements.txt . +RUN pip install -r requirements.txt + +# Indi webmanager for dev +#COPY requirements.txt . +#RUN pip install indiweb +#RUN cp indiwebmanager.service /etc/systemd/system/ +#RUN chmod 644 /etc/systemd/system/indiwebmanager.service +#RUN systemctl daemon-reload +#RUN systemctl enable indiwebmanager.service -RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no-install-recommends \ - phd2 # apt-transport-https \ # bash-completion \ @@ -41,7 +104,6 @@ RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no # astrometry-data-4208-4219\ # extra-cmake-modules\ # gpsd\ -# indi-full\ # kdelibs5-dev\ # kdoctools-dev\ # kstars-bleeding\ @@ -79,10 +141,6 @@ RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no # wget && \ -# Python stuff -COPY requirements.txt . -RUN pip install -r requirements.txt - # Build with # ./build_images.sh latest linux/amd64 # launch with diff --git a/docker/build_images.sh b/docker/build_images.sh index e68b3a1..0ce2ade 100755 --- a/docker/build_images.sh +++ b/docker/build_images.sh @@ -39,6 +39,8 @@ docker_tag() { #$2 is the actual tag echo "--docker tag $1:$2 $DOCKER_URL_REPO/$1:$2" docker tag $1:$2 $DOCKER_URL_REPO/$1:$2 + # For local kaniko please check https://github.com/GoogleContainerTools/kaniko?tab=readme-ov-file#running-kaniko-in-docker + # kaniko --dockerfile=Dockerfile --context=/path/to/build/context --destination=my-registry.com/my-image:latest } docker_push() { @@ -46,6 +48,8 @@ docker_push() { #$2 is the actual tag echo "--docker push $DOCKER_URL_REPO/$1:$2" docker push $DOCKER_URL_REPO/$1:$2 + # For local kaniko please check https://github.com/GoogleContainerTools/kaniko?tab=readme-ov-file#running-kaniko-in-docker + # kaniko --dockerfile=Dockerfile --context=/path/to/build/context --destination=my-registry.com/my-image:latest --push } docker_build () { @@ -58,7 +62,11 @@ docker_build () { PARAMETERS=$(sed -e 's/^"//' -e 's/"$//' <<<"$4") PARAMETERS="$PARAMETERS --no-cache=true" echo "--docker build $PARAMETERS -t $IMAGE_NAME $2" - docker build $PARAMETERS -t $IMAGE_NAME $2 # 2>&1 >/dev/null + # Use --progress=plain for debugging purpose + docker build --progress=plain $PARAMETERS -t $IMAGE_NAME $2 # 2>&1 >/dev/null + # For local kaniko please check https://github.com/GoogleContainerTools/kaniko?tab=readme-ov-file#running-kaniko-in-docker + # kaniko --dockerfile=Dockerfile --context=/path/to/build/context --destination=my-image:latest --build-arg KEY=VALUE + # you might want to use "--tar-path $APP_NAME.tar --no-push" and then use crane to push to remote } process_build() { @@ -89,12 +97,10 @@ process_build() { --platform $TARGET_ARCH\"" # tag the freshly generated image - docker_tag $NAME $TAG - #push the tagged image to our repo - docker_push $NAME $TAG + # docker_tag $NAME $TAG + # push the tagged image to the repo + # docker_push $NAME $TAG - - production_builder $NAME . $TARGET_ARCH echo "-- DOCKER BUILD -- Finished building image" From d269b772c07730a066e8c0e7690331b09062d8c8 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Fri, 19 Jan 2024 07:53:36 +0100 Subject: [PATCH 07/21] Embeds code inside docker --- .gitignore | 1 + docker/Dockerfile | 8 ++++++-- docker/build_images.sh | 12 ++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ff4d5d0..01d6def 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ __pycache__ *.svg *.swo *.swp +*.tar.gz **/build diff --git a/docker/Dockerfile b/docker/Dockerfile index 5dc4d2d..40c0ff5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -74,9 +74,10 @@ RUN pyenv install -v 3.11.7 RUN pyenv global 3.11.7 # Python virtual environment -ENV VIRTUAL_ENV=/opt/obs_venv -RUN source /root/.bashrc && python -m venv $VIRTUAL_ENV +ENV VIRTUAL_ENV=/opt/remote_observatory_venv +RUN python -m venv $VIRTUAL_ENV ENV PATH="$VIRTUAL_ENV/bin:$PATH" +RUN echo 'source /opt/remote_observatory_venv/bin/activate' >> /root/.bashrc # Python packages COPY requirements.txt . @@ -140,6 +141,9 @@ RUN pip install -r requirements.txt # zlib1g-dev\ # wget && \ +# Actual application code +ADD code.tar.gz /opt/remote_observatory + # Build with # ./build_images.sh latest linux/amd64 diff --git a/docker/build_images.sh b/docker/build_images.sh index 0ce2ade..e528541 100755 --- a/docker/build_images.sh +++ b/docker/build_images.sh @@ -1,5 +1,7 @@ #!/bin/bash +DOCKER_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +MAIN_REPO_DIR="$DOCKER_DIR/.." DOCKER_URL_REPO="gnthibault" DOCKER_BASE_IMAGE="ubuntu:24.04" DOCKER_ARM64_BASE_IMAGE="arm64v8/ubuntu:24.04" @@ -87,6 +89,14 @@ process_build() { DOCKER_BASE_IMAGE=$DOCKER_BASE_IMAGE fi + #Build a tar out of the code repo + tar --directory $MAIN_REPO_DIR \ + -cvzf $DOCKER_DIR/code.tar.gz \ + --exclude "*.log"\ + --exclude "*.tar.gz" \ + --exclude "*.zip" \ + --exclude "*.pyc" . + # Now build the actual production image echo "-- DOCKER BUILD -- Now building image" # Takes at input, the tag ($1) and directory ($2) whether it should embed @@ -102,8 +112,6 @@ process_build() { # docker_push $NAME $TAG echo "-- DOCKER BUILD -- Finished building image" - - } # Main script From 249c972c99e18c670a1ac248b49f9086086683e4 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Fri, 9 Feb 2024 10:00:16 +0100 Subject: [PATCH 08/21] Working on docker image --- docker/Dockerfile | 173 +++++++++++++++++++++++++++------------- docker/requirements.txt | 1 - 2 files changed, 117 insertions(+), 57 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 40c0ff5..57fe47f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,8 +7,15 @@ ENV DEBIAN_FRONTEND noninteractive # Useless docker cache for pip ENV PIP_NO_CACHE_DIR=1 -# Generic install / utilities +# Versioning +ENV INDI_VERSION=v2.0.6 +ENV PYINDI_VERSION=v1.9.1 +ENV INDI_3RD_PARTY_VERSION=v2.0.6 + + +# Generic install / utilities / dev RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommends \ + cmake \ git \ libz3-dev \ python3 \ @@ -49,11 +56,106 @@ RUN apt-get --assume-yes --quiet install --no-install-recommends \ # indi-bin \ # kstars-bleeding \ # swig -# -## OpenPhd2 might later be replaced by a fork from @gnthibault + +# Dependencies to build indi from sources + pyindi-client that is linked with binaries through swig +RUN apt-get --assume-yes --quiet install --no-install-recommends \ + astrometry.net \ + cdbs \ + dkms \ + fxload \ + libboost-regex-dev \ + libcfitsio-dev \ + libcurl4-gnutls-dev \ + libdc1394-dev \ + libev-dev \ + libfftw3-dev \ + libftdi-dev \ + libftdi1-dev \ + libgps-dev \ + libgsl0-dev \ + libjpeg-dev \ + libkrb5-dev \ + libnova-dev \ + libraw-dev \ + libtiff5-dev \ + libusb-1.0-0-dev \ + libusb-dev \ + swig + +# Build indi from sources +RUN mkdir -p $HOME/projects \ + && cd $HOME/projects \ + && git clone https://github.com/indilib/indi.git \ + && cd $HOME/projects/indi \ + && git checkout $INDI_VERSION \ + && cd $HOME/projects \ + && mkdir -p build/libindi \ + && cd build/libindi \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi \ + && make -j8 \ + && sudo make install + +## Additional dependencies with indi-3rd party \ +RUN mkdir -p $HOME/projects \ + && cd $HOME/projects \ + && git clone https://github.com/indilib/indi-3rdparty.git \ + && git checkout $INDI_3RD_PARTY_VERSION + +# indi-duino +RUN cd $HOME/projects \ + mkdir -p build/indi-duino \ + cd build/indi-duino \ + cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-duino \ + make -j8 \ + sudo make install + +# indi-asi +RUN cd $HOME/projects \ + mkdir -p build/indi-asi \ + cd build/indi-asi \ + cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-asi \ + make -j8 \ + sudo make install + +#indi-playerone +RUN cd $HOME/projects \ + mkdir -p build/indi-playerone \ + cd build/indi-playerone \ + cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-playerone \ + make -j8 \ + sudo make install + +#indi-shelyak +RUN cd $HOME/projects \ + mkdir -p build/indi-shelyak \ + cd build/indi-shelyak \ + cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-shelyak \ + make -j8 \ + sudo make install + +#libaltaircam +RUN cd $HOME/projects \ + mkdir -p build/libaltaircam \ + cd build/libaltaircam \ + cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libaltaircam \ + make -j8 \ + sudo make install + + +## OpenPhd2 might later be replaced by the original source ? #RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no-install-recommends \ # phd2 # +RUN mkdir -p $HOME/projects \ + && cd $HOME/projects \ + && git clone https://github.com/gnthibault/phd2.git \ + && mkdir -p build/phd2 \ + cd build/phd2 \ + cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/phd2 \ + make -j8 \ + sudo make install + + ## Dependencies for nice reporting / latex reports #RUN apt-get --assume-yes --quiet install --no-install-recommends \ # texlive-latex-recommended \ @@ -65,6 +167,9 @@ RUN apt-get --assume-yes --quiet install --no-install-recommends \ SHELL ["/bin/bash", "-l", "-c"] RUN echo 'export PS1="\u@\h \w> "' | cat - /root/.profile > temp && mv temp /root/.profile +# Actual application code and configs +ADD code.tar.gz /opt/remote_observatory + # Python environment RUN curl https://pyenv.run | bash RUN echo 'export PYENV_ROOT=/root/.pyenv' >> /root/.bashrc @@ -83,8 +188,16 @@ RUN echo 'source /opt/remote_observatory_venv/bin/activate' >> /root/.bashrc COPY requirements.txt . RUN pip install -r requirements.txt +# Build and install pyindi-client +RUN mkdir -p $HOME/projects \ + && cd $HOME/projects \ + && git clone https://github.com/indilib/pyindi-client.git \ + && cd $HOME/projects/pyindi-client \ + && git checkout PYINDI_VERSION \ + && pip install -e . + + # Indi webmanager for dev -#COPY requirements.txt . #RUN pip install indiweb #RUN cp indiwebmanager.service /etc/systemd/system/ #RUN chmod 644 /etc/systemd/system/indiwebmanager.service @@ -92,58 +205,6 @@ RUN pip install -r requirements.txt #RUN systemctl enable indiwebmanager.service -# apt-transport-https \ -# bash-completion \ -# build-essential \ -# ca-certificates \ -# curl \ -# git \ -# gnupg \ -# libfreetype6-dev \ -# openssh-client \ -# software-properties-common \ -# astrometry-data-4208-4219\ -# extra-cmake-modules\ -# gpsd\ -# kdelibs5-dev\ -# kdoctools-dev\ -# kstars-bleeding\ -# libastrometry*\ -# libboost-dev\ -# libboost-regex-dev\ -# libcfitsio-dev\ -# libcurl4-openssl-dev\ -# libfftw3-dev\ -# libftdi-dev\ -# libftdi1-dev\ -# libgphoto2-dev\ -# libgps-dev\ -# libgraphviz-dev \ -# libgsl-dev\ -# libindi-dev\ -# libindi1\ -# libjpeg-dev\ -# libnova*\ -# libogg-dev\ -# libpython3-dev\ -# libqt5svg5-dev\ -# libqt5websockets5-dev\ -# libraw-dev\ -# librtlsdr-dev\ -# libtheora-dev\ -# libtiff-dev\ -# libusb-1.0-0-dev\ -# libwxgtk3.0-dev\ -# qttools5-dev-tools\ -# swig3.0\ -# wcslib-dev\ -# xplanet\ -# zlib1g-dev\ -# wget && \ - -# Actual application code -ADD code.tar.gz /opt/remote_observatory - # Build with # ./build_images.sh latest linux/amd64 diff --git a/docker/requirements.txt b/docker/requirements.txt index 4e42d84..fb3aaf0 100644 --- a/docker/requirements.txt +++ b/docker/requirements.txt @@ -17,7 +17,6 @@ pyaml==20.4.0 pydantic==2.2.1 pydantic-core==2.6.1 pygraphviz==1.6 -pyindi-client== PyLaTeX==1.3.2 pymongo==3.11.3 paho-mqtt==1.6.1 From 00973aa40fab3956431dcfc312a2ae634a4a7e6c Mon Sep 17 00:00:00 2001 From: gnthibault Date: Fri, 17 May 2024 11:53:52 +0200 Subject: [PATCH 09/21] WIP --- docker/Dockerfile | 81 +++++++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 57fe47f..ce8d40f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,6 +15,7 @@ ENV INDI_3RD_PARTY_VERSION=v2.0.6 # Generic install / utilities / dev RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommends \ + build-essential \ cmake \ git \ libz3-dev \ @@ -89,13 +90,37 @@ RUN mkdir -p $HOME/projects \ && cd $HOME/projects/indi \ && git checkout $INDI_VERSION \ && cd $HOME/projects \ - && mkdir -p build/libindi \ - && cd build/libindi \ + && mkdir -p build/indi \ + && cd build/indi \ && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi \ && make -j8 \ - && sudo make install + && make install -## Additional dependencies with indi-3rd party \ +# Dependencies to build indi-3rd party from sources +RUN apt-get --assume-yes --quiet install --no-install-recommends \ + libnova-dev \ + libcfitsio-dev \ + libusb-1.0-0-dev \ + zlib1g-dev \ + libgsl-dev \ + libjpeg-dev \ + libcurl4-gnutls-dev \ + libtiff-dev \ + libftdi-dev \ + libraw-dev \ + libdc1394-dev \ + libgphoto2-dev \ + libboost-dev \ + libboost-regex-dev \ + librtlsdr-dev \ + liblimesuite-dev \ + libftdi1-dev \ + libgps-dev \ + libavcodec-dev \ + libavdevice-dev \ + libzmq3-dev + +## Additional dependencies with indi-3rd party - clone the whole thing RUN mkdir -p $HOME/projects \ && cd $HOME/projects \ && git clone https://github.com/indilib/indi-3rdparty.git \ @@ -104,42 +129,42 @@ RUN mkdir -p $HOME/projects \ # indi-duino RUN cd $HOME/projects \ mkdir -p build/indi-duino \ - cd build/indi-duino \ - cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-duino \ - make -j8 \ - sudo make install + && cd build/indi-duino \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-duino \ + && make -j8 \ + && make install # indi-asi RUN cd $HOME/projects \ mkdir -p build/indi-asi \ - cd build/indi-asi \ - cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-asi \ - make -j8 \ - sudo make install + && cd build/indi-asi \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-asi \ + && make -j8 \ + && make install #indi-playerone RUN cd $HOME/projects \ mkdir -p build/indi-playerone \ - cd build/indi-playerone \ - cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-playerone \ - make -j8 \ - sudo make install + && cd build/indi-playerone \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-playerone \ + && make -j8 \ + && make install #indi-shelyak RUN cd $HOME/projects \ mkdir -p build/indi-shelyak \ - cd build/indi-shelyak \ - cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-shelyak \ - make -j8 \ - sudo make install + && cd build/indi-shelyak \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-shelyak \ + && make -j8 \ + && make install #libaltaircam RUN cd $HOME/projects \ mkdir -p build/libaltaircam \ - cd build/libaltaircam \ - cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libaltaircam \ - make -j8 \ - sudo make install + && cd build/libaltaircam \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libaltaircam \ + && make -j8 \ + && make install ## OpenPhd2 might later be replaced by the original source ? @@ -150,10 +175,10 @@ RUN mkdir -p $HOME/projects \ && cd $HOME/projects \ && git clone https://github.com/gnthibault/phd2.git \ && mkdir -p build/phd2 \ - cd build/phd2 \ - cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/phd2 \ - make -j8 \ - sudo make install + && cd build/phd2 \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/phd2 \ + && make -j8 \ + && make install ## Dependencies for nice reporting / latex reports From 95e8f67dd5111740311ca4217371598996b4b53a Mon Sep 17 00:00:00 2001 From: gnthibault Date: Thu, 13 Jun 2024 08:18:44 +0000 Subject: [PATCH 10/21] WIP --- docker/Dockerfile | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ce8d40f..267597c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,15 +8,16 @@ ENV DEBIAN_FRONTEND noninteractive ENV PIP_NO_CACHE_DIR=1 # Versioning -ENV INDI_VERSION=v2.0.6 +ENV INDI_VERSION=v2.0.8 ENV PYINDI_VERSION=v1.9.1 -ENV INDI_3RD_PARTY_VERSION=v2.0.6 - +ENV INDI_3RD_PARTY_VERSION=v2.0.8 +ENV PYTHON_VERSION=3.12.3 # Generic install / utilities / dev RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommends \ build-essential \ cmake \ + gettext \ git \ libz3-dev \ python3 \ @@ -126,6 +127,8 @@ RUN mkdir -p $HOME/projects \ && git clone https://github.com/indilib/indi-3rdparty.git \ && git checkout $INDI_3RD_PARTY_VERSION +#for i in $(ls); do cd $i; export name=$(basename $(pwd)); cmake -DCMAKE_INSTALL_PREFIX=/usr ../../../indi-3rdparty/$name; make -j4; sudo make install; cd ..; done + # indi-duino RUN cd $HOME/projects \ mkdir -p build/indi-duino \ @@ -134,6 +137,14 @@ RUN cd $HOME/projects \ && make -j8 \ && make install +# libasi +RUN cd $HOME/projects \ + mkdir -p build/libasi \ + && cd build/libasi \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libasi \ + && make -j8 \ + && make install + # indi-asi RUN cd $HOME/projects \ mkdir -p build/indi-asi \ @@ -142,6 +153,14 @@ RUN cd $HOME/projects \ && make -j8 \ && make install +# libplayerone +RUN cd $HOME/projects \ + mkdir -p build/libplayerone \ + && cd build/libplayerone \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libplayerone \ + && make -j8 \ + && make install + #indi-playerone RUN cd $HOME/projects \ mkdir -p build/indi-playerone \ @@ -170,7 +189,11 @@ RUN cd $HOME/projects \ ## OpenPhd2 might later be replaced by the original source ? #RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no-install-recommends \ # phd2 -# + +# Dependencies to build phd2 from sources +RUN apt-get --assume-yes --quiet install --no-install-recommends \ + libwxgtk3.2-dev + RUN mkdir -p $HOME/projects \ && cd $HOME/projects \ && git clone https://github.com/gnthibault/phd2.git \ @@ -200,8 +223,8 @@ RUN curl https://pyenv.run | bash RUN echo 'export PYENV_ROOT=/root/.pyenv' >> /root/.bashrc RUN echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> /root/.bashrc RUN echo 'eval "$(pyenv init -)"' >> /root/.bashrc -RUN pyenv install -v 3.11.7 -RUN pyenv global 3.11.7 +RUN pyenv install -v $PYTHON_VERSION +RUN pyenv global $PYTHON_VERSION # Python virtual environment ENV VIRTUAL_ENV=/opt/remote_observatory_venv @@ -218,7 +241,7 @@ RUN mkdir -p $HOME/projects \ && cd $HOME/projects \ && git clone https://github.com/indilib/pyindi-client.git \ && cd $HOME/projects/pyindi-client \ - && git checkout PYINDI_VERSION \ + && git checkout $PYINDI_VERSION \ && pip install -e . From 36fbe526d263296b541158a78f619cd74cedd5e4 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Thu, 13 Jun 2024 09:13:05 +0000 Subject: [PATCH 11/21] WIP --- docker/Dockerfile | 13 +++++++++++++ requirements.txt | 11 ++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 267597c..5254b6c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -253,6 +253,19 @@ RUN mkdir -p $HOME/projects \ #RUN systemctl enable indiwebmanager.service +# # Add Docker's official GPG key: +# sudo apt-get update +# sudo apt-get install ca-certificates curl +# sudo install -m 0755 -d /etc/apt/keyrings +# sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc +# sudo chmod a+r /etc/apt/keyrings/docker.asc + +# # Add the repository to Apt sources: +# echo \ +# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ +# $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ +# sudo tee /etc/apt/sources.list.d/docker.list > /dev/null +# sudo apt-get update && sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Build with # ./build_images.sh latest linux/amd64 diff --git a/requirements.txt b/requirements.txt index c22644b..127ecfa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,23 +1,23 @@ astroalign==2.4.2 astroplan==0.9 -astropy==5.3.2 +astropy==6.1.0 astroquery==0.4.6 erdantic==0.6.0 influxdb-client==1.37.0 gcn-kafka==0.3.0 graphviz==0.20.1 -lxml==4.9.1 +lxml==5.2.2 ntplib==0.3.4 matplotlib==3.7.2 meshcat==0.3.2 -numpy==1.22.0 +numpy==1.26.4 opencv-python==4.8.0.76 photutils==1.9.0 pyaml==20.4.0 pydantic==2.2.1 pydantic-core==2.6.1 #pygraphviz==1.6 -PyLaTeX==1.3.2 +PyLaTeX==1.4.2 pymongo==3.11.3 paho-mqtt==1.6.1 #pyserial==3.4 @@ -27,7 +27,8 @@ requests==2.31.0 rinohtype==0.3.1 sep==1.2.1 #serial==0.0.97 +setuptools==70.0.0 Sphinx==1.8.1 transitions==0.7.1 tzwhere==3.0.3 -watchdog==0.8.3 +watchdog==4.0.1 \ No newline at end of file From a2df4591bb363e990177ba22532f1776106db8f6 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Thu, 13 Jun 2024 10:03:13 +0000 Subject: [PATCH 12/21] WIP --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5254b6c..5c4e5a5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,6 +19,7 @@ RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommen cmake \ gettext \ git \ + libgraphviz-dev \ libz3-dev \ python3 \ python3-dev \ From 0c8067471de1786762558ea8f33b8a62eec713c3 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sat, 10 Aug 2024 18:43:08 +0200 Subject: [PATCH 13/21] WIP --- ScopeSimulator/data/bsc5.dat.gz | Bin apps/Arduino/configure_tty.sh | 0 apps/Arduino/upload.sh | 0 apps/indi_lemarchand_box.sh | 0 apps/launch_PAWS.sh | 0 apps/launch_arduino_capture.py | 0 apps/launch_backyard_conf.sh | 0 apps/launch_indi_ASI120MC_alone.sh | 0 apps/launch_indi_aag.sh | 0 apps/launch_indi_eqmod_simu.sh | 0 apps/launch_indi_gemini2_alone.sh | 0 apps/launch_indi_gemini_asi.sh | 0 apps/launch_indi_gemini_canon.sh | 0 apps/launch_indi_scope_controller_debug.sh | 0 apps/launch_indi_simu.sh | 0 apps/launch_indi_ticfocus.sh | 0 apps/launch_weather_capture.py | 0 apps/plot_weather.py | 0 apps/prototyping/Solvercpp/build.sh | 0 apps/prototyping/messaging/listen_mqtt.sh | 0 apps/prototyping/messaging/send_mqtt.sh | 0 .../influxdb-remoteobservatory/config/config.yml | 0 .../mosquitto-remoteobservatory/mosquitto.conf | 0 .../telegraf-remoteobservatory/telegraf.conf | 0 docker/build_images.sh | 0 documentation/old_dataset_exploration/script.sh | 0 scripts/Aladin.jar | Bin scripts/solve_field.sh | 0 28 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 ScopeSimulator/data/bsc5.dat.gz mode change 100755 => 100644 apps/Arduino/configure_tty.sh mode change 100755 => 100644 apps/Arduino/upload.sh mode change 100755 => 100644 apps/indi_lemarchand_box.sh mode change 100755 => 100644 apps/launch_PAWS.sh mode change 100755 => 100644 apps/launch_arduino_capture.py mode change 100755 => 100644 apps/launch_backyard_conf.sh mode change 100755 => 100644 apps/launch_indi_ASI120MC_alone.sh mode change 100755 => 100644 apps/launch_indi_aag.sh mode change 100755 => 100644 apps/launch_indi_eqmod_simu.sh mode change 100755 => 100644 apps/launch_indi_gemini2_alone.sh mode change 100755 => 100644 apps/launch_indi_gemini_asi.sh mode change 100755 => 100644 apps/launch_indi_gemini_canon.sh mode change 100755 => 100644 apps/launch_indi_scope_controller_debug.sh mode change 100755 => 100644 apps/launch_indi_simu.sh mode change 100755 => 100644 apps/launch_indi_ticfocus.sh mode change 100755 => 100644 apps/launch_weather_capture.py mode change 100755 => 100644 apps/plot_weather.py mode change 100755 => 100644 apps/prototyping/Solvercpp/build.sh mode change 100755 => 100644 apps/prototyping/messaging/listen_mqtt.sh mode change 100755 => 100644 apps/prototyping/messaging/send_mqtt.sh mode change 100755 => 100644 conf_files/dockers/influxdb-remoteobservatory/config/config.yml mode change 100755 => 100644 conf_files/dockers/mosquitto-remoteobservatory/mosquitto.conf mode change 100755 => 100644 conf_files/dockers/telegraf-remoteobservatory/telegraf.conf mode change 100755 => 100644 docker/build_images.sh mode change 100755 => 100644 documentation/old_dataset_exploration/script.sh mode change 100755 => 100644 scripts/Aladin.jar mode change 100755 => 100644 scripts/solve_field.sh diff --git a/ScopeSimulator/data/bsc5.dat.gz b/ScopeSimulator/data/bsc5.dat.gz old mode 100755 new mode 100644 diff --git a/apps/Arduino/configure_tty.sh b/apps/Arduino/configure_tty.sh old mode 100755 new mode 100644 diff --git a/apps/Arduino/upload.sh b/apps/Arduino/upload.sh old mode 100755 new mode 100644 diff --git a/apps/indi_lemarchand_box.sh b/apps/indi_lemarchand_box.sh old mode 100755 new mode 100644 diff --git a/apps/launch_PAWS.sh b/apps/launch_PAWS.sh old mode 100755 new mode 100644 diff --git a/apps/launch_arduino_capture.py b/apps/launch_arduino_capture.py old mode 100755 new mode 100644 diff --git a/apps/launch_backyard_conf.sh b/apps/launch_backyard_conf.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_ASI120MC_alone.sh b/apps/launch_indi_ASI120MC_alone.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_aag.sh b/apps/launch_indi_aag.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_eqmod_simu.sh b/apps/launch_indi_eqmod_simu.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_gemini2_alone.sh b/apps/launch_indi_gemini2_alone.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_gemini_asi.sh b/apps/launch_indi_gemini_asi.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_gemini_canon.sh b/apps/launch_indi_gemini_canon.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_scope_controller_debug.sh b/apps/launch_indi_scope_controller_debug.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_simu.sh b/apps/launch_indi_simu.sh old mode 100755 new mode 100644 diff --git a/apps/launch_indi_ticfocus.sh b/apps/launch_indi_ticfocus.sh old mode 100755 new mode 100644 diff --git a/apps/launch_weather_capture.py b/apps/launch_weather_capture.py old mode 100755 new mode 100644 diff --git a/apps/plot_weather.py b/apps/plot_weather.py old mode 100755 new mode 100644 diff --git a/apps/prototyping/Solvercpp/build.sh b/apps/prototyping/Solvercpp/build.sh old mode 100755 new mode 100644 diff --git a/apps/prototyping/messaging/listen_mqtt.sh b/apps/prototyping/messaging/listen_mqtt.sh old mode 100755 new mode 100644 diff --git a/apps/prototyping/messaging/send_mqtt.sh b/apps/prototyping/messaging/send_mqtt.sh old mode 100755 new mode 100644 diff --git a/conf_files/dockers/influxdb-remoteobservatory/config/config.yml b/conf_files/dockers/influxdb-remoteobservatory/config/config.yml old mode 100755 new mode 100644 diff --git a/conf_files/dockers/mosquitto-remoteobservatory/mosquitto.conf b/conf_files/dockers/mosquitto-remoteobservatory/mosquitto.conf old mode 100755 new mode 100644 diff --git a/conf_files/dockers/telegraf-remoteobservatory/telegraf.conf b/conf_files/dockers/telegraf-remoteobservatory/telegraf.conf old mode 100755 new mode 100644 diff --git a/docker/build_images.sh b/docker/build_images.sh old mode 100755 new mode 100644 diff --git a/documentation/old_dataset_exploration/script.sh b/documentation/old_dataset_exploration/script.sh old mode 100755 new mode 100644 diff --git a/scripts/Aladin.jar b/scripts/Aladin.jar old mode 100755 new mode 100644 diff --git a/scripts/solve_field.sh b/scripts/solve_field.sh old mode 100755 new mode 100644 From 6b38aed6bcf686a2a2fd51139f8e7321ab20964f Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sat, 10 Aug 2024 19:42:46 +0200 Subject: [PATCH 14/21] WIP --- docker/Dockerfile | 4 ++-- docker/build_images.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 docker/build_images.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 5c4e5a5..5f79891 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -122,10 +122,11 @@ RUN apt-get --assume-yes --quiet install --no-install-recommends \ libavdevice-dev \ libzmq3-dev -## Additional dependencies with indi-3rd party - clone the whole thing +# Additional dependencies with indi-3rd party - clone the whole thing RUN mkdir -p $HOME/projects \ && cd $HOME/projects \ && git clone https://github.com/indilib/indi-3rdparty.git \ + && cd $HOME/projects/indi-3rdparty \ && git checkout $INDI_3RD_PARTY_VERSION #for i in $(ls); do cd $i; export name=$(basename $(pwd)); cmake -DCMAKE_INSTALL_PREFIX=/usr ../../../indi-3rdparty/$name; make -j4; sudo make install; cd ..; done @@ -204,7 +205,6 @@ RUN mkdir -p $HOME/projects \ && make -j8 \ && make install - ## Dependencies for nice reporting / latex reports #RUN apt-get --assume-yes --quiet install --no-install-recommends \ # texlive-latex-recommended \ diff --git a/docker/build_images.sh b/docker/build_images.sh old mode 100644 new mode 100755 index e528541..311810f --- a/docker/build_images.sh +++ b/docker/build_images.sh @@ -134,4 +134,4 @@ fi set -e # Perform actual work -process_build $img_name $image_tag $target_arch \ No newline at end of file +process_build $img_name $image_tag $target_arch \ No newline at end of file From 313b6ecae1c8df29dec1e1a69adace61fab7aadf Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sat, 10 Aug 2024 21:02:19 +0200 Subject: [PATCH 15/21] WIP --- docker/Dockerfile | 119 ++++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 56 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5f79891..b1901dc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -129,63 +129,70 @@ RUN mkdir -p $HOME/projects \ && cd $HOME/projects/indi-3rdparty \ && git checkout $INDI_3RD_PARTY_VERSION -#for i in $(ls); do cd $i; export name=$(basename $(pwd)); cmake -DCMAKE_INSTALL_PREFIX=/usr ../../../indi-3rdparty/$name; make -j4; sudo make install; cd ..; done - -# indi-duino -RUN cd $HOME/projects \ - mkdir -p build/indi-duino \ - && cd build/indi-duino \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-duino \ - && make -j8 \ - && make install - -# libasi -RUN cd $HOME/projects \ - mkdir -p build/libasi \ - && cd build/libasi \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libasi \ - && make -j8 \ - && make install - -# indi-asi -RUN cd $HOME/projects \ - mkdir -p build/indi-asi \ - && cd build/indi-asi \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-asi \ - && make -j8 \ - && make install - -# libplayerone -RUN cd $HOME/projects \ - mkdir -p build/libplayerone \ - && cd build/libplayerone \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libplayerone \ +RUN for i in indi-duino libasi indi-asi libplayerone indi-playerone indi-shelyak libaltaircam; \ + do cd $HOME/projects \ + && mkdir -p $HOME/projects/build/$i \ + && cd $HOME/projects/build/$i \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/$i \ && make -j8 \ - && make install - -#indi-playerone -RUN cd $HOME/projects \ - mkdir -p build/indi-playerone \ - && cd build/indi-playerone \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-playerone \ - && make -j8 \ - && make install - -#indi-shelyak -RUN cd $HOME/projects \ - mkdir -p build/indi-shelyak \ - && cd build/indi-shelyak \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-shelyak \ - && make -j8 \ - && make install - -#libaltaircam -RUN cd $HOME/projects \ - mkdir -p build/libaltaircam \ - && cd build/libaltaircam \ - && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libaltaircam \ - && make -j8 \ - && make install + && make install; \ + done + +## indi-duino +#RUN cd $HOME/projects \ +# && mkdir -p build/indi-duino \ +# && cd build/indi-duino \ +# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-duino \ +# && make -j8 \ +# && make install +# +## libasi +#RUN cd $HOME/projects \ +# && mkdir -p build/libasi \ +# && cd build/libasi \ +# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libasi \ +# && make -j8 \ +# && make install +# +## indi-asi +#RUN cd $HOME/projects \ +# && mkdir -p build/indi-asi \ +# && cd build/indi-asi \ +# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-asi \ +# && make -j8 \ +# && make install +# +## libplayerone +#RUN cd $HOME/projects \ +# && mkdir -p build/libplayerone \ +# && cd build/libplayerone \ +# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libplayerone \ +# && make -j8 \ +# && make install +# +##indi-playerone +#RUN cd $HOME/projects \ +# && mkdir -p build/indi-playerone \ +# && cd build/indi-playerone \ +# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-playerone \ +# && make -j8 \ +# && make install +# +##indi-shelyak +#RUN cd $HOME/projects \ +# && mkdir -p build/indi-shelyak \ +# && cd build/indi-shelyak \ +# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-shelyak \ +# && make -j8 \ +# && make install +# +##libaltaircam +#RUN cd $HOME/projects \ +# && mkdir -p build/libaltaircam \ +# && cd build/libaltaircam \ +# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libaltaircam \ +# && make -j8 \ +# && make install ## OpenPhd2 might later be replaced by the original source ? From bd2b3ad7ba1b80ca4d943c1994ceb95c4b56e4a9 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sat, 10 Aug 2024 21:26:50 +0200 Subject: [PATCH 16/21] WIP --- docker/Dockerfile | 69 +++++------------------------------------------ 1 file changed, 7 insertions(+), 62 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b1901dc..eff2ca6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,13 +5,13 @@ FROM ${BASE_IMAGE} ENV DEBIAN_FRONTEND noninteractive # Useless docker cache for pip -ENV PIP_NO_CACHE_DIR=1 +ENV PIP_NO_CACHE_DIR 1 # Versioning -ENV INDI_VERSION=v2.0.8 -ENV PYINDI_VERSION=v1.9.1 -ENV INDI_3RD_PARTY_VERSION=v2.0.8 -ENV PYTHON_VERSION=3.12.3 +ENV INDI_VERSION v2.0.8 +ENV PYINDI_VERSION v1.9.1 +ENV INDI_3RD_PARTY_VERSION v2.0.8 +ENV PYTHON_VERSION 3.12.3 # Generic install / utilities / dev RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommends \ @@ -25,6 +25,7 @@ RUN apt-get update && apt-get --assume-yes --quiet install --no-install-recommen python3-dev \ python3-numpy-dev \ python3-pip \ + python3-setuptools \ python3-six \ software-properties-common \ vim && \ @@ -138,63 +139,6 @@ RUN for i in indi-duino libasi indi-asi libplayerone indi-playerone indi-shelyak && make install; \ done -## indi-duino -#RUN cd $HOME/projects \ -# && mkdir -p build/indi-duino \ -# && cd build/indi-duino \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-duino \ -# && make -j8 \ -# && make install -# -## libasi -#RUN cd $HOME/projects \ -# && mkdir -p build/libasi \ -# && cd build/libasi \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libasi \ -# && make -j8 \ -# && make install -# -## indi-asi -#RUN cd $HOME/projects \ -# && mkdir -p build/indi-asi \ -# && cd build/indi-asi \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-asi \ -# && make -j8 \ -# && make install -# -## libplayerone -#RUN cd $HOME/projects \ -# && mkdir -p build/libplayerone \ -# && cd build/libplayerone \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libplayerone \ -# && make -j8 \ -# && make install -# -##indi-playerone -#RUN cd $HOME/projects \ -# && mkdir -p build/indi-playerone \ -# && cd build/indi-playerone \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-playerone \ -# && make -j8 \ -# && make install -# -##indi-shelyak -#RUN cd $HOME/projects \ -# && mkdir -p build/indi-shelyak \ -# && cd build/indi-shelyak \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/indi-shelyak \ -# && make -j8 \ -# && make install -# -##libaltaircam -#RUN cd $HOME/projects \ -# && mkdir -p build/libaltaircam \ -# && cd build/libaltaircam \ -# && cmake -DCMAKE_INSTALL_PREFIX=/usr $HOME/projects/indi-3rdparty/libaltaircam \ -# && make -j8 \ -# && make install - - ## OpenPhd2 might later be replaced by the original source ? #RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no-install-recommends \ # phd2 @@ -224,6 +168,7 @@ SHELL ["/bin/bash", "-l", "-c"] RUN echo 'export PS1="\u@\h \w> "' | cat - /root/.profile > temp && mv temp /root/.profile # Actual application code and configs +RUN mkdir -p /opt/remote_observatory ADD code.tar.gz /opt/remote_observatory # Python environment From a7204ef2ed5aecd705d5f9d20976a04fbaf5bc1a Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sat, 10 Aug 2024 23:54:35 +0200 Subject: [PATCH 17/21] WIP --- requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 127ecfa..7972efe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -astroalign==2.4.2 -astroplan==0.9 -astropy==6.1.0 -astroquery==0.4.6 +astroalign==2.5.1 +astroplan==0.10 +astropy==6.1.2 +astroquery==0.4.7 erdantic==0.6.0 -influxdb-client==1.37.0 +influxdb-client==1.37.0f gcn-kafka==0.3.0 graphviz==0.20.1 lxml==5.2.2 From 7ebc2d39df1abd8575a45627a3a09e38f4ba7bcb Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sun, 11 Aug 2024 01:22:56 +0200 Subject: [PATCH 18/21] WIP --- docker/Dockerfile | 4 ++-- docker/requirements.txt | 33 --------------------------------- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 docker/requirements.txt diff --git a/docker/Dockerfile b/docker/Dockerfile index eff2ca6..54f79a8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -186,8 +186,8 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" RUN echo 'source /opt/remote_observatory_venv/bin/activate' >> /root/.bashrc # Python packages -COPY requirements.txt . -RUN pip install -r requirements.txt +#COPY requirements.txt . +RUN pip install -r /opt/remote_observatory/requirements.txt # Build and install pyindi-client RUN mkdir -p $HOME/projects \ diff --git a/docker/requirements.txt b/docker/requirements.txt deleted file mode 100644 index fb3aaf0..0000000 --- a/docker/requirements.txt +++ /dev/null @@ -1,33 +0,0 @@ -astroalign==2.4.2 -astroplan==0.9 -astropy==5.3.2 -astroquery==0.4.6 -erdantic==0.6.0 -influxdb-client==1.37.0 -gcn-kafka==0.3.0 -graphviz==0.20.1 -lxml==4.9.1 -ntplib==0.3.4 -matplotlib==3.7.2 -meshcat==0.3.2 -numpy==1.22.0 -opencv-python==4.8.0.76 -photutils==1.9.0 -pyaml==20.4.0 -pydantic==2.2.1 -pydantic-core==2.6.1 -pygraphviz==1.6 -PyLaTeX==1.3.2 -pymongo==3.11.3 -paho-mqtt==1.6.1 -#pyserial==3.4 -pytz==2021.3 -pyzmq==25.1.0 -requests==2.31.0 -rinohtype==0.3.1 -sep==1.2.1 -#serial==0.0.97 -Sphinx==1.8.1 -transitions==0.7.1 -tzwhere==3.0.3 -watchdog==0.8.3 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 7972efe..05a7332 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ astroplan==0.10 astropy==6.1.2 astroquery==0.4.7 erdantic==0.6.0 -influxdb-client==1.37.0f +influxdb-client==1.44.0 gcn-kafka==0.3.0 graphviz==0.20.1 lxml==5.2.2 From 0496335e5f38d8cab2fafd3a9c14935547f221f1 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Sun, 11 Aug 2024 02:55:55 +0200 Subject: [PATCH 19/21] WIP --- docker/Dockerfile | 6 +++--- infrastructure/indiwebmanager.service | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 54f79a8..077d2dc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -199,9 +199,9 @@ RUN mkdir -p $HOME/projects \ # Indi webmanager for dev -#RUN pip install indiweb -#RUN cp indiwebmanager.service /etc/systemd/system/ -#RUN chmod 644 /etc/systemd/system/indiwebmanager.service +RUN pip install indiweb==0.1.8 +RUN cp /opt/remote_observatory/infrastructure/indiwebmanager.service /etc/systemd/system/ +RUN chmod 644 /etc/systemd/system/indiwebmanager.service #RUN systemctl daemon-reload #RUN systemctl enable indiwebmanager.service diff --git a/infrastructure/indiwebmanager.service b/infrastructure/indiwebmanager.service index 14ba64a..63f0706 100644 --- a/infrastructure/indiwebmanager.service +++ b/infrastructure/indiwebmanager.service @@ -5,9 +5,9 @@ After=multi-user.target [Service] Type=idle # MUST SET YOUR USERNAME HERE. -User=gnthibault +User=root Environment=LD_LIBRARY_PATH=/usr/local/lib:/usr/lib -ExecStart=/home/gnthibault/.local/bin/indi-web -v --xmldir /home/gnthibault/projects/RemoteObservatory/conf_files/indi_driver_xml --conf /home/gnthibault/projects/RemoteObservatory/conf_files/indi_driver_conf +ExecStart=/bin/indi-web -v --xmldir /opt/remote_observatory/infrastructure/conf_files/indi_driver_xml --conf /opt/remote_observatory/conf_files/indi_driver_conf Restart=always RestartSec=5 From 404ffc59d1e118c9e010b6e8208d155e3727d734 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Thu, 15 Aug 2024 08:14:49 +0200 Subject: [PATCH 20/21] Add 5200 gaia DR2 references --- docker/Dockerfile | 49 +++++++++++++++++++++++++++++++------ infrastructure/phd2.service | 6 ++--- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 077d2dc..68432d1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -51,6 +51,33 @@ RUN apt-get --assume-yes --quiet install --no-install-recommends \ xz-utils \ zlib1g-dev +## Install astrometry.net packages +# Check cat /usr/local/astrometry/etc/astrometry.cfg to make sure destination path is correct +# 4100-series built from the Tycho-2 catalog; scales 7-19 available, good for images wider than 1 degree. Recommended. +# Mean satellite observation epoch ~J1991.5 +# Epoch of the Tycho-2 catalog J2000.0 +# Reference system ICRS +# see https://heasarc.gsfc.nasa.gov/W3Browse/all/tycho2.html + +# 5200-series, LIGHT version built from Tycho-2 + Gaia-DR2; scales 0-6 available, good for images narrower than 1 degree. Combine with 4100-series for broader scale coverage. +# The LIGHT version contains smaller files with no additional Gaia-DR2 information tagged along. Recommended. +# Gaia DR2 astrometry consistently uses the ICRS reference system and provides stellar coordinates valid for epoch J2015.5 +# see https://www.cosmos.esa.int/web/cheops-guest-observers-programme/coordinates +RUN apt-get --assume-yes --quiet install --no-install-recommends libcairo2-dev libnetpbm11-dev \ + && mkdir -p $HOME/projects/astrometry.net \ + && cd $HOME/projects/astrometry.net \ + && wget https://astrometry.net/downloads/astrometry.net-0.95.tar.gz \ + && tar -xvf ./*.tar.gz \ + && cd astrometry.net-0.95 \ + && export NETPBM_LIB="-L/usr/lib -lnetpbm" \ + && export NETPBM_INC="-I/usr/include" \ + && ./configure --prefix=/usr \ + && make reconfig \ + && make all -j8 \ + && make install \ + && ln -s /usr/local/astrometry/bin/an-fitstopnm /usr/local/bin/an-fitstopnm \ + && wget --recursive --no-parent --continue --directory-prefix=/usr/local/astrometry/data/ https://portal.nersc.gov/project/cosmo/temp/dstn/index-5200/LITE/ + ## Indi dependencies for pre-packages binaries #RUN apt-add-repository ppa:mutlaqja/ppa && apt-get --assume-yes --quiet install --no-install-recommends \ # gsc \ @@ -62,8 +89,8 @@ RUN apt-get --assume-yes --quiet install --no-install-recommends \ # swig # Dependencies to build indi from sources + pyindi-client that is linked with binaries through swig +# astrometry.net was built from source RUN apt-get --assume-yes --quiet install --no-install-recommends \ - astrometry.net \ cdbs \ dkms \ fxload \ @@ -142,7 +169,6 @@ RUN for i in indi-duino libasi indi-asi libplayerone indi-playerone indi-shelyak ## OpenPhd2 might later be replaced by the original source ? #RUN add-apt-repository ppa:pch/phd2 && apt-get --assume-yes --quiet install --no-install-recommends \ # phd2 - # Dependencies to build phd2 from sources RUN apt-get --assume-yes --quiet install --no-install-recommends \ libwxgtk3.2-dev @@ -156,12 +182,15 @@ RUN mkdir -p $HOME/projects \ && make -j8 \ && make install +RUN cp /opt/remote_observatory/infrastructure/phd2.service /etc/systemd/system/ +RUN chmod 644 /etc/systemd/system/phd2.service + ## Dependencies for nice reporting / latex reports -#RUN apt-get --assume-yes --quiet install --no-install-recommends \ -# texlive-latex-recommended \ -# texlive-publishers \ -# texlive-bibtex-extra \ -# texlive-science +RUN apt-get --assume-yes --quiet install --no-install-recommends \ + texlive-latex-recommended \ + texlive-publishers \ + texlive-bibtex-extra \ + texlive-science # Using bash for lower level scripting from now-on SHELL ["/bin/bash", "-l", "-c"] @@ -200,8 +229,12 @@ RUN mkdir -p $HOME/projects \ # Indi webmanager for dev RUN pip install indiweb==0.1.8 -RUN cp /opt/remote_observatory/infrastructure/indiwebmanager.service /etc/systemd/system/ +RUN cp /opt/remote_observatory/infrastructure/indiwebmanager*.service /etc/systemd/system/ RUN chmod 644 /etc/systemd/system/indiwebmanager.service +RUN chmod 644 /etc/systemd/system/indiwebmanager_guiding_camera.service +RUN chmod 644 /etc/systemd/system/indiwebmanager_pointing_camera.service +RUN chmod 644 /etc/systemd/system/indiwebmanager_science_camera.service + #RUN systemctl daemon-reload #RUN systemctl enable indiwebmanager.service diff --git a/infrastructure/phd2.service b/infrastructure/phd2.service index d701839..9ae9eae 100644 --- a/infrastructure/phd2.service +++ b/infrastructure/phd2.service @@ -14,11 +14,11 @@ After=multi-user.target [Service] Type=idle -User=gnthibault +User=root Environment=LD_LIBRARY_PATH=/usr/local/lib:/usr/lib Environment="DISPLAY=:0" -# "XAUTHORITY=/home/gnthibault/.Xauthority" -ExecStartPre=rm -f /home/gnthibault/phd2.1 +# "XAUTHORITY=/root/.Xauthority" +ExecStartPre=rm -f /root/phd2.1 ExecStart=/usr/bin/phd2 Restart=always RestartSec=3 From a280d6b0d615929cbacc5176c17247dc3fa1b368 Mon Sep 17 00:00:00 2001 From: gnthibault Date: Fri, 16 Aug 2024 22:20:32 +0200 Subject: [PATCH 21/21] Add 5200 gaia DR2 references --- docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 68432d1..630597f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -76,8 +76,7 @@ RUN apt-get --assume-yes --quiet install --no-install-recommends libcairo2-dev l && make all -j8 \ && make install \ && ln -s /usr/local/astrometry/bin/an-fitstopnm /usr/local/bin/an-fitstopnm \ - && wget --recursive --no-parent --continue --directory-prefix=/usr/local/astrometry/data/ https://portal.nersc.gov/project/cosmo/temp/dstn/index-5200/LITE/ - + && wget --recursive --no-parent --no-host-directories --cut-dirs=6 --accept "*.fits" --continue --directory-prefix=/usr/local/astrometry/data/ https://portal.nersc.gov/project/cosmo/temp/dstn/index-5200/LITE/ ## Indi dependencies for pre-packages binaries #RUN apt-add-repository ppa:mutlaqja/ppa && apt-get --assume-yes --quiet install --no-install-recommends \ # gsc \