<commit_before>#!/bin/bash

### Container information
#Paths
DOCKER_ROOT="/var/www/nailgun/docker"
IMAGE_DIR="${DOCKER_ROOT}/images"
SOURCE_DIR="${DOCKER_ROOT}/sources"
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor.d"
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor"
#SUPERVISOR_CONF_DIR="<%= @config_dir %>/supervisor/"
ASTUTE_YAML="<%= @astute_settings_file %>"
#Version of Fuel to deploy
VERSION=$(awk '/release/{gsub(/"/, "");print $2}' /etc/fuel/version.yaml || echo <%= @release %>)
IMAGE_PREFIX="fuel"
# busybox image for storage containers
BUSYBOX_IMAGE="busybox.tar.gz"
# base centos image for all containers
BASE_IMAGE="centos.tar.gz"
# Order in which to start all containers
CONTAINER_SEQUENCE="postgres rabbitmq keystone rsync astute rsyslog nailgun ostf nginx cobbler mcollective"

ZIP_EXT=${ZIP_EXT:-".tar.xz"}
# source images for apps
declare -A SOURCE_IMAGES
SOURCE_IMAGES['cobbler']="${IMAGE_DIR}/cobbler${ZIP_EXT}"
SOURCE_IMAGES['postgres']="${IMAGE_DIR}/postgres${ZIP_EXT}"
SOURCE_IMAGES['rabbitmq']="${IMAGE_DIR}/rabbitmq${ZIP_EXT}"
SOURCE_IMAGES['rsync']="${IMAGE_DIR}/rsync${ZIP_EXT}"
SOURCE_IMAGES['astute']="${IMAGE_DIR}/astute${ZIP_EXT}"
SOURCE_IMAGES['nailgun']="${IMAGE_DIR}/nailgun${ZIP_EXT}"
SOURCE_IMAGES['ostf']="${IMAGE_DIR}/ostf${ZIP_EXT}"
SOURCE_IMAGES['nginx']="${IMAGE_DIR}/nginx${ZIP_EXT}"
SOURCE_IMAGES['rsyslog']="${IMAGE_DIR}/rsyslog${ZIP_EXT}"
SOURCE_IMAGES['mcollective']="${IMAGE_DIR}/mcollective${ZIP_EXT}"
SOURCE_IMAGES['keystone']="${IMAGE_DIR}/keystone${ZIP_EXT}"

# storage container names
PREFIX_STORAGE="fuel-storage-${VERSION}-"
REPO_CNT="${PREFIX_STORAGE}repo"
PUPPET_CNT="${PREFIX_STORAGE}puppet"
LOG_CNT="${PREFIX_STORAGE}log"

# app container names
declare -A CONTAINER_NAMES
prefix="fuel-core-${VERSION}-"
CONTAINER_NAMES['cobbler']="${prefix}cobbler"
CONTAINER_NAMES['postgres']="${prefix}postgres"
CONTAINER_NAMES['rabbitmq']="${prefix}rabbitmq"
CONTAINER_NAMES['rsync']="${prefix}rsync"
CONTAINER_NAMES['astute']="${prefix}astute"
CONTAINER_NAMES['nailgun']="${prefix}nailgun"
CONTAINER_NAMES['ostf']="${prefix}ostf"
CONTAINER_NAMES['nginx']="${prefix}nginx"
CONTAINER_NAMES['rsyslog']="${prefix}rsyslog"
CONTAINER_NAMES['mcollective']="${prefix}mcollective"
CONTAINER_NAMES['keystone']="${prefix}keystone"

