Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
henrysky committed Aug 10, 2024
1 parent b77c89a commit 9135689
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1
FROM nvcr.io/nvidia/tensorflow:19.10-py3
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update

# install necessary latex packages
RUN curl -L -o install-tl-unx.tar.gz https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2024/install-tl-unx.tar.gz
RUN zcat < install-tl-unx.tar.gz | tar xf -
RUN cd install-tl-2* && perl install-tl --no-interaction --scheme=small
ENV PATH="/usr/local/texlive/2024/bin/x86_64-linux:${PATH}"
RUN tlmgr install type1cm cm-super dvipng

ENV MY_ASTRO_DATA=/astro_data
ENV SDSS_LOCAL_SAS_MIRROR=$MY_ASTRO_DATA/sdss_mirror
ENV GAIA_TOOLS_DATA=$MY_ASTRO_DATA/gaia_mirror
ENV DUST_DIR=$MY_ASTRO_DATA/mwdust_mirror
RUN mkdir $MY_ASTRO_DATA $SDSS_LOCAL_SAS_MIRROR $GAIA_TOOLS_DATA $DUST_DIR
RUN git clone https://github.com/henrysky/astroNN_spectra_paper_figures.git
WORKDIR /workspace/astroNN_spectra_paper_figures
RUN pip install -r requirements.txt
RUN mkdir data_files figs
RUN curl --cookie zenodo-cookies.txt "https://zenodo.org/records/13290056/files/__train.h5.h5?download=1" --output __train.h5.h5
RUN curl --cookie zenodo-cookies.txt "https://zenodo.org/records/13290056/files/_highsnr_test.h5?download=1" --output _highsnr_test.h5
RUN curl --cookie zenodo-cookies.txt "https://zenodo.org/records/13290056/files/aspcap_training.h5?download=1" --output aspcap_training.h5
36 changes: 34 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ entire APOGEE DR14 dataset. Simultaneously, we release ``astroNN``, a well-teste
developed for this work, but that is also designed to be a general package for deep learning in astronomy. ``astroNN`` is
available at https://github.com/henrysky/astroNN with extensive documentation at http://astroNN.readthedocs.io.

.. contents:: **Table of Contents**
:depth: 3

Getting Started
=================

Expand All @@ -41,6 +44,35 @@ Some notebooks make use of my `milkyway_plot`_ to plot on milkyway.

To continuum normalize arbitrary APOGEE spectrum with v1.0.0, see: https://astronn.readthedocs.io/en/v1.0.0/tools_apogee.html#continuum-normalization-of-apogee-spectra

Docker Image
----------------

If you have `Docker`_ installed, you can use the `Dockerfile`_ to build a Docker image upon Pytorch container from `NVIDIA NGC Catalog`_ with all dependencies installed and data files downloaded.

.. _NVIDIA NGC Catalog: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch
.. _Dockerfile: Dockerfile
.. _Docker: https://www.docker.com/

To build the Docker image called ``astronn_spectra_paper_figures``, run the following command in the root directory of this repository:

.. code-block:: bash
docker build -t astronn_spectra_paper_figures .
To run the Docker container with all GPU available to the container named ``testing123``, run the following command:

.. code-block:: bash
docker run --gpus all --name testing123 -it -e SHELL=/bin/bash --entrypoint bash astronn_spectra_paper_figures
Then you can attach to the container by running:

.. code-block:: bash
docker exec -it testing123 bash
Now you can run all notebooks or training script inside the container

Jupyter Notebook
------------------
- | `Datasets_Data_Reduction.ipynb`_
Expand Down Expand Up @@ -192,11 +224,11 @@ To load it with python
Authors
=================
- | **Henry Leung** - henrysky_
| Student, Department of Astronomy and Astrophysics, University of Toronto
| Department of Astronomy and Astrophysics, University of Toronto
| Contact Henry: henrysky.leung [at] utoronto.ca
- | **Jo Bovy** - jobovy_
| Professor, Department of Astronomy and Astrophysics, University of Toronto
| Department of Astronomy and Astrophysics, University of Toronto
.. _henrysky: https://github.com/henrysky
.. _jobovy: https://github.com/jobovy
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
astroNN==1.0.1
cryptography~=37.0.0

0 comments on commit 9135689

Please sign in to comment.