Compile rust as runner

This commit is contained in:
Vrganj 2021-01-17 13:50:40 +00:00
parent be4e0776b6
commit 14565b16e4
4 changed files with 20 additions and 14 deletions

View File

@ -20,7 +20,7 @@ app.post(
errorMessage: 'Supplied language is not a string', errorMessage: 'Supplied language is not a string',
}, },
custom: { custom: {
options: value => languages.find(language => language.aliases.includes(value?.toLowerCase())), options: value => value && languages.find(language => language.aliases.includes(value.toLowerCase())),
errorMessage: 'Supplied language is not supported by Piston', errorMessage: 'Supplied language is not supported by Piston',
}, },
}, },

View File

@ -45,13 +45,17 @@ timeout -s KILL 20 \
# process janitor # process janitor
lxc-attach --clear-env -n piston -- \ lxc-attach --clear-env -n piston -- \
/bin/bash -l -c "\ /bin/bash -l -c "
for i in {1..100}; do pkill -u runner$newinc --signal SIGKILL; done ;\ for i in {1..100}
find /tmp -user runner$newinc -exec /bin/rm -rf {} \; ;\ do
find /var/tmp -user runner$newinc -exec /bin/rm -rf {} \; ;\ pkill -u runner$newinc --signal SIGKILL
find /var/lock -user runner$newinc -exec /bin/rm -rf {} \; ;\ done
find /dev/shm -user runner$newinc -exec /bin/rm -rf {} \; ;\
find /run/lock -user runner$newinc -exec /bin/rm -rf {} \; ;\ find /tmp -user runner$newinc -delete
" > /dev/null 2>&1 & find /var/tmp -user runner$newinc -delete
find /var/lock -user runner$newinc -delete
find /dev/shm -user runner$newinc -delete
find /run/lock -user runner$newinc -delete
" > /dev/null 2>&1 &
rm -rf $basepath/tmp/$epoch rm -rf $basepath/tmp/$epoch

View File

@ -1,2 +1,6 @@
cd /tmp/$2 #!/bin/bash
runuser runner$1 -c "cd /tmp/$2 ; timeout -s KILL 3 python3 -m paradoc code.code <<< args.args"
runuser runner$1 -c "
cd /tmp/$2
timeout -s KILL 3 python3 -m paradoc code.code < args.args
"

View File

@ -1,9 +1,7 @@
#!/bin/bash #!/bin/bash
cd /tmp/$2
rustc -o binary code.code
runuser runner$1 -c " runuser runner$1 -c "
cd /tmp/$2 cd /tmp/$2
rustc -o binary code.code
timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin timeout -s KILL 3 xargs -a args.args -d '\n' ./binary < stdin.stdin
" "