1
0
Fork 0
mirror of https://github.com/engineer-man/piston.git synced 2025-04-24 05:56:26 +02:00

Compare commits

...

5 commits

Author SHA1 Message Date
Cory
4da7d94c71
Merge c44fc86087 into 1d55a41a2d 2025-02-12 08:29:24 -05:00
Omar Brikaa
1d55a41a2d
Explicitly provide env vars instead of inheriting them from parent () 2025-02-08 20:46:46 +02:00
Omar Brikaa
6ef0cdf7b4
Provide HOME in sandbox () 2025-02-08 15:10:50 +02:00
Cory
c44fc86087
whoops forgot to add pydantic. 2024-05-15 14:55:31 +10:00
Cory
d66e6ac8dc
adding python mapping packages 2024-05-15 14:51:40 +10:00
5 changed files with 9 additions and 17 deletions
api/src
packages/python
3.10.0
3.11.0
3.12.0

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;

View file

@ -18,4 +18,4 @@ cd ..
rm -rf build
bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib sympy xxhash base58 cryptography PyNaCl
bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib sympy xxhash base58 cryptography PyNaCl pydantic geopy geojson h3==4.0.0b4

View file

@ -18,4 +18,4 @@ cd ..
rm -rf build
bin/pip3 install numpy scipy pandas pycryptodome whoosh bcrypt passlib sympy xxhash base58 cryptography PyNaCl
bin/pip3 install numpy scipy pandas pycryptodome whoosh bcrypt passlib sympy xxhash base58 cryptography PyNaCl pydantic geopy geojson h3==4.0.0b4

View file

@ -18,4 +18,4 @@ cd ..
rm -rf build
bin/pip3 install numpy scipy pandas pycryptodome whoosh bcrypt passlib sympy xxhash base58 cryptography PyNaCl
bin/pip3 install numpy scipy pandas pycryptodome whoosh bcrypt passlib sympy xxhash base58 cryptography PyNaCl pydantic geopy geojson h3==4.0.0b4