Add privileged flags where needed

This commit is contained in:
Omar Brikaa 2024-09-06 18:43:07 +03:00
parent b3cc3c14e8
commit 6b02d120fd
4 changed files with 10 additions and 6 deletions

View File

@ -92,7 +92,7 @@ jobs:
docker run -v $(pwd)'/repo:/piston/repo' -v $(pwd)'/packages:/piston/packages' -d --name repo docker.pkg.github.com/engineer-man/piston/repo-builder --no-build
docker pull docker.pkg.github.com/engineer-man/piston/api
docker build -t piston-api api
docker run --network container:repo -v $(pwd)'/data:/piston' -e PISTON_LOG_LEVEL=DEBUG -e 'PISTON_REPO_URL=http://localhost:8000/index' -d --name api piston-api
docker run --privileged --network container:repo -v $(pwd)'/data:/piston' -e PISTON_LOG_LEVEL=DEBUG -e 'PISTON_REPO_URL=http://localhost:8000/index' -d --name api piston-api
echo Waiting for API to start..
docker run --network container:api appropriate/curl -s --retry 10 --retry-connrefused http://localhost:2000/api/v2/runtimes

View File

@ -23,20 +23,21 @@ fetch_packages(){
mkdir build
# Start a piston container
docker run \
--privileged \
-v "$PWD/build":'/piston/packages' \
--tmpfs /piston/jobs \
-dit \
-p $port:2000 \
--name builder_piston_instance \
ghcr.io/engineer-man/piston
# Ensure the CLI is installed
cd ../cli
npm i
cd -
# Evalulate the specfile
../cli/index.js -u "http://127.0.0.1:$port" ppman spec $1
../cli/index.js -u "http://127.0.0.1:$port" ppman spec $1
}
build_container(){
@ -61,4 +62,4 @@ fetch_packages $SPEC_FILE
build_container $TAG
echo "Start your custom piston container with"
echo "$ docker run --tmpfs /piston/jobs -dit -p 2000:2000 $TAG"
echo "$ docker run --privileged --tmpfs /piston/jobs -dit -p 2000:2000 $TAG"

View File

@ -10,10 +10,12 @@ services:
- 2000:2000
volumes:
- ./data/piston/packages:/piston/packages
environment:
- PISTON_REPO_URL=http://repo:8000/index
tmpfs:
- /piston/jobs:exec,uid=1000,gid=1000,mode=711
environment:
- PISTON_DISABLE_NETWORKING=false
- PISTON_RUN_CPU_TIME=1000
- PISTON_LIMIT_OVERRIDES={"c++":{"run_cpu_time":700}}
repo: # Local testing of packages
build: repo

View File

@ -136,6 +136,7 @@ The API will now be online with no language runtimes installed. To install runti
```sh
docker run \
--privileged \
-v $PWD:'/piston' \
--tmpfs /piston/jobs \
-dit \