Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/docker/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ 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
cd $PKG_DIR
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
Expand Down
14 changes: 11 additions & 3 deletions .github/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function build_container() {

function execute_build_image() {
export BUILD_DISTRO="$1"
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
}

Expand All @@ -33,7 +33,7 @@ BUILD_CONTAINERS=false
EXECUTE_BUILD=false
BUILD_DISTRO=${BUILD_DISTRO:-"all"}

while getopts "ibced:" opt; do
while getopts "ibced:v:" opt; do
case ${opt} in
i )
INSTALL=true
Expand All @@ -48,8 +48,15 @@ while getopts "ibced:" opt; do
EXECUTE_BUILD=true
;;
d )
BUILD_DISTRO="$OPTARG"
BUILD_DISTRO=$OPTARG
;;
v )
export VERSION=$OPTARG
;;
* )
echo "Unknown option: $opt" >&2
exit 1
;;
esac
done

Expand All @@ -62,6 +69,7 @@ then
-b ( build internal )
-c ( build containers )
-e ( execute docker package build )
-v ( version )
-d [ redhat | ubuntu | debian ]""" 1>&2
exit 1
fi
Expand Down
119 changes: 89 additions & 30 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,120 @@
name: build-artifacts.yml

permissions:
id-token: write
contents: read
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]
jobs:
extract-version:
runs-on: ubuntu-latest
steps:
- 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
outputs:
version: ${{ steps.extract.outputs.version }}
git_tag: ${{ steps.extract.outputs.git_tag }}
source: ${{ steps.extract.outputs.source }}
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
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@feature/INFRA-189-build-info-in-build-step
with:
runs-on: ${{ matrix.host }}
project: database
build-name: asbench
build-version: v1.0.0
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: 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
needs: aggregate-artifacts
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-${{ 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@feature/INFRA-189-build-info-in-build-step # 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@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
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ x64
ipch
packages
packages/repositories.config
.cursorrules
9 changes: 9 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
2 changes: 2 additions & 0 deletions .trunk/configs/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
2 changes: 2 additions & 0 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier
7 changes: 7 additions & 0 deletions .trunk/configs/.shellcheckrc
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
5 changes: 5 additions & 0 deletions .trunk/configs/ruff.toml
Original file line number Diff line number Diff line change
@@ -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"]
41 changes: 41 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -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:
- [email protected]
- [email protected]
- [email protected]
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
actions:
disabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
enabled:
- trunk-upgrade-available
3 changes: 2 additions & 1 deletion pkg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading