Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into CLIENT-2217-openssl3-m…
Browse files Browse the repository at this point in the history
…anylinux
  • Loading branch information
juliannguyen4 committed Nov 15, 2024
2 parents 634d6ad + 6f2abe7 commit d463014
Show file tree
Hide file tree
Showing 41 changed files with 1,054 additions and 219 deletions.
49 changes: 38 additions & 11 deletions .github/actions/run-ee-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ inputs:
# All inputs in composite actions are strings
use-server-rc:
required: true
default: false
description: Deploy server release candidate?
default: 'false'
server-tag:
required: true
description: Specify Docker tag
default: 'latest'
# Github Composite Actions can't access secrets
# so we need to pass them in as inputs
docker-hub-username:
description: Required for using release candidates
required: false
docker-hub-password:
description: Required for using release candidates
required: false

runs:
Expand All @@ -35,13 +39,17 @@ runs:
run: |
crudini --existing=param --set config.conf enterprise-edition hosts ''
crudini --existing=param --set config.conf enterprise-edition hosts 127.0.0.1:3000
crudini --existing=param --set config.conf enterprise-edition user superuser
crudini --existing=param --set config.conf enterprise-edition password superuser
working-directory: test
shell: bash

- name: Create config folder to store configs in
run: mkdir configs
- run: echo SUPERUSER_NAME_AND_PASSWORD="superuser" >> $GITHUB_ENV
shell: bash

- name: Set credentials in config file
run: |
crudini --existing=param --set config.conf enterprise-edition user ${{ env.SUPERUSER_NAME_AND_PASSWORD }}
crudini --existing=param --set config.conf enterprise-edition password ${{ env.SUPERUSER_NAME_AND_PASSWORD }}
working-directory: test
shell: bash

- name: Log into Docker Hub to get server RC
Expand All @@ -52,7 +60,7 @@ runs:
- run: echo IMAGE_NAME=aerospike/aerospike-server-enterprise${{ inputs.use-server-rc == 'true' && '-rc' || '' }}:${{ inputs.server-tag }} >> $GITHUB_ENV
shell: bash

- run: echo SECURITY_IMAGE_NAME=${{ env.IMAGE_NAME }}-security >> $GITHUB_ENV
- run: echo NEW_IMAGE_NAME=${{ env.IMAGE_NAME }}-security-and-sc >> $GITHUB_ENV
shell: bash

# macOS Github runners and Windows self-hosted runners don't have buildx installed by default
Expand All @@ -63,19 +71,38 @@ runs:
uses: docker/build-push-action@v6
with:
# Don't want to use default Git context or else it will clone the whole Python client repo again
context: .github/workflows
context: .github/workflows/docker-build-context
build-args: |
image=${{ env.IMAGE_NAME }}
tags: ${{ env.SECURITY_IMAGE_NAME }}
server_image=${{ env.IMAGE_NAME }}
tags: ${{ env.NEW_IMAGE_NAME }}
# setup-buildx-action configures Docker to use the docker-container build driver
# This driver doesn't publish an image locally by default
# so we have to manually enable it
load: true

- run: docker run -d --name aerospike -p 3000:3000 -e DEFAULT_TTL=2592000 ${{ env.SECURITY_IMAGE_NAME }}
- run: echo SERVER_CONTAINER_NAME="aerospike" >> $GITHUB_ENV
shell: bash

- run: docker run -d --name ${{ env.SERVER_CONTAINER_NAME }} -e DEFAULT_TTL=2592000 -p 3000:3000 ${{ env.NEW_IMAGE_NAME }}
shell: bash

- uses: ./.github/actions/wait-for-as-server-to-start
with:
container-name: aerospike
container-name: ${{ env.SERVER_CONTAINER_NAME }}
is-security-enabled: true
is-strong-consistency-enabled: true

- run: echo ASADM_AUTH_FLAGS="--user=${{ env.SUPERUSER_NAME_AND_PASSWORD }} --password=${{ env.SUPERUSER_NAME_AND_PASSWORD }}" >> $GITHUB_ENV
shell: bash

# All the partitions are assumed to be dead when reusing a roster file
- run: docker exec ${{ env.SERVER_CONTAINER_NAME }} asadm $ASADM_AUTH_FLAGS --enable --execute "manage revive ns test"
shell: bash

# Apply changes
- run: docker exec ${{ env.SERVER_CONTAINER_NAME }} asadm $ASADM_AUTH_FLAGS --enable --execute "manage recluster"
shell: bash

# For debugging
- run: docker logs aerospike
shell: bash
5 changes: 4 additions & 1 deletion .github/actions/wait-for-as-server-to-start/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
is-security-enabled:
required: false
default: 'false'
is-strong-consistency-enabled:
required: false
default: 'false'