# app container options
declare -A CONTAINER_OPTIONS
base_opts="-t"
FOREGROUND="-i"
BACKGROUND="-d"
CONTAINER_OPTIONS["cobbler"]="-p 53:53/udp -p 69:69/udp -p 80:80 -p 443:443 --privileged $base_opts"
CONTAINER_OPTIONS["postgres"]="-p 5432:5432 $base_opts"
CONTAINER_OPTIONS["rabbitmq"]="-p 5672:5672 -p 4369:4369 -p 15672:15672 -p 61613:61613 $base_opts"
CONTAINER_OPTIONS["rsync"]="-p 873:873 $base_opts"
CONTAINER_OPTIONS["astute"]="$base_opts"
CONTAINER_OPTIONS["nailgun"]="-v /etc/nailgun -p 8001:8001 $base_opts"
CONTAINER_OPTIONS["ostf"]="-p 8777:8777 $base_opts"
CONTAINER_OPTIONS["nginx"]="-p 8000:8000 -p 8080:8080 $base_opts"
CONTAINER_OPTIONS["rsyslog"]="--privileged -p 514:514 -p 514:514/udp -p 25150 $base_opts"
CONTAINER_OPTIONS["mcollective"]="--privileged $base_opts"
CONTAINER_OPTIONS["keystone"]="-p 5000:5000 -p 35357:35357 $base_opts"

######
#DRAFT: Dependency of volumes for deployment
#####

#Host volumes
declare -A HOST_VOL
HOST_VOL['repo']="-v /var/www/nailgun:/var/www/nailgun:ro"
HOST_VOL['reporw']="-v /var/www/nailgun:/var/www/nailgun:rw"
HOST_VOL['puppet']="-v /etc/puppet:/puppet:ro"
HOST_VOL['sshkey']="-v /root/.ssh:/root/.ssh:ro"
HOST_VOL['astuteyaml']="-v /etc/fuel:/etc/fuel:ro"
HOST_VOL['remotelogs']="-v /var/log/remote:/remote"
HOST_VOL['dockerlogs']="-v /var/log/docker-logs:/log"

#Storage container volume mounts
declare -A CONTAINER_VOLUMES
CONTAINER_VOLUMES[$REPO_CNT]="${HOST_VOL['repo']}"<commit_msg>Allow mcollective rw access to dump directory<commit_after>#!/bin/bash

### Container information
#Paths
DOCKER_ROOT="/var/www/nailgun/docker"
IMAGE_DIR="${DOCKER_ROOT}/images"
SOURCE_DIR="${DOCKER_ROOT}/sources"
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor.d"
#SUPERVISOR_CONF_DIR="${docker_root}/supervisor"
#SUPERVISOR_CONF_DIR="<%= @config_dir %>/supervisor/"
ASTUTE_YAML="<%= @astute_settings_file %>"
#Version of Fuel to deploy
VERSION=$(awk '/release/{gsub(/"/, "");print $2}' /etc/fuel/version.yaml || echo <%= @release %>)
IMAGE_PREFIX="fuel"
# busybox image for storage containers
BUSYBOX_IMAGE="busybox.tar.gz"
# base centos image for all containers
BASE_IMAGE="centos.tar.gz"
# Order in which to start all containers
CONTAINER_SEQUENCE="postgres rabbitmq keystone rsync astute rsyslog nailgun ostf nginx cobbler mcollective"

ZIP_EXT=${ZIP_EXT:-".tar.xz"}
# source images for apps
declare -A SOURCE_IMAGES
SOURCE_IMAGES['cobbler']="${IMAGE_DIR}/cobbler${ZIP_EXT}"
SOURCE_IMAGES['postgres']="${IMAGE_DIR}/postgres${ZIP_EXT}"
SOURCE_IMAGES['rabbitmq']="${IMAGE_DIR}/rabbitmq${ZIP_EXT}"
SOURCE_IMAGES['rsync']="${IMAGE_DIR}/rsync${ZIP_EXT}"
SOURCE_IMAGES['astute']="${IMAGE_DIR}/astute${ZIP_EXT}"
SOURCE_IMAGES['nailgun']="${IMAGE_DIR}/nailgun${ZIP_EXT}"
SOURCE_IMAGES['ostf']="${IMAGE_DIR}/ostf${ZIP_EXT}"
SOURCE_IMAGES['nginx']="${IMAGE_DIR}/nginx${ZIP_EXT}"
SOURCE_IMAGES['rsyslog']="${IMAGE_DIR}/rsyslog${ZIP_EXT}"
SOURCE_IMAGES['mcollective']="${IMAGE_DIR}/mcollective${ZIP_EXT}"
SOURCE_IMAGES['keystone']="${IMAGE_DIR}/keystone${ZIP_EXT}"

