Add RedHat Host Support

This commit is contained in:
2018-02-14 09:55:19 +01:00
parent 6c91db67ff
commit 64e90950a9
6 changed files with 104 additions and 33 deletions

49
install-redhat.sh Normal file
View File

@@ -0,0 +1,49 @@
#!/bin/sh
# Copyright (c) 2018-2018
# Data Intensive Applications and Systems Labaratory (DIAS)
# Ecole Polytechnique Federale de Lausanne
#
# All Rights Reserved.
#
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright notice
# and this permission notice appear in all copies of the software, derivative
# works or modified versions, and any portions thereof, and that both notices
# appear in supporting documentation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. THE AUTHORS AND ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE
# DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.
# Import settings
. ./settings.sh
# Following official instructions from:
# https://docs.docker.com/install/linux/docker-ce/centos/
# Install docker, for CentOS/RHEL
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
# You might be requested to accept the key:
echo <<EOT
Docker Repository correct key is:
060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
If prompted, check the key is correct and accept it.
EOT
sudo yum install docker-ce
sudo systemctl start docker
# Install docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

View File

@@ -20,6 +20,9 @@
# Import settings
. ./settings.sh
# Following official instructions from:
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
# Install docker, for ubuntu
sudo apt update
sudo apt install \
@@ -38,28 +41,3 @@ sudo apt install docker-ce
# Install docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# If requested, setup portainer:
if ${PORTAINER_ENABLED}
then
# Permanent storage for Portainer
mkdir -p ${PORTAINER_DATA}
sudo docker run -d -p ${PORTAINER_PORT}:9000 \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock:rw \
-v ${PORTAINER_DATA}:/data:rw \
--name ${COMPOSE_PROJECT_NAME}_${PORTAINER_HOST} \
${PORTAINER_IMAGE}${PORTAINER_VERSION}
fi
# Permanent storage for the Databases
mkdir -p ${DB_DATA}
mkdir -p ${DB_DATASETS}
sudo chown -R 999:999 ${DB_DATA} ${DB_DATASETS}
# Permanent storage for Mesos
mkdir -p ${MESOS_MASTER_LOGS}
mkdir -p ${MESOS_MASTER_TMP}
mkdir -p ${MESOS_SLAVE_LOGS}
mkdir -p ${MESOS_SLAVE_TMP}

View File

@@ -20,6 +20,9 @@
# Import settings
. ./settings.sh
# 1. Create all the DB at once
echo "Create databases..."
created_network=false
if ! docker network ls | grep -q ${MIP_PRIVATE_NETWORK}
then
@@ -27,13 +30,14 @@ then
created_network=true
fi
# 1. Create all the DB at once
echo "Create databases..."
if [ ! -d ${DB_DATA} ]
then
mkdir -p ${DB_DATA}
sudo chown -R 999:999 ${DB_DATA}
fi
for d in ${DB_DATA} ${DB_DATASETS}
do
if [ ! -d ${d} ]
then
mkdir -p ${d}
sudo chown -R 999:999 ${d}
fi
done
db_id=$(docker run --rm -d \
-e POSTGRES_USER="${DB_USER_ADMIN}" \
@@ -56,6 +60,7 @@ do
db_list="$db_list $t"
done
# Make sure Postgres has initialized, should be a while on pgready or something.
sleep 5
docker run --rm \

33
portainer.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# Copyright (c) 2018-2018
# Data Intensive Applications and Systems Labaratory (DIAS)
# Ecole Polytechnique Federale de Lausanne
#
# All Rights Reserved.
#
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright notice
# and this permission notice appear in all copies of the software, derivative
# works or modified versions, and any portions thereof, and that both notices
# appear in supporting documentation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. THE AUTHORS AND ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE
# DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
# USE OF THIS SOFTWARE.
# Import settings
. ./settings.sh
# Permanent storage for Portainer
test -d ${PORTAINER_DATA} \
|| mkdir -p ${PORTAINER_DATA} \
|| ( echo Failed to create ${PORTAINER_DATA}; exit 1 )
sudo docker run -d -p ${PORTAINER_PORT}:9000 \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock:rw \
-v ${PORTAINER_DATA}:/data:rw \
--name ${COMPOSE_PROJECT_NAME}_${PORTAINER_HOST} \
${PORTAINER_IMAGE}${PORTAINER_VERSION}

7
run.sh
View File

@@ -20,6 +20,13 @@
# Import settings
. ./settings.sh
# Permanent storage for Mesos
mkdir -p ${MESOS_MASTER_LOGS}
mkdir -p ${MESOS_MASTER_TMP}
mkdir -p ${MESOS_SLAVE_LOGS}
mkdir -p ${MESOS_SLAVE_TMP}
# Generate Configuration from templates
for f in ${WOKEN_CONF} ${WOKEN_VALIDATION_CONF}
do
for v in $(grep '^:' settings.default.sh|cut -c 5- |cut -d: -f1)

View File

@@ -82,7 +82,6 @@
: ${PORTAINER_HOST:="portainer"}
: ${PORTAINER_PORT:="9000"}
: ${PORTAINER_DATA:="${PWD}/portainer"}
: ${PORTAINER_ENABLED:="true"}
#############################################################################
# Services