Compare commits

...

7 Commits

Author SHA1 Message Date
Ethan McCue a8c125b15a
Merge ebf8fc7735 into 1d55a41a2d 2025-02-18 17:29:19 -05:00
Omar Brikaa 1d55a41a2d
Explicitly provide env vars instead of inheriting them from parent (#703) 2025-02-08 20:46:46 +02:00
Omar Brikaa 6ef0cdf7b4
Provide HOME in sandbox (#702) 2025-02-08 15:10:50 +02:00
Ethan McCue ebf8fc7735 Move to . seperators to not confuse the rest of the scripts 2023-05-17 22:38:38 -04:00
Ethan McCue 132f21cf74 Enable preview for valhalla build 2023-05-16 00:43:16 -04:00
Ethan McCue a8e3935746 Use simpler main! 2023-05-16 00:39:36 -04:00
Ethan McCue 4c739965c2 Add java 21+ support 2023-05-16 00:21:53 -04:00
17 changed files with 96 additions and 14 deletions

View File

@ -156,7 +156,11 @@ class Job {
'-s',
'-c',
'/box/submission',
'-e',
'-E',
'HOME=/tmp',
...this.runtime.env_vars.flat_map(v => ['-E', v]),
'-E',
`PISTON_LANGUAGE=${this.runtime.language}`,
`--dir=${this.runtime.pkgdir}`,
`--dir=/etc:noexec`,
`--processes=${this.runtime.max_process_count}`,
@ -175,10 +179,6 @@ class Job {
...args,
],
{
env: {
...this.runtime.env_vars,
PISTON_LANGUAGE: this.runtime.language,
},
stdio: 'pipe',
}
);

View File

@ -178,15 +178,7 @@ class Runtime {
const env_file = path.join(this.pkgdir, '.env');
const env_content = fss.read_file_sync(env_file).toString();
this._env_vars = {};
env_content
.trim()
.split('\n')
.map(line => line.split('=', 2))
.forEach(([key, val]) => {
this._env_vars[key.trim()] = val.trim();
});
this._env_vars = env_content.trim().split('\n');
}
return this._env_vars;

9
packages/java/20.0.1/build.sh vendored Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
curl "https://download.java.net/java/GA/jdk20.0.1/b4887098932d415489976708ad6d1a4b/9/GPL/openjdk-20.0.1_linux-x64_bin.tar.gz" -o java.tar.gz
tar xzf java.tar.gz --strip-components=1
rm java.tar.gz

4
packages/java/20.0.1/environment vendored Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

5
packages/java/20.0.1/metadata.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"language": "java",
"version": "20.0.1",
"aliases": []
}

7
packages/java/20.0.1/run vendored Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
mv $1 $1.java
filename=$1.java
shift
java $filename "$@"

5
packages/java/20.0.1/test.java vendored Normal file
View File

@ -0,0 +1,5 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("OK");
}
}

9
packages/java/20.valhalla.20.75/build.sh vendored Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
curl "https://download.java.net/java/early_access/valhalla/20/openjdk-20-valhalla+20-75_linux-x64_bin.tar.gz" -o java.tar.gz
tar xzf java.tar.gz --strip-components=1
rm java.tar.gz

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

View File

@ -0,0 +1,5 @@
{
"language": "java",
"version": "20.valhalla.20.75",
"aliases": []
}

7
packages/java/20.valhalla.20.75/run vendored Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
mv $1 $1.java
filename=$1.java
shift
java --enable-preview $filename "$@"

View File

@ -0,0 +1,5 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("OK");
}
}

9
packages/java/21.ea.22/build.sh vendored Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
curl "https://download.java.net/java/early_access/jdk21/22/GPL/openjdk-21-ea+22_linux-x64_bin.tar.gz" -o java.tar.gz
tar xzf java.tar.gz --strip-components=1
rm java.tar.gz

4
packages/java/21.ea.22/environment vendored Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

5
packages/java/21.ea.22/metadata.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"language": "java",
"version": "21.ea.22",
"aliases": []
}

7
packages/java/21.ea.22/run vendored Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
mv $1 $1.java
filename=$1.java
shift
java --enable-preview $filename "$@"

5
packages/java/21.ea.22/test.java vendored Normal file
View File

@ -0,0 +1,5 @@
class Main {
public static void main(String[] args) {
System.out.println("OK");
}
}