runs:
using: "composite"
Expand All @@ -21,5 +24,5 @@ runs:
# Also, we don't want to fail if we timeout in case the server *did* finish starting up but the script couldn't detect it due to a bug
# Effectively, this composite action is like calling "sleep" that is optimized to exit early when it detects an ok from the server
- name: Wait for EE server to start
run: timeout 30 bash ./.github/workflows/wait-for-as-server-to-start.bash ${{ inputs.container-name }} ${{ inputs.is-security-enabled }} || true
run: timeout 30 bash ./.github/workflows/wait-for-as-server-to-start.bash ${{ inputs.container-name }} ${{ inputs.is-security-enabled }} ${{ inputs.is-strong-consistency-enabled }} || true
shell: bash
10 changes: 0 additions & 10 deletions .github/workflows/Dockerfile

This file was deleted.

12 changes: 10 additions & 2 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ on:
required: true
default: 'latest'
description: 'Server docker image tag'
test-file:
required: false
default: ''
description: 'new_tests/<value>'

workflow_call:
inputs:
Expand Down Expand Up @@ -106,6 +110,10 @@ on:
type: string
default: 'latest'
description: 'Server docker image tag'
test-file:
required: false
type: string
default: ''
secrets:
# Just make all the secrets required to make things simpler...
DOCKER_HUB_BOT_USERNAME:
Expand Down Expand Up @@ -228,7 +236,7 @@ jobs:

- name: Otherwise, enable integration tests
if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' }}
run: echo "TEST_COMMAND=cd {project}/test/ && pip install -r requirements.txt && python -m pytest new_tests/" >> $GITHUB_ENV
run: echo "TEST_COMMAND=cd {project}/test/ && pip install -r requirements.txt && python -m pytest -vv new_tests/${{ inputs.test-file }}" >> $GITHUB_ENV
shell: bash

- name: Set unoptimize flag
Expand Down Expand Up @@ -351,7 +359,7 @@ jobs:
working-directory: test
shell: bash

- run: python3 -m pytest new_tests/
- run: python3 -m pytest -vv new_tests/${{ inputs.test-file }}
working-directory: test
shell: bash

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/docker-build-context/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
ARG server_image=aerospike/aerospike-server-enterprise
ARG ROSTER_FILE_NAME=roster.smd
# Temp file for passing node id from one build stage to another
# Docker doesn't support command substitution for setting values for ARG variables, so we have to do this
ARG NODE_ID_FILE_NAME=node_id

FROM $server_image as configure-server

WORKDIR /opt/aerospike/smd

# Enable authentication

ARG AEROSPIKE_CONF_TEMPLATE_PATH=/etc/aerospike/aerospike.template.conf

# Not using asconfig to edit config because we are working with a template file, which may not have valid values yet
RUN echo -e "security {\n\tenable-quotas true\n}\n" >> $AEROSPIKE_CONF_TEMPLATE_PATH
# security.smd was generated manually by
# 1. Starting a new Aerospike EE server using Docker
# 2. Creating the superuser user
# 3. Copying /opt/aerospike/smd/security.smd from the container and committing it to this repo
# This file should always work
# TODO: generate this automatically, somehow.
COPY security.smd .

# Enable strong consistency
RUN sed -i "s/\(namespace.*{\)/\1\n\tstrong-consistency true/" $AEROSPIKE_CONF_TEMPLATE_PATH
RUN sed -i "s/\(namespace.*{\)/\1\n\tstrong-consistency-allow-expunge true/" $AEROSPIKE_CONF_TEMPLATE_PATH
ARG ROSTER_FILE_NAME
COPY $ROSTER_FILE_NAME .

# Fetch node id from roster.smd

# There's no tag for the latest major version to prevent breaking changes in jq
# This is the next best thing
FROM ghcr.io/jqlang/jq:1.7 as get-jq
# jq docker image doesn't have a shell
# We need a shell to fetch and pass the node id to the next build stage
FROM busybox as get-node-id
COPY --from=get-jq /jq /bin/
ARG ROSTER_FILE_NAME
COPY $ROSTER_FILE_NAME .
ARG NODE_ID_FILE_NAME
RUN jq --raw-output '.[1].value' $ROSTER_FILE_NAME > $NODE_ID_FILE_NAME

FROM configure-server as set-node-id
ARG NODE_ID_FILE_NAME
COPY --from=get-node-id $NODE_ID_FILE_NAME .
RUN sed -i "s/\(^service {\)/\1\n\tnode-id $(cat $NODE_ID_FILE_NAME)/" $AEROSPIKE_CONF_TEMPLATE_PATH
RUN rm $NODE_ID_FILE_NAME
12 changes: 12 additions & 0 deletions .github/workflows/docker-build-context/roster.smd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
[
97107025374203,
1
],
{
"key": "test",
"value": "a1",
"generation": 1,
"timestamp": 465602976982
}
]
File renamed without changes.
36 changes: 11 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
mkdir -p nullobject/src/main/nullobject
mkdir -p query/src/main/query
mkdir -p scan/src/main/scan
mkdir -p transaction/src/main/transaction
cd ../../../../
cp src/main/*.c build/temp*/src/main/src/main
Expand All @@ -138,6 +139,7 @@ jobs:
cp src/main/nullobject/*.c build/temp*/src/main/nullobject/src/main/nullobject/
cp src/main/query/*.c build/temp*/src/main/query/src/main/query/
cp src/main/scan/*.c build/temp*/src/main/scan/src/main/scan/
cp src/main/transaction/*.c build/temp*/src/main/transaction/src/main/transaction/
- name: Generate coverage report for all object files
if: ${{ !cancelled() }}
Expand Down Expand Up @@ -372,7 +374,7 @@ jobs:
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- name: Run tests
run: python -m pytest ./new_tests/test_admin_*.py
run: python -m pytest ./new_tests/test_{mrt_functionality,admin_*}.py
working-directory: test

- name: Show logs if failed
Expand Down Expand Up @@ -412,30 +414,14 @@ jobs:
run: sphinx-build -b linkcheck . links
working-directory: doc

test-metrics-node-close-listener:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.LOWEST_SUPPORTED_PY_VERSION }}
architecture: 'x64'
- name: Download aerolab
run: wget https://github.com/aerospike/aerolab/releases/download/7.5.2/aerolab-linux-amd64-7.5.2.deb
- name: Install aerolab
run: sudo dpkg -i *.deb
- name: Tell aerolab to use Docker
run: aerolab config backend -t docker
- uses: actions/download-artifact@v3
with:
name: wheel-${{ env.LOWEST_SUPPORTED_PY_VERSION }}
- run: python3 -m pip install *.whl
- run: python3 test_node_close_listener.py
working-directory: test/metrics

test-metrics-cluster-name:
test-metrics:
needs: build
strategy:
matrix:
suffix:
- node_close_listener
- cluster_name
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -449,5 +435,5 @@ jobs:
- run: python3 -m pip install *.whl
- run: python3 -m pip install -r requirements.txt
working-directory: test/metrics
- run: python3 test_cluster_name.py
- run: python3 test_${{ matrix.suffix }}.py
working-directory: test/metrics
4 changes: 4 additions & 0 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
description: 'Use server release candidate?'
required: true
default: false
server-tag:
required: false
default: latest
massif:
type: boolean
description: 'Use massif for testing memory usage'
Expand Down Expand Up @@ -57,6 +60,7 @@ jobs:
uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/wait-for-as-server-to-start.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -o pipefail

container_name=$1
is_security_enabled=$2
is_strong_consistency_enabled=$3

