From 8e4baf9e6d8d88e24efd17e8696504ebb238893a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 19 Oct 2021 19:46:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Reserve=20`static`=20notebook=20?= =?UTF-8?q?slug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0011_auto_20211019_1745.py | 29 +++++++++++++++++++ backend/sophon/notebooks/models.py | 15 +++++----- 2 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 backend/sophon/notebooks/migrations/0011_auto_20211019_1745.py diff --git a/backend/sophon/notebooks/migrations/0011_auto_20211019_1745.py b/backend/sophon/notebooks/migrations/0011_auto_20211019_1745.py new file mode 100644 index 0000000..99c3216 --- /dev/null +++ b/backend/sophon/notebooks/migrations/0011_auto_20211019_1745.py @@ -0,0 +1,29 @@ +# Generated by Django 3.2.7 on 2021-10-19 17:45 + +from django.db import migrations, models + +import sophon.notebooks.validators + + +class Migration(migrations.Migration): + dependencies = [ + ('notebooks', '0010_auto_20211019_1738'), + ] + + operations = [ + migrations.AlterField( + model_name='notebook', + name='container_image', + field=models.CharField(choices=[('steffo45/jupyterlab-docker-sophon', 'Python (Sophonic)')], default='steffo45/jupyterlab-docker-sophon', + help_text='The Docker image to run for this notebook.', max_length=256, verbose_name='Docker image'), + ), + migrations.AlterField( + model_name='notebook', + name='slug', + field=models.SlugField( + help_text='Unique alphanumeric string which identifies the project. Changing this once the container has been created will break Docker!', + max_length=64, primary_key=True, serialize=False, + validators=[sophon.notebooks.validators.DisallowedValuesValidator(['api', 'static', 'proxy', 'backend', 'frontend', 'src'])], + verbose_name='Slug'), + ), + ] diff --git a/backend/sophon/notebooks/models.py b/backend/sophon/notebooks/models.py index d740652..0632472 100644 --- a/backend/sophon/notebooks/models.py +++ b/backend/sophon/notebooks/models.py @@ -46,6 +46,7 @@ class Notebook(SophonGroupModel): validators=[ DisallowedValuesValidator([ "api", # reserved for docker deployment + "static", # reserved for production deployment "proxy", # reserved for future use "backend", # reserved for future use "frontend", # reserved for future use @@ -75,13 +76,13 @@ class Notebook(SophonGroupModel): # Remember to make a migration when changing this! IMAGE_CHOICES = ( - ("jupyter/base-notebook", "Base"), - ("jupyter/minimal-notebook", "Python"), - ("jupyter/scipy-notebook", "Python (Scientific)"), - ("jupyter/tensorflow-notebook", "Python (Tensorflow)"), - ("jupyter/r-notebook", "Python + R"), - ("jupyter/pyspark-notebook", "Python (Scientific) + Apache Spark"), - ("jupyter/all-spark-notebook", "Python (Scientific) + Scala + R + Apache Spark"), + # ("jupyter/base-notebook", "Base"), + # ("jupyter/minimal-notebook", "Python"), + # ("jupyter/scipy-notebook", "Python (Scientific)"), + # ("jupyter/tensorflow-notebook", "Python (Tensorflow)"), + # ("jupyter/r-notebook", "Python + R"), + # ("jupyter/pyspark-notebook", "Python (Scientific) + Apache Spark"), + # ("jupyter/all-spark-notebook", "Python (Scientific) + Scala + R + Apache Spark"), ("steffo45/jupyterlab-docker-sophon", "Python (Sophonic)"), )