Skip to content

Commit

Permalink
Revert "Move refactoring work to another PR"
Browse files Browse the repository at this point in the history
This reverts commit 83e848f.
  • Loading branch information
juliannguyen4 committed May 22, 2024
1 parent cc53ebe commit 74f3f90
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 305 deletions.
37 changes: 0 additions & 37 deletions .github/actions/run-ee-server-for-ext-container/action.yml

This file was deleted.

51 changes: 21 additions & 30 deletions .github/actions/run-ee-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Install crudini to manipulate config.conf
run: pip3 install crudini -c requirements.txt
working-directory: .github/workflows
shell: bash

- name: Create config.conf
run: cp config.conf.template config.conf
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
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
shell: bash

- name: Use release server
if: ${{ inputs.use-server-rc == 'false' }}
run: echo "SERVER_IMAGE=aerospike/aerospike-server-enterprise" >> $GITHUB_ENV
Expand All @@ -56,13 +33,27 @@ runs:
run: docker login --username ${{ inputs.docker-hub-username }} --password ${{ inputs.docker-hub-password }}
shell: bash

- name: Get default aerospike.conf from Docker server EE container
run: |
docker run -d --name aerospike -p 3000-3002:3000-3002 $SERVER_IMAGE:${{ inputs.server-tag }}
sleep 5
docker cp aerospike:/etc/aerospike/aerospike.conf ./configs/aerospike.conf
docker container stop aerospike
docker container rm aerospike
- name: Run EE server from Docker image
run: docker run -d --name aerospike -p 3000-3002:3000-3002 $SERVER_IMAGE:${{ inputs.server-tag }}

- name: Wait for EE server to start
run: sleep 5

- name: Create config folder to store configs in
# Cannot create parent directories using docker cp
# https://docs.docker.com/reference/cli/docker/container/cp/
run: mkdir configs
shell: bash

- name: Grab default aerospike.conf from EE server
run: docker cp aerospike:/etc/aerospike/aerospike.conf ./configs/aerospike.conf

- name: Stop EE server
run: docker container stop aerospike
shell: bash

- name: Remove EE server
run: docker container rm aerospike
shell: bash

- name: Enable security features using aerospike.conf
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/setup-docker-on-macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Install Docker on macOS runner'
description: 'Install Docker using colima'

runs:
using: "composite"
steps:
- name: Install Docker Engine
run: brew install colima
shell: bash

- name: Install Docker client
run: brew install docker
shell: bash

- name: Start Docker Engine
run: colima start
shell: bash
139 changes: 45 additions & 94 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ on:
required: false
type: boolean
default: false
# See comment about this hack in
is_workflow_call:
type: boolean
default: true
required: false
secrets:
DOCKER_HUB_BOT_USERNAME:
required: false
Expand Down Expand Up @@ -125,8 +130,8 @@ jobs:
status: ${{ job.status }}
context: "Build wheels (sdist)"

manylinux:
runs-on: ubuntu-22.04
manylinux_and_macos:
runs-on: ${{ matrix.os-and-wheel-identifier[0] }}
strategy:
fail-fast: false
matrix:
Expand All @@ -138,32 +143,49 @@ jobs:
"cp311",
"cp312"
]
platform: [
arch: [
"x86_64",
"aarch64"
]
# Need to pair these together
os-and-wheel-identifier: [
["ubuntu-22.04", "manylinux"],
["macos-12-large", "macos"]
]
exclude:
# We have a separate job for macOS M1 builds
# because we cannot use cibuildwheel on the self hosted runners (yet)
- arch: aarch64
os-and-wheel-identifier: ["macos-12-large", "macos"]

steps:
- name: Show job status for commit
uses: myrotvorets/set-commit-status-action@v2.0.0
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ github.sha }}
context: "Build wheels (${{ matrix.python }}-manylinux_${{ matrix.platform }})"
context: "Build wheels (${{ env.BUILD_IDENTIFIER }})"

- name: Get build identifier for cibuildwheel
run: echo "BUILD_IDENTIFIER=${{ matrix.python }}-${{ matrix.os-and-wheel-identifier[1] }}_${{ matrix.arch }}" >> $GITHUB_ENV

- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ inputs.ref }}
# We need the last tag before the ref, so we can relabel the version if needed
fetch-depth: 0

- name: Set up QEMU for cross compiling arm64
if: ${{ matrix.platform == 'aarch64' }}
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- uses: ./.github/actions/run-ee-server-for-ext-container
- uses: ./.github/actions/setup-docker-on-macos
if: ${{ inputs.run_tests && matrix.os-and-wheel-identifier[1] == 'macos' && inputs.test-macos-x86 }}

- uses: ./.github/actions/run-ee-server
if: ${{ inputs.run_tests }}
with:
use-server-rc: ${{ inputs.use-server-rc }}
Expand All @@ -183,17 +205,32 @@ jobs:
if: ${{ inputs.apply-no-optimizations }}
run: echo "UNOPTIMIZED=1" >> $GITHUB_ENV

