Full site deploy with custom images

This PS adds 015-make-all-images.sh script that is
building Airship images locally and using it for
Airskiff site deployment. This script it ment to
be used by Airship projects Airskiff integration
tests.

The old Airskiff deployment gate based on minikube
has been disabled.

Change-Id: I7f85af1f4f0f9a8972dfd54cd0128d4e9caafc2b
This commit is contained in:
Sergiy Markin 2024-02-29 06:28:06 +00:00
parent df5bfe08d5
commit e8b6c62261
11 changed files with 252 additions and 10 deletions

View File

@ -24,8 +24,13 @@
- treasuremap-airskiff-suse-site-lint
- treasuremap-airsloop-site-lint
- treasuremap-aiab-site-lint
- treasuremap-airskiff-deployment-ubuntu
- treasuremap-airskiff-multinode-full-site
# deprecated
# - treasuremap-airskiff-deployment-ubuntu
# disabled
# TODO
# update OSH charts vaoues in manifests and add more
# charts to full-site manifests
# - treasuremap-airskiff-multinode-full-site
- treasuremap-airskiff-1node-reduced-site
gate:
jobs:
@ -129,7 +134,10 @@
loopback_device: /dev/loop100
loopback_image: "/opt/ext_vol/openstack-helm/ceph-loop.img"
ceph_osd_data_device: /dev/loop100
kube_version: "1.28.4-1.1"
kube_version_repo: "v1.29"
# the list of k8s package versions are available here
# https://pkgs.k8s.io/core:/stable:/{{ kube_version_repo }}/deb/Packages
kube_version: "1.29.2-1.1"
calico_version: "v3.27.0"
coredns_version: "v1.11.1"
helm_version: "v3.13.2"
@ -160,13 +168,12 @@
- ./tools/deployment/airskiff/developer/000-clone-dependencies.sh
- ./tools/deployment/airskiff/developer/020-setup-client.sh
- ./tools/deployment/airskiff/developer/015-make-all-charts.sh
- ./tools/deployment/airskiff/developer/017-make-all-images.sh
- ./tools/deployment/airskiff/developer/025-start-artifactory.sh
- ./tools/deployment/airskiff/developer/026-reduce-site.sh
- ./tools/deployment/airskiff/developer/030-armada-bootstrap.sh
- ./tools/deployment/airskiff/developer/100-deploy-osh.sh
- ./tools/deployment/airskiff/common/os-env.sh
- ./tools/gate/wait-for-shipyard.sh
# - ./tools/deployment/airskiff/common/sleep.sh
- job:
name: treasuremap-airskiff-1node-reduced-site
@ -182,6 +189,7 @@
HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7
DISTRO: ubuntu_focal
gate_scripts_relative_path: .
gate_scripts:
- ./tools/deployment/airskiff/developer/000-prepare-k8s.sh
@ -189,6 +197,7 @@
- ./tools/deployment/airskiff/developer/000-clone-dependencies.sh
- ./tools/deployment/airskiff/developer/020-setup-client.sh
- ./tools/deployment/airskiff/developer/015-make-all-charts.sh
- ./tools/deployment/airskiff/developer/017-make-all-images.sh
- ./tools/deployment/airskiff/developer/025-start-artifactory.sh
- ./tools/deployment/airskiff/developer/026-reduce-site.sh
- ./tools/deployment/airskiff/developer/030-armada-bootstrap.sh

View File

@ -22,6 +22,7 @@ data:
api: "quay.io/airshipit/armada:latest-ubuntu_focal"
deckhand:
deckhand: "quay.io/airshipit/deckhand:latest-ubuntu_focal"
db_sync: quay.io/airshipit/deckhand:latest-ubuntu_focal
shipyard:
shipyard: "quay.io/airshipit/shipyard:latest-ubuntu_focal"
shipyard_db_sync: "quay.io/airshipit/shipyard:latest-ubuntu_focal"

View File

