From ad64429d73046af874d51580562ac26f226589e9 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 17:23:05 -0700 Subject: [PATCH 01/17] feat(workflows) use new workflows and aggregate matrix --- .github/workflows/build-artifacts.yml | 87 +++++++++++++++++++-------- .gitignore | 1 + 2 files changed, 63 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 2db06b56..cb9750f4 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -1,61 +1,98 @@ name: build-artifacts.yml + +permissions: + id-token: write + contents: read on: workflow_dispatch: push: branches: [ main, SERVER-216, SERVER-216-debug-jfrog ] - + pull_request: + branches: [ main, SERVER-216, SERVER-216-debug-jfrog ] jobs: + extract-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Extract Version + id: extract + uses: aerospike/shared-workflows/.github/actions/extract-version-from-tag@9528942eff580457800a2ca2a9a0bb5e309fa80c + outputs: + version: ${{ steps.extract.outputs.version }} + git_tag: ${{ steps.extract.outputs.git_tag }} build-artifacts: + needs: extract-version strategy: matrix: distro: [ debian11, debian12, debian13, ubuntu20.04, ubuntu22.04, ubuntu24.04, redhat-el8, redhat-el9, amazon-2023 ] host: [ ubuntu-24.04-arm, ubuntu-24.04 ] - uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@main + uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c with: runs-on: ${{ matrix.host }} project: database build-name: asbench - build-version: v1.0.0 + build-id: ${{ github.run_number }}-buildinfo-${{ matrix.distro }}-${{ matrix.host }} build-script: set -x && chmod o+rw dist && cd local && git checkout ${{ github.ref_name }} && git submodule update --init --recursive && .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} && .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} && find ../dist artifact-directory: dist artifact-name: unsigned-artifacts-${{ matrix.distro }}-${{ matrix.host }} - retention-days: 7 + retention-days: 1 dry-run: false - artifactory-url: https://aerospike.jfrog.io # default - artifactory-oidc-provider-name: database-gh-aerospike # default - artifactory-oidc-audience: database-gh-aerospike # default + artifactory-oidc-provider-name: database-gh-aerospike + artifactory-oidc-audience: database-gh-aerospike + publish-build-info: true + aggregate-artifacts: + needs: [build-artifacts] + runs-on: ubuntu-latest + steps: + - name: Download All Matrix Artifacts + uses: actions/download-artifact@v4 + with: + path: build-artifacts + merge-multiple: true + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: build-artifacts + overwrite: true + retention-days: 1 sign-artifacts: - strategy: - matrix: - distro: [ debian11, debian12, debian13, ubuntu20.04, ubuntu22.04, ubuntu24.04, redhat-el8, redhat-el9, amazon-2023 ] - host: [ ubuntu-24.04-arm, ubuntu-24.04 ] needs: build-artifacts - uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@main # vn.n.n + uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c # vn.n.n with: - artifact-name: signed-artifacts-${{ matrix.distro }}-${{ matrix.host }} - unsigned-artifacts: unsigned-artifacts-${{ matrix.distro }}-${{ matrix.host }} - # artifact-name: signed-artifacts # optional, defaults to signed-artifacts - # retention-days: 7 # optional, defaults to 7 - # dry-run: false # optional, for future compatibility + artifact-name: signed-artifacts + unsigned-artifacts: build-artifacts + artifactory-oidc-provider-name: database-gh-aerospike + artifactory-oidc-audience: database-gh-aerospike secrets: gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} gpg-public-key: ${{ secrets.GPG_PUBLIC_KEY }} gpg-key-pass: ${{ secrets.GPG_PASS }} upload-artifacts: - strategy: - matrix: - distro: [ debian11, debian12, debian13, ubuntu20.04, ubuntu22.04, ubuntu24.04, redhat-el8, redhat-el9, amazon-2023 ] - host: [ ubuntu-24.04-arm, ubuntu-24.04 ] - needs: sign-artifacts - uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@main # vn.n.n + needs: [sign-artifacts,extract-version] + uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c # vn.n.n with: project: database build-name: asbench - version: ${{ github.ref_name }} + build-id: ${{ github.run_number }} + metadata-build-id: ${{ github.run_number }}-buildinfo + version: ${{ needs.extract-version.outputs.version }} artifactory-url: https://aerospike.jfrog.io artifactory-oidc-provider-name: database-gh-aerospike artifactory-oidc-audience: database-gh-aerospike - artifact-name: signed-artifacts-${{ matrix.distro }}-${{ matrix.host }} + artifact-name: ${{ needs.sign-artifacts.outputs.artifact-name }} retention-days: 1 dry-run: false + create-release-bundle: + needs: [upload-artifacts,extract-version] + uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c + if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' + with: + project: database + build-names: asbench:${{ github.run_number }} + bundle-name: asbench + version: ${{ needs.extract-version.outputs.version }} + artifactory-oidc-provider-name: database-gh-aerospike + artifactory-oidc-audience: database-gh-aerospike + dry-run: false \ No newline at end of file diff --git a/.gitignore b/.gitignore index a26ce860..ec06a283 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,4 @@ x64 ipch packages packages/repositories.config +.cursorrules From 17de56c6bfb1e4db9a5bc5b660486b80c06492cb Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 17:46:26 -0700 Subject: [PATCH 02/17] chore(workflows) autoformat --- .github/workflows/build-artifacts.yml | 49 ++++++++++++++++----------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index cb9750f4..aa16ea4b 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -6,9 +6,9 @@ permissions: on: workflow_dispatch: push: - branches: [ main, SERVER-216, SERVER-216-debug-jfrog ] + branches: [main, SERVER-216, SERVER-216-debug-jfrog] pull_request: - branches: [ main, SERVER-216, SERVER-216-debug-jfrog ] + branches: [main, SERVER-216, SERVER-216-debug-jfrog] jobs: extract-version: runs-on: ubuntu-latest @@ -24,8 +24,19 @@ jobs: needs: extract-version strategy: matrix: - distro: [ debian11, debian12, debian13, ubuntu20.04, ubuntu22.04, ubuntu24.04, redhat-el8, redhat-el9, amazon-2023 ] - host: [ ubuntu-24.04-arm, ubuntu-24.04 ] + distro: + [ + debian11, + debian12, + debian13, + ubuntu20.04, + ubuntu22.04, + ubuntu24.04, + redhat-el8, + redhat-el9, + amazon-2023, + ] + host: [ubuntu-24.04-arm, ubuntu-24.04] uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c with: runs-on: ${{ matrix.host }} @@ -44,18 +55,18 @@ jobs: needs: [build-artifacts] runs-on: ubuntu-latest steps: - - name: Download All Matrix Artifacts - uses: actions/download-artifact@v4 - with: - path: build-artifacts - merge-multiple: true - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: build-artifacts - path: build-artifacts - overwrite: true - retention-days: 1 + - name: Download All Matrix Artifacts + uses: actions/download-artifact@v4 + with: + path: build-artifacts + merge-multiple: true + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: build-artifacts + overwrite: true + retention-days: 1 sign-artifacts: needs: build-artifacts uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c # vn.n.n @@ -70,7 +81,7 @@ jobs: gpg-key-pass: ${{ secrets.GPG_PASS }} upload-artifacts: - needs: [sign-artifacts,extract-version] + needs: [sign-artifacts, extract-version] uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c # vn.n.n with: project: database @@ -85,7 +96,7 @@ jobs: retention-days: 1 dry-run: false create-release-bundle: - needs: [upload-artifacts,extract-version] + needs: [upload-artifacts, extract-version] uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' with: @@ -95,4 +106,4 @@ jobs: version: ${{ needs.extract-version.outputs.version }} artifactory-oidc-provider-name: database-gh-aerospike artifactory-oidc-audience: database-gh-aerospike - dry-run: false \ No newline at end of file + dry-run: false From 4f99e3ae9fd822d7c51c81a233a45e41ae65b42d Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 18:49:58 -0700 Subject: [PATCH 03/17] fix(workflows) update extract-version action to use feature branch and add source output --- .github/workflows/build-artifacts.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index aa16ea4b..4032a97f 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -16,10 +16,11 @@ jobs: - uses: actions/checkout@v5 - name: Extract Version id: extract - uses: aerospike/shared-workflows/.github/actions/extract-version-from-tag@9528942eff580457800a2ca2a9a0bb5e309fa80c + uses: aerospike/shared-workflows/.github/actions/extract-version-from-tag@feature/INFRA-189-build-info-in-build-step outputs: version: ${{ steps.extract.outputs.version }} git_tag: ${{ steps.extract.outputs.git_tag }} + source: ${{ steps.extract.outputs.source }} build-artifacts: needs: extract-version strategy: From 7395e9d658d9b6dde3d1c9daa7e282134e910343 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 19:08:03 -0700 Subject: [PATCH 04/17] fix(workflows) DAG updates --- .github/workflows/build-artifacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 4032a97f..5a862355 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -69,7 +69,7 @@ jobs: overwrite: true retention-days: 1 sign-artifacts: - needs: build-artifacts + needs: aggregate-artifacts uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c # vn.n.n with: artifact-name: signed-artifacts @@ -99,7 +99,7 @@ jobs: create-release-bundle: needs: [upload-artifacts, extract-version] uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c - if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' + if: needs.extract-version.outputs.source == 'tag' && startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' with: project: database build-names: asbench:${{ github.run_number }} From f8e7319e0f67bf627b9ea5ad3521c7ccb477634c Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 19:11:30 -0700 Subject: [PATCH 05/17] fix(workflows) must fetch tags --- .github/workflows/build-artifacts.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 5a862355..85fa19fe 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -14,6 +14,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + with: + fetch-tags: true - name: Extract Version id: extract uses: aerospike/shared-workflows/.github/actions/extract-version-from-tag@feature/INFRA-189-build-info-in-build-step From a34fcea2fa2a9eb65d62dbe3fbe4bac961a15533 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 19:19:27 -0700 Subject: [PATCH 06/17] fix(workflows): need to fetch deep to get default tag since it was last tagged some time ago --- .github/workflows/build-artifacts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 85fa19fe..7b061ee9 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -16,6 +16,7 @@ jobs: - uses: actions/checkout@v5 with: fetch-tags: true + fetch-depth: 0 - name: Extract Version id: extract uses: aerospike/shared-workflows/.github/actions/extract-version-from-tag@feature/INFRA-189-build-info-in-build-step From 21e15ea778fde2afbba22ba1893940147c2637a1 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 19:23:56 -0700 Subject: [PATCH 07/17] chore: add debug log --- .github/workflows/build-artifacts.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 7b061ee9..43f0a450 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -47,7 +47,15 @@ jobs: project: database build-name: asbench build-id: ${{ github.run_number }}-buildinfo-${{ matrix.distro }}-${{ matrix.host }} - build-script: set -x && chmod o+rw dist && cd local && git checkout ${{ github.ref_name }} && git submodule update --init --recursive && .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} && .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} && find ../dist + build-script: set -x && \ + chmod o+rw dist && \ + find . && \ + cd local && \ + git checkout ${{ github.ref_name }} && \ + git submodule update --init --recursive && \ + .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} && \ + .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} && \ + find ../dist artifact-directory: dist artifact-name: unsigned-artifacts-${{ matrix.distro }}-${{ matrix.host }} retention-days: 1 From e3a69925cd780e2df1ae163cd89b22004a68044a Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 19:28:45 -0700 Subject: [PATCH 08/17] chore(workflows): if we script we script --- .github/workflows/build-artifacts.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 43f0a450..f07f8c8b 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -47,14 +47,15 @@ jobs: project: database build-name: asbench build-id: ${{ github.run_number }}-buildinfo-${{ matrix.distro }}-${{ matrix.host }} - build-script: set -x && \ - chmod o+rw dist && \ - find . && \ - cd local && \ - git checkout ${{ github.ref_name }} && \ - git submodule update --init --recursive && \ - .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} && \ - .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} && \ + build-script: | + set -x + chmod o+rw dist + find . + cd local + git checkout ${{ github.ref_name }} + git submodule update --init --recursive + .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} + .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} find ../dist artifact-directory: dist artifact-name: unsigned-artifacts-${{ matrix.distro }}-${{ matrix.host }} From 30c40a10b10ce71e30553558e46e7465500366d7 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 19:40:39 -0700 Subject: [PATCH 09/17] ci: adding trunk for code quality and all around goodness --- .trunk/.gitignore | 9 +++++++ .trunk/configs/.isort.cfg | 2 ++ .trunk/configs/.markdownlint.yaml | 2 ++ .trunk/configs/.shellcheckrc | 7 ++++++ .trunk/configs/.yamllint.yaml | 7 ++++++ .trunk/configs/ruff.toml | 5 ++++ .trunk/trunk.yaml | 41 +++++++++++++++++++++++++++++++ 7 files changed, 73 insertions(+) create mode 100644 .trunk/.gitignore create mode 100644 .trunk/configs/.isort.cfg create mode 100644 .trunk/configs/.markdownlint.yaml create mode 100644 .trunk/configs/.shellcheckrc create mode 100644 .trunk/configs/.yamllint.yaml create mode 100644 .trunk/configs/ruff.toml create mode 100644 .trunk/trunk.yaml diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 00000000..15966d08 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,9 @@ +*out +*logs +*actions +*notifications +*tools +plugins +user_trunk.yaml +user.yaml +tmp diff --git a/.trunk/configs/.isort.cfg b/.trunk/configs/.isort.cfg new file mode 100644 index 00000000..b9fb3f3e --- /dev/null +++ b/.trunk/configs/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +profile=black diff --git a/.trunk/configs/.markdownlint.yaml b/.trunk/configs/.markdownlint.yaml new file mode 100644 index 00000000..b40ee9d7 --- /dev/null +++ b/.trunk/configs/.markdownlint.yaml @@ -0,0 +1,2 @@ +# Prettier friendly markdownlint config (all formatting rules disabled) +extends: markdownlint/style/prettier diff --git a/.trunk/configs/.shellcheckrc b/.trunk/configs/.shellcheckrc new file mode 100644 index 00000000..8c7b1ada --- /dev/null +++ b/.trunk/configs/.shellcheckrc @@ -0,0 +1,7 @@ +enable=all +source-path=SCRIPTDIR +disable=SC2154 + +# If you're having issues with shellcheck following source, disable the errors via: +# disable=SC1090 +# disable=SC1091 diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml new file mode 100644 index 00000000..184e251f --- /dev/null +++ b/.trunk/configs/.yamllint.yaml @@ -0,0 +1,7 @@ +rules: + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/.trunk/configs/ruff.toml b/.trunk/configs/ruff.toml new file mode 100644 index 00000000..f5a235cf --- /dev/null +++ b/.trunk/configs/ruff.toml @@ -0,0 +1,5 @@ +# Generic, formatter-friendly config. +select = ["B", "D3", "E", "F"] + +# Never enforce `E501` (line length violations). This should be handled by formatters. +ignore = ["E501"] diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 00000000..7bd45f37 --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,41 @@ +# This file controls the behavior of Trunk: https://docs.trunk.io/cli +# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml +version: 0.1 +cli: + version: 1.25.0 +# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) +plugins: + sources: + - id: trunk + ref: v1.7.2 + uri: https://github.com/trunk-io/plugins +# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) +runtimes: + enabled: + - go@1.21.0 + - node@22.16.0 + - python@3.10.8 +# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) +lint: + enabled: + - actionlint@1.7.7 + - bandit@1.8.6 + - black@25.9.0 + - checkov@3.2.473 + - git-diff-check + - isort@6.0.1 + - markdownlint@0.45.0 + - osv-scanner@2.2.2 + - prettier@3.6.2 + - ruff@0.13.2 + - shellcheck@0.11.0 + - shfmt@3.6.0 + - trufflehog@3.90.8 + - yamllint@1.37.1 +actions: + disabled: + - trunk-announce + - trunk-check-pre-push + - trunk-fmt-pre-commit + enabled: + - trunk-upgrade-available From 13c433da745f98fbfb0911510fbc0b52e2ead7c2 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Tue, 30 Sep 2025 19:51:13 -0700 Subject: [PATCH 10/17] chore(workflows): remove unnecessary git commands from build-artifacts.yml --- .github/workflows/build-artifacts.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index f07f8c8b..58555556 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -52,8 +52,6 @@ jobs: chmod o+rw dist find . cd local - git checkout ${{ github.ref_name }} - git submodule update --init --recursive .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} find ../dist From 88848fbc4a99a86159c2bd733f81d9dac65b9f0a Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Wed, 1 Oct 2025 20:38:55 -0700 Subject: [PATCH 11/17] chore(workflows): update reusable workflow references --- .github/workflows/build-artifacts.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 58555556..395a9e71 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -41,7 +41,7 @@ jobs: amazon-2023, ] host: [ubuntu-24.04-arm, ubuntu-24.04] - uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c + uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages with: runs-on: ${{ matrix.host }} project: database @@ -80,7 +80,7 @@ jobs: retention-days: 1 sign-artifacts: needs: aggregate-artifacts - uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c # vn.n.n + uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages # vn.n.n with: artifact-name: signed-artifacts unsigned-artifacts: build-artifacts @@ -93,7 +93,7 @@ jobs: upload-artifacts: needs: [sign-artifacts, extract-version] - uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c # vn.n.n + uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages # vn.n.n with: project: database build-name: asbench @@ -108,7 +108,7 @@ jobs: dry-run: false create-release-bundle: needs: [upload-artifacts, extract-version] - uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@9528942eff580457800a2ca2a9a0bb5e309fa80c + uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages if: needs.extract-version.outputs.source == 'tag' && startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' with: project: database From 1ff33ee0dd4f7b71fec758fa62a7a5c45e02ad42 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Wed, 1 Oct 2025 21:01:28 -0700 Subject: [PATCH 12/17] fix(workflows): update reusable workflow references to feature/INFRA-189 for build info integration --- .github/workflows/build-artifacts.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 395a9e71..4fb1802a 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -41,7 +41,7 @@ jobs: amazon-2023, ] host: [ubuntu-24.04-arm, ubuntu-24.04] - uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages + uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@feature/INFRA-189-build-info-in-build-step with: runs-on: ${{ matrix.host }} project: database @@ -80,7 +80,7 @@ jobs: retention-days: 1 sign-artifacts: needs: aggregate-artifacts - uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages # vn.n.n + uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@feature/INFRA-189-build-info-in-build-step # vn.n.n with: artifact-name: signed-artifacts unsigned-artifacts: build-artifacts @@ -93,7 +93,7 @@ jobs: upload-artifacts: needs: [sign-artifacts, extract-version] - uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages # vn.n.n + uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@feature/INFRA-189-build-info-in-build-step # vn.n.n with: project: database build-name: asbench @@ -108,7 +108,7 @@ jobs: dry-run: false create-release-bundle: needs: [upload-artifacts, extract-version] - uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@feature/INFRA-162-asbench-add-rpm-deb-packages + uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@feature/INFRA-189-build-info-in-build-step if: needs.extract-version.outputs.source == 'tag' && startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' with: project: database From 4c8d9a2312d22e9b9bc4811818c04a5c2e85f14e Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Thu, 2 Oct 2025 18:29:00 -0700 Subject: [PATCH 13/17] feat(build): Allowing build to set version externally - Added VERSION environment variable handling in build_package.sh to ensure version is set before building packages. - Updated entrypoint.sh to accept VERSION as a command-line argument, allowing for more flexible builds. - Modified Makefile to allow VERSION to be set externally, accommodating containerized environments where tag history may not be available. --- .github/docker/build_package.sh | 10 +++++++--- .github/docker/entrypoint.sh | 15 ++++++++++++--- pkg/Makefile | 3 ++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/docker/build_package.sh b/.github/docker/build_package.sh index ae58b81f..3ece781a 100644 --- a/.github/docker/build_package.sh +++ b/.github/docker/build_package.sh @@ -4,6 +4,10 @@ function build_packages(){ echo "ENV_DISTRO is not set" return fi + if [ "$VERSION" = "" ]; then + echo "VERSION is not set" + return + fi cd "$GIT_DIR" git submodule update --init --recursive make EVENT_LIB=libuv @@ -11,11 +15,11 @@ function build_packages(){ echo "building package for $BUILD_DISTRO" if [[ $ENV_DISTRO == *"ubuntu"* ]]; then - make deb + make deb VERSION=$VERSION elif [[ $ENV_DISTRO == *"debian"* ]]; then - make deb + make deb VERSION=$VERSION elif [[ $ENV_DISTRO == *"ubi"* ]]; then - make rpm + make rpm VERSION=$VERSION else make tar fi diff --git a/.github/docker/entrypoint.sh b/.github/docker/entrypoint.sh index d9d92aed..45a8ca85 100755 --- a/.github/docker/entrypoint.sh +++ b/.github/docker/entrypoint.sh @@ -23,6 +23,7 @@ function build_container() { function execute_build_image() { export BUILD_DISTRO="$1" + export VERSION="$2" docker run -e BUILD_DISTRO -v $(realpath ../dist):/tmp/output asbackup-pkg-builder-"$BUILD_DISTRO"-"$(git rev-parse HEAD | cut -c -8)" ls -laht ../dist } @@ -33,7 +34,7 @@ BUILD_CONTAINERS=false EXECUTE_BUILD=false BUILD_DISTRO=${BUILD_DISTRO:-"all"} -while getopts "ibced:" opt; do +while getopts "ibcedv:" opt; do case ${opt} in i ) INSTALL=true @@ -48,8 +49,15 @@ while getopts "ibced:" opt; do EXECUTE_BUILD=true ;; d ) - BUILD_DISTRO="$OPTARG" + BUILD_DISTRO=$OPTARG ;; + v ) + VERSION=$OPTARG + ;; + * ) + echo "Unknown option: $opt" >&2 + exit 1 + ;; esac done @@ -62,6 +70,7 @@ then -b ( build internal ) -c ( build containers ) -e ( execute docker package build ) + -v ( version ) -d [ redhat | ubuntu | debian ]""" 1>&2 exit 1 fi @@ -123,7 +132,7 @@ if [ "$INSTALL" = "true" ]; then echo "distro not supported" fi elif [ "$BUILD_INTERNAL" = "true" ]; then - build_packages + build_packages $VERSION elif [ "$BUILD_CONTAINERS" = "true" ]; then if [ "$BUILD_DISTRO" = "all" ]; then build_container debian11 diff --git a/pkg/Makefile b/pkg/Makefile index 1f44b5a9..6ad510f2 100644 --- a/pkg/Makefile +++ b/pkg/Makefile @@ -8,7 +8,8 @@ CONFIG_DIR = /etc/aerospike # Package variables NAME = "asbench" -VERSION = $(shell git describe --tags --always | cut -d '-' -f 1-2) +# Running inside container might not have tag history. Enable setting outside. +VERSION ?= $(shell git describe --tags --always | cut -d '-' -f 1-2) MAINTAINER = "Aerospike" DESCRIPTION = "Aerospike Benchmark, a tool for performance testing Aerospike database." LICENSE = "Apache License 2.0" From d349670822debd96d6c355b7362d096f13f6ae0f Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Thu, 2 Oct 2025 18:44:53 -0700 Subject: [PATCH 14/17] feat(build): support VERSION as an environment variable - Updated entrypoint.sh to export VERSION from command-line arguments, improving flexibility in build processes. - Modified build-artifacts.yml to pass the VERSION variable during Docker container execution, ensuring consistent versioning across builds. --- .github/docker/entrypoint.sh | 21 ++++++++++----------- .github/workflows/build-artifacts.yml | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/docker/entrypoint.sh b/.github/docker/entrypoint.sh index 45a8ca85..bd2cf625 100755 --- a/.github/docker/entrypoint.sh +++ b/.github/docker/entrypoint.sh @@ -23,8 +23,7 @@ function build_container() { function execute_build_image() { export BUILD_DISTRO="$1" - export VERSION="$2" - docker run -e BUILD_DISTRO -v $(realpath ../dist):/tmp/output asbackup-pkg-builder-"$BUILD_DISTRO"-"$(git rev-parse HEAD | cut -c -8)" + docker run -e BUILD_DISTRO -e VERSION -v $(realpath ../dist):/tmp/output asbackup-pkg-builder-"$BUILD_DISTRO"-"$(git rev-parse HEAD | cut -c -8)" ls -laht ../dist } @@ -34,7 +33,7 @@ BUILD_CONTAINERS=false EXECUTE_BUILD=false BUILD_DISTRO=${BUILD_DISTRO:-"all"} -while getopts "ibcedv:" opt; do +while getopts "ibced:v:" opt; do case ${opt} in i ) INSTALL=true @@ -51,13 +50,13 @@ while getopts "ibcedv:" opt; do d ) BUILD_DISTRO=$OPTARG ;; - v ) - VERSION=$OPTARG - ;; - * ) - echo "Unknown option: $opt" >&2 - exit 1 - ;; + v ) + export VERSION=$OPTARG + ;; + * ) + echo "Unknown option: $opt" >&2 + exit 1 + ;; esac done @@ -132,7 +131,7 @@ if [ "$INSTALL" = "true" ]; then echo "distro not supported" fi elif [ "$BUILD_INTERNAL" = "true" ]; then - build_packages $VERSION + build_packages elif [ "$BUILD_CONTAINERS" = "true" ]; then if [ "$BUILD_DISTRO" = "all" ]; then build_container debian11 diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 4fb1802a..6bbd4de1 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -53,7 +53,7 @@ jobs: find . cd local .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} - .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} + .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} -v ${{ needs.extract-version.outputs.version }} find ../dist artifact-directory: dist artifact-name: unsigned-artifacts-${{ matrix.distro }}-${{ matrix.host }} From a8445d30f8d82f2f0cb7b39c0aa9e0112f4d4749 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Mon, 13 Oct 2025 19:01:56 -0700 Subject: [PATCH 15/17] chore(workflows): update reusable workflow references to main branch --- .github/workflows/build-artifacts.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 6bbd4de1..d101bb75 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Extract Version id: extract - uses: aerospike/shared-workflows/.github/actions/extract-version-from-tag@feature/INFRA-189-build-info-in-build-step + uses: aerospike/shared-workflows/.github/actions/extract-version-from-tag@main outputs: version: ${{ steps.extract.outputs.version }} git_tag: ${{ steps.extract.outputs.git_tag }} @@ -41,7 +41,7 @@ jobs: amazon-2023, ] host: [ubuntu-24.04-arm, ubuntu-24.04] - uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@feature/INFRA-189-build-info-in-build-step + uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@main with: runs-on: ${{ matrix.host }} project: database @@ -80,7 +80,7 @@ jobs: retention-days: 1 sign-artifacts: needs: aggregate-artifacts - uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@feature/INFRA-189-build-info-in-build-step # vn.n.n + uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@main # vn.n.n with: artifact-name: signed-artifacts unsigned-artifacts: build-artifacts @@ -93,7 +93,7 @@ jobs: upload-artifacts: needs: [sign-artifacts, extract-version] - uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@feature/INFRA-189-build-info-in-build-step # vn.n.n + uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@main # vn.n.n with: project: database build-name: asbench @@ -108,7 +108,7 @@ jobs: dry-run: false create-release-bundle: needs: [upload-artifacts, extract-version] - uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@feature/INFRA-189-build-info-in-build-step + uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@main if: needs.extract-version.outputs.source == 'tag' && startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' with: project: database From ee3ec333374af4cf96ebd7ece6fb87adfe1d293d Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Mon, 13 Oct 2025 19:29:26 -0700 Subject: [PATCH 16/17] refactor(workflows): refactor build-artifacts.yml after merge --- .github/workflows/build-artifacts.yml | 61 ++++++++++++++++++--------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 5d49ce38..d101bb75 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -28,15 +28,33 @@ jobs: needs: extract-version strategy: matrix: - distro: [ debian11, debian12, debian13, ubuntu20.04, ubuntu22.04, ubuntu24.04, redhat-el8, redhat-el9, amazon-2023 ] #redhat-el10 disable redhat 10 until c client patches ssl for redhat 10 - host: [ ubuntu-24.04-arm, ubuntu-24.04 ] - uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@0da06cb2182165b125dc219ca2fda09732ca0fa4 + distro: + [ + debian11, + debian12, + debian13, + ubuntu20.04, + ubuntu22.04, + ubuntu24.04, + redhat-el8, + redhat-el9, + amazon-2023, + ] + host: [ubuntu-24.04-arm, ubuntu-24.04] + uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@main with: runs-on: ${{ matrix.host }} project: database build-name: asbench - build-id: ${{ github.run_number }} - build-script: set -x && chmod o+rw dist && cd local && git checkout ${{ github.ref_name }} && git submodule update --init --recursive && .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} && .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} && find ../dist + build-id: ${{ github.run_number }}-buildinfo-${{ matrix.distro }}-${{ matrix.host }} + build-script: | + set -x + chmod o+rw dist + find . + cd local + .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} + .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} -v ${{ needs.extract-version.outputs.version }} + find ../dist artifact-directory: dist artifact-name: unsigned-artifacts-${{ matrix.distro }}-${{ matrix.host }} retention-days: 1 @@ -61,12 +79,8 @@ jobs: overwrite: true retention-days: 1 sign-artifacts: - strategy: - matrix: - distro: [ debian11, debian12, debian13, ubuntu20.04, ubuntu22.04, ubuntu24.04, redhat-el8, redhat-el9, amazon-2023 ] #redhat-el10 disable redhat 10 until c client patches ssl for redhat 10 - host: [ ubuntu-24.04-arm, ubuntu-24.04 ] - needs: build-artifacts - uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@0da06cb2182165b125dc219ca2fda09732ca0fa4 # vn.n.n + needs: aggregate-artifacts + uses: aerospike/shared-workflows/.github/workflows/reusable_sign-artifacts.yaml@main # vn.n.n with: artifact-name: signed-artifacts unsigned-artifacts: build-artifacts @@ -78,15 +92,13 @@ jobs: gpg-key-pass: ${{ secrets.GPG_PASS }} upload-artifacts: - strategy: - matrix: - distro: [ debian11, debian12, debian13, ubuntu20.04, ubuntu22.04, ubuntu24.04, redhat-el8, redhat-el9, amazon-2023 ] #redhat-el10 disable redhat 10 until c client patches ssl for redhat 10 - host: [ ubuntu-24.04-arm, ubuntu-24.04 ] - needs: sign-artifacts - uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@0da06cb2182165b125dc219ca2fda09732ca0fa4 # vn.n.n + needs: [sign-artifacts, extract-version] + uses: aerospike/shared-workflows/.github/workflows/reusable_deploy-artifacts.yaml@main # vn.n.n with: project: database build-name: asbench + build-id: ${{ github.run_number }} + metadata-build-id: ${{ github.run_number }}-buildinfo version: ${{ needs.extract-version.outputs.version }} artifactory-url: https://aerospike.jfrog.io artifactory-oidc-provider-name: database-gh-aerospike @@ -94,6 +106,15 @@ jobs: artifact-name: ${{ needs.sign-artifacts.outputs.artifact-name }} retention-days: 1 dry-run: false - build-id: ${{ github.run_number }} - metadata-build-id: ${{ github.run_number }}-metadata - + create-release-bundle: + needs: [upload-artifacts, extract-version] + uses: aerospike/shared-workflows/.github/workflows/reusable_create-release-bundle.yaml@main + if: needs.extract-version.outputs.source == 'tag' && startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' + with: + project: database + build-names: asbench:${{ github.run_number }} + bundle-name: asbench + version: ${{ needs.extract-version.outputs.version }} + artifactory-oidc-provider-name: database-gh-aerospike + artifactory-oidc-audience: database-gh-aerospike + dry-run: false From 165fabfad9bb8a951489282134db02cce3ac5903 Mon Sep 17 00:00:00 2001 From: Joe Martin Date: Mon, 13 Oct 2025 19:47:04 -0700 Subject: [PATCH 17/17] chore(workflows): disable RPM-based distros in build-artifacts.yml --- .github/workflows/build-artifacts.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index d101bb75..1052d74b 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -35,10 +35,11 @@ jobs: debian13, ubuntu20.04, ubuntu22.04, - ubuntu24.04, - redhat-el8, - redhat-el9, - amazon-2023, + ubuntu24.04 + # build script does not work with rpm based distros + # redhat-el8, + # redhat-el9, + # amazon-2023, ] host: [ubuntu-24.04-arm, ubuntu-24.04] uses: aerospike/shared-workflows/.github/workflows/reusable_execute-build.yaml@main @@ -50,7 +51,6 @@ jobs: build-script: | set -x chmod o+rw dist - find . cd local .github/docker/entrypoint.sh -c -d ${{ matrix.distro }} .github/docker/entrypoint.sh -e -d ${{ matrix.distro }} -v ${{ needs.extract-version.outputs.version }}