Skip to content

Commit

Permalink
update dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxcapades committed Aug 20, 2024
1 parent d26fb1a commit b9aa3c4
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("jvm") version "1.9.20"
kotlin("jvm") version "1.9.23"
}

allprojects {
Expand Down
10 changes: 4 additions & 6 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
id("org.jetbrains.dokka") version "1.9.10"
id("org.jetbrains.dokka") version "1.9.20"
java
`maven-publish`
}
Expand All @@ -15,7 +13,7 @@ dependencies {
implementation(kotlin("stdlib-jdk8"))

// Logging
implementation("org.slf4j:slf4j-api:1.7.36")
api("org.slf4j:slf4j-api:1.7.36")

// Jackson
implementation(platform("com.fasterxml.jackson:jackson-bom:2.16.0"))
Expand All @@ -27,8 +25,8 @@ dependencies {
implementation("org.postgresql:postgresql:42.7.3")

// S3
api("org.veupathdb.lib.s3:s34k-minio:0.7.2+s34k-0.11.0")
api("org.veupathdb.lib.s3:workspaces:4.1.2")
api("org.veupathdb.lib.s3:s34k:0.11.0")
api("org.veupathdb.lib.s3:workspaces-java:5.1.0")

// Rabbit
implementation("org.veupathdb.lib:rabbit-job-queue:2.0.0")
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/kotlin/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
requires hash.id;
requires s34k;
requires rabbit.job.queue;
requires workspaces;
requires jackson.singleton;
requires com.github.benmanes.caffeine;
requires workspaces.java;

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.veupathdb.lib.compute.platform.intern.s3

import org.veupathdb.lib.compute.platform.job.JobFileReference
import org.veupathdb.lib.s3.workspaces.WorkspaceFile
import org.veupathdb.lib.s3.workspaces.java.WorkspaceFile
import java.io.InputStream

internal data class JobFileReferenceImpl(private val raw: WorkspaceFile) : JobFileReference {
override val name: String
get() = raw.name

override val size: Long
get() = raw.size
get() = raw.size()

override fun open(): InputStream {
return raw.open()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import org.veupathdb.lib.s3.s34k.S3Api
import org.veupathdb.lib.s3.s34k.S3Client
import org.veupathdb.lib.s3.s34k.S3Config
import org.veupathdb.lib.s3.s34k.fields.BucketName
import org.veupathdb.lib.s3.workspaces.S3Workspace
import org.veupathdb.lib.s3.workspaces.S3WorkspaceFactory
import org.veupathdb.lib.s3.workspaces.java.S3Workspace
import org.veupathdb.lib.s3.workspaces.java.S3WorkspaceFactory
import java.io.File
import java.io.InputStream
import java.nio.file.Path
Expand Down Expand Up @@ -74,7 +74,7 @@ internal object S3 {
@JvmStatic
fun getJob(jobID: HashID): AsyncS3Job? {
Log.debug("Fetching workspace {} from S3", jobID)
return wsf[jobID]?.let(::XS3Workspace)?.let(::AsyncS3Job)
return wsf.get(jobID)?.let(::XS3Workspace)?.let(::AsyncS3Job)
}


Expand All @@ -89,7 +89,7 @@ internal object S3 {
fun persistFiles(jobID: HashID, files: List<Path>) {
Log.debug("persisting {} files to workspace {} in S3", files.size, jobID)

val ws = wsf[jobID] ?: throw IllegalStateException("Attempted to write result files to nonexistent workspace $jobID")
val ws = wsf.get(jobID) ?: throw IllegalStateException("Attempted to write result files to nonexistent workspace $jobID")

files.forEach {
persistFile(ws, it.toFile())
Expand Down Expand Up @@ -120,7 +120,7 @@ internal object S3 {
@JvmOverloads
fun deleteWorkspace(jobID: HashID, throwOnNotExists: Boolean = true) {
Log.info("Deleting workspace with ID {}.", jobID)
val ws = wsf[jobID]
val ws = wsf.get(jobID)

if (ws == null && throwOnNotExists) {
throw IllegalStateException("Attempted to delete nonexistent workspace $jobID")
Expand Down Expand Up @@ -168,7 +168,7 @@ internal object S3 {
Log.debug("Fetching result files from workspace {} in S3", jobID)

// Load the workspace
val ws = wsf[jobID] ?: throw IllegalStateException("Attempted to lookup result files from nonexistent workspace $jobID")
val ws = wsf.get(jobID) ?: throw IllegalStateException("Attempted to lookup result files from nonexistent workspace $jobID")

// Fetch the list of files from the workspace
val files = ws.files()
Expand Down Expand Up @@ -208,7 +208,7 @@ internal object S3 {
Log.debug("fetching target file \"{}\" for job {} in S3", fileName, jobID)

// Load the workspace
val ws = wsf[jobID] ?: throw IllegalStateException("attempted to fetch target file from nonexistent workspace $jobID")
val ws = wsf.get(jobID) ?: throw IllegalStateException("attempted to fetch target file from nonexistent workspace $jobID")

// Sift through the files for one matching the target file name and return
// it (or null if none were found).
Expand All @@ -232,7 +232,7 @@ internal object S3 {
Log.debug("Expiring workspace for job {} in S3", jobID)

// Load the workspace
val ws = wsf[jobID] ?: throw IllegalStateException("Attempted to expire nonexistent workspace $jobID")
val ws = wsf.get(jobID) ?: throw IllegalStateException("Attempted to expire nonexistent workspace $jobID")

// Iterate through the files in the workspace
ws.files().forEach {
Expand Down Expand Up @@ -288,28 +288,28 @@ internal object S3 {
fun markWorkspaceAsInProgress(jobID: HashID) {
Log.debug("marking workspace for job {} as in-progress in s3", jobID)

val ws = wsf[jobID] ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as in-progress")
val ws = wsf.get(jobID) ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as in-progress")
ws.touch(FlagInProgress)
}

fun markWorkspaceAsQueued(jobID: HashID) {
Log.debug("marking workspace for job {} as queued in S3", jobID)

val ws = wsf[jobID] ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as queued")
val ws = wsf.get(jobID) ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as queued")
ws.touch(FlagQueued)
}

fun markWorkspaceAsFailed(jobID: HashID) {
Log.debug("marking workspace for job {} as failed in s3", jobID)

val ws = wsf[jobID] ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as failed")
val ws = wsf.get(jobID) ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as failed")
ws.touch(FlagFailed)
}

fun markWorkspaceAsComplete(jobID: HashID) {
Log.debug("marking workspace for job {} as complete in s3", jobID)

val ws = wsf[jobID] ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as complete")
val ws = wsf.get(jobID) ?: throw IllegalStateException("Attempted to mark nonexistent workspace $jobID as complete")
ws.touch(FlagComplete)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.veupathdb.lib.compute.platform.intern.*
import org.veupathdb.lib.compute.platform.job.JobStatus
import org.veupathdb.lib.jackson.Json
import org.veupathdb.lib.s3.s34k.errors.S34KError
import org.veupathdb.lib.s3.workspaces.S3Workspace
import org.veupathdb.lib.s3.workspaces.java.S3Workspace

/**
* Extended S3 Workspace
Expand Down
2 changes: 1 addition & 1 deletion test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
dependencies {
implementation(project(":compute-platform"))

implementation("org.slf4j:slf4j-api:1.7.36")
implementation("org.veupathdb.lib.s3:s34k-minio:0.7.2+s34k-0.11.0")
implementation("org.apache.logging.log4j:log4j-core:2.19.0")
runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:2.19.0")
}
Expand Down

0 comments on commit b9aa3c4

Please sign in to comment.