spacetelescope / roman_tools

Instructions and tutorials for Roman software tools distributed by STScI for the science community
BSD 3-Clause "New" or "Revised" License
14 stars 6 forks source link

Master Dockerfile #32

Open robelgeda opened 4 years ago

robelgeda commented 4 years ago

I just finished making a Dokerfile for STIPS and realized most of it very similar to the Dockerfile being hosted in the wfirst-tools repo. This is because there are now 3 Dockerfiles that install the same thing but prepared with different reasons: 1) Notebooks : FROM jupyter/scipy-notebook:db3ee82ad08a 2) STIPS general user installer: FROM continuumio/miniconda3 3) STIPS WFIRST server: FROM ubuntu:16.04 (a lot of extra server packages need to be installed)

I would be easy to maintain if we can have a master docker that installs Pandeia and WebbPSF. the other Dockerfiles can then extend this file when building STIPS and STIPS server.

robelgeda commented 4 years ago

From Slack

To make maintaining the Dockers easy, I suggest having a bash script (.sh file) that installs WebbPSF, Pandeia and STIPS (basically the shell commands in the current wfirst-tools Docker file) and run that file in our Docker files when installing. That way we only have to edit the one shell script. We can put that file in the wfirst-tools repo and download that .sh file and run it in the STIPS Dokerfiles... or even clone the repository when installing. What do you think about this issue/possible solution? EDIT: Upon reviewing past discussions on this, it looks like it was decided not to combine STIPS and the other sim tools in the master docker file. In this case, we can make the .sh file into installation for WebbPSF and Pandeia only. This simplifies a lot of the workflow. This then would be a refactoring of the current master Dockerfile, putting the installation instructions in the bash shell script file. (edited)

This attempt failed as tested in #31. This solution worked to build the docker image but the bash script in the docker file caused docker to rebuild everything every time my binder was launched.

robelgeda commented 4 years ago

https://docs.docker.com/develop/develop-images/multistage-build/

robelgeda commented 4 years ago

So the best way to control the nature of the Docker file is to move away from the jupyter/scipy-notebook:db3ee82ad08a image and implement the base image ourselves. That way we can do a multistage build and use the sh files to install the sim tools and stop --or-- install the sim tools and STIPS. Given the carful work needed to replace the base image, I think its best to attempt this after AAS.

robelgeda commented 4 years ago

Note: Moving away from the current base image may affect how the Docker builds on mybinder. TODO: Investigate if this is correct