Skip to content

Commit

Permalink
Merge pull request #5222 from inception-project/refactoring/5078-Upgr…
Browse files Browse the repository at this point in the history
…ade-dependencies

#5078 - Upgrade dependencies
  • Loading branch information
reckart authored Jan 12, 2025
2 parents fdf9a61 + 686b383 commit eece3dc
Show file tree
Hide file tree
Showing 37 changed files with 26,385 additions and 12,552 deletions.
5 changes: 5 additions & 0 deletions inception/inception-app-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,11 @@
<artifactId>mock-oauth2-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spring:
max-age: 31536000

datasource:
url: ${database.url:${INCEPTION_DB_URL:jdbc:hsqldb:file:${inception.home:${user.home}/.inception}/db/inception;hsqldb.default_table_type=cached}}
url: ${database.url:${INCEPTION_DB_URL:jdbc:hsqldb:file:${inception.home:${user.home}/.inception}/db/inception;hsqldb.default_table_type=cached;hsqldb.tx=mvcc}}
username: ${database.username:${INCEPTION_DB_USERNAME:sa}}
password: ${database.password:${INCEPTION_DB_PASSWORD:}}
driver-class-name: ${database.driver:${INCEPTION_DB_DRIVER:}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static void setup()
var issuerUrl = oauth2Server.url(ISSUER_ID).toString();

setProperty("java.awt.headless", "true");
setProperty("database.url", "jdbc:hsqldb:mem:testdb");
setProperty("database.url", "jdbc:hsqldb:mem:testdb;hsqldb.tx=mvcc");
setProperty("inception.home", appHome.toString());
setProperty("remote-api.enabled", "true");
setProperty("remote-api.oauth2.enabled", "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@
import org.springframework.test.context.DynamicPropertySource;
import org.testcontainers.containers.MSSQLServerContainer;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

@Testcontainers(disabledWithoutDocker = true)
class InceptionMSSQLServerIntegrationTest
{
static final DockerImageName image = DockerImageName.parse("mcr.microsoft.com/mssql/server")
.withTag("2022-latest");
// .withTag("@sha256:45a1a9d13ca5574cf8e0fe4ae73ab77248b66d9c3132ac9658fb6c16dd72a8af");
@SuppressWarnings("resource")
static final MSSQLServerContainer<?> dbContainer = new MSSQLServerContainer<>(
"mcr.microsoft.com/mssql/server:2022-latest") //
.acceptLicense();
static final MSSQLServerContainer<?> dbContainer = new MSSQLServerContainer<>(image) //
.acceptLicense();

static @TempDir Path tempDir;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
import org.apache.lucene.codecs.KnnVectorsFormat;
import org.apache.lucene.codecs.KnnVectorsReader;
import org.apache.lucene.codecs.KnnVectorsWriter;
import org.apache.lucene.codecs.lucene99.Lucene99Codec;
import org.apache.lucene.codecs.lucene912.Lucene912Codec;
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsFormat;
import org.apache.lucene.index.SegmentReadState;
import org.apache.lucene.index.SegmentWriteState;

public class HighDimensionLucene99Codec
extends Lucene99Codec
public class HighDimensionLucene912Codec
extends Lucene912Codec
{
private final KnnVectorsFormat defaultKnnVectorsFormat;

public HighDimensionLucene99Codec(int aDimension)
public HighDimensionLucene912Codec(int aDimension)
{
var knnFormat = new Lucene99HnswVectorsFormat();
defaultKnnVectorsFormat = new HighDimensionKnnVectorsFormat(knnFormat, aDimension);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public PooledIndex create(Long aKey) throws Exception
{
var dir = new MMapDirectory(getIndexDirectory(aKey));
var iwc = new IndexWriterConfig();
iwc.setCodec(new HighDimensionLucene99Codec(embeddingService.getDimension()));
iwc.setCodec(new HighDimensionLucene912Codec(embeddingService.getDimension()));
return new PooledIndex(aKey, dir, new IndexWriter(dir, iwc));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

import de.tudarmstadt.ukp.inception.assistant.config.AssistantProperties;
import de.tudarmstadt.ukp.inception.assistant.embedding.EmbeddingService;
import de.tudarmstadt.ukp.inception.assistant.index.HighDimensionLucene99Codec;
import de.tudarmstadt.ukp.inception.assistant.index.HighDimensionLucene912Codec;
import de.tudarmstadt.ukp.inception.scheduling.SchedulingService;
import de.tudarmstadt.ukp.inception.support.SettingsUtil;
import de.tudarmstadt.ukp.inception.support.json.JSONUtil;
Expand Down Expand Up @@ -198,7 +198,7 @@ else if (LOG.isTraceEnabled()) {
IndexWriter getIndexWriter() throws IOException
{
var iwc = new IndexWriterConfig();
iwc.setCodec(new HighDimensionLucene99Codec(embeddingService.getDimension()));
iwc.setCodec(new HighDimensionLucene912Codec(embeddingService.getDimension()));
return new IndexWriter(getSharedIndexDirectory(), iwc);
}

Expand Down
Loading

0 comments on commit eece3dc

Please sign in to comment.