Skip to content

Commit

Permalink
Migrate new judge component from judge2 package.
Browse files Browse the repository at this point in the history
  • Loading branch information
mraron committed Apr 9, 2024
1 parent 980aaa2 commit 78e5fc8
Show file tree
Hide file tree
Showing 23 changed files with 155 additions and 1,235 deletions.
2 changes: 1 addition & 1 deletion cmd/glue.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"
"github.com/mraron/njudge/internal/glue"
"github.com/mraron/njudge/internal/judge2"
"github.com/mraron/njudge/internal/judge"
"github.com/mraron/njudge/internal/web/helpers/config"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down
2 changes: 1 addition & 1 deletion cmd/judge.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"errors"
"fmt"
"github.com/mraron/njudge/internal/judge2"
"github.com/mraron/njudge/internal/judge"
"github.com/mraron/njudge/pkg/language"
"github.com/mraron/njudge/pkg/language/sandbox"
"github.com/mraron/njudge/pkg/problems"
Expand Down
2 changes: 1 addition & 1 deletion internal/glue/glue.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package glue
import (
"context"
"fmt"
"github.com/mraron/njudge/internal/judge2"
"github.com/mraron/njudge/internal/judge"
"github.com/mraron/njudge/internal/njudge/db"
"github.com/mraron/njudge/internal/web/helpers/config"
"strconv"
Expand Down
4 changes: 2 additions & 2 deletions internal/glue/glue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"errors"
"github.com/mraron/njudge/internal/glue"
"github.com/mraron/njudge/internal/judge2"
"github.com/mraron/njudge/internal/judge"
"github.com/mraron/njudge/internal/njudge"
"github.com/mraron/njudge/internal/njudge/memory"
"github.com/mraron/njudge/pkg/language"
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestGlue_ProcessSubmission(t *testing.T) {
func TestJudgeIntegration(t *testing.T) {
s1, _ := sandbox.NewDummy()
s2, _ := sandbox.NewDummy()
store := problems.NewFsStore("../judge2/testdata")
store := problems.NewFsStore("../judge/testdata")
_ = store.UpdateProblems()

judge := &judge2.Judge{
Expand Down
20 changes: 4 additions & 16 deletions internal/judge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,19 @@ ARG PROJECT_NAME
FROM ubuntu:22.04 as judge_deps
RUN apt-get update && apt-get install -y wget gcc g++ git build-essential libcap-dev
WORKDIR /app
RUN git clone https://github.com/ioi/isolate.git
RUN git clone --depth 1 --branch v1.10.1 https://github.com/ioi/isolate.git
WORKDIR /app/isolate
RUN make isolate

WORKDIR /
RUN mkdir languages

WORKDIR /languages
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.4-linux-x86_64.tar.gz && \
tar zxvf julia-1.8.4-linux-x86_64.tar.gz && \
rm julia-1.8.4-linux-x86_64.tar.gz

RUN wget https://nim-lang.org/download/nim-1.6.10-linux_x64.tar.xz && \
tar xvf nim-1.6.10-linux_x64.tar.xz && \
rm nim-1.6.10-linux_x64.tar.xz

FROM ${PROJECT_NAME}-base

COPY --from=judge_deps /app/isolate /app/isolate
WORKDIR /app/isolate
RUN make install

COPY --from=judge_deps /languages/* /languages/
RUN ln -s /languages/julia-1.8.4/bin/julia /usr/local/bin/julia && \
ln -s /languages/nim-1.6.10/bin/nim /usr/bin/nim
COPY --from=julia:1.10.1 /usr/local/julia/ /usr/local/julia
COPY --from=nimlang/nim:1.6.18 /usr/bin/nim /usr/bin/nim
RUN ln -s /usr/local/julia/bin/julia /usr/local/bin/julia

WORKDIR /app
COPY configs/docker/judge_docker.json ./judge.json
Expand Down
95 changes: 0 additions & 95 deletions internal/judge/callback.go

This file was deleted.

159 changes: 0 additions & 159 deletions internal/judge/client.go

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 78e5fc8

Please sign in to comment.