Merge branch 'main' into nosqlbench-944-jsonnet

This commit is contained in:
Jonathan Shook 2023-01-27 16:36:36 -06:00
commit 2e44152044
11 changed files with 198 additions and 165 deletions

View File

@ -5,9 +5,9 @@ name: build
on: on:
push: push:
paths: tags:
- "!RELEASE_NOTES.md" - "![0-9]+.[0-9]+.[0-9]+-preview"
- "!PREVIEW_NOTES.md" - "![0-9]+.[0-9]+.[0-9]+-release"
pull_request: pull_request:
jobs: jobs:

View File

@ -14,6 +14,10 @@ name: "CodeQL"
on: on:
push: push:
branches: [ main ] branches: [ main ]
tags:
- "![0-9]+.[0-9]+.[0-9]+-preview"
- "![0-9]+.[0-9]+.[0-9]+-release"
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ main ] branches: [ main ]

View File

@ -1,9 +1,12 @@
name: preview name: preview
# This workflow should run for any push which is a preview build. # This workflow should run for any push which is a preview build.
# Preview builds are indicated with changes to PREVIEW_NOTES.md. # Preview builds are indicated with a tag that ends in -preview
# In order to effect this, you can do the following: # In order to effect this, you can do the following:
# scripts/release-notes.sh > PREVIEW_NOTES.md # scripts/tag-preview-build
# If you want to replace a build, you can use -f and then
# push the update to the tag like push -f origin <tag>,
# although this should never be done!
on: on:
push: push:
@ -17,13 +20,10 @@ jobs:
- name: checkout repo - name: checkout repo
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
node-version: '16'
- name: setup java - name: setup java
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
node-version: '16'
distribution: 'temurin' distribution: 'temurin'
java-version: '17' java-version: '17'
java-package: jdk java-package: jdk
@ -44,9 +44,8 @@ jobs:
df -h df -h
- name: Cache Maven packages - name: Cache Maven packages
uses: actions/cache@v2 uses: actions/cache@v3.2.3
with: with:
node-version: '16'
path: ~/.m2 path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2 restore-keys: ${{ runner.os }}-m2
@ -63,21 +62,17 @@ jobs:
mvn clean package -Drevision="${{ env.PREVIEW_VERSION }}" mvn clean package -Drevision="${{ env.PREVIEW_VERSION }}"
- name: Setup docker buildx - name: Setup docker buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2.2.1
with:
node-version: '16'
- name: docker hub login - name: docker hub login
uses: docker/login-action@v1 uses: docker/login-action@v2.1.0
with: with:
node-version: '16'
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker test build - name: docker test build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3.3.0
with: with:
node-version: '16'
context: . context: .
file: Dockerfile file: Dockerfile
pull: true pull: true
@ -99,7 +94,6 @@ jobs:
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
node-version: '16'
name: binaries name: binaries
path: staging path: staging
@ -117,18 +111,12 @@ jobs:
id: prepare_summary id: prepare_summary
run: | run: |
#summary=$(scripts/release-notes.sh) #summary=$(scripts/release-notes.sh)
summary=$(cat RELEASENOTES.md) summary=$(cat PREVIEW_NOTES.md)
summary="${summary//'%'/'%25'}" summary="${summary//'%'/'%25'}"
summary="${summary//$'\n'/'%0A'}" summary="${summary//$'\n'/'%0A'}"
summary="${summary//$'\r'/'%0D'}" summary="${summary//$'\r'/'%0D'}"
echo "release_summary=$summary" >> $GITHUB_STATE echo "release_summary=$summary" >> $GITHUB_STATE
- name: tag preview version
run: |
git tag nb5-${{ env.PREVIEW_VERSION }}
git tag -f nb5-preview
git push --tags
- name: bump minor version - name: bump minor version
run: | run: |
scripts/bump-minor-version scripts/bump-minor-version
@ -136,7 +124,6 @@ jobs:
- name: docker push to hub - name: docker push to hub
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
node-version: '16'
context: . context: .
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
file: Dockerfile file: Dockerfile
@ -144,48 +131,62 @@ jobs:
push: true push: true
tags: ${{ env.DOCKER_TAGS }} tags: ${{ env.DOCKER_TAGS }}
# https://github.com/softprops/action-gh-release
- name: create github release - name: create github release
id: create_github_release uses: softprops/action-gh-release@v0.1.15
uses: actions/create-release@v1 if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
node-version: '16' # body: ${{ steps.prepare_summary.outputs.release_summary }}
tag_name: ${{ env.PREVIEW_VERSION }} # body_path: PREVIEW_NOTES.md
release_name: Release ${{ env.PREVIEW_VERSION }}
draft: false draft: false
prerelease: true prerelease: true
body: ${{ steps.prepare_summary.outputs.release_summary }} generate_release_notes: true
name: Preview ${{ env.PREVIEW_VERSION }}
fail_on_unmatched_files: true
tag_name: ${{ env.PREVIEW_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
nb5/target/nb5
nb5/target/nb5.jar
- name: upload nb.jar to github release # - name: create github release
id: upload-nb-jar # id: create_github_release
uses: actions/upload-release-asset@v1 # uses: actions/create-release@v1
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: # with:
node-version: '16' # tag_name: ${{ env.PREVIEW_VERSION }}
upload_url: ${{ steps.create_github_release.outputs.upload_url }} # release_name: Release ${{ env.PREVIEW_VERSION }}
asset_path: nb5/target/nb5.jar # draft: false
asset_name: nb5.jar # prerelease: true
asset_content_type: application/octet-stream # body: ${{ steps.prepare_summary.outputs.release_summary }}
#
- name: upload nb binary to github release # - name: upload nb.jar to github release
id: upload-nb-binary # id: upload-nb-jar
uses: actions/upload-release-asset@v1 # uses: actions/upload-release-asset@v1
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: # with:
node-version: '16' # upload_url: ${{ steps.create_github_release.outputs.upload_url }}
upload_url: ${{ steps.create_github_release.outputs.upload_url }} # asset_path: nb5/target/nb5.jar
asset_path: nb5/target/nb5 # asset_name: nb5.jar
asset_name: nb5 # asset_content_type: application/octet-stream
asset_content_type: application/octet-stream #
# - name: upload nb binary to github release
# id: upload-nb-binary
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_github_release.outputs.upload_url }}
# asset_path: nb5/target/nb5
# asset_name: nb5
# asset_content_type: application/octet-stream
- name: Archive Test Results - name: Archive Test Results
if: always() if: always()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
node-version: '16'
name: test-results name: test-results
path: | path: |
[a-zA-Z]**/logs/* [a-zA-Z]**/logs/*

View File

@ -1,9 +1,12 @@
name: release name: release
# This workflow should run for any push which is a preview build. # This workflow should run for any push which is a release build.
# Preview builds are indicated with changes to PREVIEW_NOTES.md. # Release builds are indicated with a tag that ends in -release
# In order to effect this, you can do the following: # In order to effect this, you can do the following:
# scripts/release-notes.sh > RELEASE_NOTES.md # scripts/tag-release-build
# If you want to replace a build, you can use -f and then
# push the update to the tag like push -f origin <tag>,
# although this should never be done!
on: on:
push: push:
@ -17,13 +20,10 @@ jobs:
- name: checkout repo - name: checkout repo
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
node-version: '16'
- name: setup java - name: setup java
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
node-version: '16'
distribution: 'temurin' distribution: 'temurin'
java-version: '17' java-version: '17'
java-package: jdk java-package: jdk
@ -44,9 +44,8 @@ jobs:
df -h df -h
- name: Cache Maven packages - name: Cache Maven packages
uses: actions/cache@v2 uses: actions/cache@v3.2.3
with: with:
node-version: '16'
path: ~/.m2 path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2 restore-keys: ${{ runner.os }}-m2
@ -54,30 +53,29 @@ jobs:
- name: read versions - name: read versions
run: | run: |
set -x set -x
RELEASE_REVISION=$(scripts/get-release-version.sh) RELEASE_VERSION=$(scripts/get-release-version.sh)
echo "RELEASE_REVISION=${RELEASE_REVISION}" >> $GITHUB_ENV RELEASE_VERSION_NUMERIC=$(scripts/get-release-version.sh -n)
echo "DOCKER_TAGS=nosqlbench/nosqlbench:${RELEASE_REVISION},nosqlbench/nosqlbench:latest" >> $GITHUB_ENV RELEASE_VERSION_SHORT=$(scripts/get-release-version.sh -s)
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
echo "RELEASE_VERSION_NUMERIC=${RELEASE_VERSION_NUMERIC}" >> $GITHUB_ENV
echo "DOCKER_TAGS=nosqlbench/nosqlbench:${RELEASE_VERSION_NUMERIC},nosqlbench/nosqlbench:${RELEASE_VERSION_SHORT}-latest" >> $GITHUB_ENV
- name: build release revision - name: build release revision
run: | run: |
mvn clean package -Drevision="${{ env.RELEASE_REVISION }}" mvn clean package -Drevision="${{ env.RELEASE_VERSION }}"
- name: Setup docker buildx - name: Setup docker buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2.2.1
with:
node-version: '16'
- name: docker hub login - name: docker hub login
uses: docker/login-action@v1 uses: docker/login-action@v2.1.0
with: with:
node-version: '16'
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker test build - name: docker test build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3.3.0
with: with:
node-version: '16'
context: . context: .
file: Dockerfile file: Dockerfile
pull: true pull: true
@ -87,7 +85,7 @@ jobs:
- name: sanity check docker image - name: sanity check docker image
run: | run: |
docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_REVISION }} --version docker run --rm nosqlbench/nosqlbench:${{ env.RELEASE_VERSION_NUMERIC }} --version
- name: bundle artifacts - name: bundle artifacts
run: | run: |
@ -99,7 +97,6 @@ jobs:
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
node-version: '16'
name: binaries name: binaries
path: staging path: staging
@ -113,26 +110,13 @@ jobs:
# name: javadoc # name: javadoc
# path: target/nosqlbench-*-javadoc.jar # path: target/nosqlbench-*-javadoc.jar
- name: prepare release summary - name: bump minor version
id: prepare_summary
run: | run: |
#summary=$(scripts/release-notes.sh) scripts/bump-minor-version
summary=$(cat RELEASENOTES.md)
summary="${summary//'%'/'%25'}"
summary="${summary//$'\n'/'%0A'}"
summary="${summary//$'\r'/'%0D'}"
echo "release_summary=$summary" >> $GITHUB_STATE
- name: tag release
run: |
git tag nb5-${{ env.RELEASE_REVISION }}
git tag -f nb5-release
git push --tags
- name: docker push to hub - name: docker push to hub
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
node-version: '16'
context: . context: .
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
file: Dockerfile file: Dockerfile
@ -140,48 +124,62 @@ jobs:
push: true push: true
tags: ${{ env.DOCKER_TAGS }} tags: ${{ env.DOCKER_TAGS }}
# https://github.com/softprops/action-gh-release
- name: create github release - name: create github release
id: create_github_release uses: softprops/action-gh-release@v0.1.15
uses: actions/create-release@v1 if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
node-version: '16' # body: ${{ steps.prepare_summary.outputs.release_summary }}
tag_name: ${{ env.RELEASE_REVISION }} # body_path: PREVIEW_NOTES.md
release_name: Release ${{ env.RELEASE_REVISION }}
draft: false draft: false
prerelease: true prerelease: true
body: ${{ steps.prepare_summary.outputs.release_summary }} generate_release_notes: true
name: Release ${{ env.RELEASE_VERSION }}
fail_on_unmatched_files: true
tag_name: ${{ env.RELEASE_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
nb5/target/nb5
nb5/target/nb5.jar
- name: upload nb.jar to github release # - name: create github release
id: upload-nb-jar # id: create_github_release
uses: actions/upload-release-asset@v1 # uses: actions/create-release@v1
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: # with:
node-version: '16' # tag_name: ${{ env.RELEASE_VERSION }}
upload_url: ${{ steps.create_github_release.outputs.upload_url }} # release_name: Release ${{ env.RELEASE_VERSION }}
asset_path: nb5/target/nb5.jar # draft: false
asset_name: nb5.jar # prerelease: true
asset_content_type: application/octet-stream # body: ${{ steps.prepare_summary.outputs.release_summary }}
#
- name: upload nb binary to github release # - name: upload nb.jar to github release
id: upload-nb-binary # id: upload-nb-jar
uses: actions/upload-release-asset@v1 # uses: actions/upload-release-asset@v1
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: # with:
node-version: '16' # upload_url: ${{ steps.create_github_release.outputs.upload_url }}
upload_url: ${{ steps.create_github_release.outputs.upload_url }} # asset_path: nb5/target/nb5.jar
asset_path: nb5/target/nb5 # asset_name: nb5.jar
asset_name: nb5 # asset_content_type: application/octet-stream
asset_content_type: application/octet-stream #
# - name: upload nb binary to github release
# id: upload-nb-binary
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_github_release.outputs.upload_url }}
# asset_path: nb5/target/nb5
# asset_name: nb5
# asset_content_type: application/octet-stream
- name: Archive Test Results - name: Archive Test Results
if: always() if: always()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
node-version: '16'
name: test-results name: test-results
path: | path: |
[a-zA-Z]**/logs/* [a-zA-Z]**/logs/*

View File

@ -1,7 +1,33 @@
- e4e94f9e8 (HEAD -> main) support version bumping - 2b85c1cce (HEAD -> main, tag: 5.17.1-preview) versions and release action update
- 2d3263cfb make release tag distinct
- 639dbf2d6 update action version
- 1b2a773ce update files paths
- 1986b8cdb replace release action
- 7047f4486 (origin/main) remove second tagging
- 910e871a8 remove extra node version parameters
- 6b0633d4a (tag: nb5-preview, tag: nb5-5.17.1-preview) update notes filenames
- be65f812e allow forcing preview tag update
- 2a43dd077 Merge branch 'main' of github.com:nosqlbench/nosqlbench
- 6a2132669 actions testing
- 4bd0513f9 Merge pull request #950 from nosqlbench/nosqlbench-949-sigint
- 086451794 preview build testing
- 32486b3d6 unbreak the break signal
- 6d07acb8c (origin/nosqlbench-949-sigint, nosqlbench-949-sigint) unbreak the break signal
- c6aa66f50 Update DOWNLOADS.md
- 5b90831a9 Update DOWNLOADS.md
- 3e3427fca update job names
- 3f0417c96 fix preview trigger
- 29ed32d91 update revision
- 24657248f use tags only for preview and release triggers
- e254eafa8 check for main branch on preview and release
- 0ae3bd085 make preview and release tag based
- 027fc4a89 version, tagging updates
- 402154e4c docs and scripts
- ee2bda24e preview testing
- e4e94f9e8 support version bumping
- 8a2c696eb allow bumping versions - 8a2c696eb allow bumping versions
- c19b2388e (origin/prerelease-testing, origin/main, prerelease-testing) standardize on main/preview/release naming - c19b2388e (origin/prerelease-testing, prerelease-testing) standardize on main/preview/release naming
- 5facaddfe (tag: 5.17.1-prerelease) actions testing - 5facaddfe actions testing
- 33c55809d actions testing - 33c55809d actions testing
- fcdddf307 simplify version - fcdddf307 simplify version
- ac7f5762c actions cleanup - ac7f5762c actions cleanup

View File

@ -340,7 +340,7 @@ public class Scenario implements Callable<ExecutionMetricsResult> {
} }
} }
public synchronized void finish() { public void finish() {
logger.debug("finishing scenario"); logger.debug("finishing scenario");
endedAtMillis = System.currentTimeMillis(); //TODO: Make only one endedAtMillis assignment endedAtMillis = System.currentTimeMillis(); //TODO: Make only one endedAtMillis assignment
if (this.state == State.Running) { if (this.state == State.Running) {

View File

@ -17,16 +17,6 @@
set -e set -e
export branch=$(git status --branch --porcelain | cut -d' ' -f2)
if [[ $branch =~ main ]]
then
printf "On branch main, continuing\n" 1>&2
else
printf "Not branch main, bailing out\n" 1>&2
exit 2
fi
export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout) export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)
if [[ $REVISION =~ ([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT ]] if [[ $REVISION =~ ([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT ]]
then then

View File

@ -15,18 +15,13 @@
# limitations under the License. # limitations under the License.
# #
set -e if [ "$1" == "-n" ]
then numeric=true
export branch=$(git status --branch --porcelain | cut -d' ' -f2) elif [ "$1" == "-s" ]
then short=true
if [[ $branch =~ main ]]
then
printf "On branch main, continuing\n" 1>&2
else
printf "Not branch main, bailing out\n" 1>&2
exit 2
fi fi
set -e
export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout) export REVISION=$(mvn help:evaluate -Dexpression=revision -q -DforceStdout)
if [[ $REVISION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT$ ]] if [[ $REVISION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)-SNAPSHOT$ ]]
@ -60,6 +55,14 @@ else
exit 5 exit 5
fi fi
if [ "$numeric" == "true" ]
then
printf "%s.%s.%s\n" "${@:2:3}"
elif [ "$short" == "true" ]
then
printf "%s.%s\n" "${@:2:2}"
else
printf "%s.%s.%s-release\n" "${@:2:3}" printf "%s.%s.%s-release\n" "${@:2:3}"
fi

View File

@ -5,13 +5,14 @@ git log --oneline --decorate --max-count=1000 > /tmp/gitlog.txt
readarray lines < /tmp/gitlog.txt readarray lines < /tmp/gitlog.txt
for line in "${lines[@]}" for line in "${lines[@]}"
do do
printf "line: %s\n" "${line}" # printf "line: %s\n" "${line}"
if [[ $line =~ \(tag:\ ([a-zA-z0-9]+-)?[0-9]+\.[0-9]+\.[0-9]+\)-preview.+ ]] if [[ $line =~ \(tag:\ ([a-zA-z0-9]+-)?[0-9]+\.[0-9]+\.[0-9]+\)-preview.+ ]]
then then
echo "PREVIEW" true
# echo "PREVIEW"
elif [[ $line =~ \(tag:\ ([a-zA-Z0-9]+-)?[0-9]+\.[0-9]+\.[0-9]+\).+ ]] elif [[ $line =~ \(tag:\ ([a-zA-Z0-9]+-)?[0-9]+\.[0-9]+\.[0-9]+\).+ ]]
then then
echo "RELEASE" # echo "RELEASE"
# printf "no more lines after $line" 1>&2 # printf "no more lines after $line" 1>&2
break break
elif [[ $line =~ \[maven-release-plugin\] ]] elif [[ $line =~ \[maven-release-plugin\] ]]

View File

@ -6,5 +6,10 @@ RELEASE_VERSION=${CURRENT_VERSION%%-SNAPSHOT}
PREVIEW_TAG="${RELEASE_VERSION}-preview" PREVIEW_TAG="${RELEASE_VERSION}-preview"
printf "preview tag: '%s'\n" "${PREVIEW_TAG}" printf "preview tag: '%s'\n" "${PREVIEW_TAG}"
if [ "$1" == "-f" ]
then
git tag -f "${PREVIEW_TAG}"
else
git tag "${PREVIEW_TAG}" git tag "${PREVIEW_TAG}"
fi

View File

@ -6,5 +6,10 @@ RELEASE_VERSION=${CURRENT_VERSION%%-SNAPSHOT}
RELEASE_TAG="${RELEASE_VERSION}-release" RELEASE_TAG="${RELEASE_VERSION}-release"
printf "release tag: '%s'\n" "${RELEASE_TAG}" printf "release tag: '%s'\n" "${RELEASE_TAG}"
if [ "$1" == "-f" ]
then
git tag -f "${RELEASE_TAG}"
else
git tag "${RELEASE_TAG}" git tag "${RELEASE_TAG}"
fi