Skip to content
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

Added plagiarism_detector script #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions k8s/omegaup/base/frontend/cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,49 @@ spec:
- name: cronjobs-secret
secret:
secretName: cronjobs-secret
---
apiVersion: batch/v1
kind: Job
metadata:
name: plagiarism_detector
spec:
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
metadata:
labels:
app.kubernetes.io/name: plagiarism-detector
app.kubernetes.io/part-of: frontend-cronjobs
app.kubernetes.io/component: omegaup-frontend
spec:
restartPolicy: OnFailure
containers:
- name: cronjob
image: omegaup/frontend-sidecar
imagePullPolicy: IfNotPresent
command:
- /opt/omegaup/stuff/cron/plagiarism_detector.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hay que cambiar los parámetros para pasarle el alias de un concurso. y hay que cambiar el script para recibir el alias de un concurso y que incondicionalmente corra el detector en ese concurso únicamente y se salga en vez de hacer el proceso normal.

- --log-json
- --port=3306
volumeMounts:
- name: omegaup
mountPath: /opt/omegaup
- name: cronjobs-secret
mountPath: /home/ubuntu/.my.cnf
subPath: my.cnf
initContainers:
- name: init-volume
image: omegaup/frontend
imagePullPolicy: IfNotPresent
command: ['rsync', '-az', '/opt/omegaup/', '/mnt/omegaup/']
volumeMounts:
- name: omegaup
mountPath: /mnt/omegaup
volumes:
- name: omegaup
emptyDir: {}
- name: cronjobs-secret
secret:
secretName: cronjobs-secret