Commit 3d284e5f authored by Carina Antunes's avatar Carina Antunes
Browse files

REVERT to 1.3.0

parent fe6ea401
......@@ -4,4 +4,3 @@ Authors
CERN Search as a Service REST API.
- Pablo Panero <pablo.panero@cern.ch>
- Carina Antunes <carina.antunes@cern.ch>
Changes
=======
**Version 1.3.2-beta (released 2020-08-20)**
Changes:
- [NI] Add sentry-sdk dependency
----
**Version 1.3.1-beta (released 2020-08-18)**
Changes:
- [SEARCH-86] Upgrade to invenio 3.3
----
**Version 1.3.0-beta (released 2020-07-06)**
Changes:
......
......@@ -7,20 +7,21 @@
# under the terms of the MIT License; see LICENSE file for more details.
# Use CentOS7:
FROM gitlab-registry.cern.ch/webservices/cern-search/cern-search-rest-api/cern-search-rest-api-base:fd5962cd26cdea5743b8c2802a01ff25b62ddb57
FROM gitlab-registry.cern.ch/webservices/cern-search/cern-search-rest-api/cern-search-rest-api-base:bfdd86117598a031f427328c9d276f7f1b782520
ARG build_env
# Switch to base once issues with pipenv are fixed
RUN yum update -y && \
yum install -y mailcap
# CERN Search installation
WORKDIR /${WORKING_DIR}/src
ADD . /${WORKING_DIR}/src
RUN pip freeze
# If env is development, install development dependencies
RUN if [ "$build_env" != "prod" ]; then pipenv install --system --ignore-pipfile --deploy --dev; fi
RUN pip freeze
# Install CSaS
RUN pip install -e .
......
......@@ -7,46 +7,46 @@ verify_ssl = true
flake8 = ">=3.7.9"
flake8-docstrings = ">=1.5.0"
isort = "==4.3.21"
pytest-dotenv = "*"
pytest-invenio = ">=1.2.0"
pytest-mock = ">=1.6.0"
pytest-dotenv = "*"
[packages]
Flask = "*"
eventlet = "*"
gevent = ">=1.4.0"
invenio-access = ">=1.4.1,<1.5.0"
invenio-accounts = ">=1.3.0,<1.4.0"
invenio-admin = ">=1.2.1,<1.3.0"
invenio-app = ">=1.2.6,<1.3.0"
invenio-assets = ">=1.1.3,<1.2.0"
invenio-base = ">=1.2.3,<1.3.0"
invenio-celery = ">=1.2.0,<1.3.0"
invenio-config = ">=1.0.3,<1.1.0"
invenio-db = {version = ">=1.0.5,<1.1.0",extras = ["postgresql", "versioning"]}
invenio-files-processor = {extras = ["tika"],git = "https://github.com/carantunes/invenio-files-processor.git",ref = "1.0.2-alpha"}
invenio-files-rest = ">=1.2.0,<1.3.0"
invenio-indexer = ">=1.1.1,<1.2.0"
invenio-jsonschemas = ">=1.1.0,<1.2.0"
invenio-logging = {extras = ["sentry-sdk"],version = ">=1.3.0,<1.4.0"}
invenio-oauth2server = ">=1.2.0,<1.3.0"
invenio-oauthclient = ">=1.3.0,<1.4.0"
invenio-records = {extras = ["postgresql"],version = ">=1.3.1,<1.4.0"}
invenio-records-files = ">=1.2.1,<1.3.0"
invenio-records-rest = ">=1.7.1,<1.8.0"
invenio-rest = ">=1.2.1,<1.3.0"
invenio-search = {extras = ["elasticsearch7"],version = ">=1.3.1,<1.4.0"}
invenio-theme = ">=1.1.4,<1.2.0"
invenio-access = ">=1.0.0,<1.1.0"
invenio-admin = ">=1.0.0,<1.1.0"
invenio-accounts = ">=1.0.0,<1.1.0"
invenio-app = "<1.3.0,>=1.2.0"
invenio-base = "<1.3.0,>=1.2.0"
invenio-config = "<1.1.0,>=1.0.2"
invenio-db = {version = ">=1.0.0,<1.1.0",extras = ["postgresql", "versioning"]}
invenio-indexer = ">=1.1.2,<1.2.0"
invenio-jsonschemas = ">=1.0.0,<1.1.0"
invenio-logging = ">=1.0.0,<1.1.0"
invenio-records-rest = "<=1.7.0,>1.6.5"
invenio-records = {extras = ["postgresql"],version = ">=1.0.0,<1.3.0"}
invenio-rest = "<1.3,>=1.2.0"
invenio-oauthclient = ">=1.0.0,<1.1.0"
invenio-oauth2server = ">=1.0.0,<1.1.0"
invenio-search = {extras = ["elasticsearch7"],version = ">=1.2.0,<1.3.0"}
invenio-theme = ">=1.1.0,<1.2.0"
ldap = "<1.1.0,>=1.0.2"
npm = ">=0.1.1"
pip = "*"
python-ldap = "<3.2.0,>=3.1.0"
raven = ">=6.9.0,<6.10.0"
redis = ">=2.10.0,<3.0.0"
uWSGI = ">=2.0.16"
uwsgi-tools = ">=1.1.1,<1.2.0"
Flask = "*"
uWSGI = ">=2.0.16"
marshmallow = "<3"
invenio-records-files = "<1.3.0,>=1.2.0"
invenio-celery = "<1.2.0,>=1.1.0"
invenio-files-rest = ">=1.0.5,<1.1.0"
gevent = ">=1.4.0"
invenio-files-processor = {extras = ["tika"],git = "https://github.com/carantunes/invenio-files-processor.git",ref = "1.0.2-alpha"}
Werkzeug = ">=0.15,<1.0.0"
pip = "*"
eventlet = "*"
wtforms = "<2.3.0"
tika = "==1.24"
[requires]
python_version = "3.6"
This diff is collapsed.
......@@ -18,7 +18,7 @@ class CSASRecordSchemaV1(RecordMetadataSchemaJSONV1):
"""Record schema."""
@validates_schema(pass_original=True)
def validate_record(self, data, original_data, **kwargs):
def validate_record(self, data, original_data):
"""Validate record."""
if not original_data.get('_access'):
raise ValidationError('Missing field _access')
......
......@@ -14,4 +14,4 @@ and parsed by ``setup.py``.
from __future__ import absolute_import, print_function
__version__ = '1.3.2-beta'
__version__ = '1.3.0-beta'
# -*- coding: utf-8 -*-
#
# This file is part of CERN Search.
# Copyright (C) 2018-2019 CERN.
#
# CERN Search is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#####################################################################################
##### DEPRECATED #####
##### Use gitlab.cern.ch/webservices/cern-search/cern-search-rest-api-openshift #####
#####################################################################################
apiVersion: v1
kind: Template
metadata:
name: cern-search-rest-api
annotations:
descriptino: "CERN Search RESTful API and necessary services OpenShift Template"
labels:
template: "cern-search-rest-api"
objects:
##############################
##### DEPLOYMENT CONFIGS #####
##############################
### CERN Search RESTful API
- kind: DeploymentConfig
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: cern-search-rest-api
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: cern-search-rest-api
deploymentconfig: cern-search-rest-api
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: cern-search-rest-api
deploymentconfig: cern-search-rest-api
spec:
containers:
- command:
- /bin/sh
- '-c'
- /code/scripts/manage-user.sh && uwsgi --module ${UWSGI_WSGI_MODULE} --socket 0.0.0.0:${UWSGI_PORT} --master --processes ${UWSGI_PROCESSES} --threads ${UWSGI_THREADS} --stats /tmp/stats.socket
envFrom:
- configMapRef:
name: env-configmap
env:
- name: INVENIO_ACCOUNTS_SESSION_REDIS_URL
value: 'redis://$(REDIS_SERVICE_HOST):$(REDIS_SERVICE_PORT)/1'
- name: INVENIO_CACHE_REDIS_URL
value: 'redis://$(REDIS_SERVICE_HOST):$(REDIS_SERVICE_PORT)/0'
- name: INVENIO_SEARCH_ELASTIC_HOSTS
valueFrom:
secretKeyRef:
name: es
key: es_credentials
- name: INVENIO_SQLALCHEMY_DATABASE_URI
valueFrom:
secretKeyRef:
name: srchdb
key: dburi
- name: INVENIO_CERN_APP_CREDENTIALS
valueFrom:
secretKeyRef:
name: oauth
key: oauth_credentials
- name: INDEXER_SENTRY_DSN
valueFrom:
secretKeyRef:
name: sentry
key: dsn
image: gitlab-registry.cern.ch/webservices/cern-search/cern-search-rest-api:latest
imagePullPolicy: Always
name: cern-search-rest-api
ports:
- containerPort: 5000
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- cern-search-rest-api
from:
kind: ImageStreamTag
name: cern-search-rest-api:latest
namespace: test-cern-search
type: ImageChange
### Redis Server
- kind: DeploymentConfig
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: redis
spec:
replicas: 1
template:
metadata:
labels:
app: cern-search-rest-api
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
name: tcp
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
emptyDir: {}
triggers:
- type: ConfigChange
### Nginx proxy pass
- kind: DeploymentConfig
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: nginx
spec:
replicas: 1
template:
metadata:
name: nginx
labels:
app: cern-search-rest-api
spec:
containers:
- name: nginx
image: 'nginx:stable-alpine'
ports:
- containerPort: 8080
protocol: TCP
volumeMounts:
- mountPath: /etc/nginx/tls
name: nginx-tls
readOnly: true
- mountPath: /etc/nginx/conf.d
name: nginx-config
- mountPath: /var/cache/nginx
name: nginx-cache
- mountPath: /var/run
name: nginx-run
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: nginx-tls
secret:
defaultMode: 420
secretName: nginx-tls
- configMap:
defaultMode: 420
name: nginx-config
name: nginx-config
- emptyDir: {}
name: nginx-cache
- emptyDir: {}
name: nginx-run
triggers:
- type: ConfigChange
##############################
########## SERVICES ##########
##############################
# Service for the RESTful API
- kind: Service
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: cern-search-rest-api
spec:
ports:
- name: 5000-tcp
port: 5000
protocol: TCP
targetPort: 5000
selector:
app: cern-search-rest-api
deploymentconfig: cern-search-rest-api
sessionAffinity: None
type: ClusterIP
# Service for the Redis server
- kind: Service
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: redis
spec:
ports:
- name: 6379-tcp
port: 6379
protocol: TCP
targetPort: 6379
selector:
app: cern-search-rest-api
deploymentconfig: redis
sessionAffinity: None
type: ClusterIP
# Service for the Nginx proxy
- kind: Service
apiVersion: v1
metadata:
name: nginx
labels:
app: cern-search-rest-api
annotations:
service.alpha.openshift.io/serving-cert-secret-name: nginx-tls
spec:
ports:
- name: 'https'
port: 8080
targetPort: 8080
selector:
app: cern-search-rest-api
deplymentConfig: nginx
type: LoadBalancer
##############################
########### ROUTES ###########
##############################
- kind: Route
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: nginx
spec:
port:
targetPort: https
tls:
destinationCACertificate:
insecureEdgeTerminationPolicy: Redirect
termination: reencrypt
to:
kind: Service
name: proxy
weight: 100
wildcardPolicy: None
##############################
######## IMAGE STREAM ########
##############################
- kind: ImageStream
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: cern-search-rest-api-image
spec:
dockerImageRepository: gitlab-registry.cern.ch/webservices/cern-search/cern-search-rest-api
##############################
######### CONFIG MAP #########
##############################
- kind: ConfigMap
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: nginx-config
data:
nginx.conf: |
# Configuration for Nginx
server {
# Running port
listen 8080 ssl;
ssl_certificate /etc/nginx/tls/tls.crt;
ssl_certificate_key /etc/nginx/tls/tls.key;
rewrite ^/$ /account/settings/applications/;
# Proxying connections to application servers
location / {
include uwsgi_params;
uwsgi_pass cern-search-api:5000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
- kind: ConfigMap
apiVersion: v1
metadata:
labels:
app: cern-search-rest-api
name: env-configmap
data:
# Invenio
INVENIO_INSTANCE_PATH: ${INSTANCE_PATH}
# Invenio Logging
INVENIO_LOGGING_SENTRY_LEVEL: ${LOGGING_LEVEL}
# App to allow 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}
INVENIO_ADMIN_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}
INVENIO_ADMIN_USER: ${ADMIN_USER}
parameters:
- name: INSTANCE_PATH
description: "Invenio instance path for CERN Search application."
value: /usr/local/var/cernsearch/var/cernsearch-instance
- 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: ADMIN_USER:
value: 'cernsearch@cern.ch'
- 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
description: "CERN Search site name (E.g. EDMS, Indico, etc.)"
value: CERN Search
- name: LOGO_PATH
description: "CERN Search site logo (E.g. /images/cernsearchicon.png)"
value: /images/cernsearchicon.png
- name: ADMIN_UI_ACCESS_LIST
description: "List of comma separated egroups that have access to the ADMIN UI (e.g. 'egroup_one,egroup_two')"
value: "CernSearch-Administrators@cern.ch"
- name: LOGGING_LEVEL
description: "Logging level of the application"
value: 'WARNING'
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