if [[ $is_security_enabled == true ]]; then
# We need to pass credentials to asinfo if server requires it
Expand Down Expand Up @@ -38,7 +39,14 @@ done
while true; do
echo "Waiting for server to stabilize (i.e return a cluster key)..."
# We assume that when an ERROR is returned, the cluster is not stable yet (i.e not fully initialized)
if docker exec "$container_name" asinfo $user_credentials -v cluster-stable 2>&1 | (! grep -qE "^ERROR"); then
cluster_stable_info_cmd="cluster-stable"
if [[ $is_strong_consistency_enabled == true ]]; then
# The Dockerfile uses a roster from a previously running Aerospike server in a Docker container
# When we reuse this roster, the server assumes all of its partitions are dead because it's running on a new
# storage device.
cluster_stable_info_cmd="$cluster_stable_info_cmd:ignore-migrations=true"
fi
if docker exec "$container_name" asinfo $user_credentials -v $cluster_stable_info_cmd 2>&1 | (! grep -qE "^ERROR"); then
echo "Server is in a stable state."
break
fi
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
path = aerospike-client-c
# url = [email protected]:aerospike/aerospike-client-c.git
url = https://github.com/aerospike/aerospike-client-c.git
branch = stage
branch = CLIENT-2294
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.2.0rc2.dev3
15.2.0rc2
2 changes: 1 addition & 1 deletion aerospike-client-c
Submodule aerospike-client-c updated 87 files
+3 −0 Makefile
+1 −0 examples/async_examples/Makefile
+3 −3 examples/async_examples/async_batch_get/src/main/example.c
+2 −2 examples/async_examples/async_delay_queue/src/main/example.c
+4 −0 examples/async_examples/async_transaction/Makefile
+329 −0 examples/async_examples/async_transaction/src/main/example.c
+1 −0 examples/basic_examples/Makefile
+2 −2 examples/basic_examples/append/src/main/example.c
+1 −1 examples/basic_examples/incr/src/main/example.c
+4 −0 examples/basic_examples/transaction/Makefile
+144 −0 examples/basic_examples/transaction/src/main/example.c
+2 −2 examples/batch_examples/get/src/main/example.c
+ project/aerospike_logo.png
+12 −12 project/doxyfile
+116 −0 project/doxygen-awesome-sidebar-only.css
+2,681 −0 project/doxygen-awesome.css
+84 −0 project/header.html
+0 −0 project/layout.xml
+2 −0 project/test.mk
+0 −14 src/apidocs/footer.html
+0 −47 src/apidocs/header.html
+0 −716 src/apidocs/html/aerospike.css
+0 −563 src/apidocs/html/style.css
+0 −1,204 src/apidocs/old.css
+6 −6 src/include/aerospike/aerospike.h
+70 −30 src/include/aerospike/aerospike_batch.h
+93 −6 src/include/aerospike/aerospike_key.h
+6 −6 src/include/aerospike/aerospike_stats.h
+227 −0 src/include/aerospike/aerospike_txn.h
+3 −3 src/include/aerospike/as_admin.h
+21 −8 src/include/aerospike/as_async.h
+1 −1 src/include/aerospike/as_batch.h
+23 −12 src/include/aerospike/as_cluster.h
+124 −21 src/include/aerospike/as_command.h
+5 −5 src/include/aerospike/as_config.h
+2 −2 src/include/aerospike/as_error.h
+21 −16 src/include/aerospike/as_event.h
+27 −2 src/include/aerospike/as_event_internal.h
+3 −3 src/include/aerospike/as_exp.h
+1 −1 src/include/aerospike/as_latency.h
+11 −11 src/include/aerospike/as_node.h
+1 −1 src/include/aerospike/as_operations.h
+184 −45 src/include/aerospike/as_policy.h
+3 −3 src/include/aerospike/as_proto.h
+7 −1 src/include/aerospike/as_query.h
+2 −2 src/include/aerospike/as_record.h
+2 −2 src/include/aerospike/as_socket.h
+33 −2 src/include/aerospike/as_status.h
+287 −0 src/include/aerospike/as_txn.h
+95 −0 src/include/aerospike/as_txn_monitor.h
+1 −1 src/include/aerospike/version.h
+1,463 −304 src/main/aerospike/aerospike_batch.c
+1,093 −258 src/main/aerospike/aerospike_key.c
+13 −5 src/main/aerospike/aerospike_query.c
+7 −4 src/main/aerospike/aerospike_scan.c
+729 −0 src/main/aerospike/aerospike_txn.c
+1 −1 src/main/aerospike/as_cluster.c
+200 −31 src/main/aerospike/as_command.c
+6 −0 src/main/aerospike/as_error.c
+176 −16 src/main/aerospike/as_event.c
+1 −1 src/main/aerospike/as_event_uv.c
+2 −2 src/main/aerospike/as_metrics_writer.c
+3 −3 src/main/aerospike/as_node.c
+8 −4 src/main/aerospike/as_policy.c
+401 −0 src/main/aerospike/as_txn.c
+358 −0 src/main/aerospike/as_txn_monitor.c
+1 −1 src/main/aerospike/version.c
+2 −0 src/test/aerospike_test.c
+918 −0 src/test/transaction.c
+1,151 −0 src/test/transaction_async.c
+1 −1 vs/aerospike-client-c-libevent.nuspec
+1 −1 vs/aerospike-client-c-libuv.nuspec
+1 −1 vs/aerospike-client-c.nuspec
+2 −0 vs/aerospike-test/aerospike-test.vcxproj
+6 −0 vs/aerospike-test/aerospike-test.vcxproj.filters
+54 −0 vs/aerospike.sln
+6 −0 vs/aerospike/aerospike.vcxproj
+18 −0 vs/aerospike/aerospike.vcxproj.filters
+248 −0 vs/examples/async-transaction/async-transaction.vcxproj
+33 −0 vs/examples/async-transaction/async-transaction.vcxproj.filters
+4 −0 vs/examples/async-transaction/packages.config
+4 −0 vs/examples/transaction/packages.config
+248 −0 vs/examples/transaction/transaction.vcxproj
+33 −0 vs/examples/transaction/transaction.vcxproj.filters
+8 −0 xcode/aerospike-test.xcodeproj/project.pbxproj
+24 −0 xcode/aerospike.xcodeproj/project.pbxproj
+24 −0 xcode/examples.xcodeproj/project.pbxproj
Loading

0 comments on commit d463014

Please sign in to comment.