# storage container names
PREFIX_STORAGE="fuel-storage-${VERSION}-"
REPO_CNT="${PREFIX_STORAGE}repo"
PUPPET_CNT="${PREFIX_STORAGE}puppet"
LOG_CNT="${PREFIX_STORAGE}log"

# app container names
declare -A CONTAINER_NAMES
prefix="fuel-core-${VERSION}-"
CONTAINER_NAMES['cobbler']="${prefix}cobbler"
CONTAINER_NAMES['postgres']="${prefix}postgres"
CONTAINER_NAMES['rabbitmq']="${prefix}rabbitmq"
CONTAINER_NAMES['rsync']="${prefix}rsync"
CONTAINER_NAMES['astute']="${prefix}astute"
CONTAINER_NAMES['nailgun']="${prefix}nailgun"
CONTAINER_NAMES['ostf']="${prefix}ostf"
CONTAINER_NAMES['nginx']="${prefix}nginx"
CONTAINER_NAMES['rsyslog']="${prefix}rsyslog"
CONTAINER_NAMES['mcollective']="${prefix}mcollective"
CONTAINER_NAMES['keystone']="${prefix}keystone"

# app container options
declare -A CONTAINER_OPTIONS
base_opts="-t"
FOREGROUND="-i"
BACKGROUND="-d"
CONTAINER_OPTIONS["cobbler"]="-p 53:53/udp -p 69:69/udp -p 80:80 -p 443:443 --privileged $base_opts"
CONTAINER_OPTIONS["postgres"]="-p 5432:5432 $base_opts"
CONTAINER_OPTIONS["rabbitmq"]="-p 5672:5672 -p 4369:4369 -p 15672:15672 -p 61613:61613 $base_opts"
CONTAINER_OPTIONS["rsync"]="-p 873:873 $base_opts"
CONTAINER_OPTIONS["astute"]="$base_opts"
CONTAINER_OPTIONS["nailgun"]="-v /etc/nailgun -p 8001:8001 $base_opts"
CONTAINER_OPTIONS["ostf"]="-p 8777:8777 $base_opts"
CONTAINER_OPTIONS["nginx"]="-p 8000:8000 -p 8080:8080 $base_opts"
CONTAINER_OPTIONS["rsyslog"]="--privileged -p 514:514 -p 514:514/udp -p 25150 $base_opts"
CONTAINER_OPTIONS["mcollective"]="--privileged $base_opts"
CONTAINER_OPTIONS["keystone"]="-p 5000:5000 -p 35357:35357 $base_opts"

######
#DRAFT: Dependency of volumes for deployment
#####

#Host volumes
declare -A HOST_VOL
HOST_VOL['repo']="-v /var/www/nailgun:/var/www/nailgun"
HOST_VOL['reporw']="-v /var/www/nailgun:/var/www/nailgun"
HOST_VOL['puppet']="-v /etc/puppet:/puppet:ro"
HOST_VOL['sshkey']="-v /root/.ssh:/root/.ssh:ro"
HOST_VOL['astuteyaml']="-v /etc/fuel:/etc/fuel:ro"
HOST_VOL['remotelogs']="-v /var/log/remote:/remote"
HOST_VOL['dockerlogs']="-v /var/log/docker-logs:/log"

#Storage container volume mounts
declare -A CONTAINER_VOLUMES
CONTAINER_VOLUMES[$REPO_CNT]="${HOST_VOL['repo']}"
{'fraction_non_alphanumeric': 0.19270972929509514, 'fraction_numerical': 0.036451353524524256, 'mean_word_length': 9.738129496402877, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, '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': '5040665', 'n_tokens_mistral': 3236, 'n_tokens_neox': 2861, 'n_words': 401}