Compare commits

..

11 Commits

Author SHA1 Message Date
Thomas Hobson 0c0be54505
Fix #495 2022-07-02 01:46:44 +12:00
Thomas Hobson 9d53703a66
Merge pull request #489 from Hydrazer/smalltalk
smalltalk fix argv
2022-07-02 01:26:27 +12:00
Thomas Hobson 8dacccd060
Merge pull request #496 from Brikaa/fix-jobs-permissions
Fix jobs permissions
2022-07-02 01:25:01 +12:00
Thomas Hobson e021dab847
Merge pull request #497 from Jonxslays/task/piston_rspy
Add piston_rspy to the readme
2022-07-02 01:22:58 +12:00
Jonxslays 43a1242bbf
Add piston_rspy to the readme 2022-07-01 06:11:29 -07:00
Omar Brikaa e1a1be7e4c Permission mode 711 2022-06-30 13:35:35 +02:00
Omar Brikaa 07ec6b3f78 Don't include the tmpfs in the docker volume 2022-06-30 13:31:17 +02:00
Omar Brikaa 5526071f00 Set jobs permissions on startup 2022-06-30 13:19:44 +02:00
Omar Brikaa 0e5d3b56a1 Get rid of pre-commit since it does not account for hunks 2022-06-30 13:18:50 +02:00
Omar Brikaa 0ea073f6d2 Add tmpfs parameters in docker-compose dev 2022-06-30 13:17:15 +02:00
Hydrazer 91bd30f59e smalltalk fix argv 2022-06-12 08:32:06 -06:00
7 changed files with 11 additions and 16 deletions

View File

@ -35,6 +35,7 @@ expressWs(app);
} }
} }
}); });
fss.chmodSync(path.join(config.data_directory, globals.data_directories.jobs), 0o711)
logger.info('Loading packages'); logger.info('Loading packages');
const pkgdir = path.join( const pkgdir = path.join(

View File

@ -344,6 +344,9 @@ class Job {
const proc_id_int = parse_int(proc_id); const proc_id_int = parse_int(proc_id);
// Skip over any processes that aren't ours.
if(ruid != this.uid && euid != this.uid) return -1;
if (state == 'Z'){ if (state == 'Z'){
// Zombie process, just needs to be waited, regardless of the user id // Zombie process, just needs to be waited, regardless of the user id
if(!to_wait.includes(proc_id_int)) if(!to_wait.includes(proc_id_int))
@ -353,8 +356,7 @@ class Job {
} }
// We should kill in all other state (Sleep, Stopped & Running) // We should kill in all other state (Sleep, Stopped & Running)
if (ruid == this.uid || euid == this.uid) return proc_id_int;
return proc_id_int;
} catch { } catch {
return -1; return -1;
} }

View File

@ -10,11 +10,11 @@ services:
ports: ports:
- 2000:2000 - 2000:2000
volumes: volumes:
- ./data/piston:/piston - ./data/piston/packages:/piston/packages
environment: environment:
- PISTON_REPO_URL=http://repo:8000/index - PISTON_REPO_URL=http://repo:8000/index
tmpfs: tmpfs:
- /piston/jobs:exec - /piston/jobs:exec,uid=1000,gid=1000,mode=711
repo: # Local testing of packages repo: # Local testing of packages
build: repo build: repo

View File

@ -8,7 +8,7 @@ services:
ports: ports:
- 2000:2000 - 2000:2000
volumes: volumes:
- ./data/piston:/piston - ./data/piston/packages:/piston/packages
tmpfs: tmpfs:
- /piston/jobs:exec,uid=1000,gid=1000,mode=700 - /piston/jobs:exec,uid=1000,gid=1000,mode=711
- /tmp:exec - /tmp:exec

View File

@ -4,5 +4,5 @@ code_file=`pwd`/"$1"
shift shift
cd $SMALLTALK_PATH cd $SMALLTALK_PATH
$SMALLTALK_PATH/gst "$code_file" "$@" $SMALLTALK_PATH/gst "$code_file" -a "$@"

9
piston
View File

@ -14,13 +14,6 @@ docker_compose(){
fi fi
} }
init_precommit() {
if [ $PISTON_ENV == "dev" ]; then
rm -f .git/hooks/pre-commit
ln -s "$PISTON_PATH/pre-commit" "$PISTON_PATH/.git/hooks/pre-commit"
fi
}
case $1 in case $1 in
help) help)
echo "=== Piston Management ===" echo "=== Piston Management ==="
@ -66,14 +59,12 @@ case $1 in
restart) docker_compose restart ;; restart) docker_compose restart ;;
start) start)
init_precommit
docker_compose up -d docker_compose up -d
;; ;;
stop) docker_compose down ;; stop) docker_compose down ;;
bash) docker_compose exec api /bin/bash ;; bash) docker_compose exec api /bin/bash ;;
rebuild) rebuild)
init_precommit
docker_compose build && docker_compose up -d docker_compose build && docker_compose up -d
;; ;;

View File

@ -71,6 +71,7 @@ The following are approved and endorsed extensions/utilities to the core Piston
- [Pyston](https://github.com/ffaanngg/pyston), a Python wrapper for accessing the Piston API. - [Pyston](https://github.com/ffaanngg/pyston), a Python wrapper for accessing the Piston API.
- [Go-Piston](https://github.com/milindmadhukar/go-piston), a Golang wrapper for accessing the Piston API. - [Go-Piston](https://github.com/milindmadhukar/go-piston), a Golang wrapper for accessing the Piston API.
- [piston_rs](https://github.com/Jonxslays/piston_rs), a Rust wrapper for accessing the Piston API. - [piston_rs](https://github.com/Jonxslays/piston_rs), a Rust wrapper for accessing the Piston API.
- [piston_rspy](https://github.com/Jonxslays/piston_rspy), Python bindings for accessing the Piston API via `piston_rs`.
<br> <br>