Skip to content

Commit

Permalink
update docker webservice
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Lang committed Dec 12, 2023
1 parent 5963ca9 commit 3cb9203
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
9 changes: 8 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ Docker containers for Astrometry.net

(cd webservice && docker build -t astrometrynet/webservice:latest .)

docker run --net=host astrometrynet/webservice
Web service: create a directory with index files in it, eg /tmp/index,
including a docker.cfg astrometry.net configuration file, eg
add_path /index
autoindex
inparallel
and then mount it into the contain via

docker run --net=host --volume /tmp/index:/index astrometrynet/webservice

8 changes: 4 additions & 4 deletions docker/webservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ RUN mkdir appsecrets && \
cp appsecrets-example/django.py appsecrets
COPY django_db.py /src/astrometry/net/appsecrets/
#RUN (echo -n "DJANGO_SECRET_KEY = '"; tr -dc A-Za-z0-9 </dev/urandom | head -c 52; echo "'") > /src/astrometry/net/appsecrets/django.py

RUN git stash && git pull
#RUN git stash && git pull

RUN mv migrations/* /tmp && \
python manage.py makemigrations && \
Expand All @@ -41,8 +40,9 @@ RUN mv migrations/* /tmp && \
RUN git pull
ENV WSGI_LOG_FILE=
COPY run.sh /src/astrometry/net/

CMD run.sh
COPY solvescript-docker.sh /src/astrometry/net
RUN mkdir /index
CMD ./run.sh

#CMD python manage.py runserver 0.0.0.0:8000

Expand Down
2 changes: 1 addition & 1 deletion docker/webservice/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

python manage.py runserver 0.0.0.0:8000 &

python process_submissions.py &
python -u process_submissions.py --solve-locally=/src/astrometry/net/solvescript-docker.sh &

wait
16 changes: 16 additions & 0 deletions docker/webservice/solvescript-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash

# Run via:
# python process_submissions.py --solve-locally=$(pwd)/solvescript.sh

set -e

jobid=$1
axyfile=$2

BACKEND="/usr/local/bin/astrometry-engine"
CFG="/index/docker.cfg"
export TMP=/tmp

$BACKEND -v -c $CFG $axyfile -j $jobid

0 comments on commit 3cb9203

Please sign in to comment.