-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from vitrivr/feature/torchserve
- Loading branch information
Showing
20 changed files
with
1,197 additions
and
7 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
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
25 changes: 25 additions & 0 deletions
25
...gine-core/src/main/kotlin/org/vitrivr/engine/core/features/bool/ScalarBooleanRetriever.kt
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,25 @@ | ||
package org.vitrivr.engine.core.features.bool | ||
|
||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.flow.flow | ||
import org.vitrivr.engine.core.context.QueryContext | ||
import org.vitrivr.engine.core.features.AbstractRetriever | ||
import org.vitrivr.engine.core.model.content.element.ContentElement | ||
import org.vitrivr.engine.core.model.descriptor.scalar.ScalarDescriptor | ||
import org.vitrivr.engine.core.model.metamodel.Schema | ||
import org.vitrivr.engine.core.model.query.bool.BooleanQuery | ||
|
||
/** | ||
* A simple [AbstractRetriever] implementation for boolean queries on [ScalarDescriptor]s. | ||
* | ||
* @author Ralph Gasser | ||
* @version 1.0.0 | ||
*/ | ||
class ScalarBooleanRetriever<C : ContentElement<*>>(field: Schema.Field<C, ScalarDescriptor<*, *>>, query: BooleanQuery, context: QueryContext) : AbstractRetriever<C, ScalarDescriptor<*, *>>(field, query, context) { | ||
override fun toFlow(scope: CoroutineScope) = flow { | ||
val reader = this@ScalarBooleanRetriever.reader | ||
reader.queryAndJoin(this@ScalarBooleanRetriever.query).forEach { | ||
emit(it) | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...gine-core/src/main/kotlin/org/vitrivr/engine/core/features/bool/StructBooleanRetriever.kt
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,25 @@ | ||
package org.vitrivr.engine.core.features.bool | ||
|
||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.flow.flow | ||
import org.vitrivr.engine.core.context.QueryContext | ||
import org.vitrivr.engine.core.features.AbstractRetriever | ||
import org.vitrivr.engine.core.model.content.element.ContentElement | ||
import org.vitrivr.engine.core.model.descriptor.struct.StructDescriptor | ||
import org.vitrivr.engine.core.model.metamodel.Schema | ||
import org.vitrivr.engine.core.model.query.bool.BooleanQuery | ||
|
||
/** | ||
* A simple [AbstractRetriever] implementation for boolean queries on [StructDescriptor]s. | ||
* | ||
* @author Ralph Gasser | ||
* @version 1.0.0 | ||
*/ | ||
class StructBooleanRetriever<C : ContentElement<*>, D : StructDescriptor<*>>(field: Schema.Field<C, D>, query: BooleanQuery, context: QueryContext) : AbstractRetriever<C, D>(field, query, context) { | ||
override fun toFlow(scope: CoroutineScope) = flow { | ||
val reader = this@StructBooleanRetriever.reader | ||
reader.queryAndJoin(this@StructBooleanRetriever.query).forEach { | ||
emit(it) | ||
} | ||
} | ||
} |
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,108 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.plugin.serialization' version "$version_kotlin" | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'com.google.protobuf' version '0.9.4' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
api project(':vitrivr-engine-core') | ||
|
||
/** vitrivr engine Core is required for running tests. */ | ||
testImplementation(testFixtures(project(':vitrivr-engine-core'))) | ||
|
||
/** TwelveMonkeys. */ | ||
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-core', version: version_twelvemonkeys | ||
implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-jpeg', version: version_twelvemonkeys | ||
|
||
/** gRPC */ | ||
api group: 'com.google.protobuf', name: 'protobuf-java', version: version_protobuf | ||
api group: 'com.google.protobuf', name: 'protobuf-kotlin', version: version_protobuf | ||
api group: 'io.grpc', name: 'grpc-netty', version: version_grpc | ||
api group: 'io.grpc', name: 'grpc-protobuf', version: version_grpc | ||
api group: 'io.grpc', name: 'grpc-stub', version: version_grpc | ||
api group: 'io.grpc', name: 'grpc-auth', version: version_grpc | ||
api group: 'io.grpc', name: 'grpc-kotlin-stub', version: '1.4.1' | ||
api group: 'com.google.auth', name: 'google-auth-library-oauth2-http', version: '1.24.0' | ||
} | ||
|
||
protobuf { | ||
plugins { | ||
grpc { | ||
artifact = "io.grpc:protoc-gen-grpc-java:$version_grpc" | ||
} | ||
grpckt { | ||
artifact = "io.grpc:protoc-gen-grpc-kotlin:1.4.1:jdk8@jar" | ||
} | ||
} | ||
protoc { | ||
artifact = "com.google.protobuf:protoc:$version_protobuf" | ||
} | ||
generateProtoTasks { | ||
all()*.plugins { | ||
grpc { | ||
outputSubDir = 'java' | ||
} | ||
grpckt { | ||
outputSubDir = 'kotlin' | ||
} | ||
kotlin {} | ||
} | ||
} | ||
} | ||
|
||
/* Publication of vitrivr engine query to Maven Central. */ | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
groupId = 'org.vitrivr' | ||
artifactId = 'vitrivr-engine-module-torchserve' | ||
version = System.getenv().getOrDefault("MAVEN_PUBLICATION_VERSION", version.toString()) | ||
from components.java | ||
pom { | ||
name = 'vitrivr Engine TorchServe module' | ||
description = 'A module that adds facilities to call models via torch serve.' | ||
url = 'https://github.com/vitrivr/vitrivr-engine/' | ||
licenses { | ||
license { | ||
name = 'MIT License' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'ppanopticon' | ||
name = 'Ralph Gasser' | ||
email = '[email protected]' | ||
} | ||
developer { | ||
id = 'lucaro' | ||
name = 'Luca Rossetto' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:https://github.com/vitrivr/vitrivr-engine.git' | ||
url = 'https://github.com/vitrivr/vitrivr-engine/' | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
repositories { | ||
maven { | ||
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' | ||
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' | ||
name = "OSSRH" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
credentials { | ||
username = System.getenv("MAVEN_USERNAME") | ||
password = System.getenv("MAVEN_PASSWORD") | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.