-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: ProjectWorker #43
feature: ProjectWorker #43
Conversation
45097f9
to
b6ce935
Compare
@jatinkatyal13 can you have a look and let me know if I am not the correct path. |
Also how to extract zip file. I assume a library will be used for that. Let me know if you have any particular lib in your mind Edit: i used AdmZip. It is working fine. If you want a different library, i'll change it. |
Can you tell me what will be returned in which cases. (build fail, complie fail, etc ) what scores and code should be returned? |
Do I need to check how many tests are passing and how many are failing? To find out the score And code is status code right? like if it's 25, then test directory were modified. or code === 137 --> MLE , etc etc |
TODOs:
|
src/tasks/scenarios/project.ts
Outdated
run(currentJobDir: string, job: ProjectJob) { | ||
|
||
// LANG_CONFIG is undefined rn, hence card coding the value of cpus and memory | ||
const LANG_CONFIG = config.LANGS[job.lang] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will be creating a new config here named PROJECTS. In future, we might need more configurable information for these projects.
src/tasks/scenarios/project.ts
Outdated
const solutionDir = path.join(currentJobDir, job.source) | ||
await download(job.problem, solutionDir) | ||
// for testing only, change it to download | ||
var problemZip = new AdmZip('/judge-worker-prabal/current/problem.zip') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were already downloading the zip. Using exec('unzip abc.zip')
should work
src/tasks/scenarios/project.ts
Outdated
id: job.id, | ||
stderr: build_stderr, | ||
stdout: '', | ||
code: 12123, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set code to result_code
, time to result.time
and score to 0
src/tasks/scenarios/project.ts
Outdated
stdout: '', | ||
code: parseInt(result_code), | ||
time: 1, | ||
score: 12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
score will be 0
Nice job! So here are few pointers
|
@prabalsingh24 are facing any issue with the changes requested? You can always reach out to me on discord for any help. Let's complete this task and we'll be ready to deploy the new judge. |
Yeah thankss. Actually I didn't work yesterday :P I am working on it rn. I will push changes soon :) |
src/tasks/scenarios/project.ts
Outdated
} | ||
} | ||
|
||
// if hashes were equal, result_code will be found inside solution directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jatinkatyal13 is this done on purpose? result_code
and result_time
inside solutionDirectory? and other stuff in the baseDirectory? Shouldn't everything be in base directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, I'll fix this here. You can safely assume everything related to the result will be in the base directory
Codecov Report
@@ Coverage Diff @@
## project-worker #43 +/- ##
===================================================
- Coverage 90.65% 76.22% -14.44%
===================================================
Files 7 11 +4
Lines 107 143 +36
Branches 11 16 +5
===================================================
+ Hits 97 109 +12
- Misses 5 29 +24
Partials 5 5
Continue to review full report at Codecov.
|
338cacd
to
9a24b9e
Compare
Congratualtions @prabalsingh24, your pull request is merged! 🎉 Thanks for your contributions and participating in BOSS 2020. 🙌 You can claim your bounty points here. 💰 |
fixes #36, #39
Create project scenario
Send the payload to the job
Refactor src/tasks/job.ts