-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Prefetch Ryuk image with retries #13639
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -458,6 +458,9 @@ jobs: | |
| run: | | ||
| export MAVEN_OPTS="${MAVEN_INSTALL_OPTS}" | ||
| $RETRY $MAVEN clean install ${MAVEN_FAST_INSTALL} ${MAVEN_GIB} -am -pl "${{ matrix.modules }}" | ||
| - name: Prefetch Ryuk | ||
| run: | | ||
| $RETRY docker pull "$(cat testing/trino-testing-containers/src/main/resources/io/trino/testing/containers/testcontainers-ryuk-image.txt)" | ||
|
||
| - name: Maven Tests | ||
| if: matrix.modules != 'plugin/trino-singlestore' | ||
| run: $MAVEN test ${MAVEN_TEST} -pl ${{ matrix.modules }} ${{ matrix.profile != '' && format('-P {0}', matrix.profile) || '' }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| testcontainers/ryuk:0.3.3 |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * Licensed 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. | ||
| */ | ||
| package io.trino.testing.containers; | ||
|
|
||
| import com.github.dockerjava.api.model.Container; | ||
| import com.google.common.io.Resources; | ||
| import org.testcontainers.DockerClientFactory; | ||
| import org.testcontainers.utility.ResourceReaper; | ||
| import org.testng.annotations.Test; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import static com.google.common.collect.Iterables.getOnlyElement; | ||
| import static java.nio.charset.StandardCharsets.UTF_8; | ||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
||
| public class TestRyukVersion | ||
| { | ||
| @Test | ||
| public void testRyukVersionResourceFile() | ||
| throws Exception | ||
| { | ||
| ResourceReaper.instance(); | ||
| List<Container> containers = DockerClientFactory.instance().client() | ||
| .listContainersCmd().withNameFilter(List.of("testcontainers-ryuk-" + DockerClientFactory.SESSION_ID)) | ||
| .exec(); | ||
| assertThat(containers).as("containers") | ||
| .hasSize(1); | ||
|
|
||
| String currentImage = getOnlyElement(containers).getImage(); | ||
| // Sanity check the value we get from testcontainers includes version | ||
| assertThat(currentImage).as("currentImage") | ||
| .matches("testcontainers/ryuk:(.+)") | ||
| .doesNotContain("latest"); | ||
|
|
||
| String ryukImageFromResource = Resources.toString(Resources.getResource(getClass(), "testcontainers-ryuk-currentImage.txt"), UTF_8).trim(); | ||
| assertThat(ryukImageFromResource).as("ryukImageFromResource") | ||
| .isEqualTo(currentImage); | ||
| } | ||
| } |
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.
This change is not going to help:(
We blame ryuk because it is downloaded first. I disabled downloading ryuk in the past and it was still failing on other images.
If we could pre-download images before running tests then we would avoid flakiness of docker registries. Cc @ppalucha
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.
you're right.
Maybe if we retry long enough to download ryuk we cover for the short unavailability of the docker hub.
So it depends on the unavailability pattern (total vs % requests dropped).
Also, wonder whether testcontainers library does / can do retries for all images it downloads.
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.
testcontainers/testcontainers-java#5760