-# Acraino Edge Stack
+# Akraino Edge Stack
..............................................................................
-. Copyright © 2018 AT&T Intellectual Property. All rights reserved .
+. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved .
. .
. Licensed under the Apache License, Version 2.0 (the "License"); you may .
. not use this file except in compliance with the License. .
* jinja2 PyYAML python packages should be available
* git clone yaml_build project to your favorite location ( say **/opt/**).
~~~
-$ git clone http://gerrit.att-akraino.org/yaml_builds.git
+$ git clone http://gerrit.akraino.org/yaml_builds.git
~~~
* export YAML_BUILDS=<<absolute path of yaml_builds>> created is previous step.
- * aic-clcp-manifests should be installed as explained here https://codecloud.web.att.com/projects/ST_CCP/repos/aic-clcp-manifests/browse/docs/source/deployment_blueprint.md
- * export AIC_CLCP_MANIFESTS
- * As per aic-clcp-manifests documents copy all required files to new <<site_name>>
-
- This will copy a bunch of .yaml files to $AIC_CLCP_MANIFESTS/sites/<<site_name>>
-
- * aic-clcp-security-manifests should be installed as explained here https://codecloud.web.att.com/projects/ST_CCP/repos/aic-clcp-manifests/browse/docs/source/deployment_blueprint.md
- * export AIC_CLCP_SECURITY_MANIFESTS
- As per aic-clcp-manifests documents copy all required files to new <<site_name>>
-
- This will copy a bunch of .yaml files to $AIC_CLCP_MANIFESTS/sites/<<site_name>>
+~~~
+cd /root/
+git clone https://git.openstack.org/openstack/airship-treasuremap
+~~~
* Manually verifying the generated .yaml files as explained in 1.1 Manually verifying the .YAMLs
* Using following commands ssh and scp should be happen from regional servers to genesis host without asking any username/passwords
#!/bin/bash
##############################################################################
-# Copyright © 2018 AT&T Intellectual Property. All rights reserved. #
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. #
# re-generate prom config
set -x
+TIMESTAMP=$(date +"%Y%m%d%H%M")
+echo "logging to /var/log/yaml_builds/1prom-gen_$TIMESTAMP.log"
+exec > /var/log/yaml_builds/1prom-gen_$TIMESTAMP.log
+exec 2>&1
source $(dirname $0)/setenv.sh
-PROMENADE_IMAGE=quay.io/airshipit/promenade:master
+PROMENADE_IMAGE=quay.io/airshipit/promenade:009f3de7ecf6afcdd2783ac7a12470394d7dfab3
-if [ -z "$AIC_CLCP_MANIFESTS" ]
+if [ -z "$AIRSHIP_TREASUREMAP" ]
then
- echo "Please follow https://codecloud.web.att.com/projects/ST_CCP/repos/aic-clcp-manifests/browse/docs/source/deployment_blueprint.md to clone aic-clcp-manifests. Also set AIC_CLCP_MANIFESTS to it."
+ echo "Please use https://git.openstack.org/openstack/airship-treasuremap to clone airship_treasuremap. Also set AIRSHIP_TREASUREMAP to it."
exit -1
-else
- WORKSPACE=$AIC_CLCP_MANIFESTS
- echo "WORKSPACE=$WORKSPACE"
fi
if [ -z "$1" ]
then
- echo "Plese pass site name as command line argument"
+ echo "Please pass site name as command line argument"
exit -2
else
SITE=${SITE:-$1}
echo "SITE=$SITE"
fi
-
source $(dirname $0)/env_$SITE.sh
+
# Check that we are root
if [[ $(whoami) != "root" ]]
then
echo "Must be root to run $0"
exit -1
fi
-cd $AIC_CLCP_MANIFESTS/tools/
+
+if [ -z "$YAML_BUILDS" ]
+then
+ echo "Please set YAML_BUILDS"
+ exit -3
+else
+ export WORKSPACE=$YAML_BUILDS
+ echo "WORKSPACE=$WORKSPACE"
+ cd $YAML_BUILDS
+fi
install_docker() {
# Configure proxy for Docker daemon
}
cleanup() {
- rm -rf ./configs/promenade
- rm -rf ./configs/promenade-bundle
- mkdir -p ./configs/promenade
- mkdir -p ./configs/promenade-bundle
+ rm -rf ./tars/$SITE/configs/promenade
+ rm -rf ./tars/$SITE/configs/promenade-bundle
+ mkdir -p ./tars/$SITE/configs/promenade
+ mkdir -p ./tars/$SITE/configs/promenade-bundle
}
get_site_config(){
- ./pegleg.sh site -p /workspace collect ${SITE} -s /workspace/tools/configs/promenade
+ $YAML_BUILDS/tools/pegleg.sh site -p /site -a /global collect ${SITE} -s /site/tars/$SITE/configs/promenade
}
gen_certs() {
- docker run --env http_proxy=$http_proxy --env https_proxy=$https_proxy --user 0 --rm -t -w /target -v $(pwd):/target ${PROMENADE_IMAGE} promenade generate-certs -o /target/configs/promenade /target/configs/promenade/*.yaml
+ docker run --env http_proxy=$http_proxy --env https_proxy=$https_proxy --user 0 --rm -t -w /target -v $(pwd):/target ${PROMENADE_IMAGE} promenade generate-certs -o /target/tars/$SITE/configs/promenade /target/tars/$SITE/configs/promenade/*.yaml
}
gen_bundle(){
- docker run --env http_proxy=$http_proxy --env https_proxy=$https_proxy --user 0 --rm -t -w /target -v $(pwd):/target ${PROMENADE_IMAGE} promenade build-all --validators -o /target/configs/promenade-bundle /target/configs/promenade/*.yaml
+ docker run --env http_proxy=$http_proxy --env https_proxy=$https_proxy --user 0 --rm -t -w /target -v $(pwd):/target ${PROMENADE_IMAGE} promenade build-all --validators -o /target/tars/$SITE/configs/promenade-bundle /target/tars/$SITE/configs/promenade/*.yaml
+}
+
+create_scripts() {
+ KEYSTONE_IMAGE=$(grep "keystone_db_sync: docker.io" $AIRSHIP_TREASUREMAP/global/v4.0/software/config/versions.yaml | uniq | awk '{print $2}')
+ SHIPYARD_IMAGE=$(grep "shipyard_db_sync" $AIRSHIP_TREASUREMAP/global/v4.0/software/config/versions.yaml | uniq | awk '{print $2}')
+
+ DRYDOCK_PASSWORD=$(grep "^data:" $YAML_BUILDS/site/$SITE/secrets/passphrases/ucp_drydock_keystone_password.yaml | awk '{print $2}')
+ SHIPYARD_PASSWORD=$(grep "^data:" $YAML_BUILDS/site/$SITE/secrets/passphrases/ucp_shipyard_keystone_password.yaml | awk '{print $2}')
+ REGION_NAME=$SITE
+
+ cp $YAML_BUILDS/tools/deploy_site.sh $YAML_BUILDS/tars/$SITE/
+ sed -i -e "s,KEYSTONE_IMAGE=,KEYSTONE_IMAGE=$KEYSTONE_IMAGE,g" $YAML_BUILDS/tars/$SITE/deploy_site.sh
+ sed -i -e "s,SHIPYARD_IMAGE=,SHIPYARD_IMAGE=$SHIPYARD_IMAGE,g" $YAML_BUILDS/tars/$SITE/deploy_site.sh
+ sed -i -e "s/DRYDOCK_PASSWORD=/DRYDOCK_PASSWORD=$DRYDOCK_PASSWORD/g" $YAML_BUILDS/tars/$SITE/deploy_site.sh
+ sed -i -e "s/SHIPYARD_PASSWORD=/SHIPYARD_PASSWORD=$SHIPYARD_PASSWORD/g" $YAML_BUILDS/tars/$SITE/deploy_site.sh
+ sed -i -e "s/REGION_NAME=/REGION_NAME=$REGION_NAME/g" $YAML_BUILDS/tars/$SITE/deploy_site.sh
+ sed -i -e "s/{{yaml.genesis.host}}/$GENESIS_HOST/g" $YAML_BUILDS/tars/$SITE/deploy_site.sh
+
+ cp $YAML_BUILDS/tools/update_iptables.sh $YAML_BUILDS/tars/$SITE/
+ sed -i -e "s,HOST_INTERFACE=,HOST_INTERFACE=$HOST_INTERFACE,g" $YAML_BUILDS/tars/$SITE/update_iptables.sh
+ sed -i -e "s,PXE_INTERFACE=,PXE_INTERFACE=$PXE_INTERFACE,g" $YAML_BUILDS/tars/$SITE/update_iptables.sh
+
+ cp $YAML_BUILDS/tools/cleanup.sh $YAML_BUILDS/tars/$SITE/
}
prepare_tar(){
- rm ./promenade-bundle.tar
- cp ./configs/promenade/*.yaml ./configs/promenade-bundle/
- tar cvf promenade-bundle.tar ./configs/promenade-bundle/
+ rm ./tars/promenade-bundle-$SITE.tar
+ tar cvf ./tars/promenade-bundle-$SITE.tar -C ./tars/$SITE .
}
#install_docker
get_site_config
gen_certs
gen_bundle
+create_scripts
prepare_tar
-
#!/bin/bash
##############################################################################
-# Copyright © 2018 AT&T Intellectual Property. All rights reserved. #
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. #
# limitations under the License. #
##############################################################################
+set -x
source $(dirname $0)/setenv.sh
-if [ -z "$AIC_CLCP_MANIFESTS" ]
+if [ -z "$AIRSHIP_TREASUREMAP" ]
then
- echo "Please follow https://codecloud.web.att.com/projects/ST_CCP/repos/aic-clcp-manifests/browse/docs/source/deployment_blueprint.md to clone aic-clcp-manifests. Also export AIC_CLCP_MANIFESTS to it."
- exit -1
-fi
-
-if [ -z "$AIC_CLCP_SECURITY_MANIFESTS" ]
-then
- echo "Please follow https://codecloud.web.att.com/projects/ST_CCP/repos/aic-clcp-manifests/browse/docs/source/deployment_blueprint.md to clone aic-clcp-security-manifests. Also export AIC_CLCP_SECURITY_MANIFESTS to it."
+ echo "Please use https://git.openstack.org/openstack/airship-treasuremap to clone airship_treasuremap. Also set AIRSHIP_TREASUREMAP to it."
exit -1
fi
if [ -z "$1" ]
then
- echo "Plese pass site name as command line argument"
+ echo "Please pass site name as command line argument"
exit -2
else
SITE=${SITE:-$1}
fi
cd $YAML_BUILDS
-python ./scripts/jcopy.py $SITE.yaml ./templates/aic-clcp-manifests $AIC_CLCP_MANIFESTS/site/$SITE
-python ./scripts/jcopy.py $SITE.yaml ./templates/aic-clcp-security-manifests $AIC_CLCP_SECURITY_MANIFESTS/site/$SITE
-python ./scripts/jcopy.py $SITE.yaml ./templates/yaml_builds/set_site_env.sh ./tools/
-mv ./tools/set_site_env.sh ./tools/env_$SITE.sh
+python ./scripts/jcopy.py $SITE.yaml ./templates $YAML_BUILDS/site/$SITE
+python ./scripts/jcopy.py $SITE.yaml ./tools/j2/set_site_env.sh ./tools/env_$SITE.sh
+cp -r site/common/* site/$SITE/