Skip to content

Commit

Permalink
Merge #3
Browse files Browse the repository at this point in the history
3: Finish initial judge implementation r=MikailBag a=MikailBag



Co-authored-by: Mikail Bagishov <[email protected]>
  • Loading branch information
bors[bot] and MikailBag authored May 22, 2021
2 parents 79b45fd + 0c26a96 commit 690a8ee
Show file tree
Hide file tree
Showing 21 changed files with 579 additions and 308 deletions.
44 changes: 3 additions & 41 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,6 @@ name: ci
- trying
- master
jobs:
e2e-build:
env:
DOCKER_BUILDKIT: "1"
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- name: Fetch sources
uses: actions/checkout@v2
- name: Setup cache
uses: Swatinem/rust-cache@v1
- name: Build e2e artifacts
run: bash ci/e2e-build.sh
- name: Upload e2e artifacts
uses: actions/upload-artifact@v2
with:
name: e2e-artifacts
path: e2e-artifacts
retention-days: "2"
e2e-run:
needs: e2e-build
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- name: Fetch sources
uses: actions/checkout@v2
- name: Download e2e artifacts
uses: actions/download-artifact@v2
with:
name: e2e-artifacts
path: e2e-artifacts
- name: Execute tests
run: bash ci/e2e-run.sh
- name: Upload logs
uses: actions/upload-artifact@v2
with:
name: e2e-logs
path: e2e-logs
retention-days: "2"
misspell:
runs-on: ubuntu-20.04
timeout-minutes: 2
Expand Down Expand Up @@ -100,12 +62,12 @@ jobs:
steps:
- name: Fetch sources
uses: actions/checkout@v2
- name: Install nightly toolchain
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
components: clippy,rustfmt
override: "true"
toolchain: nightly
toolchain: stable
- name: Setup cache
uses: Swatinem/rust-cache@v1
- id: cargo_udeps
Expand All @@ -122,7 +84,7 @@ jobs:
mkdir -p ~/udeps
cp $( which cargo-udeps ) ~/udeps
- name: Run cargo-udeps
run: "\nexport PATH=~/udeps:$PATH \ncargo udeps \n"
run: "\nexport PATH=~/udeps:$PATH\nexport RUSTC_BOOTSTRAP=1\ncargo udeps \n"
rustfmt:
name: rustfmt
runs-on: ubuntu-20.04
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
log-contestant.json
log-full.json
76 changes: 33 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bors.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
delete-merged-branches = true
status = ["check-ci-config", "e2e-build", "e2e-run", "rustfmt", "rust-unit-tests", "rust-unused-deps", "rust-cargo-deny", "rust-lint", "publish"]
status = ["check-ci-config", "rustfmt", "rust-unit-tests", "rust-unused-deps", "rust-cargo-deny", "rust-lint", "publish"]
timeout-sec = 900
3 changes: 2 additions & 1 deletion ci/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dockerImages:
- judge
buildTimeoutMinutes: 15
buildTimeoutMinutes: 15
noE2e: true
3 changes: 3 additions & 0 deletions ci/publish-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -euxo pipefail

docker build -t judge --build-arg 'RELEASE=--release' .
42 changes: 41 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ services:
volumes:
- problems:/etc/jjs/problems:ro
- toolchains:/etc/jjs/toolchains:ro
- judge_logs:/var/log/judges
ports:
- '1789:1789'
environment:
RUST_LOG: info,warp::filters::trace=warn,judge=debug,processor=debug
setup:
build: setup
volumes:
Expand All @@ -25,16 +28,33 @@ services:
image: ghcr.io/jjs-dev/jjs-invoker:latest
# TODO: investigate why this is required
privileged: true
# only needed for interactive debugging
# pid: host
environment:
RUST_LOG: info,invoker=debug
RUST_LOG: info,invoker=trace,minion=debug,minion::linux::sandbox::watchdog=info
command:
- --shim=http://shim:8001
- --listen-address=tcp://0.0.0.0:8000
- --work-dir=/var/invoker/work
# Debugging flags; uncomment if needed
# - --debug-leak-sandboxes
# - --interactive-debug-url=http://invoker-strace-debug:8000/debug
volumes:
- pulled:/var/shim-share
- invoker_work:/var/invoker/work
- invoker_debug:/var/invoker/debug
expose:
- 8000
invoker-strace-debug:
image: ghcr.io/jjs-dev/jjs-invoker-strace-debugger:latest
privileged: true
pid: host
environment:
RUST_LOG: info,strace_debug=debug
volumes:
- strace:/var/jjs/debug/strace
expose:
- 8000
shim:
image: ghcr.io/jjs-dev/jjs-invoker-shim:latest
environment:
Expand All @@ -50,7 +70,27 @@ services:
- 8001
healthcheck:
disable: true
debug:
image: ubuntu:focal
command:
- tail
- -f
- /dev/null
volumes:
- pulled:/mnt/pulled-toolchains
- problems:/mnt/problems
- toolchains:/mnt/toolchains
- invoker_work:/mnt/invoker
- invoker_debug:/mnt/invoker-debug
- judge_logs:/mnt/judge-logs
- strace:/mnt/strace
# only needed for interactive debugging (TODO: is it actually needed?)
# pid: host
volumes:
pulled: {}
problems: {}
toolchains: {}
invoker_work: {}
invoker_debug: {}
judge_logs: {}
strace: {}
1 change: 1 addition & 0 deletions invoker-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl ClientBuilder {
pub fn add(&mut self, pool: Pool) {
self.pools.push(pool.0);
}

/// Builds a client
pub fn build(self) -> Client {
Client {
Expand Down
Loading

0 comments on commit 690a8ee

Please sign in to comment.