Full-site deploy

Change-Id: I9a986aa1fb64e527f1e3b1d5077ccd60f563588b
This commit is contained in:
Sergiy Markin 2024-02-06 23:44:03 +00:00
parent 01d80e18d8
commit bf0dfff63e
9 changed files with 358 additions and 3 deletions

View File

@ -25,7 +25,7 @@
- treasuremap-airsloop-site-lint
- treasuremap-aiab-site-lint
- treasuremap-airskiff-deployment-ubuntu
# - treasuremap-airskiff-deployment-suse
- treasuremap-airskiff-multinode-full-site
gate:
jobs:
- treasuremap-seaworthy-site-lint
@ -56,6 +56,101 @@
label: ubuntu-focal
- nodeset:
name: treasuremap-airskiff-3nodes-ubuntu_focal
nodes:
- name: primary
label: ubuntu-focal
- name: node-1
label: ubuntu-focal
- name: node-2
label: ubuntu-focal
groups:
- name: primary
nodes:
- primary
- name: nodes
nodes:
- node-1
- node-2
- job:
name: treasuremap-airskiff-infra-deploy
abstract: true
roles:
- zuul: openstack/openstack-helm-infra
- zuul: zuul/zuul-jobs
required-projects:
- openstack/openstack-helm
- openstack/openstack-helm-infra
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
timeout: 10800
pre-run:
- tools/gate/playbooks/prepare-hosts.yaml
- tools/gate/playbooks/mount-volumes.yaml
- tools/gate/playbooks/deploy-env.yaml
- tools/gate/playbooks/run-scripts.yaml
post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml
vars:
extra_volume:
size: 80G
type: Linux
mount_point: /opt/ext_vol
docker:
root_path: "/opt/ext_vol/docker"
containerd:
root_path: "/opt/ext_vol/containerd"
kubeadm:
pod_network_cidr: "10.244.0.0/24"
service_cidr: "10.96.0.0/16"
loopback_setup: true
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"
calico_version: "v3.27.0"
helm_version: "v3.6.3"
yq_version: "v4.6.0"
crictl_version: "v1.26.1"
zuul_osh_infra_relative_path: ../openstack-helm-infra
gate_scripts_relative_path: ../openstack-helm-infra
run_helm_tests: "no"
gate_scripts:
- ./tools/deployment/osh-infra-logging/000-prepare-k8s.sh
- job:
name: treasuremap-airskiff-multinode-full-site
parent: treasuremap-airskiff-infra-deploy
nodeset: treasuremap-airskiff-3nodes-ubuntu_focal
description: |
Deploy Openstack using Airskiff and latest Treasuremap changes.
Airskiff is using latest Airship v1.x based on Airflow-2.6.2
voting: true
timeout: 9600
run:
- tools/gate/playbooks/initial-setup.yaml
- tools/gate/playbooks/git-config.yaml
- tools/gate/playbooks/airskiff-reduce-site.yaml
- tools/gate/playbooks/airskiff-deploy-gate-multinode.yaml
post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml
vars:
site: airskiff
HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz
HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^site/seaworthy/.*$
- ^site/airsloop/.*$
- ^site/aiab/.*$
- job:
name: treasuremap-site-lint
description:
@ -181,7 +276,7 @@
post-run: tools/gate/playbooks/debug-report.yaml
vars:
site: airskiff
HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.12.2-linux-amd64.tar.gz
HELM_ARTIFACT_URL: https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz
HTK_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_INFRA_COMMIT: cfff60ec10a6c386f38db79bb9f59a552c2b032f
OSH_COMMIT: 2d9457e34ca4200ed631466bd87569b0214c92e7

View File

@ -0,0 +1,48 @@
#!/bin/bash
# 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 -ex
# Add labels to the core namespaces & nodes
kubectl label --overwrite namespace default name=default
kubectl label --overwrite namespace kube-system name=kube-system
kubectl label --overwrite namespace kube-public name=kube-public
kubectl label --overwrite nodes --all openstack-control-plane=enabled
kubectl label --overwrite nodes --all openstack-compute-node=enabled
kubectl label --overwrite nodes --all openvswitch=enabled
kubectl label --overwrite nodes --all linuxbridge=enabled
kubectl label --overwrite nodes --all ceph-mon=enabled
kubectl label --overwrite nodes --all ceph-osd=enabled
kubectl label --overwrite nodes --all ceph-mds=enabled
kubectl label --overwrite nodes --all ceph-rgw=enabled
kubectl label --overwrite nodes --all ceph-mgr=enabled
# We deploy l3 agent only on the node where we run test scripts.
# In this case virtual router will be created only on this node
# and we don't need L2 overlay (will be implemented later).
kubectl label --overwrite nodes -l "node-role.kubernetes.io/control-plane" l3-agent=enabled
for NAMESPACE in ceph mariadb-operator openstack osh-infra; do
tee /tmp/${NAMESPACE}-ns.yaml << EOF
apiVersion: v1
kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: ${NAMESPACE}
name: ${NAMESPACE}
name: ${NAMESPACE}
EOF
kubectl apply -f /tmp/${NAMESPACE}-ns.yaml
done
make all

View File

