Commit 1953b3a3 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

try cronjob kubernetes

parent 94ec375d
Pipeline #20182 passed with stages
in 3 minutes and 8 seconds
......@@ -12,8 +12,4 @@ RUN rm -rf Dockerfile
# Copy Pipfile and install
COPY . /code/
RUN pipenv install --system --deploy
# CRON
RUN crontab cron.txt
CMD cron
RUN pipenv install --system --deploy
\ No newline at end of file
......@@ -91,6 +91,6 @@ class Command(BaseCommand):
def handle(self, *args, **options):
self.set_logger_level(int(options['verbosity']))
# ComputeCounts().all()
# ComputeGeneLength().all()
ComputeCounts().all()
ComputeGeneLength().all()
ComputeTaxonomyRepartition().all()
#!/bin/bash
SCRIPTS_PATH=scripts
if [ -z $PORT ];then PORT=8000;fi # Need to fix to get value from .env file
python ${SCRIPTS_PATH}/manage.py collectstatic --no-input
python ${SCRIPTS_PATH}/manage.py makemigrations
python ${SCRIPTS_PATH}/manage.py migrate
python ${SCRIPTS_PATH}/manage.py runserver 0.0.0.0:${PORT}
......@@ -25,3 +25,6 @@ envsubst < ci/kubernetes/frontend.yaml | kubectl apply -n ${NAMESPACE} -f -
kubectl -n ${NAMESPACE} patch deployment frontend -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
## Ingress
envsubst < ci/kubernetes/ingress.yaml | kubectl apply -n ${NAMESPACE} -f -
# Cron jobs
envsubst < ci/kubernetes/cronjob.yaml | kubectl apply -n ${NAMESPACE} -f -
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello-test
image: $CI_REGISTRY_IMAGE/backend:${CI_COMMIT_REF_NAME}
args:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
......@@ -54,10 +54,10 @@ spec:
name: postgresql
resources:
requests:
memory: "1024Mi"
cpu: "100m"
memory: "2024Mi"
cpu: "200m"
limits:
memory: "4096Mi"
memory: "8096Mi"
cpu: "1000m"
volumeMounts:
- name: postgresql
......
......@@ -15,7 +15,7 @@ services:
DEBUG: "true"
depends_on:
- postgresql
command: /code/scripts/start.sh
command: /code/scripts/start_dev.sh
networks:
- main
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment