Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI reliability #1408

Merged
merged 4 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions build/lint-jobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import sys
import glob
import yaml


def main():
passed = True

for file in glob.glob("zuul.d/container-images/*.yaml"):
with open(file, "r") as file:
configs = yaml.safe_load(file)

for config in configs:
if "job" in config:
job = config["job"]

# Check if build or upload jobs are missing 'atmosphere-buildset-registry' dependency
if (
"build-container-image-" in job["name"]
or "upload-container-image-" in job["name"]
):
deps = job.get("dependencies", [])
if not any(
dep.get("name") == "atmosphere-buildset-registry"
for dep in deps
):
print(
f"Job '{job['name']}' is missing 'atmosphere-buildset-registry' dependency."
)
passed = False

if passed:
print(
"All build and upload jobs have 'atmosphere-buildset-registry' dependency."
)
else:
print("Jobs missing 'atmosphere-buildset-registry' dependency.")
sys.exit(1)


if __name__ == "__main__":
main()
3 changes: 3 additions & 0 deletions roles/barbican/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@
register: _octavia_implied_role_create
changed_when: _octavia_implied_role_create.rc == 0
failed_when: _octavia_implied_role_create.rc != 0 and 'Duplicate entry.' not in _octavia_implied_role_create.stderr
retries: 10
delay: 1
until: _octavia_implied_role_create.rc == 0 or 'Duplicate entry.' in _octavia_implied_role_create.stderr
12 changes: 12 additions & 0 deletions roles/kube_prometheus_stack/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Wait until Keycloak service is ready
kubernetes.core.k8s_info:
api_version: apps/v1
kind: StatefulSet
name: keycloak
namespace: auth-system
register: kube_prometheus_stack_keycloak_service
retries: 120
delay: 5
until:
- kube_prometheus_stack_keycloak_service.resources[0].status.replicas == kube_prometheus_stack_keycloak_service.resources[0].status.readyReplicas # noqa: yaml[line-length]

- name: Create Keycloak realm
no_log: true
run_once: true
Expand Down
5 changes: 5 additions & 0 deletions roles/octavia/tasks/generate_resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
environment:
OS_CLOUD: atmosphere
loop: "{{ groups['controllers'] }}"
register: _set_binding_for_ports
retries: 10
delay: 1
until: _set_binding_for_ports.rc == 0
failed_when: _set_binding_for_ports.rc != 0

- name: Get health manager networking ports
openstack.cloud.port_info:
Expand Down
3 changes: 3 additions & 0 deletions roles/octavia/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
register: _octavia_implied_role_create
changed_when: _octavia_implied_role_create.rc == 0
failed_when: _octavia_implied_role_create.rc != 0 and 'Duplicate entry.' not in _octavia_implied_role_create.stderr
retries: 10
delay: 1
until: _octavia_implied_role_create.rc == 0 or 'Duplicate entry.' in _octavia_implied_role_create.stderr

- name: Create Ingress
ansible.builtin.include_role:
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ deps =
commands =
pre-commit run --all-files --show-diff-on-failure
python3 {toxinidir}/build/sync-charts.py --check
python3 {toxinidir}/build/lint-jobs.py

[testenv:molecule-keycloak]
commands =
Expand Down
3 changes: 3 additions & 0 deletions zuul.d/container-images/cluster-api-provider-openstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
- job:
name: atmosphere-upload-container-image-cluster-api-provider-openstack
parent: atmosphere-upload-container-image
dependencies:
- name: atmosphere-buildset-registry
soft: false
vars: *container_image_vars
files: *container_image_files

Expand Down
3 changes: 3 additions & 0 deletions zuul.d/container-images/kubernetes-entrypoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
- job:
name: atmosphere-upload-container-image-kubernetes-entrypoint
parent: atmosphere-upload-container-image
dependencies:
- name: atmosphere-buildset-registry
soft: false
vars: *container_image_vars
files: *container_image_files

Expand Down
3 changes: 3 additions & 0 deletions zuul.d/container-images/openvswitch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
- job:
name: atmosphere-upload-container-image-openvswitch
parent: atmosphere-upload-container-image
dependencies:
- name: atmosphere-buildset-registry
soft: false
vars: *container_image_vars
files: *container_image_files

Expand Down
2 changes: 2 additions & 0 deletions zuul.d/container-images/python-openstackclient.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
name: atmosphere-upload-container-image-python-openstackclient
parent: atmosphere-upload-container-image
dependencies:
- name: atmosphere-buildset-registry
soft: false
- name: atmosphere-upload-container-image-ubuntu
soft: true
- name: atmosphere-upload-container-image-ubuntu-cloud-archive
Expand Down
3 changes: 3 additions & 0 deletions zuul.d/container-images/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
- job:
name: atmosphere-upload-container-image-ubuntu
parent: atmosphere-upload-container-image
dependencies:
- name: atmosphere-buildset-registry
soft: false
vars: *container_image_vars
files: *container_image_files

Expand Down