Commit dc16a66d authored by CAMPION Sebastien's avatar CAMPION Sebastien

first release compatible with runner

parent 08b546b9
......@@ -7,6 +7,9 @@ from main.models import AllgoUser
# Define an inline admin descriptor for Employee model
# which acts a bit like a singleton
from .models import Runner, Webapp
class AllgoUserInline(admin.StackedInline):
model = AllgoUser
can_delete = False
......@@ -21,3 +24,5 @@ class UserAdmin(BaseUserAdmin):
# Re-register UserAdmin
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
admin.site.register(Runner)
admin.site.register(Webapp)
\ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-18 09:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0002_auto_20180418_0755'),
]
operations = [
migrations.CreateModel(
name='JobLogs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('msg', models.TextField(blank=True, null=True)),
('dj_job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='job', to='main.Job')),
],
options={
'db_table': 'dj_job_logs',
},
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-18 09:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0003_joblogs'),
]
operations = [
migrations.AddField(
model_name='joblogs',
name='linenumber',
field=models.IntegerField(default=0),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-04-18 09:22
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0004_joblogs_linenumber'),
]
operations = [
migrations.RenameModel(
old_name='JobLogs',
new_name='JobLog',
),
]
......@@ -35,7 +35,7 @@ class AllgoUser(models.Model):
db_table = 'dj_users'
def getApp(self):
return [a.name for a in Webapp.objects.filter(user_id=self.user.id)]
return [a.name.lower() for a in Webapp.objects.filter(user_id=self.user.id)]
class DockerOs(TimeStampModel):
......@@ -212,6 +212,15 @@ class Job(TimeStampModel):
db_table = 'dj_jobs'
class JobLog(TimeStampModel):
msg = models.TextField(blank=True, null=True)
linenumber = models.IntegerField(default=0)
dj_job = models.ForeignKey(Job, related_name="job")
class Meta:
db_table = 'dj_job_logs'
class JobUploads(TimeStampModel):
"""
Data uploaded by the user to feed a given webapp
......
......@@ -6,9 +6,10 @@ app_name = 'main'
urlpatterns = [
url(r'^$', views.index, name="home"),
url(r'^tokens$', views.tokens, name="tokens"),
url(r"^runner/cmd/[sha1|sha256|md5]*:(\b[0-9a-f]{5,40}\b)$", views.runner_cmd, name="runner_cmd"),
url(r"^runner/dw/(\d+)/(.*)", views.runner_dw, name="runner_dw"),
url(r"^runner/up/(.*)", views.runner_up, name="runner_up"),
url(r"^runner/cmd$", views.runner_cmd, name="runner_cmd"),
url(r"^runner/dw/(\d+)/(.*)", views.runner_dw, name="runner_dw"),
url(r"^runner/up/(\d+)/[sha1|sha256|md5]*:(\b[0-9a-f]{5,40}\b)/(\d+)", views.runner_up, name="runner_up"),
url(r"^runner/logs/(\d+)", views.runner_log, name="runner_log"),
url(r'^registryhook', views.registryhook, name="registryhook"),
url(r'^jupyter$', views.jupyter, name="jupyter"),
url(r'^apps/$', views.WebappList.as_view(), name='webapp_list'),
......
This diff is collapsed.
......@@ -25,6 +25,9 @@ USE_L10N = True
USE_TZ = True
ALLGO_DJANGO_REGISTRY = os.environ.get("ALLGO_DJANGO_REGISTRY")
# DATABASES
# ------------------------------------------------------------------------------
DATABASES = {
......
......@@ -22,7 +22,7 @@ services:
user: "$DOCKERUSER"
ports:
- "8008:8000"
#command: "python3 manage.py runserver 0.0.0.0:8000"
command: "python3 manage.py runserver 0.0.0.0:8000"
volumes:
- "/data/dev/django:/vol"
- "./django:/opt/allgo"
......@@ -33,9 +33,11 @@ services:
environment:
ENV: dev
PYTHONUNBUFFERED: 1
ALLGO_ALLOWED_HOSTS: 0.0.0.0,dev-django,localhost
ALLGO_DJANGO_REGISTRY: "http://localhost:5000/"
DJANGO_DEBUG: 1
DJANGO_LOG_LEVEL: "DEBUG"
ALLGO_ALLOWED_HOSTS: 0.0.0.0,dev-django,localhost
ALLGO_DATASTORE: "/vol/rw/datastore"
ALLGO_DEBUG: "True"
ALLGO_JUPYTER_URL: "http://0.0.0.0:8000/hub/login"
ALLGO_EMAIL_BACKEND: "django.core.mail.backends.console.EmailBackend"
......
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