@ -28,6 +28,22 @@ set -xe
: "${CLONE_MAAS:=true}"
: "${CLONE_OSH:=true}"
CLONE_ARMADA=$(echo "$CLONE_ARMADA" | tr '[:upper:]' '[:lower:]')
CLONE_DECKHAND=$(echo "$CLONE_DECKHAND" | tr '[:upper:]' '[:lower:]')
CLONE_SHIPYARD=$(echo "$CLONE_SHIPYARD" | tr '[:upper:]' '[:lower:]')
CLONE_PORTHOLE=$(echo "$CLONE_PORTHOLE" | tr '[:upper:]' '[:lower:]')
CLONE_PROMENADE=$(echo "$CLONE_PROMENADE" | tr '[:upper:]' '[:lower:]')
CLONE_MAAS=$(echo "$CLONE_MAAS" | tr '[:upper:]' '[:lower:]')
CLONE_OSH=$(echo "$CLONE_OSH" | tr '[:upper:]' '[:lower:]')
export CLONE_ARMADA
export CLONE_DECKHAND
export CLONE_SHIPYARD
export CLONE_PORTHOLE
export CLONE_PROMENADE
export CLONE_MAAS
export CLONE_OSH
cd "${INSTALL_PATH}"
# Clone Airship projects

View File

@ -420,8 +420,14 @@ kubectl set image deployment coredns -n kube-system "coredns=registry.k8s.io/cor
rm -f "${PATCH}"
kubectl rollout restart -n kube-system deployment/coredns
kubectl rollout status --watch --timeout=300s -n kube-system deployment/coredns
sleep 10
host -v control-plane.minikube.internal
for t in 10 20 30 40
do
sleep $t
if host -v control-plane.minikube.internal
then
break
fi
done
kubectl label nodes --all --overwrite ucp-control-plane=enabled

View File

@ -30,6 +30,24 @@ CURRENT_DIR="$(pwd)"
: "${MAKE_CHARTS_PORTHOLE:=true}"
: "${MAKE_CHARTS_PROMENADE:=true}"
MAKE_CHARTS_OPENSTACK_HELM=$(echo "$MAKE_CHARTS_OPENSTACK_HELM" | tr '[:upper:]' '[:lower:]')
MAKE_CHARTS_OSH_INFRA=$(echo "$MAKE_CHARTS_OSH_INFRA" | tr '[:upper:]' '[:lower:]')
MAKE_CHARTS_ARMADA=$(echo "$MAKE_CHARTS_ARMADA" | tr '[:upper:]' '[:lower:]')
MAKE_CHARTS_DECKHAND=$(echo "$MAKE_CHARTS_DECKHAND" | tr '[:upper:]' '[:lower:]')
MAKE_CHARTS_SHIPYARD=$(echo "$MAKE_CHARTS_SHIPYARD" | tr '[:upper:]' '[:lower:]')
MAKE_CHARTS_MAAS=$(echo "$MAKE_CHARTS_MAAS" | tr '[:upper:]' '[:lower:]')
MAKE_CHARTS_PORTHOLE=$(echo "$MAKE_CHARTS_PORTHOLE" | tr '[:upper:]' '[:lower:]')
MAKE_CHARTS_PROMENADE=$(echo "$MAKE_CHARTS_PROMENADE" | tr '[:upper:]' '[:lower:]')
export MAKE_CHARTS_OPENSTACK_HELM
export MAKE_CHARTS_OSH_INFRA
export MAKE_CHARTS_ARMADA
export MAKE_CHARTS_DECKHAND
export MAKE_CHARTS_SHIPYARD
export MAKE_CHARTS_MAAS
export MAKE_CHARTS_PORTHOLE
export MAKE_CHARTS_PROMENADE
mkdir -p "${ARTIFACTS_PATH}"
cd "${INSTALL_PATH}"

View File

