Skip to content

Commit

Permalink
finish
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Nov 13, 2024
1 parent f778694 commit 0e7a577
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 37 deletions.
55 changes: 29 additions & 26 deletions .github/actions/run-ee-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ inputs:
docker-hub-password:
description: Required for using release candidates
required: false
where-should-client-connect-from:
where-is-client-connecting-from:
required: false
# docker-host, docker-container, "remote-connection" via DOCKER_HOST
description: 'docker-host, separate-docker-container, "remote-connection" via DOCKER_HOST'
default: 'docker-host'

runs:
using: "composite"
steps:
- name: Install crudini to manipulate config.conf
# This will only work on the Github hosted runners.
run: pipx install crudini --pip-args "-c ${{ github.workspace }}/.github/workflows/requirements.txt"
working-directory: .github/workflows
shell: bash
Expand All @@ -39,10 +38,8 @@ runs:
working-directory: test
shell: bash

- name: Use enterprise edition instead of community edition in config.conf
run: |
crudini --existing=param --set config.conf enterprise-edition hosts ''
crudini --existing=param --set config.conf enterprise-edition hosts 127.0.0.1:3000
- name: Disable enterprise edition connection
run: crudini --existing=param --set config.conf community-edition hosts ''
working-directory: test
shell: bash

Expand All @@ -56,6 +53,30 @@ runs:
working-directory: test
shell: bash

- name: Set IP address to localhost
if: ${{ inputs.where-is-client-connecting-from == 'docker-host' }}
run: echo SERVER_IP=127.0.0.1 >> $GITHUB_ENV
working-directory: test
shell: bash

- name: Set IP address to remote machine running the Docker daemon
if: ${{ inputs.where-is-client-connecting-from == 'remote-connection' }}
run: |
SERVER_IP=${DOCKER_HOST/tcp:\/\//}
echo SERVER_IP=${SERVER_IP/:2375/} >> $GITHUB_ENV
working-directory: test
shell: bash

- name: Set IP address to Docker container for the server
if: ${{ inputs.where-is-client-connecting-from == 'separate-docker-container' }}
run: echo SERVER_IP=$(docker container inspect -f '{{ .NetworkSettings.IPAddress }}' aerospike) >> $GITHUB_ENV
shell: bash

- name: Set EE server's IP address
run: crudini --existing=param --set config.conf enterprise-edition hosts ${{ env.SERVER_IP }}:3000
working-directory: test
shell: bash

- name: Log into Docker Hub to get server RC
if: ${{ inputs.use-server-rc == 'true' }}
run: docker login --username ${{ inputs.docker-hub-username }} --password ${{ inputs.docker-hub-password }}
Expand All @@ -64,7 +85,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 NEW_IMAGE_NAME=${{ env.IMAGE_NAME }}-security-and-sc >> $GITHUB_ENV
- run: echo NEW_IMAGE_NAME=${{ env.IMAGE_NAME }}-python-client-testing >> $GITHUB_ENV
shell: bash

# macOS Github runners and Windows self-hosted runners don't have buildx installed by default
Expand Down Expand Up @@ -96,24 +117,6 @@ runs:
is-security-enabled: true
is-strong-consistency-enabled: true

- name: Get IP address of Docker container hosting server
id: get-server-ip-address
if: ${{ inputs.docker-client-location == 'docker-container' }}
run: echo CUSTOM_SERVER_IP=$(docker container inspect -f '{{ .NetworkSettings.IPAddress }}' aerospike) >> $GITHUB_ENV
shell: bash

- name: Parse DOCKER_HOST
run: |
DOCKER_HOST_IP=${DOCKER_HOST/tcp:\/\//}
echo DOCKER_HOST_IP=${DOCKER_HOST_IP/:2375/} >> $GITHUB_ENV
working-directory: test
shell: bash

- name: Configure tests to connect to that Docker container
if: ${{ inputs.docker-client-location != 'docker-host' }}
run: crudini --existing=param --set config.conf enterprise-edition hosts ${{ env.CUSTOM_SERVER_IP }}:3000
working-directory: test

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

Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,14 @@ jobs:
uses: ./.github/actions/setup-docker-on-macos

- name: 'macOS x86: run Aerospike server in Docker container and connect via localhost'
if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' && inputs.platform-tag == 'macosx_x86_64' }}
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 }}

- name: "Linux: run Aerospike server in Docker container and configure config.conf to connect to the server container's Docker IP address"
if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' && startsWith(inputs.platform-tag, 'manylinux') }}
if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' }}
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 }}
where-should-client-connect-from: 'docker-container'
where-is-client-connecting-from: ${{ inputs.platform-tag == 'macosx_x86_64' && 'docker-host' || 'separate-docker-container' }}

- name: If not running tests against server, only run basic import test
if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'false' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/stage-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ jobs:
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
where-should-client-connect-from: 'separate-docker-container'

- name: Run distro container
# Run distro container on host network to access the Aerospike server using localhost (without having to change config.conf)
Expand Down Expand Up @@ -194,6 +195,7 @@ jobs:
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
where-should-client-connect-from: 'docker-host'

- name: Install wheel
run: python3 -m pip install *.whl
Expand Down

0 comments on commit 0e7a577

Please sign in to comment.