build.sh 634 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. _UID=$(id -u)
  3. DEF_FILE="pytorch_GAN_zoo.def"
  4. SIF_FILE="pytorch_GAN_zoo.sif"
  5. TORCH_DEF_FILE="pytorch_cu_11.1.def"
  6. TORCH_SIF_FILE="pytorch_cu_11.1.sif"
  7. pushd ../../base_containers/pytorch/ || exit
  8. if ! [ -f $TORCH_SIF_FILE ]; then
  9. if ! [ -f $TORCH_DEF_FILE ]; then
  10. ./template.py 11.1
  11. fi
  12. if [ "$_UID" = 0 ]; then
  13. singularity build $TORCH_SIF_FILE $TORCH_DEF_FILE
  14. else
  15. singularity build --fakeroot $TORCH_SIF_FILE $TORCH_DEF_FILE
  16. fi
  17. fi
  18. popd || exit
  19. if [ "$_UID" = 0 ]; then
  20. singularity build $SIF_FILE $DEF_FILE
  21. else
  22. singularity build --fakeroot $SIF_FILE $DEF_FILE
  23. fi