@ -20,7 +20,7 @@ set -xe
CURRENT_DIR="$(pwd)"
: "${INSTALL_PATH:="../"}"
: "${ARTIFACTS_PATH:="../artifacts"}"
: "${HTK_COMMIT:="ae91cf3fc3f288b6d92ace4a3a405606a653638f"}"
: "${HTK_COMMIT:="cfff60ec10a6c386f38db79bb9f59a552c2b032f"}"
: "${MAKE_CHARTS_OPENSTACK_HELM:=true}"
: "${MAKE_CHARTS_OSH_INFRA:=true}"
: "${MAKE_CHARTS_ARMADA:=true}"

View File

@ -0,0 +1,108 @@
# 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.
- hosts: primary
tasks:
- name: Clone dependencies
shell: |
set -ex
export OSH_INFRA_COMMIT={{ OSH_INFRA_COMMIT }}
export OSH_COMMIT={{ OSH_COMMIT }}
./tools/deployment/airskiff/developer/000-clone-dependencies.sh
args:
chdir: "{{ zuul.project.src_dir }}"
- name: Setup AppArmor
shell: |
set -ex
./tools/deployment/airskiff/developer/009-setup-apparmor.sh
args:
chdir: "{{ zuul.project.src_dir }}"
- name: Setup OpenStack Client
shell: |
set -ex
./tools/deployment/airskiff/developer/020-setup-client.sh
while true; do sleep 10; done
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes
- name: Build all charts locally
shell: |
set -ex
export HELM_ARTIFACT_URL={{ HELM_ARTIFACT_URL }}
export HTK_COMMIT={{ HTK_COMMIT }}
./tools/deployment/airskiff/developer/015-make-all-charts.sh
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes
- name: Start artifactory
shell: |
set -ex
# start http server with artifacts
docker rm artifacts --force || true
docker run --name artifacts -p 8282:80 -v $(pwd)/../artifacts:/usr/share/nginx/html -d nginx
sleep 10
curl --verbose -I http://control-plane.minikube.internal:8282/memcached.tgz
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes
- name: Deploy Airship components using Armada
shell: |
set -ex
mkdir -p ~/.kube
cp -rp /home/zuul/.kube/config ~/.kube/config
export PL_SITE="{{ site }}"
./tools/deployment/airskiff/developer/030-armada-bootstrap.sh
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes
- name: Deploy Software using Airship
shell: |
set -ex
export PL_SITE="{{ site }}"
./tools/deployment/airskiff/developer/100-deploy-osh.sh
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes
- name: Wait for deployment completion
shell: |
set -ex
./tools/deployment/airskiff/common/os-env.sh
./tools/gate/wait-for-shipyard.sh
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes
- name: Stop artifactory
shell: |
set -ex
# terminate artifactory
docker rm artifacts --force || true
args:
chdir: "{{ zuul.project.src_dir }}"
become: yes

View File

@ -0,0 +1,24 @@
# 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.
---
- hosts: all
become: true
gather_facts: true
roles:
- ensure-python
- ensure-pip
- clear-firewall
- deploy-apparmor
- deploy-selenium
- deploy-env
...

View File

@ -19,6 +19,9 @@
- ensure-docker
- ensure-python
- ensure-pip
- role: add-authorized-keys
public_keys:
- public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDA7eM8WFJrqQmki8rR0O3QBHyl8xq42jb1RduwuRwjWoGYJI5cX7Fx+7VR4A9ITCoiqxKS8DMfgKbt5jKC6SmvMALULZsnYlthB34KywurgxsW6fgp68DHWQ7J4CCBhoIpl0W3JW7s6b0vHLhab59r0E+AYemBVuWUqbFEy8nDAHcQv1S/2o1udhmljIN7c2ogO4KAJ7Lge0BoIP9ps4u6AVwyQZixp4anU9DHGNA/UQj4M5UyuALj5buEAuATBe9Vqj4sOvZjObPJAGPUrNRrGEWAFk+lSZHRzKXo0eeWtPqoh5UN9UDb5Pocg1krncMIZwjHKovlD1z/O1y91aY5LM1wxm/7aaIiX8eCihyVZaOuDCLF7WDT2SMs7ABcotX2MDtVQTrNNV3MmMAScFNDflzPKszd7cdjLl6PBq8bvPxmCkLmnitPTGOoh9d8i+JlbINvgx1pguYrpeciIyreCO1rjTW3MgB0tyoMEa31V+7HrauBMeNnE68YTqLTIB0= smarkin@mirantis.com
tasks:
- name: Install Packaging python module for tools/airship

View File

@ -0,0 +1,17 @@
# 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.
---
- hosts: all
roles:
- mount-extra-volume
...

View File

@ -0,0 +1,43 @@
# 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.
---
- hosts: all
vars_files:
- vars.yaml
vars:
work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}"
logs_dir: "/tmp/logs"
roles:
- gather-host-logs
tags:
- gather-host-logs
- hosts: primary
vars_files:
- vars.yaml
vars:
work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}"
logs_dir: "/tmp/logs"
roles:
- helm-release-status
- describe-kubernetes-objects
- gather-pod-logs
- gather-prom-metrics
- gather-selenium-data
tags:
- helm-release-status
- describe-kubernetes-objects
- gather-pod-logs
- gather-prom-metrics
- gather-selenium-data
...

View File

@ -0,0 +1,17 @@
# 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.
---
- hosts: all
roles:
- start-zuul-console
...