mirror of
https://github.com/criyle/go-judge.git
synced 2025-09-26 22:39:12 +08:00
Reduce build size
This commit is contained in:
parent
0db852c242
commit
a0cc4acbe8
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@ -35,10 +35,10 @@ jobs:
|
||||
GOARCH:
|
||||
- amd64
|
||||
steps:
|
||||
- name: Set up Go 1.14
|
||||
- name: Set up Go 1.15
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.14
|
||||
go-version: 1.15
|
||||
- name: Check out
|
||||
uses: actions/checkout@v2
|
||||
- name: Get git tag ref
|
||||
@ -59,7 +59,7 @@ jobs:
|
||||
GOARCH: ${{ matrix.GOARCH }}
|
||||
run: |
|
||||
go generate ./cmd/executorserver
|
||||
go build -o executorserver ./cmd/executorserver
|
||||
go build -tags nomsgpack -o executorserver ./cmd/executorserver
|
||||
go build -o executorshell ./cmd/executorshell
|
||||
- name: Build shared objects on Linux
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
@ -109,7 +109,7 @@ jobs:
|
||||
GOARCH: ${{ matrix.GOARCH }}
|
||||
run: |
|
||||
go generate ./cmd/executorserver
|
||||
go build -o executorserver.exe ./cmd/executorserver
|
||||
go build -tags nomsgpack -o executorserver.exe ./cmd/executorserver
|
||||
- name: Build shared object on Windows
|
||||
if: ${{ matrix.os == 'windows-latest' }}
|
||||
env:
|
||||
@ -145,7 +145,7 @@ jobs:
|
||||
GOARCH: ${{ matrix.GOARCH }}
|
||||
run: |
|
||||
go generate ./cmd/executorserver
|
||||
go build -o executorserver ./cmd/executorserver
|
||||
go build -tags nomsgpack -o executorserver ./cmd/executorserver
|
||||
go build -o executorshell ./cmd/executorshell
|
||||
- name: Build shared object on macOS
|
||||
if: ${{ matrix.os == 'macos-latest' }}
|
||||
|
@ -11,7 +11,7 @@ RUN go mod download
|
||||
|
||||
COPY ./ /go/judge
|
||||
|
||||
RUN go build -o executorserver ./cmd/executorserver && \
|
||||
RUN go build -tags nomsgpack -o executorserver ./cmd/executorserver && \
|
||||
go build -o cinit ./cmd/cinit && \
|
||||
go build -buildmode=c-shared -o executor_server.so ./cmd/ffi/
|
||||
|
||||
|
@ -8,7 +8,7 @@ RUN go mod download
|
||||
|
||||
COPY ./ /go/judge
|
||||
|
||||
RUN go build -o executorserver ./cmd/executorserver \
|
||||
RUN go build -tags nomsgpack -o executorserver ./cmd/executorserver \
|
||||
&& go build -o cinit ./cmd/cinit \
|
||||
&& go build -buildmode=c-shared -o executor_server.so ./cmd/ffi/
|
||||
|
||||
|
@ -59,7 +59,7 @@ Sandbox:
|
||||
- for example, by default container 0 will run with 10001 uid & gid and container 1 will run with 10002 uid & gid...
|
||||
- `-enable-cpu-rate` enabled `cpu` cgroup to control cpu rate using cfs_quota & cfs_period control
|
||||
- `-cpu-cfs-period` specifies cfs_period if cpu rate is enabled (default 100ms) (valid value: \[1ms, 1s\])
|
||||
- `-seccomp-conf` specifies `seecomp` filter setting to load when running program
|
||||
- `-seccomp-conf` specifies `seecomp` filter setting to load when running program (need build tag `seccomp`)
|
||||
- for example, by `strace -c prog` to get all `syscall` needed and restrict to that sub set
|
||||
- however, the `syscall` count 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`
|
||||
|
9
env/noseccomp_linux.go
vendored
Normal file
9
env/noseccomp_linux.go
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// +build !seccomp
|
||||
|
||||
package env
|
||||
|
||||
import "syscall"
|
||||
|
||||
func readSeccompConf(name string) ([]syscall.SockFilter, error) {
|
||||
return nil, nil
|
||||
}
|
2
env/seccomp_linux.go
vendored
2
env/seccomp_linux.go
vendored
@ -1,3 +1,5 @@
|
||||
// +build seccomp
|
||||
|
||||
package env
|
||||
|
||||
import (
|
||||
|
Loading…
Reference in New Issue
Block a user