<commit_before>#!/bin/bash

set -e
set -x

sudo aptitude update
sudo aptitude install -y git build-essential python-dev python-setuptools
sudo easy_install pip
sudo pip install ansible

if ! id | grep "(docker)" > /dev/null; then
  if ! getent group docker > /dev/null; then
    sudo groupadd -r docker
  fi
  sudo usermod -a -G docker $USER
  echo ""
  echo "Log out and log in again to make docker group effective for $USER, then run me again"
  echo ""
  exit 0
fi

PB_BRANCH=feature/multiple_containers#58
PB_REPO=https://github.com/CSC-IT-Center-for-Science/pouta-blueprints

set -e
set -x

pb_temp=$(mktemp -d)

git clone --branch $PB_BRANCH $PB_REPO $pb_temp/git

(
echo "[docker_host]"
echo "localhost ansible_connection=local"
) > $pb_temp/pb_ansible_inventory

export PYTHONUNBUFFERED=1
ansible-playbook -i $pb_temp/pb_ansible_inventory $pb_temp/git/ansible/prepare_vm.yml

cd $pb_temp/git && scripts/deploy_local_docker_containers.bash

rm -rf $pb_temp

<commit_msg>bootstrap script updated to make use of the docker role in the main playbook<commit_after>#!/bin/bash

set -e
set -x

if ! id | grep "(docker)" > /dev/null; then
  if ! getent group docker > /dev/null; then
    sudo groupadd -r docker
  fi
  sudo usermod -a -G docker $USER
  echo ""
  echo "Log out and log in again to make docker group effective for $USER, then run me again"
  echo ""
  exit 0
fi

sudo aptitude update
sudo aptitude install -y git build-essential python-dev python-setuptools
sudo easy_install pip
sudo pip install ansible==1.8.4

PB_BRANCH=wip/remote_deployment_v2
PB_REPO=https://github.com/CSC-IT-Center-for-Science/pouta-blueprints

pb_temp=$(mktemp -d)

git clone --branch $PB_BRANCH $PB_REPO $pb_temp/git

cat > $HOME/pb_ansible_inventory << END_AI
[docker_host]
localhost ansible_connection=local
END_AI

export ANSIBLE_HOST_KEY_CHECKING=0
export PYTHONUNBUFFERED=1
ansible-playbook -i $HOME/pb_ansible_inventory ansible/playbook.yml -e deploy_mode=docker

rm -rf $pb_temp


{'fraction_non_alphanumeric': 0.09453993933265925, 'fraction_numerical': 0.005561172901921132, 'mean_word_length': 4.263297872340425, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2994398', 'n_tokens_mistral': 765, 'n_tokens_neox': 715, 'n_words': 213}