Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a7698e3
Add DruidContainers to run docker tests with embedded-test framework
kfaraz Jul 21, 2025
bfd4f6a
Use correct image versions
kfaraz Jul 21, 2025
3508e64
Clean up workflow
kfaraz Jul 28, 2025
099c47b
Simplify DruidContainerResource
kfaraz Jul 28, 2025
a926d9c
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz Jul 29, 2025
16b649e
Use URIBuilder for URIs, simplify deps
kfaraz Jul 29, 2025
7965826
Use Arrays.toString
kfaraz Jul 29, 2025
2006e4f
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz Jul 29, 2025
d35c36b
Add CliEventCollector as a custom node role
kfaraz Jul 30, 2025
e9eec86
Remove CliCustomNodeRole from revised ITs
kfaraz Jul 30, 2025
2678c69
Add profile to run docker tests, skip them by default
kfaraz Jul 31, 2025
ac3df1e
Add more verifications
kfaraz Jul 31, 2025
2ec86f4
Add PostgreSQLMetadataResource
kfaraz Aug 1, 2025
a0b7b63
Clean up
kfaraz Aug 1, 2025
3654904
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz Aug 1, 2025
14e3c6b
Add class EmbeddedHostname
kfaraz Aug 1, 2025
a9c1b23
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz Aug 2, 2025
28c8dab
Fix compilation
kfaraz Aug 2, 2025
bf77c43
Remove event collector from DruidCommand
kfaraz Aug 4, 2025
8ae997a
Comment fixes
kfaraz Aug 6, 2025
e81c1f8
Add IngestionSmokeTest, always run backward compat test
kfaraz Aug 7, 2025
35c8d40
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz Aug 7, 2025
aba2e27
Remove conflicts
kfaraz Aug 7, 2025
7178779
Fix typo in docker test workflow
kfaraz Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/scripts/distribution_checks_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

export DRUID_DIST_IMAGE_NAME=apache/druid:35.0.0-SNAPSHOT
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
pattern: [ "C*", "H*,U*,V*", "N*,Q*,S*", "B*,O*,R*", "G*,J*,K*", "F*,L*,M*", "A*,D*,I*,X*,Y*,Z*", "E*,P*,T*,W*"]
uses: ./.github/workflows/worker.yml
with:
script: .github/scripts/run_unit-tests -Dtest=!QTest,'${{ matrix.pattern }}' -Dmaven.test.failure.ignore=true
script: .github/scripts/run_unit-tests -Dtest=!QTest,!*DockerTest*,'${{ matrix.pattern }}' -Dmaven.test.failure.ignore=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quilty of not moving the QTest into the validation phase ; which seem to have given rise to this pattern which could be considered bad practice

this is not really serious...it could be fixed separaetly - but nicely outlines your requirement that you just wanted to add 1 more test....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Please check the latest comments.

jdk: 17
artifact_prefix: "unit-test-reports"
key: "test-jdk17-[${{ matrix.pattern }}]"
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
pattern: [ "C*", "H*,U*,V*", "N*,Q*,S*", "B*,O*,R*", "G*,J*,K*", "F*,L*,M*", "A*,D*,I*,X*,Y*,Z*", "E*,P*,T*,W*"]
uses: ./.github/workflows/worker.yml
with:
script: .github/scripts/run_unit-tests -Dtest=!QTest,'${{ matrix.pattern }}' -fae
script: .github/scripts/run_unit-tests -Dtest=!QTest,!*DockerTest*,'${{ matrix.pattern }}' -fae
jdk: ${{ matrix.jdk }}
key: "test-jdk${{ matrix.jdk }}-[${{ matrix.pattern }}]"

Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/distribution-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: DOCKER_BUILDKIT=1 docker build -t apache/druid:tag -f distribution/docker/Dockerfile .
run: |
source .github/scripts/distribution_checks_env.sh
DOCKER_BUILDKIT=1 docker build -t $DRUID_DIST_IMAGE_NAME -f distribution/docker/Dockerfile .
- name: Save Docker image to archive
run: |
source .github/scripts/distribution_checks_env.sh
echo "Saving image $DRUID_DIST_IMAGE_NAME in archive druid-dist-container.tar.gz"
docker save "$DRUID_DIST_IMAGE_NAME" | gzip > druid-dist-container.tar.gz
- name: Cache Docker image
id: docker_dist_container
uses: actions/cache@v4
with:
key: druid-dist-container.tar.gz-${{ github.sha }}
path: |
./druid-dist-container.tar.gz
- name: Upload Docker image as artifact
uses: actions/upload-artifact@v4
with:
name: docker-image-${{ github.sha }}
path: druid-dist-container.tar.gz
97 changes: 97 additions & 0 deletions .github/workflows/docker-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Docker Tests using Distribution Image"
on:
workflow_call:

