diff --git a/Makefile b/Makefile index 3dbe6aebf1..0d38c64e0d 100644 --- a/Makefile +++ b/Makefile @@ -249,7 +249,3 @@ plugin-development-disable: # Revert all changes and delete .env if no longer ne grep -lEr --include=\*.py --exclude-dir=.venv 'from (?:plugins|tests)' | xargs gsed -i -e 's/from plugins/from ansible_collections\.cifmw\.general\.plugins/g' -e 's/from tests/from ansible_collections\.cifmw\.general\.tests/g' gsed -i '/PYTHONPATH=/d' .env [ -s .env ] || rm .env - -.PHONY: build-cifmw-client-container -build-cifmw-client-container: # Locally build cifmw-client container - podman build --security-opt label=disable -t localhost/cifmw-client:latest -f containerfiles/Containerfile.client . diff --git a/ci/playbooks/build_push_container.yml b/ci/playbooks/build_push_container.yml deleted file mode 100644 index 7373811969..0000000000 --- a/ci/playbooks/build_push_container.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Run build_push_container role - hosts: "{{ cifmw_target_host | default('localhost') }}" - tasks: - - name: Run build_push_container role - ansible.builtin.include_role: - name: build_push_container diff --git a/ci/playbooks/build_push_container_runner.yml b/ci/playbooks/build_push_container_runner.yml deleted file mode 100644 index adbea8fdb5..0000000000 --- a/ci/playbooks/build_push_container_runner.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Run build_push_container role - hosts: "{{ cifmw_zuul_target_host | default('controller') }}" - tasks: - - name: Run build_push_container role - vars: - ci_framework_src_dir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework" - ansible.builtin.command: - chdir: "{{ ci_framework_src_dir }}" - cmd: >- - ~/test-python/bin/ansible-playbook ci/playbooks/build_push_container.yml - -i {{ ansible_user_dir }}/ci-framework-data/artifacts/zuul_inventory.yml - -e @group_vars/all.yml - -e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml" diff --git a/ci/templates/projects.yaml b/ci/templates/projects.yaml index 857c9e85a7..75ae430ae8 100644 --- a/ci/templates/projects.yaml +++ b/ci/templates/projects.yaml @@ -21,9 +21,4 @@ - cifmw-tcib - cifmw-architecture-validate-hci - ci-framework-openstack-meta-content-provider - - build-push-container-cifmw-client - - github-post: - jobs: - - build-push-container-cifmw-client-post # Start generated content diff --git a/containerfiles/Containerfile.client b/containerfiles/Containerfile.client deleted file mode 100644 index 8ab69287a0..0000000000 --- a/containerfiles/Containerfile.client +++ /dev/null @@ -1,35 +0,0 @@ -FROM quay.io/centos/centos:stream9 - -LABEL summary="CI-Framework client image" \ - maintainer="CI Framework" - -# USER root -RUN dnf update -y && \ - dnf install -y git python3.11 python3.11-pip \ - python3-netaddr make gcc sudo rsync vim && \ - dnf clean all - -RUN adduser cifmw - -RUN echo "cifmw ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/cifmw - -ENV PATH="/home/cifmw/test-python/bin:$PATH:/home/cifmw/.local/bin" - -USER cifmw - -COPY --chown=cifmw:cifmw . /home/cifmw/ci-framework - -WORKDIR /home/cifmw/ci-framework - -RUN /usr/bin/make -C /home/cifmw/ci-framework setup_molecule USE_VENV=yes - -# todo(Lewis): Possible enhancements: -# - Add pre-commit install so more dependencies are bundled -# RUN /home/cifmw/test-python/bin/pre-commit install --install-hooks -# - Add entrypoint script to source python venv -# - Use ansible-dev-environment -# https://github.com/ansible/ansible-dev-environment -# RUN ade install --venv ~/test-python/ -r requirements.yml -# Requires ability to skip ansible-galaxy install call in setup_molecule -# Skip installing collections in job that builds container -# - Copy python venv from host during build rather than downloading twice. diff --git a/zuul.d/pods.yaml b/zuul.d/pods.yaml index 9c61e3cf27..ff17556277 100644 --- a/zuul.d/pods.yaml +++ b/zuul.d/pods.yaml @@ -41,76 +41,3 @@ run_test: "check_k8s_snippets_comment" files: - ^roles/ci_gen_kustomize_values/templates/.* - -# -# cifmw-client container build and push jobs -# -- job: - name: build-push-container-build - description: | - Build container using build_push_container - role. - This is a base job that can be consumed by other projects. - pre-run: - molecule-prepare.yml - Copies required projects and installs dependencies. - dump_zuul_data.yml - Copies Zuul inventory and variables to disk for later use. - run: - build_push_container_runner.yml - Nested ansible-playbook call to run - build_push_container.yml on controller. - vars: - buildah_login & registry_login_enabled - Both used by build-push-container-base job - in config repo to trigger logging into quay.rdoproject.org for later use. - parent: build-push-container-base - nodeset: centos-stream-9 - pre-run: - - ci/playbooks/molecule-prepare.yml - - ci/playbooks/dump_zuul_data.yml - run: ci/playbooks/build_push_container_runner.yml - post-run: ci/playbooks/collect-logs.yml - vars: - buildah_login: true - registry_login_enabled: true -- job: - name: build-push-container-cifmw-client - description: | - Build and push cifmw-client container to - quay.rdoproject.com registry. - vars: - cifmw_build_push_container_push - Used by build_push_container role to trigger pushing to registry. - cifmw_build_push_container_name - Name of container being build and pushed. - cifmw_build_push_container_containerfile_path - Path to containerfile. - cifmw_build_push_container_registry_name - Registry built containers will be pushed too. - Runtime: ~30mins. - parent: build-push-container-build - vars: - ansible_user_dir: "{{ lookup('env', 'HOME') }}" - cifmw_ci_framework_src: >- - {{ - (ansible_user_dir, - zuul.project.src_dir) | ansible.builtin.path_join - }} - cifmw_build_push_container_push: true - cifmw_build_push_container_name: cifmw-client - cifmw_build_push_container_containerfile_path: >- - {{ - (cifmw_ci_framework_src, - 'containerfiles', - 'Containerfile.client') | ansible.builtin.path_join - }} - cifmw_build_push_container_registry_name: >- - quay.rdoproject.org/openstack-k8s-operators/cifmw-client - cifmw_build_push_container_supported_platform: [linux/arm64, linux/amd64] - timeout: 5400 - -- job: - name: build-push-container-cifmw-client-post - description: | - Build and push cifmw-client container to - quay.rdoproject.com registry and tag with latest - To be ran in post pipeline as it controls the 'latest' tag - vars: - cifmw_build_push_container_tag_override - If branch is main, add latest tag, - otherwise tag with -latest - parent: build-push-container-cifmw-client - vars: - cifmw_build_push_container_tag_override: "{{ ['latest'] if zuul.branch == 'main' else [zuul.branch ~ 'latest'] }}" diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 8def5eb491..a49a390619 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -12,7 +12,6 @@ - cifmw-tcib - cifmw-architecture-validate-hci - ci-framework-openstack-meta-content-provider - - build-push-container-cifmw-client - cifmw-molecule-adoption_osp_deploy - cifmw-molecule-artifacts - cifmw-molecule-build_containers @@ -110,9 +109,6 @@ - edpm-ansible-molecule-edpm_podman - edpm-ansible-molecule-edpm_ovs - edpm-ansible-molecule-edpm_kernel - github-post: - jobs: - - build-push-container-cifmw-client-post name: openstack-k8s-operators/ci-framework templates: - podified-multinode-edpm-ci-framework-pipeline