@ -0,0 +1,109 @@
#!/bin/bash
# Copyright 2017 The Openstack-Helm Authors.
# 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 -xe
CURRENT_DIR="$(pwd)"
: "${INSTALL_PATH:="../"}"
: "${DISTRO:=ubuntu_focal}"
: "${DOCKER_REGISTRY:=localhost:5000}"
: "${MAKE_ARMADA_IMAGES:=false}"
: "${MAKE_DECKHAND_IMAGES:=false}"
: "${MAKE_SHIPYARD_IMAGES:=false}"
: "${MAKE_PORTHOLE_IMAGES:=false}"
: "${MAKE_PROMENADE_IMAGES:=false}"
# Convert both values to lowercase (or uppercase)
MAKE_ARMADA_IMAGES=$(echo "$MAKE_ARMADA_IMAGES" | tr '[:upper:]' '[:lower:]')
MAKE_DECKHAND_IMAGES=$(echo "$MAKE_DECKHAND_IMAGES" | tr '[:upper:]' '[:lower:]')
MAKE_SHIPYARD_IMAGES=$(echo "$MAKE_SHIPYARD_IMAGES" | tr '[:upper:]' '[:lower:]')
MAKE_PORTHOLE_IMAGES=$(echo "$MAKE_PORTHOLE_IMAGES" | tr '[:upper:]' '[:lower:]')
MAKE_PROMENADE_IMAGES=$(echo "$MAKE_PROMENADE_IMAGES" | tr '[:upper:]' '[:lower:]')
export MAKE_ARMADA_IMAGES
export MAKE_DECKHAND_IMAGES
export MAKE_SHIPYARD_IMAGES
export MAKE_PORTHOLE_IMAGES
export MAKE_PROMENADE_IMAGES
cd "${INSTALL_PATH}"
# Start docker registry
docker rm registry --force || true
docker run -d -p 5000:5000 --restart=always --name registry registry:2
curl -Ik "http://${DOCKER_REGISTRY}"
# Make charts in Airship and OSH-INFRA projects
if [[ ${MAKE_ARMADA_IMAGES} = true ]] ; then
pushd armada
make images
docker push "${DOCKER_REGISTRY}/airshipit/armada:latest-${DISTRO}"
popd
pushd treasuremap
sed -i "s#quay.io/airshipit/armada:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/armada:latest-${DISTRO}#g" ./site/airskiff/software/config/versions.yaml
sed -i "s#quay.io/airshipit/armada:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/armada:latest-${DISTRO}#g" ./global/software/config/versions.yaml
popd
fi
if [[ ${MAKE_DECKHAND_IMAGES} = true ]] ; then
pushd deckhand
make images
docker push "${DOCKER_REGISTRY}/airshipit/deckhand:latest-${DISTRO}"
popd
pushd treasuremap
sed -i "s#quay.io/airshipit/deckhand:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/deckhand:latest-${DISTRO}#g" ./site/airskiff/software/config/versions.yaml
sed -i "s#quay.io/airshipit/deckhand:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/deckhand:latest-${DISTRO}#g" ./global/software/config/versions.yaml
popd
fi
if [[ ${MAKE_SHIPYARD_IMAGES} = true ]] ; then
pushd shipyard
make images
docker push "${DOCKER_REGISTRY}/airshipit/airflow:latest-${DISTRO}"
docker push "${DOCKER_REGISTRY}/airshipit/shipyard:latest-${DISTRO}"
popd
pushd treasuremap
sed -i "s#quay.io/airshipit/airflow:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/airflow:latest-${DISTRO}#g" ./site/airskiff/software/config/versions.yaml
sed -i "s#quay.io/airshipit/shipyard:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/shipyard:latest-${DISTRO}#g" ./site/airskiff/software/config/versions.yaml
sed -i "s#quay.io/airshipit/airflow:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/airflow:latest-${DISTRO}#g" ./global/software/config/versions.yaml
sed -i "s#quay.io/airshipit/shipyard:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/shipyard:latest-${DISTRO}#g" ./global/software/config/versions.yaml
popd
fi
if [[ ${MAKE_PORTHOLE_IMAGES} = true ]] ; then
pushd porthole
make images
# Define a list of images
IMAGE_LIST=("calicoctl-utility" "ceph-utility" "compute-utility" "etcdctl-utility" "mysqlclient-utility" "openstack-utility" "postgresql-utility")
for IMAGE in "${IMAGE_LIST}"
do
docker push "${DOCKER_REGISTRY}/airshipit/porthole-${IMAGE}:latest-${DISTRO}"
done
popd
pushd treasuremap
sed -i "s#quay.io/airshipit/porthole-${IMAGE}:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/porthole-${IMAGE}:latest-${DISTRO}#g" ./global/software/config/versions.yaml
popd
fi
if [[ ${MAKE_PROMENADE_IMAGES} = true ]] ; then
pushd promenade
make images
docker push "${DOCKER_REGISTRY}/airshipit/promenade:latest-${DISTRO}"
popd
pushd treasuremap
sed -i "s#quay.io/airshipit/promenade:latest-${DISTRO}#${DOCKER_REGISTRY}/airshipit/promenade:latest-${DISTRO}#g" ./global/software/config/versions.yaml
popd
fi
docker images
cd "${CURRENT_DIR}"

View File

