From a0820692fb4393fa820a5e7df335a0780699d0b1 Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:25:39 -0400 Subject: [PATCH] wip --- .cicd/platforms.json | 8 -- .../workflows/performance_harness_run.yaml | 36 ++++---- .../workflows/ph_backward_compatibility.yaml | 26 +++--- .github/workflows/platforms.yaml | 88 ------------------- 4 files changed, 32 insertions(+), 126 deletions(-) delete mode 100644 .cicd/platforms.json delete mode 100644 .github/workflows/platforms.yaml diff --git a/.cicd/platforms.json b/.cicd/platforms.json deleted file mode 100644 index fccc8dbc00..0000000000 --- a/.cicd/platforms.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ubuntu20": { - "dockerfile": ".cicd/platforms/ubuntu20.Dockerfile" - }, - "ubuntu22": { - "dockerfile": ".cicd/platforms/ubuntu22.Dockerfile" - } -} diff --git a/.github/workflows/performance_harness_run.yaml b/.github/workflows/performance_harness_run.yaml index 7282bb1316..cbdfcd3f1d 100644 --- a/.github/workflows/performance_harness_run.yaml +++ b/.github/workflows/performance_harness_run.yaml @@ -9,6 +9,7 @@ on: options: - ubuntu20 - ubuntu22 + - reproducible override-test-params: description: 'Override perf harness params' type: string @@ -38,21 +39,21 @@ jobs: echo test-params=${{inputs.override-test-params}} >> $GITHUB_OUTPUT fi - platforms: - name: Run Platforms Workflow - uses: ./.github/workflows/platforms.yaml - with: - override-build-matrix: ${{github.event.inputs.platform-choice}} + platform-cache: + name: Platform Cache + uses: AntelopeIO/platform-cache-workflow/.github/workflows/platformcache.yaml@main permissions: - packages: write contents: read + packages: write + with: + runs-on: '["self-hosted", "enf-x86-beefy"]' + platform-files: | + .cicd/platforms + tools/reproducible.Dockerfile:builder reuse-build: name: Reuse leap build needs: [v] - if: | - always() && - needs.v.result == 'success' runs-on: ubuntu-latest outputs: build-artifact: ${{steps.downloadBuild.outputs.downloaded-file}} @@ -77,23 +78,20 @@ jobs: build-base: name: Run Build Workflow - needs: [platforms, reuse-build] - if: always() && needs.platforms.result == 'success' && needs.reuse-build.outputs.build-artifact == '' + needs: [platforms-cache, reuse-build] + if: needs.reuse-build.outputs.build-artifact == '' uses: ./.github/workflows/build_base.yaml with: - p: ${{needs.platforms.outputs.p}} - platform-matrix: ${{needs.platforms.outputs.platform-matrix}} - permissions: - packages: write - contents: read + platforms: ${{needs.platform-cache.outputs.platforms}} + platform-list: [${{github.event.inputs.platform-choice}}] tests: name: Tests - needs: [v, platforms, reuse-build, build-base] - if: always() && needs.platforms.result == 'success' && (needs.build-base.result == 'success' || needs.reuse-build.result == 'success') + needs: [v, platform-cache, reuse-build, build-base] + if: always() && (needs.build-base.result == 'success' || needs.reuse-build.result == 'success') runs-on: ubuntu-latest container: - image: ${{fromJSON(needs.platforms.outputs.p)[github.event.inputs.platform-choice].image}} + image: ${{fromJSON(needs.platform-cache.outputs.platforms)[github.event.inputs.platform-choice].image}} steps: - name: Download builddir uses: actions/download-artifact@v3 diff --git a/.github/workflows/ph_backward_compatibility.yaml b/.github/workflows/ph_backward_compatibility.yaml index 0abe6b6400..6cd5d0a741 100644 --- a/.github/workflows/ph_backward_compatibility.yaml +++ b/.github/workflows/ph_backward_compatibility.yaml @@ -12,36 +12,40 @@ defaults: shell: bash jobs: - platforms: - name: Run Platforms Workflow - uses: ./.github/workflows/platforms.yaml + platform-cache: + name: Platform Cache + uses: AntelopeIO/platform-cache-workflow/.github/workflows/platformcache.yaml@main permissions: - packages: write contents: read + packages: write + with: + runs-on: '["self-hosted", "enf-x86-beefy"]' + platform-files: | + .cicd/platforms + tools/reproducible.Dockerfile:builder build-base: name: Run Build Workflow uses: ./.github/workflows/build_base.yaml - needs: [platforms] + needs: [platform-cache] with: - p: ${{needs.platforms.outputs.p}} - platform-matrix: ${{needs.platforms.outputs.platform-matrix}} + platforms: ${{needs.platform-cache.outputs.platforms}} + platform-list: ${{needs.platform-cache.outputs.platforms}} permissions: packages: write contents: read tests: name: Tests - needs: [platforms, build-base] - if: always() && needs.platforms.result == 'success' && needs.build-base.result == 'success' + needs: [platform-cache, build-base] strategy: fail-fast: false matrix: - platform: ${{fromJSON(needs.platforms.outputs.platform-matrix)}} + platform: ${{fromJSON(needs.platform-cache.outputs.platform-list)}} release: [3.1, 3.2, 4.0] runs-on: ["self-hosted", "enf-x86-lowtier"] container: - image: ${{fromJSON(needs.platforms.outputs.p)[matrix.platform].image}} + image: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.platform].image}} options: --security-opt seccomp=unconfined steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/platforms.yaml b/.github/workflows/platforms.yaml deleted file mode 100644 index e44ce0ffda..0000000000 --- a/.github/workflows/platforms.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: "Platforms" - -on: - workflow_call: - inputs: - override-build-matrix: - description: 'Override build matrix' - type: string - required: false - outputs: - p: - description: "Discovered Build Platforms" - value: ${{ jobs.d.outputs.p }} - platform-matrix: - description: "Overridden Platform Matrix" - value: ${{ jobs.pm.outputs.platform-matrix }} - -permissions: - packages: read - contents: read - -defaults: - run: - shell: bash - -jobs: - d: - name: Discover Platforms - runs-on: ubuntu-latest - outputs: - missing-platforms: ${{steps.discover.outputs.missing-platforms}} - p: ${{steps.discover.outputs.platforms}} - steps: - - name: Discover Platforms - id: discover - uses: AntelopeIO/discover-platforms-action@v1 - with: - platform-file: .cicd/platforms.json - password: ${{secrets.GITHUB_TOKEN}} - package-name: builders - - build-platforms: - name: Build Platforms - needs: d - if: needs.d.outputs.missing-platforms != '[]' - strategy: - fail-fast: false - matrix: - platform: ${{fromJSON(needs.d.outputs.missing-platforms)}} - runs-on: ["self-hosted", "enf-x86-beefy"] - permissions: - packages: write - contents: read - steps: - - name: Login to Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{github.repository_owner}} - password: ${{secrets.GITHUB_TOKEN}} - - name: Build and push - uses: docker/build-push-action@v3 - with: - push: true - tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} - file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}} - - pm: - name: Platform Matrix - needs: [d] - if: always() && needs.d.result == 'success' - runs-on: ubuntu-latest - outputs: - platform-matrix: ${{steps.pm-results.outputs.platform-matrix}} - steps: - - name: Parse Platform Matrix - id: parse-pm - uses: actions/github-script@v6 - with: - script: return Object.keys(${{needs.d.outputs.p}}) - - name: Check | Override result - id: pm-results - run: | - echo 'platform-matrix=${{steps.parse-pm.outputs.result}}' >> $GITHUB_OUTPUT - - if [[ "${{inputs.override-build-matrix}}" != "" ]]; then - echo 'platform-matrix=["${{inputs.override-build-matrix}}"]' >> $GITHUB_OUTPUT - fi