Bootstrap: localimage
From: /sw/external/NGC/pytorch_23.05-py3.sif

%environment
    export PROJECT_DIR="/projects/bcse/"
    export CONTAINER_WORKDIR="/amplfi/"

%files
. /amplfi/

%post

python -m pip install --upgrade pip && python -m pip install uv

cd /amplfi/ \
    && uv export --format requirements-txt -o requirements.txt.tmp --no-hashes \
    && cat requirements.txt.tmp | grep -v 'torch==' | grep -v 'torchaudio==' | grep -v 'triton' | grep -v 'protobuf' | grep -v 'nvidia' > requirements.txt \
    && rm requirements.txt.tmp \
    && python -m pip install -r requirements.txt --no-deps \
    && python -m pip install -e . --no-deps

%runscript
#!/bin/bash
exec "$@"
