diff --git a/.gitignore b/.gitignore index 0c0e7e42c..32f9cdbb5 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,4 @@ test_data/census demographics.tab test_data/Census_Judicial_DP_Master_782015.tab preprocess_web/code/ravens_metadata/settings/gce preprocess_web/code/ravens_metadata/settings/gce_db_params.py +deploy/test_cloudsql.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..1e258f41c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "submodules/metadata"] + path = submodules/metadata + url = https://github.com/TwoRavens/metadata.git diff --git a/Dockerfile-web b/Dockerfile-web index 353f54872..9bb2c5563 100644 --- a/Dockerfile-web +++ b/Dockerfile-web @@ -25,7 +25,7 @@ WORKDIR /var/webapps/raven-metadata-service # Copy over the requirements and run them # ------------------------------------- COPY ./requirements/ ./requirements -RUN pip3 install --no-cache-dir -r requirements/30_preprocess_web.txt +RUN pip3 install --no-cache-dir -r requirements/40_preprocess_web_mysql.txt # ------------------------------------- # Create a volume for sharing between containers diff --git a/preprocess_web/code/fabfile.py b/preprocess_web/code/fabfile.py index cb86c4550..17d037cc7 100644 --- a/preprocess_web/code/fabfile.py +++ b/preprocess_web/code/fabfile.py @@ -251,7 +251,7 @@ def run_preprocess(input_file, output_file=None): else: preprocess_cmd = 'python3 %s/preprocess.py %s' % \ (preprocess_dir, - input_file) + input_file) print('Run command: "%s"' % preprocess_cmd) local(preprocess_cmd) diff --git a/preprocess_web/code/ravens_metadata/settings/base.py b/preprocess_web/code/ravens_metadata/settings/base.py index 41fb6a3c3..8532dbc90 100644 --- a/preprocess_web/code/ravens_metadata/settings/base.py +++ b/preprocess_web/code/ravens_metadata/settings/base.py @@ -20,8 +20,8 @@ # Add path to celery task code # PREPROCESS_DIR = join(dirname(dirname(dirname(BASE_DIR))), - 'preprocess', - 'code') + 'preprocess', + 'code') sys.path.append(PREPROCESS_DIR) # Quick-start development settings - unsuitable for production @@ -52,7 +52,6 @@ 'django.contrib.staticfiles', 'django.contrib.humanize', - # debug toolbar 'debug_toolbar', # track preprocess @@ -192,4 +191,3 @@ TEST_ENV_VARIABLE = os.environ.get('TEST_ENV_VARIABLE', '(nothing set)') - diff --git a/preprocess_web/code/ravens_metadata/settings/gce_deploy_settings.py b/preprocess_web/code/ravens_metadata/settings/gce_deploy_settings.py index 54daa12cd..02c931b52 100644 --- a/preprocess_web/code/ravens_metadata/settings/gce_deploy_settings.py +++ b/preprocess_web/code/ravens_metadata/settings/gce_deploy_settings.py @@ -6,6 +6,7 @@ from google.oauth2 import service_account +DEBUG = False # ----------------------------------- # use Google Cloud MySQL # ----------------------------------- diff --git a/preprocess_web/code/ravens_metadata_apps/content_pages/templates/content_pages/editor.css b/preprocess_web/code/ravens_metadata_apps/content_pages/templates/content_pages/editor.css new file mode 100644 index 000000000..e69de29bb diff --git a/preprocess_web/code/ravens_metadata_apps/content_pages/templates/content_pages/editor.js b/preprocess_web/code/ravens_metadata_apps/content_pages/templates/content_pages/editor.js new file mode 100644 index 000000000..e69de29bb diff --git a/preprocess_web/code/ravens_metadata_apps/content_pages/templates/content_pages/editor_index.html b/preprocess_web/code/ravens_metadata_apps/content_pages/templates/content_pages/editor_index.html new file mode 100644 index 000000000..13d3a6947 --- /dev/null +++ b/preprocess_web/code/ravens_metadata_apps/content_pages/templates/content_pages/editor_index.html @@ -0,0 +1,12 @@ +{% load static %} + + + + TwoRavens Metadata + + + + + + + diff --git a/preprocess_web/code/ravens_metadata_apps/content_pages/urls.py b/preprocess_web/code/ravens_metadata_apps/content_pages/urls.py index 8aa0c1c36..917316a50 100644 --- a/preprocess_web/code/ravens_metadata_apps/content_pages/urls.py +++ b/preprocess_web/code/ravens_metadata_apps/content_pages/urls.py @@ -1,8 +1,16 @@ -from django.urls import path +from django.urls import path, re_path from ravens_metadata_apps.content_pages import views urlpatterns = ( + path('editor', + views.view_editor, + name='view_editor'), + + re_path(r'editor/(?P\d{1,10})/editor', + views.view_editor, + name='view_editor_with_id'), + path('monitoring/alive', views.view_monitoring_alive, name='view_monitoring_alive'), diff --git a/preprocess_web/code/ravens_metadata_apps/content_pages/views.py b/preprocess_web/code/ravens_metadata_apps/content_pages/views.py index bee7166c3..6bb5af0a1 100644 --- a/preprocess_web/code/ravens_metadata_apps/content_pages/views.py +++ b/preprocess_web/code/ravens_metadata_apps/content_pages/views.py @@ -16,6 +16,15 @@ def view_monitoring_alive(request): """For kubernetes liveness check""" return JsonResponse(get_json_success("server up")) +def view_editor(request, preprocess_id=None): + """editor landing page""" + info_dict = dict() + + return render(request, + 'content_pages/editor_index.html', + info_dict) + + @login_required def view_err_500_test(request): diff --git a/requirements/30_preprocess_web.txt b/requirements/30_preprocess_web.txt index 1555aca58..6c46016b6 100644 --- a/requirements/30_preprocess_web.txt +++ b/requirements/30_preprocess_web.txt @@ -29,6 +29,6 @@ django-guardian==1.4.9 django-storages==1.6.6 google-cloud-storage==1.10.0 -# mySQL +# for editor distribution # -mysqlclient==1.3.12 +webpack==6.0.0 diff --git a/requirements/40_preprocess_web_mysql.txt b/requirements/40_preprocess_web_mysql.txt new file mode 100644 index 000000000..76784d793 --- /dev/null +++ b/requirements/40_preprocess_web_mysql.txt @@ -0,0 +1,5 @@ +-r 30_preprocess_web.txt + +# mySQL +# +mysqlclient==1.3.12 diff --git a/submodules/README.md b/submodules/README.md new file mode 100644 index 000000000..6e9cf2812 --- /dev/null +++ b/submodules/README.md @@ -0,0 +1,22 @@ +# Submodules + +This directory is used for incorporating other git repositories. + +These repos are incorporated in two ways: + +1. **git submodules**: e.g. pointers to other github repositories. + - ref: https://git-scm.com/book/en/v2/Git-Tools-Submodules +1. copying in the repository manually + - This is in the case for a required repository that is behind a password--though not private in a licensing sense + +## Submodule Log + +**6/13/2018** + +- Add repository [TwoRavens/metadata](https://github.com/TwoRavens/metadata) + - **version**: [0.3](https://github.com/TwoRavens/metadata/releases/tag/0.3) + - **method of inclusion** + ``` + git submodule add https://github.com/TwoRavens/metadata.git + git checkout 9b62433df4e2b28e1fd3e4df13533160d3a47eb9 + ``` diff --git a/submodules/metadata b/submodules/metadata new file mode 160000 index 000000000..9b62433df --- /dev/null +++ b/submodules/metadata @@ -0,0 +1 @@ +Subproject commit 9b62433df4e2b28e1fd3e4df13533160d3a47eb9