ci: switch to gha (#2707)
Signed-off-by: Mohammed Naser <mnaser@vexxhost.com> Signed-off-by: Tadas Sutkaitis <tadas.sutkaitis@vexxhost.com> Co-authored-by: Tadas Sutkaitis <tadas.sutkaitis@vexxhost.com>
This commit is contained in:
1 parent
f87d0234fd
commit
19d6b917d8
12 files changed
+1654
-151
No files matched your search
@@ -0,0 +1,75 @@
|
||||
name: Run Molecule Tests
|
||||
description: Run Molecule tests for Atmosphere collection
|
||||
|
||||
inputs:
|
||||
scenario:
|
||||
description: Molecule scenario to run
|
||||
required: true
|
||||
csi_driver:
|
||||
description: CSI driver to use for the test
|
||||
default: local-path-provisioner
|
||||
network_backend:
|
||||
description: Network backend to use for the test
|
||||
default: openvswitch
|
||||
depot_build_id:
|
||||
description: Depot build ID to use for the test
|
||||
default: ''
|
||||
use_mirrors:
|
||||
description: Use mirrors for container images
|
||||
default: "true"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- shell: bash
|
||||
run: sudo swapoff -a
|
||||
|
||||
- shell: bash
|
||||
run: sudo apt-get update
|
||||
|
||||
- shell: bash
|
||||
run: |
|
||||
sudo mkdir -p /var/lib/etcd
|
||||
sudo mount -t tmpfs -o nodev,nosuid,size=512M tmpfs /var/lib/etcd
|
||||
|
||||
- uses: astral-sh/setup-uv@v6
|
||||
|
||||
- shell: bash
|
||||
run: |
|
||||
uv sync --dev
|
||||
echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
|
||||
env:
|
||||
UV_PYTHON_DOWNLOADS: never
|
||||
UV_PYTHON_PREFERENCE: only-system
|
||||
|
||||
- uses: depot/setup-action@v1
|
||||
if: ${{ inputs.depot_build_id != '' }}
|
||||
with:
|
||||
oidc: true
|
||||
|
||||
- shell: bash
|
||||
if: ${{ inputs.use_mirrors == 'true' }}
|
||||
run: |
|
||||
FILE="roles/defaults/vars/main.yml"
|
||||
if [[ -f "$FILE" ]]; then
|
||||
sed -i -E \
|
||||
-e "s|\{\{\s*atmosphere_image_prefix\s*\}\}registry\.atmosphere\.dev|harbor.atmosphere.dev|g" \
|
||||
-e "s|\{\{\s*atmosphere_image_prefix\s*\}\}|harbor.atmosphere.dev/|g" \
|
||||
"$FILE"
|
||||
else
|
||||
echo "File $FILE not found, skipping replacement."
|
||||
fi
|
||||
|
||||
# NOTE(mnaser): The newer versions of Helm have introduced more strict handling of
|
||||
# spacing that breaks some of the Helm charts, so we remove it here
|
||||
# for now so that Ansible installs it.
|
||||
- shell: bash
|
||||
run: rm -rfv /usr/local/bin/helm || true
|
||||
|
||||
- shell: bash
|
||||
run: sudo --preserve-env=ANSIBLE_PYTHON_INTERPRETER,ATMOSPHERE_NETWORK_BACKEND,DEPOT_BUILD_ID,DEPOT_TOKEN,MOLECULE_CSI_DRIVER env "PATH=$PATH" molecule test -s ${{ inputs.scenario }}
|
||||
env:
|
||||
ANSIBLE_PYTHON_INTERPRETER: /usr/bin/python3
|
||||
ATMOSPHERE_NETWORK_BACKEND: ${{ inputs.network_backend }}
|
||||
DEPOT_BUILD_ID: ${{ inputs.depot_build_id }}
|
||||
MOLECULE_CSI_DRIVER: ${{ inputs.csi_driver }}
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- stable/.*
|
||||
|
||||
permissions: {}
|
||||
|
||||
@@ -58,3 +59,80 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/build
|
||||
|
||||
images:
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: images-push-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: depot/setup-action@v1
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: harbor.atmosphere.dev
|
||||
username: ${{ secrets.HARBOR_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_PASSWORD }}
|
||||
- uses: depot/bake-action@v1
|
||||
id: bake
|
||||
with:
|
||||
project: jd10vkmkwv
|
||||
save: ${{ github.event_name == 'pull_request' }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
TAG: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
|
||||
outputs:
|
||||
build-id: ${{ steps.bake.outputs.build-id }}
|
||||
|
||||
csi:
|
||||
runs-on: ubuntu-22.04
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
csi_driver:
|
||||
- local-path-provisioner
|
||||
- rbd
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: ./.github/actions/molecule
|
||||
with:
|
||||
scenario: csi
|
||||
csi_driver: ${{ matrix.csi_driver }}
|
||||
|
||||
keycloak:
|
||||
runs-on: vexxhost-ubuntu-22.04-4
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: ./.github/actions/molecule
|
||||
with:
|
||||
scenario: keycloak
|
||||
|
||||
aio:
|
||||
runs-on: vexxhost-ubuntu-22.04-16
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
concurrency:
|
||||
group: ${{ github.job }}-${{ matrix.network_backend }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
needs:
|
||||
- images
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
network_backend:
|
||||
- openvswitch
|
||||
- ovn
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: ./.github/actions/molecule
|
||||
with:
|
||||
scenario: aio
|
||||
network_backend: ${{ matrix.network_backend }}
|
||||
depot_build_id: ${{ needs.images.outputs.build-id }}
|
||||
@@ -1,18 +1,5 @@
|
||||
VERSION --use-copy-link --try 0.8
|
||||
|
||||
unit.go:
|
||||
FROM golang:1.21
|
||||
RUN go install github.com/jstemmer/go-junit-report/v2@latest
|
||||
COPY --dir go.mod go.sum /src
|
||||
WORKDIR /src
|
||||
RUN go mod download
|
||||
COPY --dir charts/ cmd/ internal/ roles/ tools/ /src
|
||||
TRY
|
||||
RUN go test -v 2>&1 ./... | go-junit-report -set-exit-code > junit-go.xml
|
||||
FINALLY
|
||||
SAVE ARTIFACT /src/junit-go.xml AS LOCAL junit-go.xml
|
||||
END
|
||||
|
||||
build.venv.runtime:
|
||||
FROM ubuntu:jammy
|
||||
RUN \
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# SPDX-FileCopyrightText: © 2025 VEXXHOST, Inc.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import pbr.version
|
||||
|
||||
__version__ = pbr.version.VersionInfo("atmosphere").release_string()
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
FROM golang AS ovn-kubernetes
|
||||
ARG OVN_KUBERNETES_REF=5359e7d7f872058b6e5bf884c9f19d1922451f29
|
||||
ADD https://github.com/ovn-org/ovn-kubernetes.git#${OVN_KUBERNETES_REF} /src
|
||||
ADD https://github.com/ovn-kubernetes/ovn-kubernetes.git#${OVN_KUBERNETES_REF} /src
|
||||
COPY patches/ovn-kubernetes /patches/ovn-kubernetes
|
||||
RUN git -C /src apply --verbose /patches/ovn-kubernetes/*
|
||||
RUN <<EOF bash -xe
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
- name: Configure hostname
|
||||
- name: Prepare systems for CI
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Configure short hostname
|
||||
@@ -25,6 +25,56 @@
|
||||
regexp: '^127\.0\.1\.1'
|
||||
line: 127.0.1.1 {{ inventory_hostname }} {{ inventory_hostname_short }}
|
||||
|
||||
- name: Pull built images in CI
|
||||
when:
|
||||
- lookup('env', 'DEPOT_TOKEN') is defined and lookup('env', 'DEPOT_TOKEN') != ''
|
||||
- lookup('env', 'DEPOT_BUILD_ID') is defined and lookup('env', 'DEPOT_BUILD_ID') != ''
|
||||
block:
|
||||
- name: Install "containerd"
|
||||
ansible.builtin.include_role:
|
||||
name: vexxhost.containers.containerd
|
||||
|
||||
- name: Install "containerd"
|
||||
ansible.builtin.include_role:
|
||||
name: vexxhost.containers.containerd
|
||||
|
||||
- name: Get list of all Depot images for build
|
||||
no_log: true
|
||||
ansible.builtin.uri:
|
||||
method: POST
|
||||
url: https://api.depot.dev/depot.cli.v1.BuildService/GetPullInfo
|
||||
body_format: json
|
||||
headers:
|
||||
Authorization: "Bearer {{ lookup('env', 'DEPOT_TOKEN') }}"
|
||||
body:
|
||||
build_id: "{{ lookup('env', 'DEPOT_BUILD_ID') }}"
|
||||
register: depot_get_pull_info
|
||||
|
||||
- name: Pull all images to "containerd"
|
||||
no_log: true
|
||||
ansible.builtin.command:
|
||||
cmd: ctr -n="k8s.io" image pull -u {{ depot_get_pull_info.json.username }}:{{ depot_get_pull_info.json.password }} {{ depot_get_pull_info.json.reference }}-{{ item.targetName }}
|
||||
loop: "{{ depot_get_pull_info.json.options | selectattr('save', 'equalto', true) | selectattr('tags', 'defined') }}"
|
||||
loop_control:
|
||||
label: "{{ item.tags[0] }}"
|
||||
register: depot_pull_images
|
||||
|
||||
- name: Tag pulled images
|
||||
ansible.builtin.command:
|
||||
cmd: ctr -n="k8s.io" image tag {{ depot_get_pull_info.json.reference }}-{{ item.targetName }} {{ item.tags[0] }} {{ item.tags[0] | replace('harbor.atmosphere.dev', 'registry.atmosphere.dev') }}
|
||||
loop: "{{ depot_pull_images.results | map(attribute='item') }}"
|
||||
loop_control:
|
||||
label: "{{ item.tags[0] }}"
|
||||
|
||||
- name: Get list of all images
|
||||
ansible.builtin.command:
|
||||
cmd: ctr -n="k8s.io" image ls -q
|
||||
register: image_list
|
||||
|
||||
- name: Print list of pulled images
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ image_list.stdout_lines }}"
|
||||
|
||||
- name: Create fake devices for Ceph
|
||||
ansible.builtin.import_playbook: vexxhost.ceph.create_fake_devices
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
[build-system]
|
||||
requires = ["pbr>=6.1.1"]
|
||||
build-backend = "pbr.build"
|
||||
|
||||
[project]
|
||||
name = "atmosphere"
|
||||
dynamic = ["version"]
|
||||
authors = [{ name = "VEXXHOST, Inc.", email = "support@vexxhost.com" }]
|
||||
description = "Simple & easy private cloud platform featuring VMs, Kubernetes & bare-metal"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
license = "Apache-2.0"
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Environment :: OpenStack",
|
||||
"Intended Audience :: Information Technology",
|
||||
"Intended Audience :: System Administrators",
|
||||
"Operating System :: POSIX :: Linux",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
]
|
||||
dependencies = [
|
||||
"ansible-core>=2.15.9",
|
||||
"docker-image-py>=0.1.12",
|
||||
"jmespath>=1.0.1",
|
||||
"netaddr>=0.8.0",
|
||||
"openstacksdk>1",
|
||||
"rjsonnet>=0.5.2",
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"kubernetes",
|
||||
"molecule>=25.5.0",
|
||||
"oslotest>=5.0.1",
|
||||
"stestr>=4.2.0",
|
||||
"testscenarios>=0.5.0",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
source = "https://github.com/vexxhost/atmosphere"
|
||||
documentation = "https://vexxhost.github.io/atmosphere/"
|
||||
issues = "https://github.com/vexxhost/atmosphere/issues"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = ["atmosphere"]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "atmosphere.__version__"}
|
||||
@@ -1,28 +0,0 @@
|
||||
[metadata]
|
||||
name = atmosphere
|
||||
summary = Simple & easy private cloud platform featuring VMs, Kubernetes & bare-metal
|
||||
description_file = README.md
|
||||
description_content_type = text/markdown
|
||||
author = VEXXHOST, Inc.
|
||||
author_email = support@vexxhost.com
|
||||
url = https://github.com/vexxhost/atmosphere
|
||||
project_urls =
|
||||
Bug Tracker = https://github.com/vexxhost/atmosphere/issues
|
||||
Documentation = https://vexxhost.github.io/atmosphere/
|
||||
Source Code = https://github.com/vexxhost/atmosphere
|
||||
python_requires = >=3.8
|
||||
classifiers =
|
||||
Development Status :: 5 - Production/Stable
|
||||
Environment :: OpenStack
|
||||
Intended Audience :: Information Technology
|
||||
Intended Audience :: System Administrators
|
||||
License :: OSI Approved :: Apache Software License
|
||||
Operating System :: POSIX :: Linux
|
||||
Programming Language :: Python
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Programming Language :: Python :: 3.10
|
||||
Programming Language :: Python :: 3.11
|
||||
Programming Language :: Python :: 3 :: Only
|
||||
Programming Language :: Python :: Implementation :: CPython
|
||||
@@ -1,6 +0,0 @@
|
||||
# Copyright (c) 2024 VEXXHOST, Inc.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(setup_requires=["pbr>=2.0.0"], pbr=True)
|
||||
@@ -9,25 +9,6 @@
|
||||
name: atmosphere-tox-py3
|
||||
parent: tox
|
||||
|
||||
- job:
|
||||
name: atmosphere-build-images
|
||||
parent: depot-bake
|
||||
vars:
|
||||
depot_bake_project_id: jd10vkmkwv
|
||||
depot_bake_environment:
|
||||
REGISTRY: harbor.atmosphere.dev/ci
|
||||
TAG: "{{ zuul.change }}"
|
||||
files: &image_build_files
|
||||
- ^images/
|
||||
- docker-bake.hcl
|
||||
|
||||
- job:
|
||||
name: atmosphere-promote-images
|
||||
parent: promote-depot-bake
|
||||
files: *image_build_files
|
||||
vars:
|
||||
promote_depot_bake_job: atmosphere-build-images
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule
|
||||
parent: tox
|
||||
@@ -49,23 +30,6 @@
|
||||
ATMOSPHERE_ANSIBLE_TAGS: "{{ ansible_molecule_tags | default(['all']) | join(',') }}"
|
||||
ATMOSPHERE_ANSIBLE_SKIP_TAGS: "{{ ansible_molecule_skip_tags | default([]) | join(',') }}"
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-csi
|
||||
parent: atmosphere-molecule
|
||||
abstract: true
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-csi-local-path-provisioner
|
||||
parent: atmosphere-molecule-csi
|
||||
vars:
|
||||
tox_envlist: molecule-csi-local-path-provisioner
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-csi-rbd
|
||||
parent: atmosphere-molecule-csi
|
||||
vars:
|
||||
tox_envlist: molecule-csi-rbd
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-aio
|
||||
parent: atmosphere-molecule
|
||||
@@ -75,38 +39,6 @@
|
||||
roles:
|
||||
- zuul: openstack/openstack-helm
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-aio-keycloak
|
||||
parent: atmosphere-molecule-aio
|
||||
nodeset:
|
||||
nodes:
|
||||
- name: ubuntu-jammy
|
||||
label: jammy-8c-8g
|
||||
vars:
|
||||
tox_envlist: molecule-keycloak
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-aio-full
|
||||
parent: atmosphere-molecule-aio
|
||||
abstract: true
|
||||
timeout: 7200
|
||||
nodeset:
|
||||
nodes:
|
||||
- name: ubuntu-jammy
|
||||
label: jammy-16c-64g
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-aio-openvswitch
|
||||
parent: atmosphere-molecule-aio-full
|
||||
vars:
|
||||
tox_envlist: molecule-aio-openvswitch
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-aio-ovn
|
||||
parent: atmosphere-molecule-aio-full
|
||||
vars:
|
||||
tox_envlist: molecule-aio-ovn
|
||||
|
||||
- job:
|
||||
name: atmosphere-molecule-aio-ovn-bgp-agent
|
||||
parent: atmosphere-molecule-aio-ovn
|
||||
|
||||
+5
-34
@@ -17,44 +17,15 @@
|
||||
jobs:
|
||||
- atmosphere-tox-helm-unittest
|
||||
- atmosphere-tox-py3
|
||||
- atmosphere-molecule-aio-keycloak:
|
||||
dependencies: &image_build_jobs
|
||||
- name: atmosphere-build-images
|
||||
soft: true
|
||||
- atmosphere-molecule-aio-openvswitch:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-aio-ovn:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-aio-ovn-bgp-agent:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-csi-local-path-provisioner:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-csi-rbd:
|
||||
dependencies: *image_build_jobs
|
||||
# - atmosphere-molecule-aio-ovn-bgp-agent
|
||||
gate:
|
||||
jobs:
|
||||
- atmosphere-tox-helm-unittest
|
||||
- atmosphere-tox-py3
|
||||
- atmosphere-build-images
|
||||
- atmosphere-molecule-aio-keycloak:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-aio-openvswitch:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-aio-ovn:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-aio-ovn-bgp-agent:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-csi-local-path-provisioner:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-csi-rbd:
|
||||
dependencies: *image_build_jobs
|
||||
promote:
|
||||
jobs:
|
||||
- atmosphere-promote-images
|
||||
# - atmosphere-molecule-aio-ovn-bgp-agent
|
||||
periodic:
|
||||
jobs:
|
||||
- atmosphere-molecule-aio-upgrade-openvswitch:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-aio-upgrade-ovn:
|
||||
dependencies: *image_build_jobs
|
||||
- atmosphere-molecule-aio-upgrade-openvswitch
|
||||
- atmosphere-molecule-aio-upgrade-ovn
|
||||
vars:
|
||||
container_registry: harbor.atmosphere.dev/library
|
||||
Reference in new issue
Block a user