Skip to content

Commit

Permalink
finally get singularity working
Browse files Browse the repository at this point in the history
  • Loading branch information
36000 committed Jan 8, 2024
1 parent 31cd513 commit 82cbffc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
9 changes: 7 additions & 2 deletions gpu_docker/cuda_build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

if [ $# -lt 1 ]; then
echo "Error: At least one argument is required."
exit 1
fi

export AFQ_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
export CUDA_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

apptainer build ${1} ${CUDA_DIR}/cuda_track.def
sed "s|PLACEHOLDER_FOR_PACKAGE_PATH|${AFQ_PATH}|g" ${AFQ_PATH}/gpu_docker/cuda_track_template.def > ${AFQ_PATH}/gpu_docker/_temp.def

apptainer build ${1} ${AFQ_PATH}/gpu_docker/_temp.def

rm ${AFQ_PATH}/gpu_docker/_temp.def

15 changes: 2 additions & 13 deletions gpu_docker/cuda_track.def → gpu_docker/cuda_track_template.def
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
Bootstrap: docker
From: nvidia/cuda:12.0.1-devel-ubuntu20.04

%pre
if [ -z "${AFQ_PATH}" ]; then
echo "Error: AFQ_PATH is not set." >&2
exit 1
else
echo "AFQ_PATH is set to '$AFQ_PATH'"
echo $AFQ_PATH > /tmp/afq_path.txt
fi

%files
/tmp/afq_path.txt /tmp/afq_path.txt
PLACEHOLDER_FOR_PACKAGE_PATH /opt/pyAFQ

%environment
export DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -64,9 +55,7 @@ From: nvidia/cuda:12.0.1-devel-ubuntu20.04
cd /opt/GPUStreamlines/build/cuslines && pip install -e .

# Install pyAFQ
AFQ_PATH=$(cat /tmp/afq_path.txt)
pip install -e $AFQ_PATH
rm /tmp/afq_path.txt # Clean up the temporary file
pip install -e /opt/pyAFQ

%runscript
exec /opt/pyAFQ/bin/pyAFQ "$@"

0 comments on commit 82cbffc

Please sign in to comment.