<commit_before>WORK_DIR=`pwd`

sudo apt-get update

#install java 7 if needed
JAVA_VER=`java -version 2>&1 | grep "java version" | awk '{print $3}' | tr -d \" | awk '{split($0, array, ".")} END{print array[2]}'`
if [ "$JAVA_VER" -ge 7 ]; then
    echo "Java 7 or greater detected."
else
    echo "Java version is lower than 7."
    sudo apt-get -y install openjdk-7-jre-headless
fi

#install nextflow if needed
cd $HOME
if [ ! -d nextflow/ ]; then
	mkdir -p nextflow
	cd nextflow/
	curl -fsSL get.nextflow.io | bash
else
	echo "Nextflow is already installed on this machine."
fi

#add to PATH
echo "export PATH=$HOME/nextflow:$PATH" >> $HOME/.bashrc

# install docker if needed
if [ -z `which docker` ]; then
	sudo apt-get -y install apt-transport-https ca-certificates
	sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys <KEY>

	# Add the repository to your APT sources
	echo "deb https://apt.dockerproject.org/repo ubuntu-precise main" > docker.list && sudo mv docker.list /etc/apt/sources.list.d/
	sudo apt-get update
	apt-cache policy docker-engine

	# Install docker and start
	sudo apt-get -y install docker-engine
	sudo service docker start
else 
	echo "Docker is already installed on this machine."
fi

# Test the installation
sudo docker run hello-world

cd $WORK_DIR<commit_msg>Create the docker group and add the ubuntu user.<commit_after>WORK_DIR=`pwd`

sudo apt-get update

#install java 7 if needed
JAVA_VER=`java -version 2>&1 | grep "java version" | awk '{print $3}' | tr -d \" | awk '{split($0, array, ".")} END{print array[2]}'`
if [ "$JAVA_VER" -ge 7 ]; then
    echo "Java 7 or greater detected."
else
    echo "Java version is lower than 7."
    sudo apt-get -y install openjdk-7-jre-headless
fi

#install nextflow if needed
cd $HOME
if [ ! -d nextflow/ ]; then
	mkdir -p nextflow
	cd nextflow/
	curl -fsSL get.nextflow.io | bash
else
	echo "Nextflow is already installed on this machine."
fi

#add to PATH
echo "export PATH=$HOME/nextflow:$PATH" >> $HOME/.bashrc

# install docker if needed
if [ -z `which docker` ]; then
	sudo apt-get -y install apt-transport-https ca-certificates
	sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys <KEY>

	# Add the repository to your APT sources
	echo "deb https://apt.dockerproject.org/repo ubuntu-precise main" > docker.list && sudo mv docker.list /etc/apt/sources.list.d/
	sudo apt-get update
	apt-cache policy docker-engine

	# Install docker and start the daemon
	sudo apt-get -y install docker-engine
	sudo service docker start
	
	#create the docker group and add the docker user. This avoids to have to use sudo in all the docker commands. Nextflow won't work without this setting.
	sudo usermod -aG docker ubuntu	
	
else 
	echo "Docker is already installed on this machine."
fi

# Test the installation
sudo docker run hello-world

cd $WORK_DIR
{'fraction_non_alphanumeric': 0.1099092812281926, 'fraction_numerical': 0.009769713886950453, 'mean_word_length': 3.6167471819645733, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5877886', 'n_tokens_mistral': 1035, 'n_tokens_neox': 927, 'n_words': 367}