@ -21,6 +21,9 @@ set -xe
: "${PEGLEG:="./tools/airship pegleg"}"
: "${PL_SITE:="airskiff"}"
: "${TARGET_MANIFEST:="cluster-bootstrap"}"
: "${DISTRO:=ubuntu_focal}"
: "${DOCKER_REGISTRY:=quay.io}"
# Render documents
${PEGLEG} site -r . render "${PL_SITE}" -o airskiff.yaml
@ -28,7 +31,7 @@ ${PEGLEG} site -r . render "${PL_SITE}" -o airskiff.yaml
# Set permissions o+r, beacause these files need to be readable
# for Armada in the container
AIRSKIFF_PERMISSIONS=$(stat --format '%a' airskiff.yaml)
KUBE_CONFIG_PERMISSIONS=$(stat --format '%a' ~/.kube/config)
# KUBE_CONFIG_PERMISSIONS=$(stat --format '%a' ~/.kube/config)
sudo chmod 0644 airskiff.yaml
# sudo chmod 0644 ~/.kube/config
@ -38,8 +41,8 @@ docker run --rm --net host -p 8000:8000 --name armada \
-v ~/.kube/config:/armada/.kube/config \
-v "$(pwd)"/airskiff.yaml:/airskiff.yaml \
-v "${INSTALL_PATH}":/airship-components \
quay.io/airshipit/armada:latest-ubuntu_focal\
apply /airskiff.yaml --debug --target-manifest $TARGET_MANIFEST
"${DOCKER_REGISTRY}/airshipit/armada:latest-${DISTRO}" \
apply /airskiff.yaml --debug --target-manifest "${TARGET_MANIFEST}"
# # Set back permissions of the files
sudo chmod "${AIRSKIFF_PERMISSIONS}" airskiff.yaml

View File

@ -24,4 +24,24 @@ HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7
COREDNS_VERSION: v1.11.1
DISTRO: ubuntu_focal
DOCKER_REGISTRY: quay.io
MAKE_ARMADA_IMAGES: false
MAKE_DECKHAND_IMAGES: false
MAKE_SHIPYARD_IMAGES: false
MAKE_PORTHOLE_IMAGES: false
MAKE_PROMENADE_IMAGES: false
CLONE_ARMADA: true
CLONE_DECKHAND: true
CLONE_SHIPYARD: true
CLONE_PORTHOLE: true
CLONE_PROMENADE: true
CLONE_MAAS: true
CLONE_OSH: true
MAKE_ARMADA_IMAGES: false
MAKE_DECKHAND_IMAGES: false
MAKE_SHIPYARD_IMAGES: false
MAKE_DECKHAND_IMAGES: false
MAKE_PORTHOLE_IMAGES: false
MAKE_PROMENADE_IMAGES: false
...

View File

@ -40,6 +40,26 @@
OSH_INFRA_COMMIT: "{{ OSH_INFRA_COMMIT | default('cfff60ec10a6c386f38db79bb9f59a552c2b032f') }}"
OSH_COMMIT: "{{ OSH_COMMIT | default('2d9457e34ca4200ed631466bd87569b0214c92e7') }}"
COREDNS_VERSION: "{{ coredns_version | default('v1.11.1') }}"
DISTRO: "{{ DISTRO | default('ubuntu_focal') }}"
DOCKER_REGISTRY: "{{ DOCKER_REGISTRY | default('quay.io') }}"
MAKE_ARMADA_IMAGES: "{{ MAKE_ARMADA_IMAGES | default('false') }}"
MAKE_DECKHAND_IMAGES: "{{ MAKE_DECKHAND_IMAGES | default('false') }}"
MAKE_SHIPYARD_IMAGES: "{{ MAKE_SHIPYARD_IMAGES | default('false') }}"
MAKE_PORTHOLE_IMAGES: "{{ MAKE_PORTHOLE_IMAGES | default('false') }}"
MAKE_PROMENADE_IMAGES: "{{ MAKE_PROMENADE_IMAGES | default('false') }}"
CLONE_ARMADA: "{{ CLONE_ARMADA | default('true') }}"
CLONE_DECKHAND: "{{ CLONE_DECKHAND | default('true') }}"
CLONE_SHIPYARD: "{{ CLONE_SHIPYARD | default('true') }}"
CLONE_PORTHOLE: "{{ CLONE_PORTHOLE | default('true') }}"
CLONE_PROMENADE: "{{ CLONE_PROMENADE | default('true') }}"
CLONE_MAAS: "{{ CLONE_MAAS | default('true') }}"
CLONE_OSH: "{{ CLONE_OSH | default('true') }}"
MAKE_ARMADA_IMAGES: "{{ MAKE_ARMADA_IMAGES | default('false') }}"
MAKE_DECKHAND_IMAGES: "{{ MAKE_DECKHAND_IMAGES | default('false') }}"
MAKE_SHIPYARD_IMAGES: "{{ MAKE_SHIPYARD_IMAGES | default('false') }}"
MAKE_DECKHAND_IMAGES: "{{ MAKE_DECKHAND_IMAGES | default('false') }}"
MAKE_PORTHOLE_IMAGES: "{{ MAKE_PORTHOLE_IMAGES | default('false') }}"
MAKE_PROMENADE_IMAGES: "{{ MAKE_PROMENADE_IMAGES | default('false') }}"
# NOTE(aostapenko) using bigger than async_status timeout due to async_status issue with
# not recognizing timed out jobs: https://github.com/ansible/ansible/issues/25637
async: 3600

