From 04ad1cf8803fadf81166e980125b1467ed0ebc6c Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 17 Mar 2025 09:15:44 -0500 Subject: [PATCH 1/3] feat: add capi driver to magnum Signed-off-by: Kevin Carter --- Containerfiles/MagnumRXT-Containerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Containerfiles/MagnumRXT-Containerfile diff --git a/Containerfiles/MagnumRXT-Containerfile b/Containerfiles/MagnumRXT-Containerfile new file mode 100644 index 000000000..b12e2ae5e --- /dev/null +++ b/Containerfiles/MagnumRXT-Containerfile @@ -0,0 +1,11 @@ +ARG VERSION=master-ubuntu_jammy +FROM openstackhelm/magnum:${VERSION} as build +RUN apt-get update && apt-get install -y git && apt clean +RUN . /var/lib/openstack/bin/activate; \ +/var/lib/openstack/bin/pip install git+https://github.com/openstack/oslo.db@${PLUGIN_VERSION}#egg=oslo_db \ + git+https://opendev.org/openstack/magnum-capi-helm@${PLUGIN_VERSION}#egg=magnum_capi_helm +RUN /var/lib/openstack/bin/pip install --upgrade --force-reinstall pip +RUN find /var/lib/openstack -regex '^.*\(__pycache__\|\.py[co]\)$' -delete + +FROM openstackhelm/magnum:${VERSION} +COPY --from=build /var/lib/openstack/. /var/lib/openstack/ From 83ecdd0baba35ff8d34a7398d8815d20d97b0773 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 17 Mar 2025 09:15:44 -0500 Subject: [PATCH 2/3] feat: add capi driver to magnum Signed-off-by: Kevin Carter --- .github/workflows/release-magnum-rxt.yml | 115 +++++++++++++++++++++++ Containerfiles/MagnumRXT-Containerfile | 11 +++ 2 files changed, 126 insertions(+) create mode 100644 .github/workflows/release-magnum-rxt.yml create mode 100644 Containerfiles/MagnumRXT-Containerfile diff --git a/.github/workflows/release-magnum-rxt.yml b/.github/workflows/release-magnum-rxt.yml new file mode 100644 index 000000000..4916e97e0 --- /dev/null +++ b/.github/workflows/release-magnum-rxt.yml @@ -0,0 +1,115 @@ +# +name: Create and Publish a Heat Image + +on: + push: + paths: + - '.github/workflows/release-magnum-rxt.yml' + - 'Containerfiles/HeatRXT-Containerfile' + branches: + - development + - main + workflow_dispatch: + inputs: + imageTag: + description: 'Set tag for the image' + required: true + default: '2024.1-ubuntu_jammy' + type: choice + options: + - 2024.1-ubuntu_jammy + +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + DEF_TAG_NAME: 2024.1-ubuntu_jammy + +# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. +jobs: + build-and-push-image: + outputs: + MY_DATE: ${{ steps.mydate.outputs.MY_DATE }} + MY_CONTAINER: ${{ steps.mycontainer.outputs.MY_CONTAINER }} + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # ghcr only allows lowercase repository names + - name: lowercase repo name + run: | + echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Dynamically set MY_DATE environment variable + run: echo "MY_DATE=$(date +%s)" >> $GITHUB_ENV + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + file: Containerfiles/HeatRXT-Containerfile + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/magnum:${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/magnum:${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }}-${{ env.MY_DATE }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }} + - name: Dynamically set MY_CONTAINER output option + id: mycontainer + run: echo "MY_CONTAINER=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/magnum:${{ github.event.inputs.imageTag }}-${{ env.MY_DATE }}" >> $GITHUB_OUTPUT + - name: Dynamically set MY_DATE output option + id: mydate + run: echo "MY_DATE=${{ env.MY_DATE }}" >> $GITHUB_OUTPUT + + change-original-images: + runs-on: ubuntu-latest + needs: [build-and-push-image] + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Dynamically update the original images file + run: jq '. + ["${{ needs.build-and-push-image.outputs.MY_CONTAINER }}"] | sort' .original-images.json | tee .original-images.json.new + - name: Rewrite original images file + run: mv .original-images.json.new .original-images.json + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v7 + with: + commit-message: Update original images with new container + committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> + signoff: false + branch: ${{ needs.build-and-push-image.outputs.MY_DATE }} + sign-commits: true + delete-branch: true + title: 'chore: Update original images' + body: | + Update container image + - Updated original image file with container ${{needs.build-and-push-image.outputs.MY_CONTAINER}} + change request Auto-generated + labels: | + container images + automated pr + draft: false diff --git a/Containerfiles/MagnumRXT-Containerfile b/Containerfiles/MagnumRXT-Containerfile new file mode 100644 index 000000000..b12e2ae5e --- /dev/null +++ b/Containerfiles/MagnumRXT-Containerfile @@ -0,0 +1,11 @@ +ARG VERSION=master-ubuntu_jammy +FROM openstackhelm/magnum:${VERSION} as build +RUN apt-get update && apt-get install -y git && apt clean +RUN . /var/lib/openstack/bin/activate; \ +/var/lib/openstack/bin/pip install git+https://github.com/openstack/oslo.db@${PLUGIN_VERSION}#egg=oslo_db \ + git+https://opendev.org/openstack/magnum-capi-helm@${PLUGIN_VERSION}#egg=magnum_capi_helm +RUN /var/lib/openstack/bin/pip install --upgrade --force-reinstall pip +RUN find /var/lib/openstack -regex '^.*\(__pycache__\|\.py[co]\)$' -delete + +FROM openstackhelm/magnum:${VERSION} +COPY --from=build /var/lib/openstack/. /var/lib/openstack/ From 6e90347d6c223527087353799fbd3c2f70274d49 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 14:31:50 +0000 Subject: [PATCH 3/3] Update original images with new container --- .original-images.json | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.original-images.json b/.original-images.json index 30442d5f2..3c7bc4e59 100644 --- a/.original-images.json +++ b/.original-images.json @@ -1,28 +1,26 @@ [ - "quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_jammy", - "docker.io/rabbitmq:3.13-management", "docker.io/docker:17.07.0", - "docker.io/xrally/xrally-openstack:2.0.0", - "docker.io/openstackhelm/cinder:2024.1-ubuntu_jammy", - "docker.io/openstackhelm/ceph-config-helper:latest-ubuntu_jammy", - "docker.io/openstackhelm/designate:2024.1-ubuntu_jammy", + "docker.io/kolla/centos-source-openvswitch-vswitchd:master", + "docker.io/kolla/ubuntu-source-nova-compute-ironic:master", + "docker.io/library/postgres:14.5", + "docker.io/library/postgres:14.5", "docker.io/openstackhelm/barbican:2024.1-ubuntu_jammy", "docker.io/openstackhelm/ceph-config-helper:latest-ubuntu_jammy", + "docker.io/openstackhelm/ceph-config-helper:latest-ubuntu_jammy", + "docker.io/openstackhelm/cinder:2024.1-ubuntu_jammy", + "docker.io/openstackhelm/designate:2024.1-ubuntu_jammy", "docker.io/openstackhelm/glance:2024.1-ubuntu_jammy", - "docker.io/library/postgres:14.5", "docker.io/openstackhelm/horizon:2023.1-ubuntu_jammy", + "docker.io/openstackhelm/magnum:2024.1-ubuntu_jammy", + "docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy", "docker.io/openstackhelm/osh-selenium:latest-ubuntu_jammy", "docker.io/openstackhelm/ospurge:latest", - "ghcr.io/vexxhost/netoffload:v1.0.1", - "docker.io/kolla/ubuntu-source-nova-compute-ironic:master", - "gcr.io/google_containers/hyperkube-amd64:v1.11.6", - "docker.io/kolla/centos-source-openvswitch-vswitchd:master", "docker.io/openstackhelm/placement:2024.1-ubuntu_jammy", - "docker.io/library/postgres:14.5", + "docker.io/rabbitmq:3.13-management", "docker.io/wrouesnel/postgres_exporter:v0.4.6", - "quay.io/airshipit/porthole-postgresql-utility:latest-ubuntu_bionic", - "docker.io/openstackhelm/magnum:2024.1-ubuntu_jammy", - "docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy", + "docker.io/xrally/xrally-openstack:2.0.0", + "gcr.io/google_containers/hyperkube-amd64:v1.11.6", + "ghcr.io/cloudnull/genestack/magnum:2024.1-ubuntu_jammy-1742221842", "ghcr.io/rackerlabs/genestack/ceilometer:2024.1-ubuntu_jammy-1738626813", "ghcr.io/rackerlabs/genestack/cinder-volume-rxt:2024.1-ubuntu_jammy-1731085441", "ghcr.io/rackerlabs/genestack/glance:2024.1-ubuntu_jammy-1740121591", @@ -33,5 +31,8 @@ "ghcr.io/rackerlabs/genestack/nova-efi:2024.1-ubuntu_jammy-1737928811", "ghcr.io/rackerlabs/genestack/octavia-ovn:2024.1-ubuntu_jammy-1737651745", "ghcr.io/rackerlabs/keystone-rxt:2024.1-ubuntu_jammy-1739377879", - "ghcr.io/rackerlabs/skyline-rxt:master-ubuntu_jammy-1739967315" + "ghcr.io/rackerlabs/skyline-rxt:master-ubuntu_jammy-1739967315", + "ghcr.io/vexxhost/netoffload:v1.0.1", + "quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_jammy", + "quay.io/airshipit/porthole-postgresql-utility:latest-ubuntu_bionic" ]