-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(JAQPOT-432): support docker runtime + docker_llm runtime (#130)
* feat(JAQPOT-432): support docker config * feat: DOCKER_LLM model type
- Loading branch information
Showing
11 changed files
with
119 additions
and
23 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
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/org/jaqpot/api/mapper/DockerConfigMapper.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,20 @@ | ||
package org.jaqpot.api.mapper | ||
|
||
import org.jaqpot.api.entity.DockerConfig | ||
import org.jaqpot.api.entity.Model | ||
import org.jaqpot.api.model.DockerConfigDto | ||
|
||
fun DockerConfig.toDto(): DockerConfigDto { | ||
return DockerConfigDto( | ||
appName = this.appName, | ||
dockerImage = this.dockerImage | ||
) | ||
} | ||
|
||
fun DockerConfigDto.toEntity(model: Model): DockerConfig { | ||
return DockerConfig( | ||
appName = this.appName, | ||
model = model, | ||
dockerImage = this.dockerImage | ||
) | ||
} |
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
37 changes: 37 additions & 0 deletions
37
src/main/kotlin/org/jaqpot/api/service/prediction/runtime/runtimes/util/HttpClientUtil.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,37 @@ | ||
package org.jaqpot.api.service.prediction.runtime.runtimes.util | ||
|
||
import io.netty.channel.ChannelOption | ||
import io.netty.handler.timeout.ReadTimeoutHandler | ||
import io.netty.handler.timeout.WriteTimeoutHandler | ||
import reactor.netty.http.client.HttpClient | ||
import reactor.netty.resources.ConnectionProvider | ||
import java.time.Duration | ||
import java.util.concurrent.TimeUnit | ||
|
||
class HttpClientUtil { | ||
companion object { | ||
|
||
fun generateHttpClient( | ||
maxIdleTimeInMin: Long, | ||
maxLifeTimeInMin: Long, | ||
responseTimeoutInMin: Long, | ||
readTimeoutInMin: Long, | ||
writeTimeoutInMin: Long | ||
): HttpClient { | ||
val connectionProvider = | ||
ConnectionProvider.builder("custom") | ||
.maxIdleTime(Duration.ofMinutes(maxIdleTimeInMin)) | ||
.maxLifeTime(Duration.ofMinutes(maxLifeTimeInMin)) | ||
.build() | ||
|
||
return HttpClient.create(connectionProvider) | ||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000) | ||
.option(ChannelOption.SO_KEEPALIVE, true) | ||
.responseTimeout(Duration.ofMinutes(responseTimeoutInMin)) | ||
.doOnConnected { conn -> | ||
conn.addHandlerLast(ReadTimeoutHandler(readTimeoutInMin, TimeUnit.MINUTES)) | ||
.addHandlerLast(WriteTimeoutHandler(writeTimeoutInMin, TimeUnit.MINUTES)) | ||
} | ||
} | ||
} | ||
} |
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,40 @@ | ||
package org.jaqpot.api.storage | ||
|
||
import org.jaqpot.api.error.JaqpotRuntimeException | ||
import org.springframework.context.annotation.Profile | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Profile("local") | ||
@Service | ||
class LocalStorage : Storage { | ||
override fun getObject(bucketName: String, keyName: String): Optional<ByteArray> { | ||
return Optional.empty() | ||
} | ||
|
||
override fun getObjects(bucketName: String, keyNames: List<String>): Map<String, ByteArray> { | ||
return emptyMap() | ||
} | ||
|
||
override fun listObjects(bucketName: String, prefix: String): List<String> { | ||
return emptyList() | ||
} | ||
|
||
override fun putObject(bucketName: String, keyName: String, obj: ByteArray, metadata: Map<String, String>) { | ||
throw JaqpotRuntimeException("Not implemented") | ||
} | ||
|
||
override fun putObject( | ||
bucketName: String, | ||
keyName: String, | ||
contentType: String, | ||
obj: ByteArray, | ||
metadata: Map<String, String> | ||
) { | ||
throw JaqpotRuntimeException("Not implemented") | ||
} | ||
|
||
override fun deleteObject(bucketName: String, keyName: String) { | ||
throw JaqpotRuntimeException("Not implemented") | ||
} | ||
} |
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