<commit_before>#!/usr/bin/env bash

set -e -o -x errexit

# Script called by Terraform to do all the things just like we used to in the 90s.
# Things must go in Chef!

#
# Pull off git
#
pushd ~
git clone --depth 1 https://github.com/Klazomenai/rehab.earth.git
popd

#
# Docker
#
yum install -y docker
systemctl start docker
sudo systemctl enable docker
curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker network create rehab.earth

#
# Vault
#
pushd ~/rehab.earth/docker/vault
docker-compose build
docker-compose up -d
popd

#
# Consul
#
pushd ~/rehab.earth/docker/consul
docker-compose up -d
popd

#
# Concourse
#
pushd ~/rehab.earth/docker/concourse
mkdir -p keys/web keys/worker
ssh-keygen -t rsa -f ./keys/web/tsa_host_key -N ''
ssh-keygen -t rsa -f ./keys/web/session_signing_key -N ''
ssh-keygen -t rsa -f ./keys/worker/worker_key -N ''
cp ./keys/worker/worker_key.pub ./keys/web/authorized_worker_keys
cp ./keys/web/tsa_host_key.pub ./keys/worker
docker-compose up -d
popd
# Fly for Concourse
wget -O fly -q https://github.com/concourse/concourse/releases/download/v2.7.0/fly_linux_amd64
mv fly /usr/local/bin/fly
chmod u+x /usr/local/bin/fly
# Looks like concourse needs a little sleep before it wakes up, this sleep needs sorting properly
sleep 20
# The start of the beginning and the end of bootstrap
# Starting to really need Vault!
fly --target lite login --concourse-url http://bootstrap:8080 --username=concourse --password=<PASSWORD>
fly --target lite set-pipeline --non-interactive --pipeline infra --config ~/rehab.earth/ci/pipeline.yml
fly --target lite unpause-pipeline --pipeline infra
<commit_msg>Ensure Consul starts firts<commit_after>#!/usr/bin/env bash

set -e -o -x errexit

# Script called by Terraform to do all the things just like we used to in the 90s.
# Things must go in Chef!

#
# Pull off git
#
pushd ~
git clone --depth 1 https://github.com/Klazomenai/rehab.earth.git
popd

#
# Docker
#
yum install -y docker
systemctl start docker
sudo systemctl enable docker
curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker network create rehab.earth

#
# Consul
#
pushd ~/rehab.earth/docker/consul
docker-compose up -d
popd
# Give consul a bit of time to wake, better poll could be used here
sleep 10

#
# Vault
#
pushd ~/rehab.earth/docker/vault
docker-compose build
docker-compose up -d
popd

#
# Concourse
#
pushd ~/rehab.earth/docker/concourse
mkdir -p keys/web keys/worker
ssh-keygen -t rsa -f ./keys/web/tsa_host_key -N ''
ssh-keygen -t rsa -f ./keys/web/session_signing_key -N ''
ssh-keygen -t rsa -f ./keys/worker/worker_key -N ''
cp ./keys/worker/worker_key.pub ./keys/web/authorized_worker_keys
cp ./keys/web/tsa_host_key.pub ./keys/worker
docker-compose up -d
popd
# Fly for Concourse
wget -O fly -q https://github.com/concourse/concourse/releases/download/v2.7.0/fly_linux_amd64
mv fly /usr/local/bin/fly
chmod u+x /usr/local/bin/fly
# Looks like concourse needs a little sleep before it wakes up, this sleep needs sorting properly
sleep 20
# The start of the beginning and the end of bootstrap
# Starting to really need Vault!
fly --target lite login --concourse-url http://bootstrap:8080 --username=concourse --password=<PASSWORD>
fly --target lite set-pipeline --non-interactive --pipeline infra --config ~/rehab.earth/ci/pipeline.yml
fly --target lite unpause-pipeline --pipeline infra

{'fraction_non_alphanumeric': 0.12277777777777778, 'fraction_numerical': 0.010555555555555556, 'mean_word_length': 3.6225930680359437, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '125224', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1286, 'n_words': 391}