Skip to content

Commit 688b94e

Browse files
committed
Rename invoker -> judge
1 parent 7441e1e commit 688b94e

39 files changed

+159
-162
lines changed

Cargo.lock

Lines changed: 46 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ opt-level = 0
3636
[workspace]
3737
# TODO: add other as they are fixed
3838
members=[ "src/devtool", "src/gen-api-client", "src/cli", "src/client",
39-
"src/problem-loader", "src/invoker", "src/dist-files-generator",
40-
"src/dist-builder", "src/svaluer", "src/invoker-api", "src/pps/api",
39+
"src/problem-loader", "src/judge", "src/dist-files-generator",
40+
"src/dist-builder", "src/svaluer", "src/judging-apis", "src/pps/api",
4141
"src/pps/cli", "src/pps/server" ]
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: Role
33
metadata:
4-
name: invoker
4+
name: judge
55
rules:
66
- apiGroups: [""]
77
resources: ["configmaps"]
@@ -10,27 +10,27 @@ rules:
1010
apiVersion: v1
1111
kind: ServiceAccount
1212
metadata:
13-
name: invoker
13+
name: judge
1414
---
1515
apiVersion: rbac.authorization.k8s.io/v1
1616
kind: RoleBinding
1717
metadata:
18-
name: invoker
18+
name: judge
1919
subjects:
2020
- kind: ServiceAccount
21-
name: invoker
21+
name: judge
2222
apiGroup: ""
2323
roleRef:
2424
kind: Role
25-
name: invoker
25+
name: judge
2626
apiGroup: rbac.authorization.k8s.io
2727
---
2828
apiVersion: apps/v1
2929
kind: Deployment
3030
metadata:
31-
name: invoker
31+
name: judge
3232
labels:
33-
app: invoker
33+
app: judge
3434
# {{- if .Values.dev.kubeScore }}
3535
annotations:
3636
kube-score/ignore: container-security-context
@@ -39,21 +39,21 @@ spec:
3939
replicas: 1
4040
selector:
4141
matchLabels:
42-
app: invoker
42+
app: judge
4343
template:
4444
metadata:
4545
labels:
46-
app: invoker
46+
app: judge
4747
spec:
48-
serviceAccountName: invoker
48+
serviceAccountName: judge
4949
containers:
50-
- name: invoker
50+
- name: judge
5151
env:
5252
- name: RUST_LOG
53-
value: info,invoker=trace,problem_loader=trace,puller=trace
53+
value: info,judger=trace,problem_loader=trace,puller=trace
5454
- name: JJS_AUTH_DATA_INLINE
5555
value: '{"endpoint": "http://apiserver:1779/", "auth": {"byToken": {"token": "Dev::root"}}}'
56-
image: "{{ .Values.image.repositoryPrefix }}invoker:{{ .Values.image.tag }}"
56+
image: "{{ .Values.image.repositoryPrefix }}judge:{{ .Values.image.tag }}"
5757
imagePullPolicy: {{ .Values.image.pullPolicy }}
5858
securityContext:
5959
privileged: true
@@ -69,7 +69,7 @@ spec:
6969
apiVersion: v1
7070
kind: Service
7171
metadata:
72-
name: invoker
72+
name: judge
7373
spec:
7474
type: ClusterIP
7575
ports:
@@ -78,4 +78,4 @@ spec:
7878
protocol: TCP
7979
name: http
8080
selector:
81-
app: invoker
81+
app: judge

k8s/jjs/templates/network-policy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ spec:
1616
apiVersion: networking.k8s.io/v1
1717
kind: NetworkPolicy
1818
metadata:
19-
name: builtin-invoker
19+
name: builtin-judge
2020
spec:
2121
podSelector:
2222
matchLabels:
23-
app: invoker
23+
app: judge
2424
policyTypes:
2525
- Ingress
2626
ingress: []

