Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ jobs:
run: |
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We blame ryuk because it is downloaded first.

you're right.

I disabled downloading ryuk in the past and it was still failing on other images.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also, wonder whether testcontainers library does / can do retries for all images it downloads.

testcontainers/testcontainers-java#5760

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)"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@nineinchnick how i should add this to ci.yml?
where else i should add this?

PTs for sure, others?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IIRC @nineinchnick is working on a change that will extract common code to separate step extracted as separate file. Then it will be easy to add such changes

- name: Maven Tests
if: matrix.modules != 'plugin/trino-singlestore'
run: $MAVEN test ${MAVEN_TEST} -pl ${{ matrix.modules }} ${{ matrix.profile != '' && format('-P {0}', matrix.profile) || '' }}
Expand Down
6 changes: 6 additions & 0 deletions testing/trino-testing-containers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
<artifactId>testcontainers</artifactId>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
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);
}
}