From 84530c92e9eb63a16d25adc0f3af0ca0c6ea33d6 Mon Sep 17 00:00:00 2001 From: Gerrod Ubben Date: Tue, 15 Oct 2024 14:58:26 -0400 Subject: [PATCH 1/2] Update actions to latest version and set CI python to 3.11 [noissue] --- .github/workflows/docs.yml | 17 ------ .github/workflows/kanban.yml | 97 ------------------------------- .github/workflows/pulp_images.yml | 18 +++--- 3 files changed, 11 insertions(+), 121 deletions(-) delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/kanban.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 4221daf8..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Nightly Docs - -on: - schedule: - - cron: '15 3 * * *' - workflow_dispatch: - -jobs: - publish-docs: - name: Publish docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Run publish docs script - env: - PULP_DOCS_KEY: ${{ secrets.PULP_DOCS_KEY }} - run: .ci/scripts/publish_docs.sh ${GITHUB_REF##*/} diff --git a/.github/workflows/kanban.yml b/.github/workflows/kanban.yml deleted file mode 100644 index a884dbfc..00000000 --- a/.github/workflows/kanban.yml +++ /dev/null @@ -1,97 +0,0 @@ -# Manage issues in a project board using https://github.com/leonsteinhaeuser/project-beta-automations - ---- -name: Kanban -on: - pull_request_target: - issues: - types: - - labeled - - reopened - - assigned - - closed - -env: - free_to_take: Free to take - in_progress: In Progress - needs_review: Needs review - done: Done - -jobs: - # only prio-list labeled items should be added to the board - add-to-project-board: - if: github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'prio-list') && contains(fromJson('["labeled", "reopened"]'), github.event.action) - runs-on: ubuntu-latest - steps: - - name: Add issue to Free-to-take list - uses: leonsteinhaeuser/project-beta-automations@v2.0.0 - with: - gh_token: ${{ secrets.RELEASE_TOKEN }} - organization: pulp - project_id: 8 - resource_node_id: ${{ github.event.issue.node_id }} - operation_mode: status - status_value: ${{ env.free_to_take }} # Target status - - move-to-inprogress: - if: github.event_name == 'issues' && github.event.action == 'assigned' - runs-on: ubuntu-latest - steps: - - name: Move an issue to the In Progress column - uses: leonsteinhaeuser/project-beta-automations@v2.0.0 - with: - gh_token: ${{ secrets.RELEASE_TOKEN }} - organization: pulp - project_id: 8 - resource_node_id: ${{ github.event.issue.node_id }} - operation_mode: status - status_value: ${{ env.in_progress }} # Target status - - find-linked-issues: - if: github.event_name == 'pull_request_target' - runs-on: ubuntu-latest - name: Find issues linked to a PR - outputs: - linked-issues: ${{ steps.linked-issues.outputs.issues }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Get Linked Issues Action - uses: kin/gh-action-get-linked-issues@v1.0 - id: linked-issues - with: - access-token: ${{ secrets.RELEASE_TOKEN }} - - move-to-needs-review: - if: github.event_name == 'pull_request_target' && contains(fromJson(needs.find-linked-issues.outputs.linked-issues).*.issue.state, 'open') - runs-on: ubuntu-latest - name: Move linked issues to Needs Review - needs: find-linked-issues - strategy: - max-parallel: 3 - matrix: - issues: ${{ fromJSON(needs.find-linked-issues.outputs.linked-issues) }} - steps: - - name: Move to Needs Review - uses: leonsteinhaeuser/project-beta-automations@v2.0.0 - with: - gh_token: ${{ secrets.RELEASE_TOKEN }} - organization: pulp - project_id: 8 - resource_node_id: ${{ matrix.issues.issue.node_id }} - operation_mode: status - status_value: ${{ env.needs_review }} # Target status - - move-to-done: - if: github.event_name == 'issues' && github.event.action == 'closed' - runs-on: ubuntu-latest - steps: - - name: Move an issue to the Done column - uses: leonsteinhaeuser/project-beta-automations@v2.0.0 - with: - gh_token: ${{ secrets.RELEASE_TOKEN }} - organization: pulp - project_id: 8 - resource_node_id: ${{ github.event.issue.node_id }} - operation_mode: status - status_value: ${{ env.done }} # Target status diff --git a/.github/workflows/pulp_images.yml b/.github/workflows/pulp_images.yml index f209277c..5a861b11 100644 --- a/.github/workflows/pulp_images.yml +++ b/.github/workflows/pulp_images.yml @@ -4,8 +4,6 @@ on: push: branches: - latest - schedule: - - cron: '0 1 * * *' workflow_dispatch: pull_request: env: @@ -24,7 +22,9 @@ jobs: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 + with: + python-version: 3.11 - name: Check commit message if: github.event_name == 'pull_request' @@ -80,7 +80,9 @@ jobs: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 + with: + python-version: 3.11 - name: Update to the latest pip run: python -m pip install --upgrade pip @@ -123,7 +125,7 @@ jobs: echo "pulp_ci_centos_id=${id}" >> "$GITHUB_ENV" - name: Cache podman images - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 with: key: base-images=${{ env.pulp_ci_centos_id }} path: base-images.tar @@ -169,7 +171,9 @@ jobs: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 + with: + python-version: 3.11 - name: Install python dependencies if: github.event_name == 'schedule' @@ -185,7 +189,7 @@ jobs: fi - name: Restore podman images from cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: key: base-images=${{ needs.base-images.outputs.pulp_ci_centos_id }} path: base-images.tar From 33746e710291a39b86203ba109a1da06dd24ce02 Mon Sep 17 00:00:00 2001 From: Gerrod Ubben Date: Wed, 16 Oct 2024 13:51:38 -0400 Subject: [PATCH 2/2] Remove galaxy scenarios from CI & publish workflows Galaxy-ng doesn't have a version for pulpcore==3.39 so we don't need to run these scenarios for this branch. [noissue] --- .github/workflows/pulp_images.yml | 57 +++---------------------------- 1 file changed, 5 insertions(+), 52 deletions(-) diff --git a/.github/workflows/pulp_images.yml b/.github/workflows/pulp_images.yml index 5a861b11..4e5c6698 100644 --- a/.github/workflows/pulp_images.yml +++ b/.github/workflows/pulp_images.yml @@ -1,9 +1,6 @@ name: pulp-oci-images CI on: - push: - branches: - - latest workflow_dispatch: pull_request: env: @@ -56,16 +53,9 @@ jobs: image_variants: "${{ steps.image_variants.outputs.image_variants }}" pulp_ci_centos_id: "${{ steps.pulp_ci_centos_id.outputs.pulp_ci_centos_id }}" steps: - # We do not want to build nightly images unless it's a PR to the latest branch, - # or a branch/dispatch build on the latest branch. - name: Set the list of image_variants for later jobs id: image_variants - run: | - if [ "${{ github.base_ref }}" == "latest" ] || [ "${{ github.ref_name }}" == "latest" ]; then - echo "image_variants=[\"nightly\",\"stable\"]" >> "$GITHUB_OUTPUT" - else - echo "image_variants=[\"stable\"]" >> "$GITHUB_OUTPUT" - fi + run: echo "image_variants=[\"stable\"]" >> "$GITHUB_OUTPUT" - name: Set the temporary image tag run: | @@ -87,16 +77,6 @@ jobs: - name: Update to the latest pip run: python -m pip install --upgrade pip - - name: Dispatch workflows on stable branches - if: github.event_name == 'schedule' - run: | - echo ::group::PYDEPS - pip install gitpython requests packaging jinja2 pyyaml - echo ::endgroup:: - python .ci/scripts/update_ci_branches.py - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - - name: Build images run: | podman version @@ -145,12 +125,6 @@ jobs: - image_name: pulp web_image: pulp-web pip_name: pulpcore - - image_name: galaxy-minimal - web_image: galaxy-web - pip_name: galaxy-ng - - image_name: galaxy - web_image: galaxy-web - pip_name: galaxy-ng steps: - name: Set the temporary image tags run: | @@ -218,7 +192,7 @@ jobs: sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes for ARCH in arm64 amd64 do - if [[ "${{ matrix.app.image_name }}" == "pulp-minimal" || "${{ matrix.app.image_name }}" == "galaxy-minimal" ]]; then + if [[ "${{ matrix.app.image_name }}" == "pulp-minimal" ]]; then podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.core --tag pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG}-${ARCH} --build-arg FROM_TAG=${TEMP_BASE_TAG}-${ARCH} . podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ matrix.app.image_name }}/${{ matrix.image_variant }}/Containerfile.webserver --tag pulp/${{ matrix.app.web_image }}:${TEMP_APP_TAG}-${ARCH} --build-arg FROM_TAG=${TEMP_APP_TAG}-${ARCH} . else @@ -253,32 +227,11 @@ jobs: podman stop pulp podman rm pulp - - name: Test the image in s6 mode (galaxy) - if: matrix.app.image_name == 'galaxy' - run: | - images/s6_assets/test.sh "pulp/${{ matrix.app.image_name }}:${TEMP_APP_TAG}-amd64" https - podman stop pulp - podman rm pulp - - name: Compose up + if: matrix.app.image_name == 'pulp-minimal' run: | - if [[ "${{ matrix.app.image_name }}" == "pulp" || "${{ matrix.app.image_name }}" == "galaxy" ]]; then - - # Reuse the folders from the s6 mode tests - FILE="compose.folders.yml" - echo "host all all 10.0.0.0/8 trust" | sudo tee -a pgsql/data/pg_hba.conf > /dev/null - echo "listen_addresses = '*'" | sudo tee -a pgsql/data/postgresql.conf > /dev/null - - # We'll pull the web image from a registry since we didn't build it. - if [ "${{ matrix.image_variant }}" == "nightly" ]; then - WEB_TAG="nightly" - else - WEB_TAG="${APP_BRANCH}" - fi - else - FILE="compose.yml" - WEB_TAG="${TEMP_APP_TAG}-amd64" - fi + FILE="compose.yml" + WEB_TAG="${TEMP_APP_TAG}-amd64" cd images/compose sed -i "s/pulp-minimal:latest/${{ matrix.app.image_name }}:${TEMP_APP_TAG}-amd64/g" $FILE sed -i "s/pulp-web:latest/${{ matrix.app.web_image }}:${WEB_TAG}/g" $FILE