1
0
Fork 0

rm old docker files

qfits
Jeff Moe 2022-08-06 18:16:07 -06:00
parent eb341f7fd9
commit 8963f3516d
2 changed files with 0 additions and 299 deletions

139
DOCKER.md
View File

@ -1,139 +0,0 @@
# DOCKER.md - Introduction
Sattools, stvid and strf are Unix-native tools, with complex and
specific environment requirements in order for them to operate.
The Docker environment allows you to gain access to sattools
without knowing how to install dependencies or compile source.
It has the additional benefit of being able to use the sattools
environment without affecting other environments on your computer.
The instructions below will get you running sattools in about
15 minutes.
# Setup your Docker / X-Windows environment
Mac/PC **Docker Desktop**
- Create an account and download Docker Desktop:
https://www.docker.com/products/docker-desktop
Windows:
Install **Xming X Server for Windows** - https://sourceforge.net/projects/xming/
Mac:
Install **XQuartz** - https://www.xquartz.org/ (can also install via brew)
Log out/back in as directed by the installer
Unix/Linux:
`sudo apt-get update && sudo apt-get install docker.io`
From your X11 terminal, find your computer's IP address and authorize it for X11 connections
`xauth + 192.168.1.2`
# Download and build the sattools Dockerfile
https://github.com/cbassa/sattools/blob/master/Dockerfile
## In a Terminal (Mac/Unix) or Powershell (Windows) build the Dockerfile:
`docker build - < Dockerfile`
After a few minutes, your build should successfully finish. Check for your image with the command:
`$ docker images`
>REPOSITORY TAG IMAGE ID CREATED SIZE
><none> <none> 1ad51e488e1f 12 seconds ago 1.47GB
Take note of the IMAGE ID, in this case `1ad51e488e1f` this code represents the IMAGE you just built.
To run this image in a new container, run the following command in the terminal.
```docker run -it -e DISPLAY='host.docker.internal:0 \'
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-v ~/Documents/satobs:/root/satellite/satobs \
--name mysattools 1ad51e488e1f \
/bin/bash
```
## Check out your new sattols Docker environment
You will be placed into the environment in the commandline of your sattools environment in the Docker container.
`root@a9031e8397c6:~# cd /root/satellite/sattools/`
The first thing you will want to do, is to specify your location. To do this, edit the file "stations.in"
`root@a9031e8397c6:~/satellite/sattools# nano data/sites.txt`
Scroll to the bottom of the file, to edit the entry for station 9999 with the name Graves.
Following the formatting for the file, enter the latitutde, longitude, elevation and name for your observing site, and save the file:
`9999 TS 47.6672 -122.0931 101 TruSat`
Next, you will want to edit the stvid configuration, which will allow you to get updated TLEs
First, register for a space-track.org account at https://www.space-track.org/auth/createAccount
Next, edit the information for your observation location, and put in the login information
for your space-track.org account
```cd /root/satellite/stvid
root@a9031e8397c6:~/satellite/stvid# cp configuration.ini-dist configuration.ini
nano configuration.ini
```
Last, update the TLEs with
`root@a9031e8397c6:~/satellite/stvid# python3 update_tle.py`
You can see your new TLEs at:
```root@a9031e8397c6:~/satellite/stvid# cd /root/satellite/tle/
root@a9031e8397c6:~/satellite/tle# ls -al
```
Here a few things that you can do now that your environment is set up for your location with TLEs
Get sunset / sunrise for your site (in UTC):
`root@a9031e8397c6:~/satellite/tle# allnight`
> 2019-11-27T00:56:27 2019-11-27T14:55:44
Run passes for your site for 3 hours, above 45 degrees, starting at sunset (from above):
`pass -t 2019-11-27T00:56:27 -l 10800 -A 45`
Run skymap to interactively view passes for your site:
`skymap S`
This should open a graphical display in an X-window on your system.
Use > to advance by 1 minute
Type `exit` to leave the docker environment.
# Returning to your docker environment.
You can check to see if your container is still running by typing the following in the terminal:
```(MVP) MBP-140320:~ chris$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a9031e8397c6 d82642132ae1 "/bin/sh -c /bin/bas…" 6 days ago Up 6 days st-b3
6fe73f3d652e d82642132ae1 "/bin/sh -c /bin/bas…" 6 days ago Exited (0) 6 days ago st-b2
```
You can see multiple containers from the image you built. In this case, the container a9031e8397c6 is still running.
To reattach to this container, execute:
`docker attach a9031e8397c6`
You might need to press `return` to see the prompt.
If you don't have a container running (like container 6fe73f3d652e), you can restart it with:
`docker start 6fe73f3d652e`
If you don't have any active containers, you can start over with the `docker run` command above.
## Things to watch out for
1. When you build/start/stop/exit containers, its possible for multiple (1.5 gigabyte) containers to pile up. Review the commands for `docker rmi` and `docker rm` for how to remove thiese.
1. Any changes you make inside the docker container are not automatively saved to the image. If you would like to save your changes, use the `docker commit` command to make an updated version of the images with your changes.

View File

