Skip to content

Commit

Permalink
Merge pull request #281 from padthaitofuhot/develop
Browse files Browse the repository at this point in the history
release 2.2.0
  • Loading branch information
padthaitofuhot committed Jun 20, 2017
2 parents c9c3490 + 347c0c4 commit b536249
Show file tree
Hide file tree
Showing 75 changed files with 662 additions and 5,644 deletions.
9 changes: 3 additions & 6 deletions README.md
Expand Up @@ -73,8 +73,8 @@ Please be aware that Install Node bootstrapping requires Internet access to the

If you prefer to download a prefab Install Node as an OVF/OVA, follow one of the links below. Please note that OVAs are produced upon each release and do not necessarily have the most current software.

* [dellemc-ecsce-3.0.0.1-install-node-2.1.0-vm0.ova](http://130852476153187606.public.ecstestdrive.com/public/dellemc-ecsce-3.0.0.1-install-node-2.1.0-vm0.ova)
* [dellemc-ecsce-3.0.0.1-install-node-2.1.0-vm0.ova.xz](http://130852476153187606.public.ecstestdrive.com/public/dellemc-ecsce-3.0.0.1-install-node-2.1.0-vm0.ova.xz)
* [dellemc-ecsce-3.0.0.1-install-node-2.2.0-vm0.ova](http://130852476153187606.public.ecstestdrive.com/public/dellemc-ecsce-3.0.0.1-install-node-2.2.0-vm0.ova)
* [dellemc-ecsce-3.0.0.1-install-node-2.2.0-vm0.ova.xz](http://130852476153187606.public.ecstestdrive.com/public/dellemc-ecsce-3.0.0.1-install-node-2.2.0-vm0.ova.xz)

#### [ECS Single-Node Deployment with Install Node (recommended)](docs/source/installation/ECS-Installation.md)
Using an Install Node for isolated environments, deploy a stand-alone instance of ECS to a single hardware or virtual machine.
Expand All @@ -95,10 +95,7 @@ Using an Install Node for isolated environments, deploy a multi-node ECS instanc
| [release.conf](https://github.com/EMCECS/ECS-CommunityEdition/blob/develop/release.conf) | Installer release information file
| [ui](https://github.com/EMCECS/ECS-CommunityEdition/tree/develop/ui) | Install Node utilities and support files
| [bootstrap_plugins](https://github.com/EMCECS/ECS-CommunityEdition/tree/develop/bootstrap_plugins) | Install Node bootstrap script support files
| [legacy](https://github.com/EMCECS/ECS-CommunityEdition/tree/develop/legacy) | (Legacy) Deployment scripts
| [legacy/ecs-single-node](https://github.com/EMCECS/ECS-CommunityEdition/tree/develop/legacy/ecs-single-node) | (Legacy) Contains the scripts to run a Elastic Cloud Storage single Node Docker and Vagrant deployments|
| [legacy/ecs-multi-node](https://github.com/EMCECS/ECS-CommunityEdition/tree/develop/legacy/ecs-multi-node) | (Legacy) Contains the scripts to run a Elastic Cloud Storage Multiple Node Docker deployment|
| [legacy/Documentation](https://github.com/EMCECS/ECS-CommunityEdition/tree/develop/legacy/Documentation) | (Legacy) Contains documentation files and media|


# Support

Expand Down
17 changes: 15 additions & 2 deletions bootstrap.sh
Expand Up @@ -22,7 +22,7 @@ set -o pipefail
# TODO: Add GitHub URLs to help text (bottom)
usage() {
log "providing usage info"
cat <<EOH
cat <<EOH | more
[Usage]
-h This help text
Expand Down Expand Up @@ -57,6 +57,10 @@ cat <<EOH
You may be prompted for your credentials if authentication is required.
You may need to use -d (below) to add the registry's cert to Docker.
-l After Docker is installed, login to the Docker registry to access images
which require access authentication. Login to Dockerhub by default unless
-r is used.
-d <x509.crt> NOTE: This does nothing unless -r is also given.
If an alternate Docker registry was specified with -r and uses a cert
that cannot be resolved from the anchors in the local system's trust
Expand Down Expand Up @@ -120,6 +124,7 @@ proxy_test_val="google.com:80"
build_image_flag=false
registry_flag=false
registry_val=''
dlogin_flag=false
regcert_flag=false
regcert_val=''
vm_flag=false
Expand All @@ -138,7 +143,7 @@ mirror_flag=false
mirror_val=''

### Argue with arguments
while getopts ":zyngqvhc:b:m:o:p:k:t:d:r:" opt; do
while getopts ":zynglqvhc:b:m:o:p:k:t:d:r:" opt; do
case $opt in
b)
export build_image_flag=true
Expand All @@ -164,6 +169,9 @@ while getopts ":zyngqvhc:b:m:o:p:k:t:d:r:" opt; do
export mitm_val="${OPTARG}"
ensure_file_exists "${mitm_val}" "HTTPS proxy cert"
;;
l)
export dlogin_flag=true
;;
m)
export mirror_flag=true
export mirror_val="${OPTARG}"
Expand Down Expand Up @@ -469,6 +477,11 @@ fi
docker_registry
ping_sudo

###
v "Check if Docker login needed"
if $dlogin_flag; then
retry_until_ok docker login
fi

### Test Docker install
v "Testing docker installation"
Expand Down
208 changes: 208 additions & 0 deletions bootstrap_plugins/centos72.plugin.sh
@@ -0,0 +1,208 @@
#@IgnoreInspection BashAddShebang

# Copyright (c) 2015 EMC Corporation
# All Rights Reserved
#
# This software contains the intellectual property of EMC Corporation
# or is licensed to EMC Corporation from third parties. Use of this
# software and the intellectual property contained therein is expressly
# limited to the terms and conditions of the License Agreement under which
# it is provided by or on behalf of EMC.

# OS Support library for CentOS 7.3

os_supported=true

# Docker binary
docker_binary='/bin/docker'

# packages to clean up during preflight
list_preflight_packages="git nfs-client"
#nfs-tools"

# Do any OS-specific tasks that must be done prior to bootstrap
do_preflight() {
rm_repo_pkg "$list_preflight_packages"
}

# packages to install before others
#list_prefix_packages='epel-release python-devel wget curl ntp'
list_prefix_packages='wget curl ntp epel-release yum-utils'

# script to run for installing prefix_packages
in_prefix_packages() {
in_repo_pkg "$list_prefix_packages"
if ! docker version; then
curl -fsSL https://get.docker.com/ | sudo sh
fi
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker $(whoami)
}

# packages to install
# list_general_packages='yum-utils git python-pip python-docker-py'
list_general_packages='git python-docker-py'

# script to run for installing general_packages
in_general_packages() {
in_repo_pkg "$list_general_packages"
# sudo pip install --upgrade pip
# sudo pip install --upgrade virtualenv
}

# packages to install after others
# list_suffix_packages='vim htop iotop iftop jq rsync pigz gdisk aria2'
list_suffix_packages='htop jq pigz gdisk aria2 firewalld'

# script to run for installing suffix_packages
in_suffix_packages() {
in_repo_pkg "$list_suffix_packages"

# Install Rocker
curl -fsSL ${rocker_artifact_url} \
| sudo tar -xzC /usr/local/bin && sudo chmod +x /usr/local/bin/rocker
}

# packages to install if a VM
list_vm_packages='dkms qemu-guest-agent open-vm-tools'

# command to run for installing vm_packages
in_vm_packages() {
in_repo_pkg "$list_vm_packages"
# return 0
}

# command to install one or more os package manager package
in_repo_pkg() {
while ! sudo yum -y install $*; do
sleep 5
done
}

rm_repo_pkg() {
sudo yum -y autoremove $*
}

# command to update all packages in the os package manager
up_repo_pkg_all() {
sudo yum -y update
}

# command to rebuild the os package manager's database
up_repo_db() {
while ! sudo yum -y makecache; do
sleep 10
# retry
done
}

# command to set os package manager proxy
set_repo_proxy_conf() {
sudo sed -i -e '/^proxy=/d' /etc/yum.conf
echo "proxy=${http_proxy}" \
| append /etc/yum.conf
}

# command to set os package manager to keep its cache
set_repo_keepcache_conf() {
sudo sed -i -e '/^keepcache=/d' /etc/yum.conf
echo "keepcache=1" \
| append /etc/yum.conf
}

# idempotent config script to fixup repos to properly use proxycaches
set_repo_cacheable_idempotent() {
sudo sed -i -e 's/^#baseurl=/baseurl=/' /etc/yum.repos.d/*
sudo sed -i -e 's/^mirrorlist=/#mirrorlist=/' /etc/yum.repos.d/*
}

set_repo_mirror_idempotent() {
# sudo sed -i -e "s#http:///centos#http://${mirror_val}/centos#g" /etc/yum.repos.d/*
sudo sed -i -e "s#http://.*/centos#http://${mirror_val}/centos#g" /etc/yum.repos.d/*
}

# command to set the proxy for the whole OS
set_os_proxy() {
sudo sed -i -e '/_proxy/d' /etc/environment
echo -n "http_proxy=${http_proxy}\nhttps_proxy=${http_proxy}\nftp_proxy=${http_proxy}\n" \
| append /etc/environment
if $mirror_flag; then
echo -n "no_proxy=${mirror_val}\n" | append /etc/environment
fi
}

# command to determine if the OS needs restarting after package updates
get_os_needs_restarting() {
if ! [ -z "$(sudo /usr/bin/needs-restarting)" ]; then
return 0
else
return 1
fi
}

# command to reboot the system
do_reboot() {
sudo reboot
}

# Command to configure docker's proxy under centos flavored systemd
set_docker_proxy() {
local tmpconf="/etc/systemd/system/docker.service.d/http-proxy.conf"
if ! [ -d "$(dirname $tmpconf)" ]; then
sudo mkdir "$(dirname $tmpconf)"
fi
log "sed error is OK here if the proxy config file does not yet exist."
sudo sed -i -e '/HTTP_PROXY/d' "$tmpconf"
echo "Environment=\"HTTP_PROXY=${http_proxy}\" \"NO_PROXY=localhost,127.0.0.1,$(hostname),$(hostname -f)\"" \
| append "$tmpconf"
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl status docker
}

# command to add mitm cert to docker trust store
set_docker_reg_cert() {
local registry="${1}"
local cert="${2}"
if ! [ -d "/etc/docker/certs.d/${registry}" ]; then
sudo mkdir -p "/etc/docker/certs.d/${registry}"
sudo cp "${cert}" "/etc/docker/certs.d/${registry}/ca.crt"
else
if [ -f "/etc/docker/certs.d/${registry}/ca.crt" ]; then
echo "Reusing existing /etc/docker/certs.d/${registry}/ca.crt"
else
sudo cp "${cert}" "/etc/docker/certs.d/${registry}/ca.crt"
fi
fi
set_mitm_cert "${cert}"
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl status docker
}

# command to add mitm cert to local trust store
set_mitm_cert() {
sudo cp "${1}" "/etc/pki/ca-trust/source/anchors/$(basename ${1}).crt"
sudo update-ca-trust extract
}

do_post_install() {
# Disable postfix since we don't need an MTA
sudo systemctl disable --now postfix
}

override_dhcp_dns() {
nameserver_list="${1}"
sudo sed -i -e 's/PEERDNS="yes"/PEERDNS="no"/' /etc/sysconfig/network-scripts/ifcfg-*
sudo sed -i -e '/DNS[0-9]=/d' /etc/sysconfig/network-scripts/ifcfg-*
sudo sed -i -e '/nameserver/d' /etc/resolv.conf
nsnumber=1
for nameserver in $(echo ${nameserver_list} | tr ',' ' '); do
echo "nameserver ${nameserver}" | append /etc/resolv.conf
for script in /etc/sysconfig/network-scripts/ifcfg-*; do
echo "DNS${nsnumber}=${nameserver}" | append "${script}"
done
nsnumber=$((nsnumber++))
done
}
1 change: 1 addition & 0 deletions bootstrap_plugins/centos73.plugin.sh
Expand Up @@ -18,6 +18,7 @@ docker_binary='/bin/docker'

# packages to clean up during preflight
list_preflight_packages="git"
#nfs-tools"

# Do any OS-specific tasks that must be done prior to bootstrap
do_preflight() {
Expand Down
6 changes: 3 additions & 3 deletions bootstrap_plugins/os-router.plugin.sh
Expand Up @@ -58,9 +58,9 @@ route_os() {

case "${os}" in

# centos\ linux\ release\ 7.2*)
# source ${plugins}/centos72.plugin.sh
# ;;
centos\ linux\ release\ 7.2*)
source ${plugins}/centos72.plugin.sh
;;

centos\ linux\ release\ 7.3*)
source ${plugins}/centos73.plugin.sh
Expand Down
5 changes: 1 addition & 4 deletions docs/design/reference.deploy.yml
Expand Up @@ -83,10 +83,7 @@ facts:
storage_pools:
- name: sp1
members:
- 192.168.2.220
- 192.168.2.221
- 192.168.2.222
- 192.168.2.223
- 192.168.2.200
options:
is_protected: false
is_cold_storage_enabled: false
Expand Down

0 comments on commit b536249

Please sign in to comment.