Skip to content

Commit

Permalink
Merge pull request #95 from NJUPT-SAST/feat/refactor-gojudge-mid
Browse files Browse the repository at this point in the history
feat: refactor gojudge mid
  • Loading branch information
feellmoose authored Sep 7, 2024
2 parents 885f251 + 05fbb8f commit 6f476f5
Show file tree
Hide file tree
Showing 36 changed files with 2,458 additions and 281 deletions.
4 changes: 4 additions & 0 deletions api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ lint:
use:
- DEFAULT

modules:
- path: sastoj
name: buf.build/sast-oj/backend

deps:
- buf.build/googleapis/googleapis
- buf.build/kratos/apis
Expand Down
2 changes: 1 addition & 1 deletion api/sastoj/admin/case/service/v1/case.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package api.sastoj.admin.case.service.v1;

import "google/api/annotations.proto";

option go_package = "sastoj//api/sastoj/admin/case/service/v1;v1";
option go_package = "sastoj/api/sastoj/admin/case/service/v1;v1";
option java_multiple_files = true;
option java_package = "api.sastoj.admin.case.service.v1";

Expand Down
6 changes: 3 additions & 3 deletions api/sastoj/admin/contest/service/v1/contest.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
syntax = "proto3";

package api.sastoj.admin.contest;
package api.sastoj.admin.contest.service.v1;

import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "errors/errors.proto";
import "validate/validate.proto";
option go_package = "sastoj/api/sastoj/admin/contest;contest";
option go_package = "sastoj/api/sastoj/admin/contest/service/v1;v1";
option java_multiple_files = true;
option java_package = "api.sastoj.admin.contest";
option java_package = "api.sastoj.admin.contest.service.v1";

service Contest {
rpc CreateContest (CreateContestRequest) returns (CreateContestReply){
Expand Down
2 changes: 1 addition & 1 deletion api/sastoj/admin/judge/service/v1/judge.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package api.sastoj.admin.judge.service.v1;
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";

option go_package = "sastoj//api/sastoj/admin/cases/service/v1;v1";
option go_package = "sastoj/api/sastoj/admin/cases/service/v1;v1";
option java_multiple_files = true;
option java_package = "api.sastoj.admin.cases.service.v1";

Expand Down
2 changes: 1 addition & 1 deletion api/sastoj/admin/judger/service/v1/judger.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package api.sastoj.admin.judger.service.v1;

import "google/api/annotations.proto";

option go_package = "sastoj//api/sastoj/admin/judger/service/v1;v1";
option go_package = "sastoj/api/sastoj/admin/judger/service/v1;v1";
option java_multiple_files = true;
option java_package = ".api.sastoj.admin.judger.service.v1";

Expand Down
6 changes: 3 additions & 3 deletions api/sastoj/admin/problem/service/v1/problem.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";

package api.sastoj.admin.problem;
package api.sastoj.admin.problem.service.v1;

option go_package = "sastoj/api/sastoj/admin/problem;problem";
option go_package = "sastoj/api/sastoj/admin/problem/service/v1;v1";
option java_multiple_files = true;
option java_package = "api.sastoj.admin.problem";
option java_package = "api.sastoj.admin.problem.service.v1";

import "google/api/annotations.proto";

Expand Down
212 changes: 0 additions & 212 deletions api/sastoj/admin/user/service/v1/openapi.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion api/sastoj/gojudge/judger/gojudge/v1/gojudge.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

import "google/protobuf/empty.proto";

package pb;
package criyle.gojudge.pb;

option go_package = "github.com/criyle/go-judge/pb";

Expand Down
6 changes: 3 additions & 3 deletions api/sastoj/gojudge/judger/service/v1/judge.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";

package sastoj.gojudge.judger.service.v1;
package api.sastoj.gojudge.judger.service.v1;

option go_package = "sastoj/sastoj/gojudge/judge/service/v1;v1";
option go_package = "sastoj/api/sastoj/gojudge/judge/service/v1;v1";
option java_multiple_files = true;
option java_package = "sastoj.gojudge.judge.service.v1";
option java_package = "api.sastoj.gojudge.judge.service.v1";

service Judge {
//List all judges and check status
Expand Down
2 changes: 1 addition & 1 deletion api/sastoj/rsjudge/cases/service/v1/cases.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package cases.v1;
package api.sastoj.rsjudge.cases.service.v1;

option go_package = "sastoj/api/sastoj/rsjudge/cases/service/v1;v1";

Expand Down
24 changes: 24 additions & 0 deletions app/judge/gojudge/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.22 AS builder

COPY . /src
WORKDIR /src

RUN GOPROXY=https://goproxy.cn make build

FROM debian:stable-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
&& rm -rf /var/lib/apt/lists/ \
&& apt-get autoremove -y && apt-get autoclean -y

COPY --from=builder /src/bin /app

WORKDIR /app

EXPOSE 8000
EXPOSE 9000
VOLUME /data/conf

CMD ["./server", "-conf", "/data/conf"]
Loading

0 comments on commit 6f476f5

Please sign in to comment.