Skip to content

Commit 661b57c

Browse files
committed
Merge branch 'feature/workflow-build-images' into test/workflow-build-images
* feature/workflow-build-images: use the docker images from the github container registry fix
2 parents cdb0bfa + 0d7feed commit 661b57c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

.github/workflows/run-matrix.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
max-parallel: 10
2121
matrix:
2222
include: ${{ fromJSON(inputs.include) }}
23+
env:
24+
# These env variables are used in the docker-compose.yml and the run_tests.sh script.
25+
REGISTRY: ghcr.io
26+
IMAGE_NAME: ${{ github.repository }}/apm-agent-python-testing
2327
steps:
2428
- uses: actions/checkout@v4
2529
- name: Run tests

tests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ services:
185185
- zookeeper
186186

187187
run_tests:
188-
image: elasticobservability/apm-agent-python-testing:${PYTHON_VERSION}
188+
image: ${REGISTRY:-elasticobservability}/${IMAGE_NAME:-apm-agent-python-testing}:${PYTHON_VERSION}
189189
environment:
190190
ES_8_URL: 'http://elasticsearch8:9200'
191191
ES_7_URL: 'http://elasticsearch7:9200'

tests/scripts/docker/run_tests.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -ex
33

44
function cleanup {
5-
PYTHON_VERSION=${1} docker compose down -v
5+
PYTHON_VERSION=${1} REGISTRY=${REGISTRY} IMAGE_NAME=${IMAGE_NAME} docker compose down -v
66

77
if [[ $CODECOV_TOKEN ]]; then
88
cd ..
@@ -21,6 +21,8 @@ docker_pip_cache="/tmp/cache/pip"
2121
TEST="${1}/${2}"
2222
LOCAL_USER_ID=${LOCAL_USER_ID:=$(id -u)}
2323
LOCAL_GROUP_ID=${LOCAL_GROUP_ID:=$(id -g)}
24+
IMAGE_NAME=${IMAGE_NAME:-"apm-agent-python-testing"}
25+
REGISTRY=${REGISTRY:-"elasticobservability"}
2426

2527
cd tests
2628

@@ -42,18 +44,19 @@ echo "Running tests for ${1}/${2}"
4244

4345
if [[ -n $DOCKER_DEPS ]]
4446
then
45-
PYTHON_VERSION=${1} docker compose up -d ${DOCKER_DEPS}
47+
PYTHON_VERSION=${1} REGISTRY=${REGISTRY} IMAGE_NAME=${IMAGE_NAME} docker compose up -d ${DOCKER_DEPS}
4648
fi
4749

4850
# CASS_DRIVER_NO_EXTENSIONS is set so we don't build the Cassandra C-extensions,
4951
# as this can take several minutes
5052

5153
if ! ${CI}; then
54+
full_image_name="${REGISTRY}/${IMAGE_NAME}:${1}"
5255
DOCKER_BUILDKIT=1 docker build \
5356
--progress=plain \
54-
--cache-from="elasticobservability/apm-agent-python-testing:${1}" \
57+
--cache-from="${full_image_name}" \
5558
--build-arg PYTHON_IMAGE="${1/-/:}" \
56-
--tag "elasticobservability/apm-agent-python-testing:${1}" \
59+
--tag "${full_image_name}" \
5760
.
5861
fi
5962

@@ -67,6 +70,8 @@ PYTHON_VERSION=${1} docker compose run \
6770
-e WITH_COVERAGE=true \
6871
-e CASS_DRIVER_NO_EXTENSIONS=1 \
6972
-e PYTEST_JUNIT="--junitxml=/app/tests/docker-${1}-${2}-python-agent-junit.xml" \
73+
-e REGISTRY=${REGISTRY} \
74+
-e IMAGE_NAME=${IMAGE_NAME} \
7075
-v ${pip_cache}:$(dirname ${docker_pip_cache}) \
7176
-v "$(dirname $(pwd))":/app \
7277
--rm run_tests \

0 commit comments

Comments
 (0)