jobs:
run-docker-tests:
name: Run Docker tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve Docker container
id: docker-restore
uses: actions/cache/restore@v4
with:
key: druid-dist-container.tar.gz-${{ github.sha }}
path: |
./druid-dist-container.tar.gz
- name: Stop and remove Druid Docker containers
run: |
echo "Force stopping all Druid containers and pruning"
docker ps -aq --filter "ancestor=apache/druid" | xargs -r docker rm -f
docker system prune -af --volumes
- name: Load Docker image
run: |
docker load --input druid-dist-container.tar.gz
docker images
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
cache: 'maven'
- name: Run *DockerTest*
id: run-it
run: |
source .github/scripts/distribution_checks_env.sh
.github/scripts/run_unit-tests -Dtest=*DockerTest* -Ddruid.testing.docker.image=$DRUID_DIST_IMAGE_NAME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of trying to reuse the run_unit-tests script; you could possibly make a separate one for this; and run that (you could still invode run_unit-tests from there if you want)

you should preferrably also use the worker.yml to run it....that way if you want to test the workflow you could just try to run that script on your own machine!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of trying to reuse the run_unit-tests script; you could possibly make a separate one for this; and run that (you could still invode run_unit-tests from there if you want)

Could you please elaborate? What would be the advantage of putting this in a separate script if we would still invoke run_unit-tests from there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could run it locally to reproduce what's happening on the CI; you could call mvn directly; but you will also need to build the image...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added script run_docker-tests. To run all Docker tests locally,

$ DRUID_DIST_IMAGE_NAME=apache/druid:34.0.0-rc1 .github/scripts/run_docker-tests

This doesn't include the image building yet though.

timeout-minutes: 60

- name: Collect docker logs on failure
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
run: |
mkdir docker-logs
for c in $(docker ps -a --format="{{.Names}}")
do
docker logs $c > ./docker-logs/$c.log
done
Comment on lines +54 to +61
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you integrate this into the worker.yml somehow: put it inside a script and configure the artifact collector to save that as well..

- name: Tar docker logs
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
run: tar cvzf ./docker-logs.tgz ./docker-logs

- name: Upload docker logs to GitHub
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: failure-docker-logs
path: docker-logs.tgz

- name: Collect service logs on failure
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
run: |
tar cvzf ./service-logs.tgz /tmp/embedded-tests
- name: Upload Druid service logs to GitHub
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: failure-service-logs
path: service-logs.tgz

- name: Collect surefire reports on failure
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
run: |
tar cvzf ./surefire-logs.tgz ./embedded-tests/target/surefire-reports
- name: Upload surefire reports to GitHub
if: ${{ failure() && steps.run-it.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: failure-surefire-logs
path: surefire-logs.tgz
6 changes: 5 additions & 1 deletion .github/workflows/unit-and-integration-tests-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ jobs:
DRUID_PREVIOUS_VERSION_DOWNLOAD_URL: ${{ needs.set-env-var.outputs.DRUID_PREVIOUS_VERSION_DOWNLOAD_URL }}
DRUID_PREVIOUS_IT_IMAGE_NAME: ${{ needs.set-env-var.outputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}

docker-tests:
needs: [build]
uses: ./.github/workflows/docker-tests.yml

actions-timeline:
needs: [build, unit-tests, revised-its, standard-its]
needs: [build, unit-tests, revised-its, standard-its, docker-tests]
runs-on: ubuntu-latest
if: ${{ !cancelled() }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions embedded-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.druid.extensions</groupId>
<artifactId>druid-testcontainers</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down
Loading