Skip to content

Latest commit

 

History

History
109 lines (83 loc) · 3.02 KB

File metadata and controls

109 lines (83 loc) · 3.02 KB

cBioPortal

Session service

Set up mongo database:

helm install --name cbioportal-session-service-mongo --set persistence.size=10Gi stable/mongodb

Deploy session service app:

kubectl apply -f session-service/session_service.yaml

How to migrate one mongo database to mongo db in kubernetes

Run on the database you'd like to copy (change ${} variables accordingly):

mongodump \
    --db ${DB_NAME} \
    -u ${ADMIN_USER} \
    -p ${ADMIN_PASSWORD} \
    --authenticationDatabase ${AUTH_DATABASE_IF_DIFF_THEN_DEFAULT} \
    --out ${OUTPUT_FOLDER}

Then copy the output folder to the contaier

kubectl cp  \
    ${OUTPUT_FOLDER} \
    ${MONGO_CONTAINER_NAME}:/bitnami/mongodb/mongo-session-service-dump

NOTE: you can get the ${MONGO_CONTAINER_NAME} by looking at the output from kubectl get po.

Then import the database

# start bash shell in the container
kubectl exec -it  ${MONGO_CONTAINER_NAME} /bin/bash
# inside the container
mongorestore \
    --authenticationDatabase admin \
    -u root \
    -p ${MONGODB_ROOT_PASSWORD} \
    --db ${DB_NAME} \
    --drop \
    /bitnami/mongodb/mongo-session-service-dump/${DB_NAME}
# you can get the mongodb root password from the helm chart
# helm status cbioportal-session-service-mongo

Once completed you can delete the dump again:

rm -rf /bitnami/mongodb/mongo-session-service-dump

Make a dump of the mongo data base in kubernetes

Port forward the database

kubectl port-forward  svc/cbioportal-session-service-mongo-mongodb   37017:27017

Then connect locally using Docker (this is using docker on Mac):

docker run -v $PWD:/local --rm -it mongo:3.6 mongodump --out /local/session-service-dump-20190207 --uri mongodb://docker.for.mac.localhost:37017/session_service

cBioPortal backend

Database

We are running a mysql database inside the cluster:

helm install -f cbioportal_mysql_db_values.yml --set mysqlRootPassword=picksomerootpasswordhere cbioportal-production-db stable/mysql

NOTE: downloading index.do for all studies went down from 2m to 30s by playing with the mysql configuration, so be sure to use ours. There's an article about setting the right innodb_buffer_pool_size: https://scalegrid.io/blog/calculating-innodb-buffer-pool-size-for-your-mysql-server/

Redis

helm install  --name cbioportal-redis  stable/redis --set master.securityContext.enabled=false --set password=picksomeredispassword --set slave.securityContext.enabled=false --set cluster.enabled=false

Configuration

To set up the configuration values one needs access to the portal-configuration portal (this only needs to be done when configuration changes). Then one can create the config maps:

kubectl apply -f portal-configuration/k8s-config-vars/public/config_map.yaml

For now we only allow changing a few runtime properties that aren't in the default portal.properties.EXAMPLE file of the repo.

kubectl apply -f cbioportal_spring_boot.yaml
kubectl apply -f service.yaml