diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index 7a550f2..e0c5e12 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -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 diff --git a/builder/build.sh b/builder/build.sh index eaae21d..ca4d40f 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -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" diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 2180344..2311c5b 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -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 diff --git a/readme.md b/readme.md index b765a5b..28e552d 100644 --- a/readme.md +++ b/readme.md @@ -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 \