From cac7f0cf40b8f1365ec0bbeddfa609a462dfcd59 Mon Sep 17 00:00:00 2001 From: Arnaldo Garcia Rincon Date: Fri, 14 Jun 2024 21:39:28 +0000 Subject: [PATCH] github: rework issue templates and action workflows for kit Signed-off-by: Arnaldo Garcia Rincon --- .github/ISSUE_TEMPLATE/metal_driver.md | 26 -------- .../ISSUE_TEMPLATE/{image.md => package.md} | 4 +- .github/actions/list-variants/action.yml | 24 ------- .github/workflows/build.yml | 45 ++----------- .github/workflows/cache.yml | 8 +-- .github/workflows/weekly.yml | 65 ------------------- 6 files changed, 13 insertions(+), 159 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/metal_driver.md rename .github/ISSUE_TEMPLATE/{image.md => package.md} (87%) delete mode 100644 .github/actions/list-variants/action.yml delete mode 100644 .github/workflows/weekly.yml diff --git a/.github/ISSUE_TEMPLATE/metal_driver.md b/.github/ISSUE_TEMPLATE/metal_driver.md deleted file mode 100644 index 1e4e58d96..000000000 --- a/.github/ISSUE_TEMPLATE/metal_driver.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: bare metal variant - driver request -about: Request a driver to be added to the metal variant of Bottlerocket -labels: status/needs-triage, area/metal, type/enhancement ---- - - - -**What I'd like:** - -**Device type (e.g. network interface, disk controller):** - -**Device vendor:** - -**Device model:** - -**Driver used on other Linux distribition:** - -**Any alternatives you've considered:** - diff --git a/.github/ISSUE_TEMPLATE/image.md b/.github/ISSUE_TEMPLATE/package.md similarity index 87% rename from .github/ISSUE_TEMPLATE/image.md rename to .github/ISSUE_TEMPLATE/package.md index b61e72ada..6da8db36e 100644 --- a/.github/ISSUE_TEMPLATE/image.md +++ b/.github/ISSUE_TEMPLATE/package.md @@ -1,5 +1,5 @@ --- -name: Bug report - Bottlerocket image +name: Bug report - Bottlerocket package about: Let us know about a problem with Bottlerocket labels: status/needs-triage, type/bug --- @@ -11,7 +11,7 @@ Tips: - Please include any error messages you received, with any required context. --> -**Image I'm using:** +**Package I'm using:** diff --git a/.github/actions/list-variants/action.yml b/.github/actions/list-variants/action.yml deleted file mode 100644 index a6e800c76..000000000 --- a/.github/actions/list-variants/action.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: "List active variants" -description: "Dynamically determines current Bottlerocket variants based on repo contents." -outputs: - variants: - description: A list of all variants defined in the repo - value: ${{ steps.get-variants.outputs.variants }} - aarch-enemies: - description: Variants that should not run for aarch64 - value: ${{ steps.get-variants.outputs.aarch-enemies }} -runs: - using: "composite" - steps: - - uses: actions/checkout@v4 - - id: get-variants - name: Determine variants - shell: bash - run: | - cd variants - output="variants=$(ls -d */ | cut -d'/' -f 1 | grep -vE '^(shared|target)$' | sort | awk '$0 != x "-nvidia" && NR>1 {print x} {x=$0} END {print}' | jq -R -s -c 'split("\n")[:-1]')" - echo $output - echo $output >> $GITHUB_OUTPUT - output="aarch-enemies=$(ls -d */ | cut -d'/' -f 1 | grep -E '(^(metal|vmware)|\-dev$)' | jq -R -s -c 'split("\n")[:-1] | [ .[] | {"variant": ., "arch": "aarch64"}]')" - echo $output - echo $output >> $GITHUB_OUTPUT diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cffc5532..a2d237507 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,41 +17,22 @@ on: - '**.tpl' # Sample config files and OpenAPI docs - '**.yaml' - # Other files that don't affect the build - - 'packages/os/eni-max-pods' concurrency: group: ${{ github.ref }} cancel-in-progress: true jobs: - list-variants: - # This needs to be its own job since the build job needs its output before - # it can initialize - if: github.repository == 'bottlerocket-os/bottlerocket' - name: "Determine variants" - runs-on: ubuntu-latest - outputs: - variants: ${{ steps.get-variants.outputs.variants }} - aarch-enemies: ${{ steps.get-variants.outputs.aarch-enemies }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/list-variants - id: get-variants - build: - needs: list-variants runs-on: group: bottlerocket labels: bottlerocket_ubuntu-latest_32-core continue-on-error: true strategy: matrix: - variant: ${{ fromJson(needs.list-variants.outputs.variants) }} arch: [x86_64, aarch64] - exclude: ${{ fromJson(needs.list-variants.outputs.aarch-enemies) }} fail-fast: false - name: "Build ${{ matrix.variant }}-${{ matrix.arch }}" + name: "Build ${{ matrix.arch }}" steps: - name: Random delay run: | @@ -61,23 +42,11 @@ jobs: - uses: actions/checkout@v4 - name: Preflight step to set up the runner uses: ./.github/actions/setup-node - - if: contains(matrix.variant, 'nvidia') - run: | - cat <<-EOF > Licenses.toml - [nvidia] - spdx-id = "LICENSE-LicenseRef-NVIDIA-Customer" - licenses = [ - { path = "NVIDIA", license-url = "https://www.nvidia.com/en-us/drivers/nvidia-license/" } - ] - EOF - run: rustup component add rustfmt - - run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} unit-tests - - run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-fmt + - run: make twoliter unit-tests + # TODO: fixme please! + # - run: make twoliter check-fmt # Avoid running Go lint check via `cargo make check-lints` since there's a separate golangci-lint workflow - - run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-clippy - - run: cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} check-shell - - run: | - cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} \ - -e BUILDSYS_ARCH=${{ matrix.arch }} \ - -e BUILDSYS_JOBS=12 \ - -e BUILDSYS_UPSTREAM_LICENSE_FETCH="${{ contains(matrix.variant, 'nvidia') }}" + - run: make twoliter check-clippy + - run: make twoliter check-shell + - run: make ARCH="${{ matrix.arch }}" diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 2b66cc020..174a27241 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -7,12 +7,12 @@ on: paths: - '.github/**' - 'sources/Cargo.lock' - - 'tools/pubsys*/**' - - '!tools/pubsys/policies/**' - - '!tools/pubsys/**.example' + - 'Twoliter.toml' + - 'Twoliter.lock' + - 'Makefile' jobs: cache: - if: github.repository == 'bottlerocket-os/bottlerocket' + if: github.repository == 'bottlerocket-os/bottlerocket-core-kit' runs-on: group: bottlerocket labels: bottlerocket_ubuntu-latest_8-core diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml deleted file mode 100644 index 125e554f3..000000000 --- a/.github/workflows/weekly.yml +++ /dev/null @@ -1,65 +0,0 @@ -# This is basically a duplicate of the main "build" workflow, but uses GOPROXY=direct -# to try to catch errors close to their introduction due to yanked Go modules. These -# could otherwise be covered up by caching and not discovered until much later when -# bypassing the main cache. -name: Weekly -on: - schedule: - # Run Monday at 02:15 UTC. Randomly chosen as a "quiet" time for this to run. - # See syntax for format details: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onschedule - - cron: '15 2 * * 1' - -env: - # When Go packages are built, buildsys will vendor in dependent Go code for - # that package and bundle it up in a tarball. This env variable is consumed - # and used to configure Go to directly download code from its upstream source. - # This is a useful early signal during GitHub actions to see if there are - # upstream Go code problems. - GOPROXY: direct - -jobs: - list-variants: - # This needs to be its own job since the build job needs its output before - # it can initialize - if: github.repository == 'bottlerocket-os/bottlerocket' - name: "Determine variants" - runs-on: ubuntu-latest - outputs: - variants: ${{ steps.get-variants.outputs.variants }} - aarch-enemies: ${{ steps.get-variants.outputs.aarch-enemies }} - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/list-variants - id: get-variants - - build: - needs: list-variants - runs-on: - group: bottlerocket - labels: bottlerocket_ubuntu-latest_32-core - continue-on-error: false - strategy: - matrix: - variant: ${{ fromJson(needs.list-variants.outputs.variants) }} - arch: [x86_64, aarch64] - exclude: ${{ fromJson(needs.list-variants.outputs.aarch-enemies) }} - fail-fast: false - name: "Build ${{ matrix.variant }}-${{ matrix.arch }}" - steps: - - uses: actions/checkout@v4 - - name: Preflight step to set up the runner - uses: ./.github/actions/setup-node - - if: contains(matrix.variant, 'nvidia') - run: | - cat <<-EOF > Licenses.toml - [nvidia] - spdx-id = "LICENSE-LicenseRef-NVIDIA-Customer" - licenses = [ - { path = "NVIDIA", license-url = "https://www.nvidia.com/en-us/drivers/nvidia-license/" } - ] - EOF - - run: | - cargo make -e BUILDSYS_VARIANT=${{ matrix.variant }} \ - -e BUILDSYS_ARCH=${{ matrix.arch }} \ - -e BUILDSYS_JOBS=12 \ - -e BUILDSYS_UPSTREAM_LICENSE_FETCH="${{ contains(matrix.variant, 'nvidia') }}"