This repository contains the helm chart to deploy an Invenio instance.
Login and select the right project:
$ oc login <your.openshift.cluster>
$ oc project invenio
Create all the needed secrets and install Invenio.
Database secrets:
$ POSTGRESQL_PASSWORD=$(openssl rand -hex 8)
$ POSTGRESQL_USER=invenio
$ POSTGRESQL_HOST=db
$ POSTGRESQL_PORT=5432
$ POSTGRESQL_DATABASE=invenio
$ oc create secret generic \
--from-literal="POSTGRESQL_PASSWORD=$POSTGRESQL_PASSWORD" \
--from-literal="SQLALCHEMY_DB_URI=postgresql+psycopg2://$POSTGRESQL_USER:$POSTGRESQL_PASSWORD@$POSTGRESQL_HOST:$POSTGRESQL_PORT/$POSTGRESQL_DATABASE" \
db-secrets
secret "db-secrets" created
RabbitMQ secrets:
$ RABBITMQ_DEFAULT_PASS=$(openssl rand -hex 8)
$ oc create secret generic \
--from-literal="RABBITMQ_DEFAULT_PASS=$RABBITMQ_DEFAULT_PASS" \
--from-literal="CELERY_BROKER_URL=amqp://guest:$RABBITMQ_DEFAULT_PASS@mq:5672/" \
mq-secrets
secret "mq-secrets" created
Elasticsearch secrets:
$ ELASTICSEARCH_PASSWORD=$(openssl rand -hex 8)
$ ELASTICSEARCH_USER=username
$ oc create secret generic \
--from-literal="ELASTICSEARCH_PASSWORD=$ELASTICSEARCH_PASSWORD" \
--from-literal="ELASTICSEARCH_USER=$ELASTICSEARCH_USER" \
elasticsearch-secrets
invenio-search
, therefore the way to create the secret is:
$ export INVENIO_SEARCH_ELASTIC_HOSTS="[{'host': 'localhost', 'timeout': 30, 'port': 9200, 'use_ssl': True, 'http_auth':('USERNAME_CHANGEME', 'PASSWORD_CHANGEME')}]"
$ oc create secret generic \
--from-literal="INVENIO_SEARCH_ELASTIC_HOSTS=$INVENIO_SEARCH_ELASTIC_HOSTS" \
elasticsearch-secrets
verify_certs
),
prefixing (url_prefix
) and more.
- Your host in a
values.yaml
file. - The web/worker docker images.
host: yourhost.localhost
web:
image: your/invenio-image
worker:
image: your/invenio-image
Adding a helm repository:
$ helm repo add helm-invenio https://inveniosoftware.github.io/helm-invenio/
$ helm repo update
$ helm search invenio
NAME CHART VERSION APP VERSION DESCRIPTION
helm-invenio/invenio 0.2.0 1.16.0 Open Source framework for large-scale digital repositories
helm-invenio/invenio 0.1.0 1.16.0 Open Source framework for large-scale digital repositories
Install the desired version
$ helm install invenio helm-invenio/invenio --version 0.2.0
Cloning the GitHub repository:
$ git clone https://github.com/inveniosoftware/helm-invenio.git
$ cd helm-invenio/
$ helm install invenio ./invenio [--disable-openapi-validation]
NAME: invenio
LAST DEPLOYED: Mon Mar 9 16:25:15 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:Invenio is ready to rock :rocket:
--disable-openapi-validation
as there is currently a problem with OpenShift objects and Helm when it comes to client side validation, see issue.
Get a bash terminal in a pod:
$ oc get pods
$ oc exec -it <web-pod> bash
Setup the instance:
$ . scl_source enable rh-python36
$ invenio db init # If the db does not exist already
$ invenio db create
$ invenio index init
$ invenio index queue init purge
$ invenio files location --default 'default-location' $(invenio shell --no-term-title -c "print(app.instance_path)")'/data'
$ invenio roles create admin
$ invenio access allow superuser-access role admin
One time job
$ oc process -f job.yml --param JOB_NAME='demo-data-1' \
--param JOB_COMMAND='invenio demo create 300 1000' | oc create -f -
Cron job
$ oc process -f cronjob.yml --param JOB_NAME=index-run \
--param JOB_COMMAND=invenio index run -d | oc create -f -