Skip to content
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

Upgrade testcontainers #261

Merged
merged 1 commit into from
Oct 16, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class FlyteSandboxClient {
public static FlyteSandboxClient create() {
String version = String.valueOf(System.currentTimeMillis());

String address = FlyteSandboxContainer.INSTANCE.getContainerIpAddress();
Copy link
Member Author

Choose a reason for hiding this comment

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

Deprecated.

String address = FlyteSandboxContainer.INSTANCE.getHost();
int port = FlyteSandboxContainer.INSTANCE.getMappedPort(30081);

ManagedChannel channel =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ private static void startContainer() {
IOUtils.copy(imageInputStream, outputStream);
}

// for some reason, when running on Mac, the above copied file is not fully ready after the
// stream being closed; sleeping a little bit could work around that
Thread.sleep(1000);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is pretty strange and it is not about unflushed stream because I tried.


ExecResult execResult =
INSTANCE.execInContainer(
"docker", "load", "-i", "integration-tests/target/jflyte.tar.gz");
Expand Down Expand Up @@ -106,9 +110,8 @@ public void start() {

logger().info("Flyte is ready!");

String consoleUri =
Copy link
Member Author

Choose a reason for hiding this comment

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

Deprecated.

String.format("http://%s:%d/console", getContainerIpAddress(), getMappedPort(30081));
String k8sUri = String.format("http://%s:%d", getContainerIpAddress(), getMappedPort(30082));
String consoleUri = String.format("http://%s:%d/console", getHost(), getMappedPort(30081));
String k8sUri = String.format("http://%s:%d", getHost(), getMappedPort(30082));

logger().info("Flyte UI is available at " + consoleUri);
logger().info("K8s dashboard is available at " + k8sUri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.junit.rules.ExternalResource;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.containers.Network;
import org.testcontainers.utility.ResourceReaper;

// see https://github.com/testcontainers/testcontainers-java/issues/3081

Expand Down Expand Up @@ -79,7 +78,7 @@ protected void after() {
@Override
public void close() {
if (initialized.getAndSet(false)) {
ResourceReaper.instance().removeNetworkById(NAME);
Copy link
Member Author

Choose a reason for hiding this comment

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

Deprecated.

DockerClientFactory.instance().client().removeNetworkCmd(NAME).exec();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.util.IOUtils;
Expand Down Expand Up @@ -52,8 +55,12 @@ public class S3FileSystemIT {
public void setUp() {
s3 =
AmazonS3ClientBuilder.standard()
.withEndpointConfiguration(localStack.getEndpointConfiguration(S3))
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed methods.

.withCredentials(localStack.getDefaultCredentialsProvider())
.withEndpointConfiguration(
new EndpointConfiguration(
localStack.getEndpointOverride(S3).toString(), localStack.getRegion()))
.withCredentials(
new AWSStaticCredentialsProvider(
new BasicAWSCredentials(localStack.getAccessKey(), localStack.getSecretKey())))
.build();

s3.createBucket("flyteorg");
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.8.0</version>
<version>5.12.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
Expand All @@ -400,7 +400,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>1.15.3</version>
<version>1.19.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Loading