Commit c46fb805 authored by sebastien letort's avatar sebastien letort

Merge branch 'django' into purge_rails

parents 9849d406 ffa355b0
Pipeline #77527 passed with stages
in 3 minutes and 31 seconds
......@@ -11,3 +11,4 @@ __pycache__
.coverage
/controller/htmlcov
/.env
metrics/*.stats
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
stages:
- build
- test
- cleanning
before_script:
- docker info
- docker-compose --version
- pwd
# ---------------------------
bootstrap:
tags:
- allgo
stage: build
script: "./bootstrap"
django_pylint:
stage: test
# only:
# - /django/
script:
- docker info
- apk update
- apk upgrade
- apk add python python-dev py-pip build-base bash openssl python3
- pip install docker-compose
- mkdir -p /data/dev
- rm -Rf /data/dev/*
- /bin/bash bootstrap dev-mysql dev-controller dev-ssh dev-django dev-nginx dev-smtpsink dev-registry
- echo $PYLINTHOME
- docker exec -i dev-django pylint3 --rcfile=.pylintrc allgo
allow_failure: true
#~ django_test:
#~ stage: test
#~ # only:
#~ # - /django/
#~ script:
#~ - docker exec -i dev-django python3 manage.py test
nettoyage:
stage: cleanning
when: always
script:
- sudo rm -rf data/*
#!/bin/bash
CONTAINERS="dev-redis dev-mysql dev-controller dev-ssh dev-django dev-smtpsink dev-registry dev-nginx"
CONTAINERS="dev-redis dev-mysql dev-controller dev-ssh dev-django dev-smtpsink dev-registry dev-nginx dev-toolbox"
die()
......
......@@ -29,4 +29,7 @@ ENV ENV="" \
ALLGO_REDIS_HOST="{ENV}-redis" \
ALLGO_IMPORT_REGISTRY="cargo.irisa.fr:8003/allgo/prod/webapp"
# to prevent __pycache__generation, which is owned by root.
ENV PYTHONDONTWRITEBYTECODE 1
LABEL dk.migrate_always=1
This diff is collapsed.
......@@ -10,7 +10,9 @@ RUN apt-getq update && apt-getq install \
python-mysqldb python3-crypto gunicorn3 python3-redis python-mysqldb \
python3-crypto python3-natsort python3-aiohttp python3-aioredis supervisor \
python3-ipy python3-django-taggit python3-iso8601 python3-robot-detection \
python3-sqlparse
python3-sqlparse \
python3-django-extensions python3-pydotplus \
python3-pylint-django
COPY requirements.txt /tmp/
RUN cd /tmp && pip3 install -r requirements.txt && rm requirements.txt
......@@ -22,6 +24,7 @@ USER allgo
WORKDIR /opt/allgo
LABEL dk.migrate_always=1
ENV PYTHONUNBUFFERED 1
ENV PYLINTHOME /opt/allgo_metrics
# NOTE: we use SIGINT instead of SIGTERM because the django server does not
# catch SIGTERM (while gunicorn catches both SIGTERM & SIGINT)
......
......@@ -662,7 +662,7 @@ class AllgoAio:
"""
try:
job_ids = {int(x) for x in request.url.query.getall("id")}
job_ids = {int(x) for x in request.url.query.getall("id", ())}
# limit the number of jobs in a single request
if len(job_ids) > 20:
raise ValueError()
......
......@@ -81,7 +81,7 @@ DATABASES = {
'HOST': env.ALLGO_DATABASE_HOST,
'OPTIONS': {'sql_mode': env.ALLGO_DATABASE_MODE},
'TEST': {
'NAME': 'test_allgo',
'NAME': 'allgo_test',
'CHARSET': 'utf8',
'COLLATE': 'utf8_general_ci',
},
......@@ -115,6 +115,7 @@ THIRD_PARTY_APPS = [
'allauth.socialaccount',
'allauth.socialaccount.providers.gitlab',
'taggit',
'django_extensions',
]
LOCAL_APPS = [
'main',
......
#! /bin/bash
# TODO: the command should be placed in the Makefile or an official doc.
# It should be ran in the django container.
# cf https://django-extensions.readthedocs.io/en/latest/graph_models.html
python3 ./manage.py graph_models --all-applications --group-models --output allgo_model.png
......@@ -27,6 +27,7 @@ services:
volumes:
- "/data/dev/django:/vol"
- "./django:/opt/allgo"
- "./metrics:/opt/allgo_metrics"
networks: [dev]
tty: true
stdin_open: true
......
This directory will get the metrics from django pylint.
And this file aims to make the directory committed.
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