feat(runner): add the own code runner contract, client and nsjail service
This commit is contained in:
1 parent
5e1db37746
commit
cdf6bcbb91
109 files changed
+24084
-28
No files matched your search
@@ -0,0 +1,59 @@
|
||||
# DEVELOPMENT ONLY: the code runner on a developer machine (Docker Desktop).
|
||||
#
|
||||
# This file is never part of a release or a production deployment. It gives
|
||||
# the container `privileged: true`, because nsjail needs namespaces and a
|
||||
# writable cgroup v2 tree inside the Docker Desktop VM, and it serves plain
|
||||
# HTTP on loopback. A privileged container on the core application host is
|
||||
# forbidden; production runs the runner image only inside its dedicated VM
|
||||
# with TLS and without these switches (see docs/en/DEPLOY.md).
|
||||
#
|
||||
# Use it through make -C deploy runner-dev-up, which creates the local token
|
||||
# file named by RUNNER_DEV_TOKEN_FILE.
|
||||
services:
|
||||
runner:
|
||||
build:
|
||||
context: ../../runner
|
||||
dockerfile: Dockerfile
|
||||
image: lincodex-runner-dev:local
|
||||
# DEV ONLY: see the header.
|
||||
privileged: true
|
||||
cgroup: private
|
||||
# Reaps any orphan as a second line of defense; the runner itself lets
|
||||
# nsjail reap every jailed process.
|
||||
init: true
|
||||
read_only: true
|
||||
environment:
|
||||
RUNNER_LISTEN_ADDRESS: ":8080"
|
||||
# DEV ONLY: production requires RUNNER_TLS_CERT_FILE and RUNNER_TLS_KEY_FILE.
|
||||
RUNNER_DEV_ALLOW_PLAINTEXT_HTTP: "true"
|
||||
RUNNER_API_TOKEN_FILE: /run/secrets/runner_api_token
|
||||
RUNNER_MAX_CONCURRENT_RUNS: "1"
|
||||
secrets:
|
||||
- runner_api_token
|
||||
tmpfs:
|
||||
- /var/lib/lincodex-runner/work:size=64m,mode=0711
|
||||
ports:
|
||||
- "127.0.0.1:${RUNNER_DEV_HTTP_PORT:-8070}:8080"
|
||||
healthcheck:
|
||||
test: ["CMD", "/opt/lincodex-runner/lincodex-runner", "healthcheck"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
start_period: 5s
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: "3"
|
||||
# The planned runner VM has 2 vCPU and 3 GB.
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "2.0"
|
||||
memory: 3G
|
||||
pids: 512
|
||||
|
||||
secrets:
|
||||
runner_api_token:
|
||||
file: ${RUNNER_DEV_TOKEN_FILE:?Set RUNNER_DEV_TOKEN_FILE or use make -C deploy runner-dev-up}
|
||||
Reference in new issue
Block a user