Skip to content

Commit fd20b1a

Browse files
fix: add the modules in dockerfile/
1 parent 829797e commit fd20b1a

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

.github/workflows/publish-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
run: |
3232
cd Judge/lib
3333
npm version patch
34-
git config --global user.name 'github-actions[bot]'
35-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
34+
git config --global user.name "GitHub Actions Bot"
35+
git config --global user.email "action@github.com"
3636
git add .
3737
git commit -m "chore: bump patch version [skip ci]"
3838
git push https://${GITHUB_PAT}@github.com/lightning-sagar/Judge.git main

judge-image-for-worker/workers/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ FROM node:22-alpine
22

33
RUN apk update && apk add --no-cache \
44
build-base \
5+
g++ \
6+
make \
7+
cmake \
58
openjdk17 \
69
python3 \
710
py3-pip \
8-
bash
11+
bash \
12+
libstdc++ \
13+
musl-dev
914

1015
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk
1116
ENV PATH="${JAVA_HOME}/bin:${PATH}"

judge-image-for-worker/workers/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import fetch from "node-fetch";
77
import "dotenv/config";
88
import { connectredis } from "./redis/redis.js";
99
import cors from "cors";
10+
import { error } from "console";
1011

1112
const app = express();
1213
const allowedOrigins = [
@@ -39,11 +40,12 @@ const redis_server = await connectredis();
3940
async function compileCode(language, codePath, execPath) {
4041
if (language === "cpp") {
4142
return new Promise((resolve, reject) => {
43+
console.log("checks: ",codePath,execPath,language)
4244
exec(
4345
`g++ "${codePath}" -o "${execPath}"`,
4446
{ timeout: 10000 },
4547
(err, _, stderr) => {
46-
if (err) return reject("C++ Compilation Error:\n" + stderr);
48+
if (err) return reject("C++ Compilation Error:\n" + stderr || error.message);
4749
resolve();
4850
}
4951
);

judge-image-for-worker/workers/redis/redis.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const connectredis = async () => {
1919
})
2020
.catch((err) => {
2121
console.log({ err: "error while connecting" });
22+
return process.exit(1)
2223
});
2324

2425
return client;

worker-ops/judge-workers.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,19 @@ spec:
2020
ports:
2121
- containerPort: 5000
2222
env:
23-
- name: WORKER_FIELD
24-
valueFrom:
25-
fieldRef:
26-
fieldPath: metadata.name
23+
- name: PORT
24+
value: '3000'
2725
- name: host_redis
28-
value: "redis-19417.c270.us-east-1-3.ec2.redns.redis-cloud.com"
26+
value: 'redis-10605.c81.us-east-1-2.ec2.redns.redis-cloud.com'
2927
- name: password_redis
30-
value: "e5qUny4OV6WiMnOPWt4bRM9NmEmOYa91"
28+
value: 'm0lxMKQLt21NqkeQy6EckxAZEFBYE9Es'
3129
resources:
3230
requests:
33-
memory: "256Mi"
34-
cpu: "500m"
35-
limits:
3631
memory: "512Mi"
3732
cpu: "1000m"
33+
limits:
34+
memory: "1024Mi"
35+
cpu: "2000m"
3836
readinessProbe:
3937
exec:
4038
command: ["/bin/sh", "-c", "g++ --version"]

0 commit comments

Comments
 (0)