Skip to content

Commit

Permalink
Trying to make the wrapper work
Browse files Browse the repository at this point in the history
  • Loading branch information
Alathreon committed Sep 17, 2023
1 parent 6d11aa2 commit 51c5d51
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 333 deletions.
234 changes: 0 additions & 234 deletions JShellAPI/gradlew

This file was deleted.

89 changes: 0 additions & 89 deletions JShellAPI/gradlew.bat

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ public JShellService(JShellSessionService sessionService, String id, long timeou
"--cap-drop=ALL",
"--network=none",
"--pids-limit=2000",
"--memory=500M",
"--read-only",
"--memory=" + maxMemory + "m",
"--cpus=" + cpus,
"--name", containerName(),
"jshellwrapper",
"java", "-DevalTimeoutSeconds=%d".formatted(evalTimeout), "-jar", "JShellWrapper.jar")
"-e", "\"evalTimeoutSeconds=%d\"".formatted(evalTimeout),
"togetherjava.org:5001/togetherjava/jshellwrapper:master")
.directory(new File(".."))
.redirectError(errorLogs.toFile())
.start();
Expand Down
26 changes: 26 additions & 0 deletions JShellWrapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion

plugins {
id 'java'
id 'com.google.cloud.tools.jib' version '3.3.2'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}

group 'org.togetherjava'
Expand All @@ -13,6 +15,30 @@ java {
}
}

var outputImage = 'togetherjava.org:5001/togetherjava/jshellwrapper:master' ?: 'latest'

jib {
from.image = 'eclipse-temurin:20'
to {
image = outputImage
auth {
username = System.getenv('ORG_REGISTRY_USER') ?: ''
password = System.getenv('ORG_REGISTRY_PASSWORD') ?: ''
}
}
container {
ports = [ "8081-8081" ]
mainClass = 'Main'
setCreationTime(java.time.Instant.now().toString())
}
}

shadowJar {
archiveBaseName.set('JShellWrapper')
archiveClassifier.set('')
archiveVersion.set('')
}

repositories {
mavenCentral()
}
Expand Down
3 changes: 2 additions & 1 deletion JShellWrapper/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 51c5d51

Please sign in to comment.