Bootstrap: docker
From: continuumio/miniconda3

%files
    THEPATH/equiv_fm/bgmol
    THEPATH/equiv_fm/bgflow
    THEPATH/equiv_fm/eq_ot_flow
    THEPATH/equiv_fm/path_grad_helpers.py



%post
    conda create -n myenv python=3.9
    conda update -n base -c defaults conda -y
    conda install -n myenv -c conda-forge pip setuptools -y
    
    # Install specific versions with conda
    conda install -n myenv -c conda-forge "numpy< 1.24" -y
    conda install -n myenv -c conda-forge "mdtraj<1.10" -y
    
    conda install -n myenv -c conda-forge gcc=12.1.0
    
    # Install the rest via conda where available
    conda install -n myenv -c conda-forge \
        jedi \
        pytorch \
        torchvision \
        torchdiffeq \
        pot \
        einops \
        scikit-learn \
        tqdm \
        openmm \
        matplotlib \
        ipdb \
        jupyterlab \
        jupyter_client \
        jupyter \
        click \
        wandb \
        xtb-python \
	h5py \
	pytables \
	networkx 

    conda install -n myenv anaconda::scipy


    # Install local packages still via pip
    conda run --no-capture-output -n myenv pip install --root-user-action=ignore  THEPATH/bgmol/
    conda run --no-capture-output -n myenv pip install --root-user-action=ignore THEPATH/bgflow/
    
    # torchdyn is not on conda-forge, fallback to pip
    conda run --no-capture-output -n myenv pip install --root-user-action=ignore  torchdyn


    # Source environment at runtime
    echo ". /opt/conda/etc/profile.d/conda.sh" >> $SINGULARITY_ENVIRONMENT
    echo "conda activate myenv" >> $SINGULARITY_ENVIRONMENT

