Configurations
Command Line Arguments
Server
- The default binding address for the go judge is
localhost:5050. Can be specified with-http-addrflag. - By default gRPC endpoint is disabled, to enable gRPC endpoint, add
-enable-grpcflag. - The default binding address for the gRPC go judge is
localhost:5051. Can be specified with-grpc-addrflag. - The default log level is info, use
-silentto disable logs or use-releaseto enable release logger (auto turn on if in docker). -auth-tokento add token-based authentication to REST / gRPC- By default, the GO debug endpoints (
localhost:5052/debug) are disabled, to enable, specifies-enable-debug, and it also enables debug log - By default, the prometheus metrics endpoints (
localhost:5052/metrics) are disabled, to enable, specifies-enable-metrics - Monitoring HTTP endpoint is enabled if metrics / debug is enabled, the default addr is
localhost:5052and can be specified by-monitor-addr
Sandbox
- The default concurrency equal to number of CPU, Can be specified with
-parallelismflag. - The default file store is in memory, local cache can be specified with
-dirflag. - The default CGroup prefix is
gojudge, Can be specified with-cgroup-prefixflag. -src-prefixto restrictsrccopyIn path split by comma (need to be absolute path) (example:/bin,/usr)-time-limit-checker-intervalspecifies time limit checker interval (default 100ms) (valid value: [1ms, 1s])-output-limitspecifies size limit of POSIX rlimit of output (default 256MiB)-extra-memory-limitspecifies the additional memory limit to check memory limit exceeded (default 16KiB)-copy-out-limitspecifies the default file copy out max (default 64MiB)-open-file-limitspecifies the max number of open files (default 256)-cpusetspecifiescpuset.cpuscgroup for each container (Linux only)-container-cred-startspecifies containersetuid/setgidcredential start point (default: 0 (disabled)) (Linux only)- for example, by default container 0 will run with 10001 uid & gid and container 1 will run with 10002 uid & gid...
-enable-cpu-rateenabledcpucgroup to control cpu rate using cfs_quota & cfs_period control (Linux only)-cpu-cfs-periodspecifies cfs_period if cpu rate is enabled (default 100ms) (valid value: [1ms, 1s])
-seccomp-confspecifiesseccompfilter setting to load when running program (need build tagseccomp) (Linux only)- for example, by
strace -c progto get allsyscallneeded and restrict to that sub set - however, the
syscallcount in one platform(e.g. x86_64) is not suitable for all platform, so this option is not recommended - the program killed by seccomp filter will have status
Dangerous Syscall
- for example, by
-pre-forkspecifies number of container to create when server starts-tmp-fs-paramspecifies the tmpfs parameter for/wand/tmpwhen using default mounting (Linux only)-file-timeoutspecifies maximum TTL for file created in file store (e.g.30m)-mount-confspecifies detailed mount configuration, please refermount.yamlas a reference (Linux only)-container-init-pathspecifies path tocinit(do not use, debug only) (Linux only)-no-fallbackexit the program if creating cgroup failed and trying to fallback to rlimit / rusage mode (Linux only)
Environment Variables
Environment variable will be override by command line arguments if they both present and all command line arguments have its correspond environment variable (e.g. ES_HTTP_ADDR). Run go-judge --help to see all the environment variable configurations.