@@ -4,88 +4,73 @@ description: 'Run EE server. Returns once server is ready. Only tested on Linux
44# since it's using the default admin / admin credentials
55inputs :
66 # All inputs in composite actions are strings
7- use-server-rc :
8- required : true
9- description : Deploy server release candidate?
10- default : ' false'
11- server-tag :
12- required : true
13- description : Specify Docker tag
14- default : ' latest'
7+ registry-name :
8+ description : Registry name
9+ required : false
10+ default : docker.io
11+ registry-username :
12+ description : Required for using release candidates
13+ required : false
1514 # Github Composite Actions can't access secrets
1615 # so we need to pass them in as inputs
17- docker-hub-username :
16+ registry-password :
1817 description : Required for using release candidates
1918 required : false
20- docker-hub-password :
21- description : Required for using release candidates
19+ image-name :
2220 required : false
21+ description : aerospike/aerospike-server-enterprise
22+ default : ' aerospike/aerospike-server-enterprise'
23+ server-tag :
24+ required : true
25+ description : Specify Docker tag
26+ default : ' latest'
2327 where-is-client-connecting-from :
2428 required : false
2529 description : ' docker-host, separate-docker-container, "remote-connection" via DOCKER_HOST'
2630 default : ' docker-host'
31+ env-vars :
32+ required : false
33+ description : Used to disable server features
34+ default : ' STRONG_CONSISTENCY=1 SECURITY=1 MUTUAL_TLS=1'
2735
2836runs :
2937 using : " composite"
3038 steps :
3139 # Start up server
3240
33- - name : Log into Docker Hub to get server RC
34- if : ${{ inputs.use-server-rc == 'true' }}
35- run : docker login --username ${{ inputs.docker-hub-username }} --password ${{ inputs.docker-hub-password }}
36- shell : bash
37-
38- - run : echo IMAGE_NAME=aerospike/aerospike-server-enterprise${{ inputs.use-server-rc == 'true' && '-rc' || '' }}: ${{ inputs.server-tag }} >> $GITHUB_ENV
39- shell : bash
41+ - name : Log into registry to get non-public server RCs
42+ # We can still pull public images while logged in, so just do this all the time to make things simple
43+ uses : docker/ login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
44+ with :
45+ registry : ${{ inputs.registry-name }}
46+ username : ${{ inputs.registry-username }}
47+ password : ${{ inputs.registry-password }}
4048
41- - run : echo NEW_IMAGE_NAME =${{ env.IMAGE_NAME }}-python-client-testing >> $GITHUB_ENV
49+ - run : echo IMAGE_FULL_NAME =${{ inputs.registry-name }}/${{ inputs.image-name }}:${{ inputs.server-tag }} >> $GITHUB_ENV
4250 shell : bash
4351
44- # macOS Github runners and Windows self-hosted runners don't have buildx installed by default
45- - if : ${{ runner.os == 'Windows' || runner.os == 'macOS' }}
46- uses : docker/setup-buildx-action@v3
47-
4852 - run : echo CA_CERT_FILE_NAME="ca.cer" >> $GITHUB_ENV
4953 shell : bash
5054
5155 - run : echo TLS_PORT="4333" >> $GITHUB_ENV
5256 shell : bash
5357
54- - name : Build Aerospike server Docker image for testing
55- # We enable TLS standard authentication to verify that the OpenSSL library bundled with the wheel works
56- # You can manually verify this by enabling debug logging in the client and checking that the server certificate was verified
57- uses : docker/build-push-action@v6
58- with :
59- # Don't want to use default Git context or else it will clone the whole Python client repo again
60- context : .github/workflows/docker-build-context
61- build-args : |
62- SERVER_IMAGE=${{ env.IMAGE_NAME }}
63- TLS_PORT=${{ env.TLS_PORT }}
64- tags : ${{ env.NEW_IMAGE_NAME }}
65- # setup-buildx-action configures Docker to use the docker-container build driver
66- # This driver doesn't publish an image locally by default
67- # so we have to manually enable it
68- load : true
69-
70- - run : echo SERVER_CONTAINER_NAME="aerospike" >> $GITHUB_ENV
71- shell : bash
72-
73- - run : docker run -d --name ${{ env.SERVER_CONTAINER_NAME }} -p 3000:3000 -p ${{ env.TLS_PORT }}:${{ env.TLS_PORT }} ${{ env.NEW_IMAGE_NAME }}
74- shell : bash
75-
7658 - name : ' macOS: install timeout command'
7759 if : ${{ runner.os == 'macOS' }}
7860 run : brew install coreutils
7961 shell : bash
8062
81- - name : Wait for container to be healthy
82- run : |
83- timeout 30s bash -c 'until [[ "$(docker inspect -f {{.State.Health.Status}} ${{ env.SERVER_CONTAINER_NAME }})" == "healthy" ]]; do sleep 0.1; done'
63+ # Github composite actions don't support env variables for the whole composite action,
64+ # so this is a workaround
65+ - id : get-container-name
66+ run : echo container-name=aerospike >> $GITHUB_OUTPUT
8467 shell : bash
8568
86- # For debugging
87- - run : docker logs ${{ env.SERVER_CONTAINER_NAME }}
69+ - run : ${{ inputs.env-vars }} bash ./run-ee-server.bash
70+ working-directory : .github/workflows/docker-setup
8871 shell : bash
72+ env :
73+ CONTAINER_NAME : ${{ steps.get-container-name.outputs.container-name }}
8974
9075 # Configure tests
9176
@@ -113,7 +98,10 @@ runs:
11398 crudini --existing=param --set config.conf enterprise-edition password ${{ env.SUPERUSER_NAME_AND_PASSWORD }}
11499 crudini --set config.conf tls enable true
115100 # Cannot use abs path because config.conf is copied into Docker container during cibuildwheel tests
116- crudini --set config.conf tls cafile ../.github/workflows/docker-build-context/${{ env.CA_CERT_FILE_NAME }}
101+ crudini --set config.conf tls cafile ../.github/workflows/docker-setup/${{ env.CA_CERT_FILE_NAME }}
102+ crudini --set config.conf tls keyfile ../.github/workflows/docker-setup/client.pem
103+ crudini --set config.conf tls certfile ../.github/workflows/docker-setup/client.cer
104+
117105 working-directory : test
118106 shell : bash
119107
@@ -133,19 +121,19 @@ runs:
133121
134122 - name : Set IP address to Docker container for the server
135123 if : ${{ inputs.where-is-client-connecting-from == 'separate-docker-container' }}
136- run : echo SERVER_IP=$(docker container inspect -f '{{ .NetworkSettings.IPAddress }}' ${{ env.SERVER_CONTAINER_NAME }}) >> $GITHUB_ENV
124+ run : echo SERVER_IP=$(docker container inspect -f '{{ .NetworkSettings.IPAddress }}' ${{ steps.get-container-name.outputs.container-name }}) >> $GITHUB_ENV
137125 shell : bash
138126
139127 - name : Invalid input
140128 if : ${{ env.SERVER_IP == '' }}
141129 run : exit 1
142130 shell : bash
143131
144- - name : Get cluster name
145- run : echo CLUSTER_NAME=$(docker exec ${{ env.SERVER_CONTAINER_NAME }} asinfo -v "get-config:context=service" -l | grep -i cluster-name | cut -d = -f 2) >> $GITHUB_ENV
146- shell : bash
147-
148- - name : Set EE server's IP address
149- run : crudini --existing=param --set config.conf enterprise-edition hosts "${{ env.SERVER_IP }}:${{ env.TLS_PORT }}|${{ env.CLUSTER_NAME } }"
132+ # Here we just assume that TLS is enabled. Whenever the dev tests are run with run-ee-server.yml, TLS is enabled anyways.
133+ # TODO: but this needs to be fixed eventually for other clients that disable TLS for their tests.
134+ - name : Set EE server's IP address and TLS name for test config
135+ run : |
136+ cluster_name=$(docker run --rm --network host aerospike/aerospike-tools asinfo -U admin -P admin -v "get-config:context=service" -l | grep -i cluster-name | cut -d = -f 2)
137+ crudini --existing=param --set config.conf enterprise-edition hosts "${{ env.SERVER_IP }}:${{ env.TLS_PORT }}|${cluster_name }"
150138 working-directory : test
151139 shell : bash
0 commit comments