Merge "Add a dev script to kick off Airship in a Bottle"
This commit is contained in:
commit
2348594153
19
README.md
19
README.md
|
@ -1,11 +1,20 @@
|
||||||
# UCP Integration
|
# Airship in a Bottle
|
||||||
|
|
||||||
UCP, or Undercloud Platform, is a broad integration of several components
|
Airship is a new name for the project, formerly known as UCP. References to
|
||||||
|
'UCP' or 'Undercloud Platform' will be corrected in time.
|
||||||
|
|
||||||
|
Airship is a broad integration of several components
|
||||||
enabling an automated, resilient Kubernetes-based infrastructure for hosting
|
enabling an automated, resilient Kubernetes-based infrastructure for hosting
|
||||||
Helm-deployed containerized workloads
|
Helm-deployed containerized workloads.
|
||||||
|
|
||||||
Find documentation for Undercloud Platform Integration on
|
To get started, run the following in a fresh VM:
|
||||||
[readthedocs](http://ucpintegration.readthedocs.org).
|
```
|
||||||
|
sudo -i
|
||||||
|
mkdir -p /root/deploy && cd "$_"
|
||||||
|
git clone https://github.com/openstack/airship-in-a-bottle
|
||||||
|
cd /root/deploy/airship-in-a-bottle/manifests/dev_single_node
|
||||||
|
./airship-in-a-bottle.sh
|
||||||
|
```
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# #
|
||||||
|
# Set up and deploy a Airship environment for development/testing purposes. #
|
||||||
|
# Many of the defaults and sources used here are NOT production ready, and #
|
||||||
|
# this should not be used as a copy/paste source for any production use. #
|
||||||
|
# #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
echo "Welcome to Airship in a Bottle"
|
||||||
|
echo " /--------------------\\"
|
||||||
|
echo "| \\"
|
||||||
|
echo "| |---| \\----"
|
||||||
|
echo "| | x | \\"
|
||||||
|
echo "| |---| |"
|
||||||
|
echo "| | /"
|
||||||
|
echo "| \____|____/ /----"
|
||||||
|
echo "| /"
|
||||||
|
echo " \--------------------/"
|
||||||
|
sleep 1
|
||||||
|
echo ""
|
||||||
|
echo "The minimum recommended size of the VM is 4 vCPUs, 16GB of RAM with 64GB disk space."
|
||||||
|
sleep 1
|
||||||
|
echo "Let's collect some information about your VM to get started."
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# IP and Hostname setup
|
||||||
|
HOST_IFACE=$(ip route | grep "^default" | head -1 | awk '{ print $5 }')
|
||||||
|
read -p "Is your HOST IFACE $HOST_IFACE? (y/n) " YN_HI
|
||||||
|
if [ "$YN_HI" != "y" ]; then
|
||||||
|
read -p "What is your HOST IFACE? " HOST_IFACE
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOCAL_IP=$(ip addr | awk "/inet/ && /${HOST_IFACE}/{sub(/\/.*$/,\"\",\$2); print \$2}")
|
||||||
|
read -p "Is your LOCAL IP $LOCAL_IP? (y/n) " YN_IP
|
||||||
|
if [ "$YN_IP" != "y" ]; then
|
||||||
|
read -p "What is your LOCAL IP? " LOCAL_IP
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Updates the /etc/hosts file
|
||||||
|
HOSTS="${LOCAL_IP} ${HOSTNAME}"
|
||||||
|
HOSTS_REGEX="${LOCAL_IP}.*${HOSTNAME}"
|
||||||
|
if grep -q "$HOSTS_REGEX" "/etc/hosts"; then
|
||||||
|
echo "Not updating /etc/hosts, entry ${HOSTS} already exists."
|
||||||
|
else
|
||||||
|
echo "Updating /etc/hosts with: ${HOSTS}"
|
||||||
|
cat << EOF | sudo tee -a /etc/hosts
|
||||||
|
$HOSTS
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
# x/32 will work for CEPH in a single node deploy.
|
||||||
|
CIDR="$LOCAL_IP/32"
|
||||||
|
|
||||||
|
# Variable setup
|
||||||
|
set -x
|
||||||
|
# The IP address of the genesis node
|
||||||
|
export HOSTIP=$LOCAL_IP
|
||||||
|
# The CIDR of the network for the genesis node
|
||||||
|
export HOSTCIDR=$CIDR
|
||||||
|
# The network interface on the genesis node
|
||||||
|
export NODE_NET_IFACE=$HOST_IFACE
|
||||||
|
|
||||||
|
export TARGET_SITE="dev"
|
||||||
|
set +x
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Starting Airship deployment..."
|
||||||
|
sleep 1
|
||||||
|
./deploy-airship.sh
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# #
|
# #
|
||||||
# Set up and deploy a UCP environment for development/testing purposes. #
|
# Set up and deploy an Airship environment for development/testing purposes. #
|
||||||
# Many of the defaults and sources used here are NOT production ready, and #
|
# Many of the defaults and sources used here are NOT production ready, and #
|
||||||
# this should not be used as a copy/paste source for any production use. #
|
# this should not be used as a copy/paste source for any production use. #
|
||||||
# #
|
# #
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# IMPORTANT:
|
# IMPORTANT:
|
||||||
# If the directory for ucp-integration is already cloned into $WORKSPACE,
|
# If the directory for airship-in-a-bottle is already cloned into $WORKSPACE,
|
||||||
# it will not be re-cloned. This can be used to set up different tests, like
|
# it will not be re-cloned. This can be used to set up different tests, like
|
||||||
# changing the versions and contents of the design before running this script
|
# changing the versions and contents of the design before running this script
|
||||||
|
|
||||||
|
@ -47,19 +47,19 @@ NODE_NET_IFACE=${NODE_NET_IFACE:-""}
|
||||||
|
|
||||||
|
|
||||||
# Repositories
|
# Repositories
|
||||||
UCP_INTEGRATION_REPO=${UCP_INTEGRATION_REPO:-"https://github.com/att-comdev/ucp-integration"}
|
AIRSHIP_IN_A_BOTTLE_REPO=${AIRSHIP_IN_A_BOTTLE_REPO:-"https://github.com/openstack/airship-in-a-bottle"}
|
||||||
UCP_INTEGRATION_REFSPEC=${UCP_INTEGRATION_REFSPEC:-""}
|
AIRSHIP_IN_A_BOTTLE_REFSPEC=${AIRSHIP_IN_A_BOTTLE_REFSPEC:-""}
|
||||||
PEGLEG_REPO=${PEGLEG_REPO:-"https://github.com/att-comdev/pegleg.git"}
|
PEGLEG_REPO=${PEGLEG_REPO:-"https://github.com/openstack/airship-pegleg.git"}
|
||||||
PEGLEG_REFSPEC=${PEGLEG_REFSPEC:-""}
|
PEGLEG_REFSPEC=${PEGLEG_REFSPEC:-""}
|
||||||
SHIPYARD_REPO=${SHIPYARD_REPO:-"https://github.com/att-comdev/shipyard.git"}
|
SHIPYARD_REPO=${SHIPYARD_REPO:-"https://github.com/openstack/airship-shipyard.git"}
|
||||||
SHIPYARD_REFSPEC=${SHIPYARD_REFSPEC:-""}
|
SHIPYARD_REFSPEC=${SHIPYARD_REFSPEC:-""}
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
PEGLEG_IMAGE=${PEGLEG_IMAGE:-"artifacts-aic.atlantafoundry.com/att-comdev/pegleg:latest"}
|
PEGLEG_IMAGE=${PEGLEG_IMAGE:-"artifacts-aic.artifacts-aic.atlantafoundry.com/att-comdev/pegleg:latest"}
|
||||||
PROMENADE_IMAGE=${PROMENADE_IMAGE:-"quay.io/attcomdev/promenade:latest"}
|
PROMENADE_IMAGE=${PROMENADE_IMAGE:-"quay.io/attcomdev/promenade:latest"}
|
||||||
|
|
||||||
# Command shortcuts
|
# Command shortcuts
|
||||||
PEGLEG=${WORKSPACE}/pegleg/tools/pegleg.sh
|
PEGLEG=${WORKSPACE}/airship-pegleg/tools/pegleg.sh
|
||||||
|
|
||||||
function check_preconditions() {
|
function check_preconditions() {
|
||||||
set +x
|
set +x
|
||||||
|
@ -125,14 +125,14 @@ function setup_repos() {
|
||||||
# Clone and pull the various git repos
|
# Clone and pull the various git repos
|
||||||
# Get pegleg for the script only. Image is separately referenced.
|
# Get pegleg for the script only. Image is separately referenced.
|
||||||
get_repo pegleg ${PEGLEG_REPO} ${PEGLEG_REFSPEC}
|
get_repo pegleg ${PEGLEG_REPO} ${PEGLEG_REFSPEC}
|
||||||
# Get ucp-integration for the design
|
# Get airship-in-a-bottle for the design
|
||||||
get_repo ucp-integration ${UCP_INTEGRATION_REPO} ${UCP_INTEGRATION_REFSPEC}
|
get_repo airship-in-a-bottle ${AIRSHIP_IN_A_BOTTLE_REPO} ${AIRSHIP_IN_A_BOTTLE_REFSPEC}
|
||||||
# Get Shipyard for use after genesis
|
# Get Shipyard for use after genesis
|
||||||
get_repo shipyard ${SHIPYARD_REPO} ${SHIPYARD_REFSPEC}
|
get_repo shipyard ${SHIPYARD_REPO} ${SHIPYARD_REFSPEC}
|
||||||
}
|
}
|
||||||
|
|
||||||
function configure_dev_configurables() {
|
function configure_dev_configurables() {
|
||||||
cat << EOF >> ${WORKSPACE}/ucp-integration/deployment_files/site/${TARGET_SITE}/deployment/dev-configurables.yaml
|
cat << EOF >> ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/deployment/dev-configurables.yaml
|
||||||
data:
|
data:
|
||||||
hostname: ${HOSTNAME}
|
hostname: ${HOSTNAME}
|
||||||
hostip: ${HOSTIP}
|
hostip: ${HOSTIP}
|
||||||
|
@ -149,7 +149,7 @@ function install_dependencies() {
|
||||||
|
|
||||||
function run_pegleg_collect() {
|
function run_pegleg_collect() {
|
||||||
# Runs pegleg collect to get the documents combined
|
# Runs pegleg collect to get the documents combined
|
||||||
IMAGE=${PEGLEG_IMAGE} ${PEGLEG} site -p /workspace/ucp-integration/deployment_files collect ${TARGET_SITE} -s /workspace/collected
|
IMAGE=${PEGLEG_IMAGE} ${PEGLEG} site -p /workspace/airship-in-a-bottle/deployment_files collect ${TARGET_SITE} -s /workspace/collected
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_certs() {
|
function generate_certs() {
|
||||||
|
@ -177,12 +177,12 @@ function generate_certs() {
|
||||||
$(ls ${WORKSPACE}/genesis)
|
$(ls ${WORKSPACE}/genesis)
|
||||||
|
|
||||||
# Copy the generated certs back into the deployment_files structure
|
# Copy the generated certs back into the deployment_files structure
|
||||||
cp ${WORKSPACE}/genesis/certificates.yaml ${WORKSPACE}/ucp-integration/deployment_files/site/${TARGET_SITE}/secrets
|
cp ${WORKSPACE}/genesis/certificates.yaml ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets
|
||||||
}
|
}
|
||||||
|
|
||||||
function lint_design() {
|
function lint_design() {
|
||||||
# After the certificates are in the deployment files run a pegleg lint
|
# After the certificates are in the deployment files run a pegleg lint
|
||||||
IMAGE=${PEGLEG_IMAGE} ${PEGLEG} lint -p /workspace/ucp-integration/deployment_files
|
IMAGE=${PEGLEG_IMAGE} ${PEGLEG} lint -p /workspace/airship-in-a-bottle/deployment_files
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_genesis() {
|
function generate_genesis() {
|
||||||
|
@ -223,8 +223,8 @@ function genesis_complete() {
|
||||||
set +x
|
set +x
|
||||||
echo "Genesis complete. "
|
echo "Genesis complete. "
|
||||||
echo "The .yaml files in ${WORKSPACE} contain the site design that may be suitable for use with Shipyard. "
|
echo "The .yaml files in ${WORKSPACE} contain the site design that may be suitable for use with Shipyard. "
|
||||||
echo "The Shipyard Keystone password may be found in ${WORKSPACE}/ucp-integration/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml"
|
echo "The Shipyard Keystone password may be found in ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml"
|
||||||
cat ${WORKSPACE}/ucp-integration/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml
|
cat ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml
|
||||||
echo " "
|
echo " "
|
||||||
set -x
|
set -x
|
||||||
}
|
}
|
||||||
|
@ -233,10 +233,10 @@ function setup_deploy_site() {
|
||||||
# creates a directory /${WORKSPACE}/site with all the things necessary to run
|
# creates a directory /${WORKSPACE}/site with all the things necessary to run
|
||||||
# deploy_site
|
# deploy_site
|
||||||
mkdir -p ${WORKSPACE}/site
|
mkdir -p ${WORKSPACE}/site
|
||||||
cp ${WORKSPACE}/ucp-integration/manifests/dev_single_node/creds.sh ${WORKSPACE}/site
|
cp ${WORKSPACE}/airship-in-a-bottle/manifests/dev_single_node/creds.sh ${WORKSPACE}/site
|
||||||
cp ${WORKSPACE}/genesis/*.yaml ${WORKSPACE}/site
|
cp ${WORKSPACE}/genesis/*.yaml ${WORKSPACE}/site
|
||||||
cp ${WORKSPACE}/shipyard/tools/run_shipyard.sh ${WORKSPACE}/site
|
cp ${WORKSPACE}/airship-shipyard/tools/run_shipyard.sh ${WORKSPACE}/site
|
||||||
cp ${WORKSPACE}/shipyard/tools/shipyard_docker_base_command.sh ${WORKSPACE}/site
|
cp ${WORKSPACE}/airship-shipyard/tools/shipyard_docker_base_command.sh ${WORKSPACE}/site
|
||||||
set +x
|
set +x
|
||||||
echo " "
|
echo " "
|
||||||
echo "${WORKSPACE}/site is now set up with creds.sh which can be sourced to set up credentials for use in running Shipyard"
|
echo "${WORKSPACE}/site is now set up with creds.sh which can be sourced to set up credentials for use in running Shipyard"
|
||||||
|
@ -290,7 +290,8 @@ configure_dev_configurables || error "adding dev-configurables values"
|
||||||
install_dependencies || error "installing dependencies"
|
install_dependencies || error "installing dependencies"
|
||||||
run_pegleg_collect || error "running pegleg collect"
|
run_pegleg_collect || error "running pegleg collect"
|
||||||
generate_certs || error "setting up certs with Promenade"
|
generate_certs || error "setting up certs with Promenade"
|
||||||
lint_design || error "linting the design"
|
# Temporarially disabled until lint_design works with a single node.
|
||||||
|
# lint_design || error "linting the design"
|
||||||
generate_genesis || error "generating genesis"
|
generate_genesis || error "generating genesis"
|
||||||
run_genesis || error "running genesis"
|
run_genesis || error "running genesis"
|
||||||
validate_genesis || error "validating genesis"
|
validate_genesis || error "validating genesis"
|
|
@ -33,15 +33,15 @@ export HOSTCIDR=10.0.0.0/24
|
||||||
export NODE_NET_IFACE=ens3
|
export NODE_NET_IFACE=ens3
|
||||||
|
|
||||||
# Repositories
|
# Repositories
|
||||||
# export UCP_INTEGRATION_REPO="https://github.com/att-comdev/ucp-integration"
|
# export UCP_INTEGRATION_REPO="https://github.com/openstack/airship-in-a-bottle"
|
||||||
# export UCP_INTEGRATION_REFSPEC=""
|
# export UCP_INTEGRATION_REFSPEC=""
|
||||||
# export PEGLEG_REPO="https://github.com/att-comdev/pegleg.git"
|
# export PEGLEG_REPO="https://github.com/openstack/airship-pegleg.git"
|
||||||
# export PEGLEG_REFSPEC=""
|
# export PEGLEG_REFSPEC=""
|
||||||
# export SHIPYARD_REPO="https://github.com/att-comdev/shipyard.git"
|
# export SHIPYARD_REPO="https://github.com/openstack/airship-shipyard.git"
|
||||||
# export SHIPYARD_REFSPEC=""
|
# export SHIPYARD_REFSPEC=""
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
# export PEGLEG_IMAGE="artifacts-aic.atlantafoundry.com/att-comdev/pegleg:latest"
|
# export PEGLEG_IMAGE="artifacts-aic.atlantafoundry.com/openstack/airship-pegleg:latest"
|
||||||
# export PROMENADE_IMAGE="quay.io/attcomdev/promenade:latest"
|
# export PROMENADE_IMAGE="quay.io/attcomdev/promenade:latest"
|
||||||
|
|
||||||
# The directory that will contain the copies of designs and repos from this script
|
# The directory that will contain the copies of designs and repos from this script
|
||||||
|
|
Loading…
Reference in New Issue