- name: Set include dsym flag
if: ${{ matrix.os-and-wheel-identifier[1] == 'macos' && inputs.include-debug-info-for-macos }}
run: echo "INCLUDE_DSYM=1" >> $GITHUB_ENV

- uses: haya14busa/action-cond@v1
id: test-command
with:
cond: ${{ inputs.run_tests && (matrix.os-and-wheel-identifier[1] != 'macos' || inputs.test-macos-x86) }}
if_true: "cd {project}/test/ && pip install -r requirements.txt && python -m pytest new_tests/"
if_false: "python -c 'import aerospike'"

- name: Disable tests (only run basic import test)
run: echo "TEST_COMMAND=${{ steps.test-command.outputs.value }}" >> $GITHUB_ENV

- name: Build wheel
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_ENVIRONMENT_PASS_LINUX: ${{ inputs.apply-no-optimizations && 'UNOPTIMIZED' || '' }}
CIBW_BUILD: ${{ matrix.python }}-manylinux_${{ matrix.platform }}
CIBW_ENVIRONMENT_MACOS: SSL_LIB_PATH="$(brew --prefix openssl@1.1)/lib/" CPATH="$(brew --prefix openssl@1.1)/include/" STATIC_SSL=1
CIBW_BUILD: ${{ env.BUILD_IDENTIFIER }}
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_ALL_LINUX: >
yum install openssl-devel -y &&
yum install python-devel -y &&
yum install python-setuptools -y
CIBW_ARCHS: "${{ matrix.platform }}"
CIBW_ARCHS: "${{ matrix.arch }}"
CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }}

- name: Upload wheels to GitHub
Expand All @@ -211,92 +248,6 @@ jobs:
status: ${{ job.status }}
context: "Build wheels (${{ matrix.python }}-manylinux_${{ matrix.platform }})"

macOS-x86:
strategy:
fail-fast: false
matrix:
python: [
"cp38",
"cp39",
"cp310",
"cp311",
"cp312"
]
runs-on: macos-12-large
steps:
- name: Show job status for commit
uses: myrotvorets/set-commit-status-action@v2.0.0
if: ${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
sha: ${{ github.sha }}
context: "Build wheels (${{ matrix.python }}-macosx_x86_64)"

- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ inputs.ref }}
fetch-depth: 0

- name: Install Docker Engine
if: ${{ inputs.run_tests }}
run: brew install colima

- name: Install Docker client
if: ${{ inputs.run_tests }}
run: brew install docker

- name: Start Docker Engine
if: ${{ inputs.run_tests }}
run: colima start

- uses: ./.github/actions/run-ee-server
if: ${{ inputs.run_tests }}
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: Enable tests
if: ${{ inputs.run_tests && inputs.test-macos-x86 }}
run: echo "TEST_COMMAND=cd {project}/test/ && pip install -r requirements.txt && python -m pytest new_tests/" >> $GITHUB_ENV

- name: Disable tests (only run basic import test)
if: ${{ !inputs.run_tests || !inputs.test-macos-x86 }}
run: echo "TEST_COMMAND=python -c 'import aerospike'" >> $GITHUB_ENV

- name: Set unoptimize flag
if: ${{ inputs.apply-no-optimizations }}
run: echo "UNOPTIMIZED=1" >> $GITHUB_ENV

- name: Set include dsym flag
if: ${{ inputs.include-debug-info-for-macos }}
run: echo "INCLUDE_DSYM=1" >> $GITHUB_ENV

- name: Build wheel
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_BUILD: ${{ matrix.python }}-macosx_x86_64
CIBW_BUILD_FRONTEND: build
CIBW_ENVIRONMENT: SSL_LIB_PATH="$(brew --prefix openssl@1.1)/lib/" CPATH="$(brew --prefix openssl@1.1)/include/" STATIC_SSL=1
CIBW_ARCHS: "x86_64"
CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }}

- name: Save macOS wheel
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: ${{ matrix.python }}-macosx_x86_64.build
path: wheelhouse/*.whl

- name: Set final commit status
uses: myrotvorets/set-commit-status-action@v2.0.0
if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }}
with:
status: ${{ job.status }}
sha: ${{ github.sha }}
context: "Build wheels (${{ matrix.python }}-macosx_x86_64)"

macOS-m1:
runs-on: [
self-hosted,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
parver==0.5
crudini==0.9.4
delocate==0.10.4
mypy==1.10.0
9 changes: 1 addition & 8 deletions .github/workflows/stage-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,7 @@ jobs:
with:
python-version: ${{ matrix.python-version[0] }}

- name: Install Docker Engine
run: brew install colima

- name: Install Docker client
run: brew install docker

- name: Start Docker Engine
run: colima start
- uses: ./.github/actions/setup-docker-on-macos

- uses: ./.github/actions/run-ee-server
with:
Expand Down
Loading

0 comments on commit 74f3f90

Please sign in to comment.