View File

@ -24,4 +24,24 @@ HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7
COREDNS_VERSION: v1.11.1
DISTRO: ubuntu_focal
DOCKER_REGISTRY: quay.io
MAKE_ARMADA_IMAGES: false
MAKE_DECKHAND_IMAGES: false
MAKE_SHIPYARD_IMAGES: false
MAKE_PORTHOLE_IMAGES: false
MAKE_PROMENADE_IMAGES: false
CLONE_ARMADA: true
CLONE_DECKHAND: true
CLONE_SHIPYARD: true
CLONE_PORTHOLE: true
CLONE_PROMENADE: true
CLONE_MAAS: true
CLONE_OSH: true
MAKE_ARMADA_IMAGES: false
MAKE_DECKHAND_IMAGES: false
MAKE_SHIPYARD_IMAGES: false
MAKE_DECKHAND_IMAGES: false
MAKE_PORTHOLE_IMAGES: false
MAKE_PROMENADE_IMAGES: false
...

View File

@ -37,4 +37,24 @@
OSH_INFRA_COMMIT: "{{ OSH_INFRA_COMMIT | default('cfff60ec10a6c386f38db79bb9f59a552c2b032f') }}"
OSH_COMMIT: "{{ OSH_COMMIT | default('2d9457e34ca4200ed631466bd87569b0214c92e7') }}"
COREDNS_VERSION: "{{ coredns_version | default('v1.11.1') }}"
DISTRO: "{{ DISTRO | default('ubuntu_focal') }}"
DOCKER_REGISTRY: "{{ DOCKER_REGISTRY | default('quay.io') }}"
MAKE_ARMADA_IMAGES: "{{ MAKE_ARMADA_IMAGES | default('false') }}"
MAKE_DECKHAND_IMAGES: "{{ MAKE_DECKHAND_IMAGES | default('false') }}"
MAKE_SHIPYARD_IMAGES: "{{ MAKE_SHIPYARD_IMAGES | default('false') }}"
MAKE_PORTHOLE_IMAGES: "{{ MAKE_PORTHOLE_IMAGES | default('false') }}"
MAKE_PROMENADE_IMAGES: "{{ MAKE_PROMENADE_IMAGES | default('false') }}"
CLONE_ARMADA: "{{ CLONE_ARMADA | default('true') }}"
CLONE_DECKHAND: "{{ CLONE_DECKHAND | default('true') }}"
CLONE_SHIPYARD: "{{ CLONE_SHIPYARD | default('true') }}"
CLONE_PORTHOLE: "{{ CLONE_PORTHOLE | default('true') }}"
CLONE_PROMENADE: "{{ CLONE_PROMENADE | default('true') }}"
CLONE_MAAS: "{{ CLONE_MAAS | default('true') }}"
CLONE_OSH: "{{ CLONE_OSH | default('true') }}"
MAKE_ARMADA_IMAGES: "{{ MAKE_ARMADA_IMAGES | default('false') }}"
MAKE_DECKHAND_IMAGES: "{{ MAKE_DECKHAND_IMAGES | default('false') }}"
MAKE_SHIPYARD_IMAGES: "{{ MAKE_SHIPYARD_IMAGES | default('false') }}"
MAKE_DECKHAND_IMAGES: "{{ MAKE_DECKHAND_IMAGES | default('false') }}"
MAKE_PORTHOLE_IMAGES: "{{ MAKE_PORTHOLE_IMAGES | default('false') }}"
MAKE_PROMENADE_IMAGES: "{{ MAKE_PROMENADE_IMAGES | default('false') }}"
...