Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to run on cloud notebooks #90

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 35 additions & 56 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,57 +1,36 @@
ARG image_url=gcr.io/panoptes-exp/panoptes-pocs
ARG image_tag=develop
FROM ${image_url}:${image_tag} AS pipeline-base

LABEL description="Development environment for working with the PIPELINE"
LABEL maintainers="[email protected]"
LABEL repo="github.com/panoptes/panoptes-pipeline"

ARG userid=1000
ENV USERID $userid

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PYTHONUNBUFFERED True

ENV PORT 8080

USER "${userid}"

USER "${USERID}"
WORKDIR /build
COPY --chown="${USERID}:${USERID}" . .
RUN echo "Building wheel" && \
sudo chown -R "${userid}:${userid}" /build && \
python setup.py bdist_wheel -d /build/dist

FROM pipeline-base AS panoptes-pipeline

USER "${USERID}"
WORKDIR /build
COPY --from=pipeline-base /build/dist/ /build/dist
RUN echo "Installing module" && \
pip install --no-cache-dir "$(ls /build/dist/*.whl)" && \
FROM continuumio/miniconda3

RUN apt-get update && \
apt-get install -y --no-install-recommends \
astrometry.net source-extractor dcraw exiftool \
libcfitsio-dev libcfitsio-bin \
libpng-dev libjpeg-dev \
libfreetype6-dev \
libffi-dev && \
# Cleanup
pip cache purge && \
conda clean -fay && \
sudo apt-get autoremove --purge --yes \
gcc pkg-config git && \
sudo apt-get autoclean --yes && \
sudo apt-get --yes clean && \
sudo rm -rf /var/lib/apt/lists/*

USER "${USERID}"
WORKDIR /app
COPY --chown="${USERID}:${USERID}" ./services/* /app/
COPY ./notebooks/ProcessFITS.ipynb .
COPY ./notebooks/ProcessObservation.ipynb .

RUN echo "Creating /input and /output directories" && \
sudo mkdir -p /input && \
sudo mkdir -p /output && \
sudo chown -R "${USERID}:${USERID}" /input && \
sudo chown -R "${USERID}:${USERID}" /output && \
sudo chmod -R 777 /input && \
sudo chmod -R 777 /output

CMD [ "gunicorn --workers 1 --threads 8 --timeout 0 -k uvicorn.workers.UvicornWorker --bind :${PORT:-8080} pipeline:app" ]
apt-get autoremove --purge --yes && \
apt-get autoclean --yes && \
rm -rf /var/lib/apt/lists/*

ADD http://data.astrometry.net/4100/index-4108.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4110.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4111.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4112.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4113.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4114.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4115.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4116.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4117.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4118.fits /usr/share/astrometry
ADD http://data.astrometry.net/4100/index-4119.fits /usr/share/astrometry

RUN conda update -n base conda && \
conda install -c conda-forge mamba && \
mamba install -c conda-forge \
astropy astroplan astroquery photutils \
scipy numpy pandas scikit-learn scikit-image numexpr \
bokeh seaborn plotly panel \
jupyterlab ipywidgets ipython-autotime \
gcsfs google-cloud-storage \
h5py \
pip
20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@ PANOPTES Image Processing for the Extraction of Lightcurves in Nearby Exoplanets

## Description

So many planets, such little time...
This repository contains code that allows for the processing and discovering of [PANOPTES](https://www.projectpanoptes.org) data.

### Deploy
Most processing is done in the cloud using dedicated Google Cloud Platform services, but the code contained in this repository can be used to process results locally.

See [Deployment](../README.md#deploy) in main README for preferred deployment method.
In general the processing is set up as series of Jupyter Notebooks that are processed automatically using [papermill](https://papermill.readthedocs.io/en/latest/). The processed notebooks are stored as artifcats in storage buckets.

#### Notification Creation
## Usage

The bucket notification only needs to be created once, which can be done with the following command:
### Online

```sh
gsutil notification create -t process-raw-image -f json -e OBJECT_FINALIZE gs://panoptes-images-raw/
```
#### Binder

You can list existing notifications with:

```sh
gsutil notification list gs://panoptes-images-incoming/
```
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/panoptes/panoptes-pipeline/prepare-cleanup)
39 changes: 0 additions & 39 deletions deploy.sh

This file was deleted.

15 changes: 0 additions & 15 deletions docker-compose.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions environment.yaml

This file was deleted.

Loading