Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2.2 #8

Merged
merged 3 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/src/views/annotate/subviews/JobsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
–
<b v-if="eraRange[1] >= d.item.tagger.eraTo">{{ d.item.tagger.eraTo }}</b><span v-else>{{
d.item.tagger.eraTo
}}</span>
}}</span>
</div>
</template>

Expand Down Expand Up @@ -296,6 +296,7 @@ table button {
:deep(.vue-slider) .vue-slider-dot {
width: 25px !important;
height: 25px !important;
z-index: 1;
}

:deep(.vue-slider) .vue-slider-dot-handle {
Expand Down
153 changes: 76 additions & 77 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,78 +1,77 @@
import org.jetbrains.dokka.DokkaConfiguration.Visibility
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "3.2.3"
id("io.spring.dependency-management") version "1.1.4"
id("org.jetbrains.dokka") version "1.9.10"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
kotlin("plugin.serialization") version "1.9.22"
}

group = "org.ivdnt"
version = "0.0.2-ALPHA-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
// Spring
implementation("org.springframework.boot:spring-boot-starter-web:3.2.4")
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools
implementation("org.springframework.boot:spring-boot-devtools:3.2.3")

// kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.22")
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") // JVM dependency

// swagger
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0")


implementation("com.beust:klaxon:5.6")
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.2.0")

// yaml
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
implementation("org.yaml:snakeyaml:2.2")

// Tests
testImplementation ("org.springframework.boot:spring-boot-starter-test:3.2.3")
}

tasks.test {
environment(mapOf("profile" to "dev"))
useJUnitPlatform()
}

tasks.withType<Test> {
useJUnitPlatform()
// https://stackoverflow.com/questions/52733942/increase-heap-memory-for-gradle-test
// minHeapSize = "4096m"
// maxHeapSize = "4096m"
// jvmArgs = listOf("-XX:MaxPermSize=1024m") // fails on some IDEs
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
configureEach {
documentedVisibilities.set(setOf(Visibility.PUBLIC, Visibility.PROTECTED, Visibility.PRIVATE, Visibility.INTERNAL))
}
}
import org.jetbrains.dokka.DokkaConfiguration.Visibility
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "3.2.3"
id("io.spring.dependency-management") version "1.1.4"
id("org.jetbrains.dokka") version "1.9.10"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
kotlin("plugin.serialization") version "1.9.22"
}

group = "org.ivdnt"
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
// Spring
implementation("org.springframework.boot:spring-boot-starter-web:3.2.4")
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools
implementation("org.springframework.boot:spring-boot-devtools:3.2.3")

// kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.22")
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") // JVM dependency

// swagger
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0")


implementation("com.beust:klaxon:5.6")
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.2.0")

// yaml
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
implementation("org.yaml:snakeyaml:2.2")

// Tests
testImplementation ("org.springframework.boot:spring-boot-starter-test:3.2.3")
}

tasks.test {
environment(mapOf("profile" to "dev"))
useJUnitPlatform()
}

tasks.withType<Test> {
useJUnitPlatform()
// https://stackoverflow.com/questions/52733942/increase-heap-memory-for-gradle-test
// minHeapSize = "4096m"
// maxHeapSize = "4096m"
// jvmArgs = listOf("-XX:MaxPermSize=1024m") // fails on some IDEs
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
configureEach {
documentedVisibilities.set(setOf(Visibility.PUBLIC, Visibility.PROTECTED, Visibility.PRIVATE, Visibility.INTERNAL))
}
}
}
4 changes: 2 additions & 2 deletions server/data/taggers/hug-tdn-1600-1900.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ produces:
- POS
- TOK
model:
name: hug-tdn-1400-1600
href: https://github.com/INL/galahad-huggingface-models/tree/1.0.0/models/galahad/tagger/pos_model_tdn_1400-1600
name: hug-tdn-1600-1900
href: https://github.com/INL/galahad-huggingface-models/tree/1.0.0/models/galahad/tagger/pos_model_tdn_1600-1900
software:
name: int-huggingface
href: https://github.com/INL/int-huggingface-tagger/tree/1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import java.io.File


val mapper: ObjectMapper by lazy { ObjectMapper() }
const val LOCK_SLEEP_TIME = 100L // ms to sleep before retrying to access locked file.

abstract class FileBackedCache<T>(
file: File,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.ivdnt.galahad.data.document.SOURCE_LAYER_NAME
import org.ivdnt.galahad.jobs.Jobs
import org.ivdnt.galahad.port.CmdiMetadata
import org.ivdnt.galahad.port.CorpusTransformMetadata
import org.ivdnt.galahad.taggers.Taggers
import org.ivdnt.galahad.taggers.Tagger
import org.ivdnt.galahad.util.createZipFile
import java.io.File
import java.io.OutputStream
Expand Down Expand Up @@ -94,10 +94,10 @@ class Corpus(
override fun expensiveGet() = metadataCache.get<CorpusMetadata>()
}

val sourceTagger: ExpensiveGettable<Taggers.Summary> = object : ExpensiveGettable<Taggers.Summary> {
override fun expensiveGet(): Taggers.Summary {
val sourceTagger: ExpensiveGettable<Tagger> = object : ExpensiveGettable<Tagger> {
override fun expensiveGet(): Tagger {
val metadata = metadata.expensiveGet()
return Taggers.Summary(
return Tagger(
id = SOURCE_LAYER_NAME,
description = "uploaded annotations",
tagset = metadata.tagset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Documents(
override fun delete(key: String): Document? {
val fullyDeleted: Boolean = workDirectory.resolve(key).deleteRecursively()
if (!fullyDeleted) println("Partial deletion of $key")
// TODO remember we also need to delete in associated jobs
return readOrNull(key)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.ivdnt.galahad.data.layer.Layer
import org.ivdnt.galahad.port.InternalFile
import org.ivdnt.galahad.port.SourceLayerableFile
import org.ivdnt.galahad.port.tsv.TSVFile
import org.ivdnt.galahad.taggers.Taggers
import org.ivdnt.galahad.taggers.Tagger
import org.ivdnt.galahad.tagset.Tagset
import org.ivdnt.galahad.tagset.TagsetStore
import org.springframework.web.bind.annotation.*
Expand Down Expand Up @@ -61,8 +61,8 @@ class InternalJobController (
val (corpusID, jobName, documentName) = dataForProcessingID( fileId ) ?: throw Exception("Processing ID not found, was this file uploaded by me?")
val original: Document = corpora.getUncheckedCorpusAccess( corpusID ).documents.readOrThrow( documentName )
val job: Job = corpora.getUncheckedCorpusAccess( corpusID ).jobs.readOrThrow( jobName )
val taggerSummary: Taggers.Summary? = job.taggers.getSummaryOrNull(job.name, null ).expensiveGet()
val tagset: Tagset? = tagsets.getOrNull(taggerSummary?.tagset)
val taggerTagger: Tagger? = job.taggerStore.getSummaryOrNull(job.name, null ).expensiveGet()
val tagset: Tagset? = tagsets.getOrNull(taggerTagger?.tagset)

when (val uploadedFile = InternalFile.from(tempFile, DocumentFormat.Tsv).expensiveGet()) {
// Treat TSVFiles separately form SourceLayerableFiles, because calling sourceLayer() on a TSV
Expand Down
Loading
Loading