nuclear-multimessenger-astronomy / nmma

A pythonic library for probing nuclear physics and cosmology with multimessenger analysis
https://nuclear-multimessenger-astronomy.github.io/nmma/
GNU General Public License v3.0
30 stars 58 forks source link

add apptainer definition file #276

Open deepchatterjeeligo opened 10 months ago

deepchatterjeeligo commented 10 months ago

Add a singularity/apptainer definition file. Image built as $ apptainer build nmma.sif nmma.def. I have done basic sanity checks like running help scripts on executables. E.g.

$ apptainer run nmma.sif lightcurve-generation -h
Install afterglowpy if you want to simulate afterglows.
Install wrapt_timeout_decorator if you want timeout simulations.
usage: lightcurve-generation [-h] --model MODEL [--svd-path SVD_PATH] --outdir OUTDIR [--outfile-type OUTFILE_TYPE] --label LABEL [--tmin TMIN] [--tmax TMAX] [--dt DT] [--svd-mag-ncoeff SVD_MAG_NCOEFF] [--svd-lbol-ncoeff SVD_LBOL_NCOEFF] [--filters FILTERS]
                             [--generation-seed seed] [--injection PATH] [--joint-light-curve] [--with-grb-injection] [--grb-resolution GRB_RESOLUTION] [--jet-type JET_TYPE] [--plot] [--verbose] [--injection-detection-limit mAB] [--interpolation-type INTERPOLATION_TYPE]
                             [--absolute] [--ztf-sampling] [--ztf-uncertainties] [--ztf-ToO {180,300}] [--rubin-ToO] [--rubin-ToO-type {BNS,NSBH}] [--photometry-augmentation] [--photometry-augmentation-seed seed]
                             [--photometry-augmentation-N-points PHOTOMETRY_AUGMENTATION_N_POINTS] [--photometry-augmentation-filters PHOTOMETRY_AUGMENTATION_FILTERS] [--photometry-augmentation-times PHOTOMETRY_AUGMENTATION_TIMES] [--train-stats]
                             [--refresh-models-list REFRESH_MODELS_LIST] [--xlim [XLIM ...]] [--ylim [YLIM ...]] [--photometric-error-budget PHOTOMETRIC_ERROR_BUDGET] [--increment-seeds]

Inference on kilonova ejecta parameters.

.
.
.

Happy to add more tests in case this is helpful.

mcoughlin commented 9 months ago

We can wait until you are able to test this, but if it doesn't end up working out, maybe we just merge next week.

deepchatterjeeligo commented 9 months ago

I did not know that apptainer/singularity cannot be installed on a mac. I wouldn't mind putting a stage in the CI to build and test with the image, but the size of the sif file turns out to be around 2GB, so maybe we can do that maybe eventually, only for tags. But the advantage of keeping a def file is that I can build the image file on my local (linux) machine and just copy it to a cluster and run it using the apptainer run... there. My student found this helpful, hence I thought of adding the definition file.