Skip to content

Commit

Permalink
in process... #161
Browse files Browse the repository at this point in the history
  • Loading branch information
raprasad committed Jun 13, 2018
1 parent 5ffdbed commit b6842ce
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "submodules/metadata"]
path = submodules/metadata
url = https://github.com/TwoRavens/metadata.git
2 changes: 1 addition & 1 deletion Dockerfile-web
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion preprocess_web/code/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 2 additions & 4 deletions preprocess_web/code/ravens_metadata/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -52,7 +52,6 @@
'django.contrib.staticfiles',
'django.contrib.humanize',

# debug toolbar
'debug_toolbar',

# track preprocess
Expand Down Expand Up @@ -192,4 +191,3 @@


TEST_ENV_VARIABLE = os.environ.get('TEST_ENV_VARIABLE', '(nothing set)')

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from google.oauth2 import service_account


DEBUG = False
# -----------------------------------
# use Google Cloud MySQL
# -----------------------------------
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% load static %}
<!doctype html>
<html>
<head>
<title>TwoRavens Metadata</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{% static "editor/src.a65d33e9.css" %}"></head>
<body style="padding-top: 72px">
<script src="{% static "editor/src.a65d33e9.js" %}"></script>
</body>
</html>
10 changes: 9 additions & 1 deletion preprocess_web/code/ravens_metadata_apps/content_pages/urls.py
Original file line number Diff line number Diff line change
@@ -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<preprocess_id>\d{1,10})/editor',
views.view_editor,
name='view_editor_with_id'),

path('monitoring/alive',
views.view_monitoring_alive,
name='view_monitoring_alive'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions requirements/30_preprocess_web.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions requirements/40_preprocess_web_mysql.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r 30_preprocess_web.txt

# mySQL
#
mysqlclient==1.3.12
22 changes: 22 additions & 0 deletions submodules/README.md
Original file line number Diff line number Diff line change
@@ -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
```
1 change: 1 addition & 0 deletions submodules/metadata
Submodule metadata added at 9b6243

0 comments on commit b6842ce

Please sign in to comment.