Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Aerospike client to 6.2.0 #29

Merged
merged 5 commits into from
Nov 2, 2023
Merged
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
9 changes: 0 additions & 9 deletions .circleci/circleci.settings.xml

This file was deleted.

43 changes: 0 additions & 43 deletions .circleci/config.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .circleci/gpg.playtika.pub

This file was deleted.

2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"documentation":
- /**/*.adoc
34 changes: 34 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name-template: $NEXT_PATCH_VERSION
tag-template: $NEXT_PATCH_VERSION

template: |
# Changes
$CHANGES

# --------
# NOTE: When adding new labels please also update required-labels.yml workflow.
# --------
categories:
- title: 💣️ Breaking changes
label: breaking-change

- title: 🚀 Features & Enhancements
labels:
- feature
- enhancement

- title: 🐞 Fixes
label: bug

- title: 📁 Java Dependencies updates
label: dependencies

- title: 📁 Docker images updates
label: docker-update-images

- title: 📖 Documentation
label: documentation

- title: 🏡 Housekeeping
label: housekeeping

14 changes: 14 additions & 0 deletions .github/workflows/changelog-release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Changelog Release Drafter

on:
push:
branches:
- develop

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Trivy"

on:
schedule:
- cron: '24 10 * * 5'

jobs:
build:
name: Trivy vulnerability scanner
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
14 changes: 14 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Pull Request Auto Labeler"
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
39 changes: 39 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
build-jdk17:
runs-on: ubuntu-latest
name: Build project
concurrency:
# The commit SHA or the branch name of the pull request. See: https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
group: ${{ github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Build with Maven
run: ./mvnw -version && whoami && umask -S && umask a+rw && umask -S && ./mvnw clean verify -P docker-clean -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.count=3 --no-snapshot-updates --batch-mode --no-transfer-progress
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish to the Maven Central Repository

on:
release:
types: [ published ]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{github.event.release.target_commitish}}
token: ${{ secrets.RELEASE_PERSONAL_ACCESS_TOKEN }}

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
cache: 'maven'

- name: Update version
if: ${{ success() }}
run: ./mvnw --batch-mode --no-transfer-progress versions:set -DnewVersion=${{github.event.release.tag_name}} versions:commit

- name: Publish to the Maven Central Repository
if: ${{ success() }}
run: ./mvnw --batch-mode --no-transfer-progress -Dgib.disable=true -P ossrh -DskipTests deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Commit & Push changes
if: ${{ success() }}
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Release ${{github.event.release.tag_name}}'
branch: ${{ github.event.release.target_commitish }}
39 changes: 39 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Renovate for update docker images

on:
workflow_dispatch:
inputs:
dryRun:
description: "Dry-Run"
default: false
required: false
type: boolean
logLevel:
description: "Log-Level"
required: false
default: 'debug'
type: choice
options:
- info
- warn
- debug
- error
- fatal
schedule:
- cron: '0 8 * * *'

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Self-hosted Renovate
uses: renovatebot/github-action@v39.0.5
with:
configurationFile: .github/renovate/renovate.json
token: ${{ secrets.RELEASE_PERSONAL_ACCESS_TOKEN }}
env:
DRY_RUN: ${{ inputs.dryRun || 'false' }}
LOG_LEVEL: ${{ inputs.logLevel || 'debug' }}
16 changes: 16 additions & 0 deletions .github/workflows/required-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://github.com/mheap/github-action-required-labels
name: Pull Request Required Labels
on:
pull_request:
types: [ opened, labeled, unlabeled, synchronize ]
jobs:
label:
if: github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
name: Verify Pull Request has labels
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: minimum
count: 1
labels: "breaking-change, feature, enhancement, bug, dependencies, docker-update-images, documentation, housekeeping"
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![CircleCI](https://circleci.com/gh/Playtika/nosql-batch-updater/tree/develop.svg?style=shield&circle-token=2fee7a6c26cbd37d4530dc0ef8d4f70027d070ae)](https://circleci.com/gh/Playtika/nosql-batch-updater/tree/develop)
[![codecov](https://codecov.io/gh/Playtika/nosql-batch-updater/branch/master/graph/badge.svg)](https://codecov.io/gh/Playtika/nosql-batch-updater)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.playtika.nosql/batch-updater-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.playtika.nosql/batch-updater-parent)
# nosql-batch-updater
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
import com.aerospike.AerospikeContainerUtils;
import com.aerospike.AerospikeProperties;
import com.aerospike.client.AerospikeClient;
import com.aerospike.client.IAerospikeClient;
import com.aerospike.client.Info;
import com.aerospike.client.async.EventLoops;
import com.aerospike.client.policy.ClientPolicy;
import org.testcontainers.containers.GenericContainer;

import java.util.stream.Stream;

public class AerospikeTestUtils {

public static AerospikeProperties AEROSPIKE_PROPERTIES = new AerospikeProperties();
Expand All @@ -31,28 +27,4 @@ public static AerospikeClient getAerospikeClient(GenericContainer aerospike, Eve
aerospike.getMappedPort(AEROSPIKE_PROPERTIES.getPort()));
}

public static void deleteAllRecords(GenericContainer container) throws InterruptedException {
try(AerospikeClient client = new AerospikeClient(container.getContainerIpAddress(),
container.getMappedPort(AEROSPIKE_PROPERTIES.getPort()))) {
while(!isEmptyNamespace(client, AEROSPIKE_PROPERTIES.getNamespace())){
truncateNamespace(client, AEROSPIKE_PROPERTIES.getNamespace());
Thread.sleep(100);
}
}
}

public static void truncateNamespace(IAerospikeClient client, String namespace) throws InterruptedException {
while(!isEmptyNamespace(client, namespace)){
client.truncate(null, namespace, null, null);
Thread.sleep(100);
}
}

public static boolean isEmptyNamespace(IAerospikeClient client, String namespace){
String answer = Info.request(client.getNodes()[0], "sets/" + namespace);
return answer.isEmpty()
|| Stream.of(answer.split(";"))
.allMatch(s -> s.contains("objects=0"));
}

}
Loading