<commit_before>BootStrap:docker
From:tensorflow/tensorflow:1.12.0-gpu-py3

%environment

	#Environment variables

	#Use bash as default shell
	SHELL=/bin/bash

	
%setup
	#Runs on host
	#The path to the image is $SINGULARITY_ROOTFS
	 # Copy and rename
    	cp -R /vagrant/pyModule ${SINGULARITY_ROOTFS}
	

%files
	#cp -r /home/vagrant/testing\ pipeline /opt

%post
	#Post setup script

	

  #Updating and getting required packages
  apt-get clean
  apt-get dist-upgrade && apt-get install -y --no-install-recommends --ignore-missing \
  python-dicom\
  python-numpy\
  python-scipy\
  python-matplotlib\
  ipython\
  ipython-notebook\
  python-pandas\
  python-sympy\
  python-nose\
  git

  apt-get clean

  #apt-get update
  #apt-get install -y wget git vim
  #apt-get install python-dicom
  #apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

  pip install dicom==0.9.9.post1
  pip install scikit-image
  pip install opencv-python
  
  apt update && apt install -y libsm6 libxext6
  apt-get install -y libxrender-dev
  
  mkdir /software
  cd /software
  cp -r /pyModule /software
  


%runscript
	#Executes with the singularity run command
	#cd /software/pipeline/pyModule
	python /software/pyModule/run_inference_clinical_3D.py arg1=$1 arg2=$2	

%labels
AUTHOR <EMAIL>


%test
	#Test that script is a success

	#Load environment variables
	#. /environment

	#Test tensorflow install
	#python -c "import tensorflow"<commit_msg>New recipe to include Cuda dependencies within the container. Now the user only needs Singularity 3.1 and the NVIDIA drivers installed to run<commit_after>Bootstrap: docker
From: nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04

%environment

	#Environment variables

	#Use bash as default shell
	SHELL=/bin/bash

	#Add nvidia driver paths
	PATH="/nvbin:$PATH"
	LD_LIBRARY_PATH="/nvlib;$LD_LIBRARY_PATH"

	#Add CUDA paths
	CPATH="/usr/local/cuda/include:$CPATH"
	PATH="/usr/local/cuda/bin:$PATH"
	LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
	CUDA_HOME="/usr/local/cuda"

	#Add Anaconda path
	PATH="/usr/local/anaconda3-4.2.0/bin:$PATH"

	export PATH LD_LIBRARY_PATH CPATH CUDA_HOME


%setup
	#Runs on host
	#The path to the image is $SINGULARITY_ROOTFS



%post
	#Post setup script

	#Load environment variables
	. /environment

	#Default mount paths
	mkdir /scratch /data /shared /fastdata

	#Nvidia Library mount paths
	mkdir /nvlib /nvbin
1.12.
  	#Updating and getting required packages
  	apt-get update
 	apt-get install -y python3
  	apt-get install -y wget git vim

  	apt update
  	apt install -y virtualenv
  	virtualenv -p python3 env
  	ls env/lib
  	ls -l `which sh`
  	. env/bin/activate

  	#Creates a build directory
  	mkdir build
  	cd build

  	apt install -y python3-pip
  	python --version
  	pip3 --version
  
	pip3 install Pillow 

  	#Install Tensorflow  	
  	pip3 install --no-cache-dir tensorflow-gpu==1.12.0

  	# Upgrade all packages to their latest versions
  	apt-get -y update && apt-get -y upgrade

  	# Install expect to automate responses for interactive build questions
  	apt-get -y install expect

  	apt-get clean
  	apt-get dist-upgrade && apt-get install -y --no-install-recommends --ignore-missing \
  	python-dicom\
  	python-numpy\
  	python-scipy\
  	python-matplotlib\
  	ipython\
  	ipython-notebook\
  	python-pandas\
  	python-sympy\
  	python-nose

  
  	apt update
  	apt-get clean

  	pip3 install pydicom
  	pip3 install numpy
  	pip3 install scikit-image
  	pip3 install opencv-python
  	pip3 install protobuf
  	pip3 install matplotlib
  	pip install --upgrade pip
	
	apt-get install -y python-imaging

  	apt update && apt install -y libsm6 libxext6
  	apt-get install -y libxrender-dev

  	apt update
  	
  	mkdir /software
  	cd /software
  	git clone https://github.com/cerr/CERR.git
  	wget https://github.com/cerr/aimodels/raw/master/PROSTATE_DEEPLABV3_1.0.pb
  


	#Install Keras
	#pip install keras

%runscript
	#Executes with the singularity run command
	
	which python
	python --version
	pwd
	. /env/bin/activate	
	
	python /software/CERR/CERR_core/Contouring/models/mr_prostate_DeepLab/run_inference_clinical_3D.py arg1=$1 arg2=$2	

%test
	#Test that script is a success

	#Load environment variables
	#. /environment

	#Test tensorflow install
	#python -c "import tensorflow"
{'fraction_non_alphanumeric': 0.08597701149425287, 'fraction_numerical': 0.013793103448275862, 'mean_word_length': 3.2120038722168442, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4937226', 'n_tokens_mistral': 1684, 'n_tokens_neox': 1550, 'n_words': 434}