@ -1,160 +0,0 @@
# Best Practices for Writing Docker Files
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
# Note that this currently is a larger-than-necessary image due to the the
# intermediate RUN commands to compile the different pages
# Stringing-it-all-together would reduce the size, but would make build
# debugging more challenging
FROM ubuntu:18.04
# To avoid questions from tzdata
ARG DEBIAN_FRONTEND=noninteractive
# Modify the following with your preferred COSPAR station ID
ENV ST_COSPAR 9999
# Update these directories per your preferences
ENV HOME /root
ENV SAT_DIR $HOME/satellite
ENV ST_DATADIR $SAT_DIR/sattools
ENV ST_TLEDIR $SAT_DIR/tle
ENV ST_OBSDIR $SAT_DIR/satobs
# Note that its convenient to mount your host filesystem to the ST_TLEDIR and ST_OBSDIR with
# -V YOUR_EXTERNAL_TLE_DIR:/root/satellite/tle
# -V YOUR_EXTERNAL_SATOBS_DIR:/root/satellite/satobs
RUN echo "Step 1.0: Install dependencies from APT" \
& apt-get update && apt-get install -y --no-install-recommends \
git \
make \
dos2unix \
sextractor \
wcslib-dev \
pgplot5 \
libgsl-dev \
gfortran \
g++ \
libpng-dev \
libx11-dev \
libjpeg-dev \
libexif-dev \
unzip \
vim \
nano \
wget \
# For hough3dlines
libeigen3-dev \
# For STVID
python3 \
python3-dev \
astrometry.net \
# For scipy
libblas3 \
liblapack3 \
liblapack-dev \
libblas-dev \
# For STRF
libfftw3-dev \
# For pip
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# For STVID package requirements.txt
WORKDIR /tmp
RUN ["/bin/bash", "-c", "set -o pipefail && wget -O - https://bootstrap.pypa.io/get-pip.py | python3 -"]
RUN echo "Step 2.0: Install qfits for SATTOOLS"
WORKDIR /usr/local/src
RUN ["/bin/bash", "-c", "set -o pipefail && wget -O - ftp://ftp.eso.org/pub/qfits/qfits-5.2.0.tar.gz | tar xzvf - \
&& cd qfits-5.2.0 \
&& chmod +w src/xmemory.c \
&& sed -i -e 's/swapfd = open(fname, O_RDWR | O_CREAT);/swapfd = open(fname, O_RDWR | O_CREAT, 0644);/g' src/xmemory.c \
&& ./configure \
&& make \
&& make install \
&& echo 'Step 2.1: clean up' \
&& rm -rf /usr/local/src/qfits-5.2.0"]
WORKDIR ${SAT_DIR}
RUN echo "Step 3.0: Install hough3dlines for STVID" \
&& git clone https://gitlab.com/pierros/hough3d-code.git \
&& cd hough3d-code \
&& make \
&& rm *.o \
&& echo "Done installing dependencies" \
&& mkdir -p $SAT_DIR
##
## THIS SECTION BUILDS SATTOOLS SUITE
##
WORKDIR $SAT_DIR
RUN echo "Step 4.0: Build satools/strf/stvid" \
&& echo "Step 4.1: Build sattools: Satellite Tracking Toolkit" \
&& git clone https://github.com/interplanetarychris/sattools.git \
&& cd sattools \
&& git checkout Docker \
&& make \
&& make clean
RUN echo "Step 4.2. Build stvid: Satellite tracking with video cameras" \
&& git clone https://github.com/interplanetarychris/stvid.git \
&& cd $SAT_DIR/stvid \
&& git checkout Docker \
&& pip install -r $SAT_DIR/stvid/requirements.txt \
# Needed twice, because ppgplot installs correctly on the second try
&& pip install -r $SAT_DIR/stvid/requirements.txt
#WORKDIR /usr/local/src
#RUN git clone https://github.com/haavee/ppgplot.git
# WORKDIR /usr/local/src/ppgplot
# RUN python3 setup.py install
WORKDIR $SAT_DIR
RUN echo "Step 4.3. Build strf: Radio Frequency Satellite Tracking" \
&& git clone https://github.com/cbassa/strf.git \
&& cd $SAT_DIR/strf \
&& make \
&& make clean
RUN echo "Step 4.4 Decrease container size after everything is compiled" \
&& apt-get purge -y \
wcslib-dev \
libgsl-dev \
gfortran \
libpng-dev \
libx11-dev \
libjpeg-dev \
libexif-dev \
# For hough3dlines
libeigen3-dev \
# For STVID
python3-dev \
# For scipy
liblapack-dev \
libblas-dev \
# For STRF
libfftw3-dev \
&& apt-get autoremove -y
WORKDIR $HOME
RUN echo "Step 5.0: set environment variables" \
&& echo "export ST_COSPAR=$ST_COSPAR" >>$HOME/.profile \
&& echo "export ST_DATADIR=$ST_DATADIR" >>$HOME/.profile \
&& echo "export ST_TLEDIR=$ST_TLEDIR" >>$HOME/.profile \
&& echo "export ST_OBSDIR=$ST_OBSDIR" >>$HOME/.profile \
&& mkdir -p $ST_OBSDIR \
&& mkdir $ST_OBSDIR/control \
&& echo "Step 5.1: set path" \
&& echo "PATH=$ST_DATADIR:$ST_DATADIR/scripts:$SAT_DIR/hough3d-code:$SAT_DIR/strf:\$PATH" >>$HOME/.profile
RUN echo "Step 5.2: Download initial TLEs" \
&& mkdir -p $ST_TLEDIR \
&& $ST_DATADIR/tleupdate \
&& echo "Final step: run" \
&& echo "source $HOME/.profile"
# Run bash by default if everything else compiles
ENTRYPOINT /bin/bash
CMD bash