Commit 96e7db74 authored by Pablo Panero's avatar Pablo Panero
Browse files

Merge branch 'openshift' into 'master'

Modify template, config.py and add documentation with new parameters for search instance deployment

See merge request webservices/cern_search_rest!24
parents 680e2356 f5c88a17
......@@ -371,14 +371,17 @@ gunicorn -b :5000 --certfile=ssl.crt --keyfile=ssl.key cern_search_rest.wsgi
CERN Search specific parameters:
-
-
-
The rest of the configuration comes from the parameters are configurable thought the Invenio Framework. The full list of
the overwriten ones is show below, nonetheless, if needed others can be overwriten (check documentation of the
corresponding project in the [invenio repository](www.github.com/inveniosoftware)):
-
-
-
\ No newline at end of file
- CERN_SEARCH_REMOTE_APP_RESOURCE: It is the ``Homepage`` value in the OAuth application registration. Note that it
should not include nor the protocol (``https://``) nor the ending slash (``\``). Basically, this would be the name of
your server, which if it is deployed in OpenShift would be like ``you-project-name.web.cern.ch``.
- CERN_SEARCH_DEFAULT_INDEX: The default index where to insert data if not index / schema is specified in the request.
- CERN_SEARCH_DEFAULT_DOC_TYPE: The value of the default document type. It must be part of the default index,
defined in the above variable.
- CERN_SEARCH_INSTANCE: The name of the instance. A folder with this name must exist in
``cern_search_rest/modules/cernsearch/jsonschemas/``, therefore, upon index creation an alias will be set for all the
indexes (mappings existing in this folder). This indexes will be the ones over whom searches will be performed.
The rest of the configuration comes from parameters that are configurable through the Invenio Framework or Flask.
The full list of the overwritten ones can be found in ``cern_search_rest/config.py``, nonetheless, if needed
others can be overwritten (check documentation of the corresponding project in the
[invenio repository](www.github.com/inveniosoftware)):
\ No newline at end of file
......@@ -4,6 +4,7 @@
from __future__ import absolute_import, print_function
import copy
import os
from invenio_oauthclient.contrib import cern
from .modules.cernsearch.permissions import (record_read_permission_factory,
......@@ -26,7 +27,7 @@ THEME_SEARCHBAR = False
CERN_REMOTE_APP = copy.deepcopy(cern.REMOTE_APP)
CERN_REMOTE_APP["params"].update(dict(request_token_params={
"resource": "test-cern-search.cern.ch", # replace with your server
"resource": os.getenv('CERN_SEARCH_REMOTE_APP_RESOURCE', 'test-cern-search.cern.ch'),
"scope": "Name Email Bio Groups",
}))
......@@ -60,13 +61,13 @@ JSONSCHEMAS_REGISTER_ENDPOINTS_UI = False
# TODO use ES central service. Change INDEXER_RECORD_TO_INDEX = 'invenio_indexer.utils.default_record_to_index'
INDEXER_DEFAULT_DOC_TYPE = 'test-doc_v0.0.1'
INDEXER_DEFAULT_INDEX = 'cernsearch-test-test-doc_v0.0.1'
INDEXER_DEFAULT_DOC_TYPE = os.getenv('CERN_SEARCH_DEFAULT_DOC_TYPE', 'test-doc_v0.0.1')
INDEXER_DEFAULT_INDEX = os.getenv('CERN_SEARCH_DEFAULT_INDEX', 'cernsearch-test-test-doc_v0.0.1')
# Search configuration
# =====================
SEARCH_MAPPINGS = ['cernsearch-test']
SEARCH_MAPPINGS = [os.getenv('CERN_SEARCH_INSTANCE', 'cernsearch-test')]
# Records REST configuration
# ===========================
......@@ -85,7 +86,7 @@ RECORDS_REST_ENDPOINTS = dict(
item_route='/record/<{0}:pid_value>'.format(_Record_PID),
list_route='/records/',
links_factory_imp='invenio_records_rest.links:default_links_factory',
record_class='cern_search_rest.modules.cernsearch.api:CernSearchRecord', # TODO
record_class='cern_search_rest.modules.cernsearch.api:CernSearchRecord',
record_serializers={
'application/json': ('invenio_records_rest.serializers'
':json_v1_response'),
......
......@@ -324,22 +324,36 @@ objects:
name: env-configmap
data:
# Invenio
INVENIO_INSTANCE_PATH: ${APP_INSTANCE_PATH}
INVENIO_INSTANCE_PATH: ${INSTANCE_PATH}
# App to allow hosts
INVENIO_APP_ALLOWED_HOSTS: ${APP_ALLOWED_HOSTS}
INVENIO_APP_ALLOWED_HOSTS: ${ALLOWED_HOSTS}
# Invenio Theme
INVENIO_THEME_FRONTPAGE_TITLE: ${SITE_NAME}
INVENIO_THEME_SITENAME: ${SITE_NAME}
INVENIO_THEME_LOGO: ${LOGO_PATH}
INVENIO_THEME_LOGO_ADMIN: ${LOGO_PATH}
INVENIO_ADMIN_VIEW_ACCESS_GROUPS: ${ADMIN_UI_ACCESS_LIST}
# CERN Search
CERN_SEARCH_REMOTE_APP_RESOURCE: ${REMOTE_APP_RESOURCE}
CERN_SEARCH_DEFAULT_INDEX: ${DEFAULT_INDEX}
CERN_SEARCH_DEFAULT_DOC_TYPE: ${DEFAULT_DOC_TYPE}
CERN_SEARCH_INSTANCE: ${SEARCH_INSTANCE}
parameters:
- name: APP_INSTANCE_PATH
- name: INSTANCE_PATH
description: "Invenio instance path for CERN Search application."
value: /usr/local/var/cernsearch/var/cernsearch-instance
- name: APP_ALLOWED_HOSTS
- name: REMOTE_APP_RESOURCE
description: "the name of the server / project"
value: 'test-cern-search.cern.ch'
- name: DEFAULT_INDEX
value: 'cernsearch-test-test-doc_v0.0.1'
- name: DEFAULT_DOC_TYPE
value: 'test-doc_v0.0.1'
- name: SEARCH_INSTANCE
value: 'cernsearch-test'
- name: ALLOWED_HOSTS
description: "Invenio App allowed hosts. Without protocol (e.g. http) nor salsh ('/') at the end"
value: "['test-cern-search.web.cern.ch']"
- name: SITE_NAME
......
Supports Markdown
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