src/dist-builder/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ fn make_rust_package_list() -> Vec<RustPackage> {
193193
add("pps-cli", "jjs-pps", Section::Tool);
194194
//add("userlist", "jjs-userlist", Section::Tool);
195195
add("cli", "jjs-cli", Section::Tool);
196-
add("invoker", "jjs-invoker", Section::Daemon);
196+
add("judge", "jjs-judge", Section::Daemon);
197197
add("svaluer", "jjs-svaluer", Section::Tool);
198198
/*add(
199199
"configure-toolchains",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
[package]
3-
name = "invoker"
3+
name = "judge"
44
version = "0.1.0"
55
authors = ["Mikail Bagishov <bagishov.mikail@yandex.ru>"]
66
edition = "2018"
@@ -11,7 +11,7 @@ serde = { version = "1.0.115", features = ["derive"] }
1111
serde_json = "1.0.57"
1212
dotenv = "0.15.0"
1313
aho-corasick = "0.7.13"
14-
invoker-api = {path = "../invoker-api"}
14+
judging-apis = {path = "../judging-apis"}
1515
pom = {path = "../pom"}
1616
libc = "0.2.76"
1717
nix = "0.18.0"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates
33
ENV JJS_DATA=/data
44
ENV JJS_AUTH_DATA=/auth/authdata.yaml
55
ENV RUST_BACKTRACE=1
6-
COPY jjs-invoker /bin/jjs-invoker
7-
ENTRYPOINT ["jjs-invoker"]
6+
COPY jjs-judge /bin/jjs-judge
7+
ENTRYPOINT ["jjs-judge"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
33
#[derive(Deserialize, Serialize, Debug)]
44
#[serde(deny_unknown_fields)]
55
#[serde(rename_all = "kebab-case")]
6-
pub struct InvokerConfig {
6+
pub struct JudgeConfig {
77
/// How many workers should be spawned
88
/// By default equal to processor count
99
#[serde(default)]
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub enum InvocationFinishReason {
3636
/// Contains both judging task and back address.
3737
/// Each task source is represented as mpsc channel of `TaskInfo`s
3838
pub struct JudgeRequestAndCallbacks {
39-
pub request: invoker_api::JudgeRequest,
39+
pub request: judging_apis::JudgeRequest,
4040
pub callbacks: Arc<dyn JudgeResponseCallbacks>,
4141
}
4242

@@ -62,13 +62,13 @@ pub trait JudgeResponseCallbacks: Send + Sync {
6262
async fn add_outcome_header(
6363
&self,
6464
invocation_id: Uuid,
65-
header: invoker_api::JudgeOutcomeHeader,
65+
header: judging_apis::JudgeOutcomeHeader,
6666
) -> anyhow::Result<()>;
6767

6868
async fn deliver_live_status_update(
6969
&self,
7070
invocation_id: Uuid,
71-
lsu: invoker_api::LiveStatusUpdate,
71+
lsu: judging_apis::LiveStatusUpdate,
7272
) -> anyhow::Result<()>;
7373
}
7474

@@ -77,7 +77,7 @@ pub struct Controller {
7777
scheduler: Arc<Scheduler>,
7878
problem_loader: Arc<problem_loader::Loader>,
7979
toolchains_dir: Arc<Path>,
80-
_config: Arc<crate::config::InvokerConfig>,
80+
_config: Arc<crate::config::JudgeConfig>,
8181
// used as RAII resource owner
8282
_temp_dir: Arc<tempfile::TempDir>,
8383
toolchain_loader: Arc<toolchains::ToolchainLoader>,
@@ -98,7 +98,7 @@ fn get_num_cpus() -> usize {
9898
impl Controller {
9999
pub async fn new(
100100
cfg_data: util::cfg::CfgData,
101-
config: Arc<crate::config::InvokerConfig>,
101+
config: Arc<crate::config::JudgeConfig>,
102102
) -> anyhow::Result<Controller> {
103103
let worker_count = match config.workers {
104104
Some(cnt) => cnt,

0 commit comments

Comments
 (0)