Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Update dependencies, improve Docker build.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchallen committed Nov 9, 2022
1 parent 1592d2d commit 1aa81d9
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 31 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ plugins {
kotlin("jvm") version "1.7.20" apply false
id("org.jmailen.kotlinter") version "3.12.0" apply false
id("com.github.ben-manes.versions") version "0.43.0"
id("com.google.devtools.ksp").version("1.7.20-1.0.7") apply false
id("com.google.devtools.ksp").version("1.7.20-1.0.8") apply false
}
subprojects {
group = "com.github.cs125-illinois.questioner"
version = "2022.10.7"
version = "2022.11.0"
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
Expand Down
4 changes: 2 additions & 2 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ dependencies {
implementation("org.ow2.asm:asm:9.4")

api("com.beyondgrader.resource-agent:agent:2022.9.3")
api("com.github.cs125-illinois.jeed:core:2022.10.8")
api("com.github.cs125-illinois.jeed:core:2022.11.0")
api("com.github.cs125-illinois:jenisol:2022.10.5")
api("io.kotest:kotest-runner-junit5:5.5.3")
api("io.kotest:kotest-runner-junit5:5.5.4")
api("com.google.truth:truth:1.1.3")
api("com.github.cs125-illinois:libcs1:2022.10.0")
}
Expand Down
6 changes: 3 additions & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("com.google.googlejavaformat:google-java-format:1.15.0")
implementation("com.google.guava:guava:31.1-jre")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.4")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0")
implementation("com.github.slugify:slugify:3.0.2")
implementation("org.apache.httpcomponents.client5:httpclient5-fluent:5.1.3")

testImplementation("io.kotest:kotest-runner-junit5:5.5.3")
testImplementation("io.kotest:kotest-runner-junit5:5.5.4")
}
tasks.compileKotlin {
dependsOn(tasks.generateGrammarSource)
Expand Down
36 changes: 21 additions & 15 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
FROM openjdk:17-jdk-slim

ARG TARGETARCH
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

WORKDIR /
COPY *.jar questioner.jar
CMD [\
"java",\
"-ea", "--enable-preview", "-Dfile.encoding=UTF-8",\
"-Xms512m", "-Xmx2G", "-Xss256k", "-XX:+UseZGC", "-XX:ZCollectionInterval=8",\
"-XX:-OmitStackTraceInFastThrow",\
"--add-opens", "java.base/java.lang=ALL-UNNAMED",\
"--add-opens", "java.base/java.util=ALL-UNNAMED",\
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",\
"--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",\
"--add-exports", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",\
"--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",\
"--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",\
"--add-exports", "java.management/sun.management=ALL-UNNAMED",\
"-jar", "questioner.jar"\
]
CMD java -ea --enable-preview -Dfile.encoding=UTF-8 \
-Xms1G -Xmx1G -Xss256k \
-XX:+UseZGC -XX:ZCollectionInterval=8 -XX:-OmitStackTraceInFastThrow \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
--add-exports java.management/sun.management=ALL-UNNAMED \
$JAVA_OPTS \
-jar questioner.jar

# vim: tw=0
37 changes: 29 additions & 8 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
application
id("org.jmailen.kotlinter")
id("com.github.johnrengelman.shadow") version "7.1.2"
id("com.palantir.docker") version "0.34.0"
id("com.google.devtools.ksp")
}
dependencies {
Expand All @@ -25,7 +24,7 @@ dependencies {

implementation("org.slf4j:slf4j-api:2.0.3")
implementation("ch.qos.logback:logback-classic:1.4.4")
implementation("io.github.microutils:kotlin-logging:3.0.3")
implementation("io.github.microutils:kotlin-logging:3.0.4")
}
task("createProperties") {
doLast {
Expand Down Expand Up @@ -54,15 +53,37 @@ tasks.shadowJar {
application {
mainClass.set("edu.illinois.cs.cs125.questioner.server.MainKt")
}
docker {
name = "cs125/questioner"
files(tasks["shadowJar"].outputs)
@Suppress("DEPRECATION")
tags("latest")
}
kotlin {
kotlinDaemonJvmArgs = listOf("-Dfile.encoding=UTF-8")
}
tasks.withType<ShadowJar> {
isZip64 = true
}
val dockerName = "cs125/questioner"
tasks.register<Copy>("dockerCopyJar") {
from(tasks["shadowJar"].outputs)
into("${buildDir}/docker")
}
tasks.register<Copy>("dockerCopyDockerfile") {
from("${projectDir}/Dockerfile")
into("${buildDir}/docker")
}
tasks.register<Exec>("dockerBuild") {
dependsOn("dockerCopyJar", "dockerCopyDockerfile")
workingDir("${buildDir}/docker")
commandLine(
("docker build . " +
"-t ${dockerName}:latest " +
"-t ${dockerName}:${project.version}").split(" ")
)
}
tasks.register<Exec>("dockerPush") {
dependsOn("dockerCopyJar", "dockerCopyDockerfile")
workingDir("${buildDir}/docker")
commandLine(
("docker buildx build . --platform=linux/amd64,linux/arm64/v8 " +
"--builder multiplatform " +
"--tag ${dockerName}:latest " +
"--tag ${dockerName}:${project.version} --push").split(" ")
)
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2022.10.7
version=2022.11.0

0 comments on commit 1aa81d9

Please sign in to comment.