-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1404c44
commit 3a27cfa
Showing
12 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -50,6 +50,7 @@ body: | |
- Oracle Free | ||
- Oracle XE | ||
- OrientDB | ||
- Pinecone | ||
- PostgreSQL | ||
- Presto | ||
- Pulsar | ||
|
This file contains 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 |
---|---|---|
|
@@ -50,6 +50,7 @@ body: | |
- Oracle Free | ||
- Oracle XE | ||
- OrientDB | ||
- Pinecone | ||
- PostgreSQL | ||
- Presto | ||
- Pulsar | ||
|
This file contains 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 |
---|---|---|
|
@@ -50,6 +50,7 @@ body: | |
- Oracle Free | ||
- Oracle XE | ||
- OrientDB | ||
- Pinecone | ||
- PostgreSQL | ||
- Qdrant | ||
- QuestDB | ||
|
This file contains 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 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 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 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,30 @@ | ||
# Pinecone | ||
|
||
Testcontainers module for [Pinecone](https://github.com/orgs/pinecone-io/packages/container/package/pinecone-local). | ||
|
||
## PineconeContainer's usage examples | ||
|
||
You can start an Pinecone container instance from any Java application by using: | ||
|
||
<!--codeinclude--> | ||
[Pinecone container](../../modules/pinecone/src/test/java/org/testcontainers/pinecone/PineconeContainerTest.java) inside_block:container | ||
<!--/codeinclude--> | ||
|
||
## Adding this module to your project dependencies | ||
|
||
Add the following dependency to your `pom.xml`/`build.gradle` file: | ||
|
||
=== "Gradle" | ||
```groovy | ||
testImplementation "org.testcontainers:pinecone:{{latest_version}}" | ||
``` | ||
|
||
=== "Maven" | ||
```xml | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>pinecone</artifactId> | ||
<version>{{latest_version}}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
``` |
This file contains 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 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,8 @@ | ||
description = "Testcontainers :: ActiveMQ" | ||
|
||
dependencies { | ||
api project(':testcontainers') | ||
|
||
testImplementation 'org.assertj:assertj-core:3.26.3' | ||
testImplementation 'io.pinecone:pinecone-client:3.1.0' | ||
} |
29 changes: 29 additions & 0 deletions
29
modules/pinecone/src/main/java/org/testcontainers/pinecone/PineconeContainer.java
This file contains 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,29 @@ | ||
package org.testcontainers.pinecone; | ||
|
||
import org.testcontainers.containers.GenericContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
public class PineconeContainer extends GenericContainer<PineconeContainer> { | ||
|
||
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse( | ||
"ghcr.io/pinecone-io/pinecone-local" | ||
); | ||
|
||
private static final int PORT = 5080; | ||
|
||
public PineconeContainer(String dockerImageName) { | ||
this(DockerImageName.parse(dockerImageName)); | ||
} | ||
|
||
public PineconeContainer(DockerImageName dockerImageName) { | ||
super(dockerImageName); | ||
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); | ||
|
||
withEnv("PORT", String.valueOf(5080)); | ||
withExposedPorts(5080); | ||
} | ||
|
||
public String getEndpoint() { | ||
return "http://" + getHost() + ":" + getMappedPort(PORT); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
modules/pinecone/src/test/java/org/testcontainers/pinecone/PineconeContainerTest.java
This file contains 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,33 @@ | ||
package org.testcontainers.pinecone; | ||
|
||
import io.pinecone.clients.Pinecone; | ||
import org.junit.Test; | ||
import org.openapitools.db_control.client.model.DeletionProtection; | ||
import org.openapitools.db_control.client.model.IndexModel; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class PineconeContainerTest { | ||
|
||
@Test | ||
public void testSimple() { | ||
try ( // container { | ||
PineconeContainer container = new PineconeContainer("ghcr.io/pinecone-io/pinecone-local:v0.7.0") | ||
// } | ||
) { | ||
container.start(); | ||
|
||
// client { | ||
Pinecone pinecone = new Pinecone.Builder("pclocal") | ||
.withHost(container.getEndpoint()) | ||
.withTlsEnabled(false) | ||
.build(); | ||
// } | ||
|
||
String indexName = "example-index"; | ||
pinecone.createServerlessIndex(indexName, "cosine", 2, "aws", "us-east-1", DeletionProtection.DISABLED); | ||
IndexModel indexModel = pinecone.describeIndex(indexName); | ||
assertThat(indexModel.getDeletionProtection()).isEqualTo(DeletionProtection.DISABLED); | ||
} | ||
} | ||
} |
This file contains 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,16 @@ | ||
<configuration> | ||
|
||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<!-- encoders are assigned the type | ||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | ||
<encoder> | ||
<pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
|
||
<logger name="org.testcontainers" level="INFO"/> | ||
</configuration> |