-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add DruidContainers to run docker tests with embedded-test framework #18302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
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 bfd4f6a
Use correct image versions
kfaraz 3508e64
Clean up workflow
kfaraz 099c47b
Simplify DruidContainerResource
kfaraz a926d9c
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz 16b649e
Use URIBuilder for URIs, simplify deps
kfaraz 7965826
Use Arrays.toString
kfaraz 2006e4f
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz d35c36b
Add CliEventCollector as a custom node role
kfaraz e9eec86
Remove CliCustomNodeRole from revised ITs
kfaraz 2678c69
Add profile to run docker tests, skip them by default
kfaraz ac3df1e
Add more verifications
kfaraz 2ec86f4
Add PostgreSQLMetadataResource
kfaraz a0b7b63
Clean up
kfaraz 3654904
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz 14e3c6b
Add class EmbeddedHostname
kfaraz a9c1b23
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz 28c8dab
Fix compilation
kfaraz bf77c43
Remove event collector from DruidCommand
kfaraz 8ae997a
Comment fixes
kfaraz e81c1f8
Add IngestionSmokeTest, always run backward compat test
kfaraz 35c8d40
Merge branch 'master' of github.com:apache/druid into add_druid_conta…
kfaraz aba2e27
Remove conflicts
kfaraz 7178779
Fix typo in docker test workflow
kfaraz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/bin/bash | ||
|
|
||
| # 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. | ||
|
|
||
| # Runs Docker tests | ||
| # Requires environment variable DRUID_DIST_IMAGE_NAME | ||
|
|
||
| set -e | ||
|
|
||
| DRUID_IMAGE_NAME_ENV="DRUID_DIST_IMAGE_NAME" | ||
| DRUID_IMAGE_NAME=$DRUID_DIST_IMAGE_NAME | ||
|
|
||
| DRUID_IMAGE_SYS_PROPERTY="druid.testing.docker.image" | ||
|
|
||
| if [ -z "${DRUID_IMAGE_NAME}" ]; then | ||
| echo "ERROR!! Environment variable [$DRUID_IMAGE_NAME_ENV] not set!" | ||
| echo "Run 'export $DRUID_IMAGE_NAME_ENV=<druid-image-to-test>' to specify the image to use in the Docker tests." | ||
| exit 1 | ||
| else | ||
| echo "Running Docker tests with image[$DRUID_IMAGE_NAME]" | ||
| fi | ||
|
|
||
| OPTS+="-pl embedded-tests" | ||
| mvn -B $OPTS verify -Pdocker-tests -D$DRUID_IMAGE_SYS_PROPERTY=$DRUID_IMAGE_NAME "-DjfrProfilerArgLine=$JFR_PROFILER_ARG_LINE" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # 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: Set Docker image env var | ||
| run: echo "DRUID_DIST_IMAGE_NAME=apache/druid:docker-tests" >> $GITHUB_ENV | ||
| - name: Build the Docker image | ||
| run: DOCKER_BUILDKIT=1 docker build -t $DRUID_DIST_IMAGE_NAME -f distribution/docker/Dockerfile . | ||
| - name: Save Docker image to archive | ||
| run: | | ||
| 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: 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 Docker tests | ||
| id: run-it | ||
| run: .github/scripts/run_docker-tests | ||
| 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 | ||
|
|
||
| - 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 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.ymlsomehow: put it inside a script and configure the artifact collector to save that as well..