diff --git a/releasenotes/notes/skyline-4763b3a9c14ace98.yaml b/releasenotes/notes/skyline-4763b3a9c14ace98.yaml new file mode 100644 index 0000000000..9fdd1f4ded --- /dev/null +++ b/releasenotes/notes/skyline-4763b3a9c14ace98.yaml @@ -0,0 +1,9 @@ +--- +skyline: + - | + Bring out database migrations and nginx config generation + to separate scripts so that they can be run independently + during init container phase. + - | + Use Loci Skyline image by default. +... diff --git a/skyline/templates/bin/_db-sync.sh.tpl b/skyline/templates/bin/_db-sync.sh.tpl new file mode 100644 index 0000000000..9289db5ae9 --- /dev/null +++ b/skyline/templates/bin/_db-sync.sh.tpl @@ -0,0 +1,21 @@ +#!/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 + +# FIXME: Add db sync executable endpoint to skyline-apiserver package and use it here +site_packages_dir=$(python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])') +alembic -c ${site_packages_dir}/skyline_apiserver/db/alembic/alembic.ini upgrade head diff --git a/skyline/templates/bin/_skyline-apiserver-init.sh.tpl b/skyline/templates/bin/_skyline-apiserver-init.sh.tpl new file mode 100644 index 0000000000..2e7f183840 --- /dev/null +++ b/skyline/templates/bin/_skyline-apiserver-init.sh.tpl @@ -0,0 +1,20 @@ +#!/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 + +GENERATOR_ARGS="--output-file /etc/nginx/nginx.conf" +skyline-nginx-generator ${GENERATOR_ARGS} diff --git a/skyline/templates/bin/_skyline-apiserver.sh.tpl b/skyline/templates/bin/_skyline-apiserver.sh.tpl new file mode 100644 index 0000000000..067666b2cd --- /dev/null +++ b/skyline/templates/bin/_skyline-apiserver.sh.tpl @@ -0,0 +1,19 @@ +#!/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 + +gunicorn -c /etc/skyline/gunicorn.py skyline_apiserver.main:app diff --git a/skyline/templates/configmap-bin.yaml b/skyline/templates/configmap-bin.yaml index 681d107c4d..ebed7e7d9b 100644 --- a/skyline/templates/configmap-bin.yaml +++ b/skyline/templates/configmap-bin.yaml @@ -30,5 +30,10 @@ data: {{- include "helm-toolkit.scripts.db_drop" . | indent 4 }} ks-user.sh: | {{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} - + db-sync.sh: | +{{ tuple "bin/_db-sync.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + skyline-apiserver-init.sh: | +{{ tuple "bin/_skyline-apiserver-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + skyline-apiserver.sh: | +{{ tuple "bin/_skyline-apiserver.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{- end }} diff --git a/skyline/templates/deployment.yaml b/skyline/templates/deployment.yaml index 789bb1b321..d22b609868 100644 --- a/skyline/templates/deployment.yaml +++ b/skyline/templates/deployment.yaml @@ -50,13 +50,50 @@ spec: {{ .Values.labels.skyline.node_selector_key }}: {{ .Values.labels.skyline.node_selector_value }} initContainers: {{ tuple $envAll "skyline" $mounts_skyline_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - containers: - - name: skyline + - name: api-init {{ tuple $envAll "skyline" | include "helm-toolkit.snippets.image" | indent 10 }} -{{ dict "envAll" $envAll "application" "skyline" "container" "skyline" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} + command: + - /bin/sh + - -c + - /tmp/skyline-apiserver-init.sh + volumeMounts: + - name: pod-tmp + mountPath: /tmp + - name: skyline-bin + mountPath: /tmp/skyline-apiserver-init.sh + subPath: skyline-apiserver-init.sh + readOnly: true + - name: skyline-etc + mountPath: /etc/skyline/skyline.yaml + subPath: skyline.yaml + readOnly: true + - name: skyline-etc + mountPath: /etc/skyline/gunicorn.py + subPath: gunicorn.py + readOnly: true + - name: nginx-etc + mountPath: /etc/nginx +{{ if $mounts_skyline_init.volumeMounts }}{{ toYaml $mounts_skyline_init.volumeMounts | indent 12 }}{{ end }} + containers: + - name: nginx + command: + - /bin/sh + - -c + - cp /etc/nginx/.skyline/nginx.conf /etc/nginx/nginx.conf && nginx -g 'daemon off;' +{{ tuple $envAll "skyline_nginx" | include "helm-toolkit.snippets.image" | indent 10 }} ports: - name: api containerPort: {{ tuple "skyline" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + volumeMounts: + - name: pod-tmp + mountPath: /tmp + - name: nginx-etc + mountPath: /etc/nginx/.skyline + - name: skyline +{{ tuple $envAll "skyline" | include "helm-toolkit.snippets.image" | indent 10 }} +{{ dict "envAll" $envAll "application" "skyline" "container" "skyline" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} + command: + - /tmp/skyline-apiserver.sh volumeMounts: - name: pod-tmp mountPath: /tmp @@ -70,12 +107,22 @@ spec: mountPath: /etc/skyline/gunicorn.py subPath: gunicorn.py readOnly: true + - name: skyline-bin + mountPath: /tmp/skyline-apiserver.sh + subPath: skyline-apiserver.sh + readOnly: true {{ if $mounts_skyline.volumeMounts }}{{ toYaml $mounts_skyline.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-tmp emptyDir: {} + - name: nginx-etc + emptyDir: {} - name: skyline-var-lib emptyDir: {} + - name: skyline-bin + configMap: + name: skyline-bin + defaultMode: 0555 - name: skyline-etc secret: secretName: skyline-etc diff --git a/skyline/templates/job-db-sync.yaml b/skyline/templates/job-db-sync.yaml index e911c99567..23fde8b9b9 100644 --- a/skyline/templates/job-db-sync.yaml +++ b/skyline/templates/job-db-sync.yaml @@ -62,10 +62,16 @@ spec: image: {{ .Values.images.tags.skyline_db_sync | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} {{ tuple . .Values.pod.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} - env: - - name: KOLLA_BOOTSTRAP - value: "" +{{ dict "envAll" . "application" "skyline" "container" "db_sync" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} + command: + - /bin/sh + - -c + - /tmp/db-sync.sh volumeMounts: + - name: skyline-bin + mountPath: /tmp/db-sync.sh + subPath: db-sync.sh + readOnly: true - name: pod-tmp mountPath: /tmp - name: etc-service @@ -80,6 +86,10 @@ spec: emptyDir: {} - name: etc-service emptyDir: {} + - name: skyline-bin + configMap: + name: skyline-bin + defaultMode: 0555 - name: db-sync-conf secret: secretName: {{ $configMapEtc | quote }} diff --git a/skyline/values.yaml b/skyline/values.yaml index fa6d603e0e..cf111fafad 100644 --- a/skyline/values.yaml +++ b/skyline/values.yaml @@ -26,11 +26,12 @@ helm3_hook: true images: pull_policy: IfNotPresent tags: - skyline_db_sync: quay.io/airshipit/skyline:latest - skyline: quay.io/airshipit/skyline:latest - db_init: quay.io/airshipit/heat:2025.1-ubuntu_jammy + skyline_db_sync: quay.io/airshipit/skyline:2025.2-ubuntu_noble + skyline: quay.io/airshipit/skyline:2025.2-ubuntu_noble + skyline_nginx: quay.io/airshipit/skyline:2025.2-ubuntu_noble + db_init: quay.io/airshipit/heat:2025.2-ubuntu_noble dep_check: 'quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_jammy' - ks_user: quay.io/airshipit/heat:2025.1-ubuntu_jammy + ks_user: quay.io/airshipit/heat:2025.2-ubuntu_noble local_registry: active: false exclude: @@ -90,7 +91,7 @@ endpoints: path: /skyline scheme: default: mysql+pymysql - skyline: mysql + skyline: mysql+pymysql port: mysql: default: 3306 diff --git a/values_overrides/skyline/2025.1-ubuntu_jammy.yaml b/values_overrides/skyline/2025.1-ubuntu_jammy.yaml new file mode 100644 index 0000000000..acb088e459 --- /dev/null +++ b/values_overrides/skyline/2025.1-ubuntu_jammy.yaml @@ -0,0 +1,10 @@ +--- +images: + tags: + skyline_db_sync: quay.io/airshipit/skyline:2025.1-ubuntu_jammy + skyline: quay.io/airshipit/skyline:2025.1-ubuntu_jammy + skyline_nginx: quay.io/airshipit/skyline:2025.1-ubuntu_jammy + db_init: quay.io/airshipit/heat:2025.1-ubuntu_jammy + dep_check: 'quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_jammy' + ks_user: quay.io/airshipit/heat:2025.1-ubuntu_jammy +... diff --git a/values_overrides/skyline/2025.2-ubuntu_noble.yaml b/values_overrides/skyline/2025.2-ubuntu_noble.yaml new file mode 100644 index 0000000000..bc1643cc28 --- /dev/null +++ b/values_overrides/skyline/2025.2-ubuntu_noble.yaml @@ -0,0 +1,10 @@ +--- +images: + tags: + skyline_db_sync: quay.io/airshipit/skyline:2025.2-ubuntu_noble + skyline: quay.io/airshipit/skyline:2025.2-ubuntu_noble + skyline_nginx: quay.io/airshipit/skyline:2025.2-ubuntu_noble + db_init: quay.io/airshipit/heat:2025.2-ubuntu_noble + dep_check: 'quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_jammy' + ks_user: quay.io/airshipit/heat:2025.2-ubuntu_noble +... diff --git a/zuul.d/2025.2-ubuntu_noble.yaml b/zuul.d/2025.2-ubuntu_noble.yaml index 953649ecf4..4cd68940b5 100644 --- a/zuul.d/2025.2-ubuntu_noble.yaml +++ b/zuul.d/2025.2-ubuntu_noble.yaml @@ -55,4 +55,14 @@ container_distro_name: ubuntu container_distro_version: noble +- job: + name: openstack-helm-skyline-2025-2-ubuntu_noble + parent: openstack-helm-skyline + nodeset: openstack-helm-3nodes-ubuntu_noble + timeout: 10800 + vars: + osh_params: + openstack_release: "2025.2" + container_distro_name: ubuntu + container_distro_version: noble ... diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 09ae91b7b7..9c12d1d6c6 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -485,6 +485,8 @@ name: openstack-helm-skyline parent: openstack-helm-deploy timeout: 10800 + files: + - skyline/.* vars: gate_scripts: - ./tools/deployment/common/prepare-bashrc.sh diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 9c18a21271..7a2209ae4a 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -37,7 +37,6 @@ # 2025.1 Ubuntu Jammy - openstack-helm-cinder-2025-1-ubuntu_jammy # 3 nodes rook - openstack-helm-compute-kit-2025-1-ubuntu_jammy # 1 node + 3 nodes - - openstack-helm-skyline-2025-1-ubuntu_jammy # 3 nodes - openstack-helm-octavia-2025-1-ubuntu_jammy # 4 nodes - openstack-helm-blazar-2025-1-ubuntu_jammy # 3 nodes; run only if blazar changed - openstack-helm-cloudkitty-2025-1-ubuntu_jammy # 3 nodes; run only if cloudkitty changed @@ -50,6 +49,7 @@ - openstack-helm-cinder-2025-2-ubuntu_noble # 5 nodes rook - openstack-helm-compute-kit-2025-2-ubuntu_noble # 1 node + 3 nodes - openstack-helm-compute-kit-ovn-2025-2-ubuntu_noble # 1 node + 3 nodes + - openstack-helm-skyline-2025-2-ubuntu_noble # 3 nodes # Infra jobs - openstack-helm-logging - openstack-helm-monitoring