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

Support for Docker and Singularity containers #63

Merged
merged 5 commits into from
Apr 1, 2022

Conversation

manuparra
Copy link
Contributor

Hi! we needed to containerize SPISEA for a workshop (working with Kubernetes) and we have created the Dockerfile to deploy SPISEA completely from docker containers. We also took the opportunity to use it from Singularity. I leave you in this PR the Dockerfile, which provides the steps to set up SPISEA and the documentation to a) build the image from Dockerfile, b) download it from DockerHub to use it and c) use SPISEA from Singularity.
If you find this interesting, you can include it. Thank you very much.

@mwhosek
Copy link
Contributor

mwhosek commented Mar 30, 2022

Great, thanks for this contribution to SPISEA! This provides a nice way to install the code. We are indeed interested in merging your updates into our code base.

I'm not very familiar with Docker, but was able to follow your installation instructions without trouble. However, I was a bit confused on how to run SPISEA scripts from my current working directory (outside of the container) in the SPISEA container. I tried the command you provide in the documentation:

docker run -ti -v $PWD:/scripts/ spisea python /scripts/myscript.py

While my script ran successfully, I couldn't find where the output files were saved (no scripts subdirectory was created?). Perhaps I misunderstood how this command should work?

Instead, I found that I needed a command like this:

docker run -v $PWD:$PWD -w $PWD -ti spisea python myscript.py

Which then wrote the output files produced by myscript.py in my current working directory. (See docs under "Mount volume" here: https://docs.docker.com/engine/reference/commandline/run/). If this makes sense, I may add it to the documentation you've provided.

Also, we'd like to acknowledge your contribution! With your permission, we would add your name (plus anyone else you think is appropriate) to our Contributors page here.

Thanks again!
Matt

@manuparra
Copy link
Contributor Author

Hi @mwhosek Yes, in my documentation example I wanted to indicate that you can use a folder inside the container. But another way to run it is as you have indicated so that everything you do (the outputs) are saved in the directory where you are located by using $PWD (outside/inside container), so your solution is perfectly valid. I've updated the documentation with your change, so you could already do the merge.

I also created a version for Singularity which is much more intuitive than Docker.

Thank you very much, we will be very grateful if you include us in the contributors list. We are two colleagues who have contributed to this containerization: Manuel Parra-Royón and Javier Moldón.

@mwhosek mwhosek merged commit e0c3d14 into astropy:main Apr 1, 2022
@mwhosek
Copy link
Contributor

mwhosek commented Apr 1, 2022

Great, thanks again @manuparra! Your changes have been merged and contributions acknowledged in SPISEA release v2.1.2, which is now live.

@manuparra
Copy link
Contributor Author

Thanks @mwhosek !
I'm happy to collaborate with SPISEA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants