-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from bento-platform/releases/v15.1
Release v15.1
- Loading branch information
Showing
20 changed files
with
373 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o allexport | ||
# This file is a shim between the user and the `py_bentoctl` management CLI module. Its job is two-fold: | ||
# - Load any environment variables from the various .env and .bash files, which configure a given Bento deployment. | ||
# - Pass the configured environment, and CLI arguments, to the Python module. | ||
|
||
# Sourcing order | ||
# 1. default_config.env (declare some defaults for configurable variables / make them exist) | ||
# 2. local.env (overrides for default config) | ||
# 3. bento.env (uses some local.env values) | ||
# 4. local.env *again* (overrides for bento.env values, e.g. versions) | ||
# Automatically export any variables set in this shell to processes launched from this shell (i.e., `py_bentoctl`): | ||
set -o allexport | ||
|
||
# ENVIRONMENT CONFIGURATION -------------------------------------------------------------------------------------------- | ||
# Sourcing order: | ||
# 1. default_config.env (declare some defaults for configurable variables / make them exist) | ||
source etc/default_config.env | ||
if [[ -f "local.env" ]]; then | ||
source local.env | ||
fi | ||
# 2. local.env (overrides for default config) | ||
if [[ -f "local.env" ]]; then source local.env; fi | ||
# 3. bento.env (uses some local.env values) | ||
source etc/bento.env | ||
if [[ -f "local.env" ]]; then | ||
source local.env | ||
fi | ||
# 4. local.env *again* (overrides for bento.env values, e.g. versions) | ||
if [[ -f "local.env" ]]; then source local.env; fi | ||
# 5. bento_post_config.bash (script, rather than .env, for branching decisions based on environment) | ||
source etc/bento_post_config.bash | ||
# ---------------------------------------------------------------------------------------------------------------------- | ||
|
||
# After configuring the environment, take any CLI arguments that were passed to this script and forward them to the | ||
# Python bentoctl module, which will perform the actual execution: | ||
python3 -m py_bentoctl.entry "$@" | ||
|
||
# Reverse change to variable-setting behaviour from the beginning of the script: | ||
set +o allexport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Deployment | ||
|
||
This section details the required steps to deploy Bento on a server and expose it to the internet. | ||
The instructions assume you have a server with a public IP and DNS records pointing to it for the domains you will use. | ||
|
||
A bento deployment usually has up to 4 domains or subdomains, this section uses the following examples: | ||
```bash | ||
BENTOV2_DOMAIN=bento.example.com | ||
BENTOV2_PORTAL_DOMAIN=portal.${BENTOV2_DOMAIN} | ||
BENTOV2_AUTH_DOMAIN=auth.${BENTOV2_DOMAIN} | ||
BENTOV2_CBIOPORTAL_DOMAIN=cbioportal.${BENTOV2_DOMAIN} | ||
``` | ||
|
||
For a real deployment, make sure that your `local.env` file uses valid domain names for which SSL certificates | ||
can be obtained. | ||
|
||
## Certificates paths | ||
|
||
In production mode, Bento must use valid SSL certificates instead of self-signed ones. | ||
Before requesting certificates, make sure that you override the following environment | ||
variables in your `local.env` file. | ||
|
||
```bash | ||
BENTOV2_AUTH_FULLCHAIN_RELATIVE_PATH=/live/$BENTOV2_AUTH_DOMAIN/fullchain.pem | ||
BENTOV2_AUTH_PRIVKEY_RELATIVE_PATH=/live/$BENTOV2_AUTH_DOMAIN/privkey.pem | ||
BENTOV2_GATEWAY_INTERNAL_PORTAL_FULLCHAIN_RELATIVE_PATH=/live/$BENTOV2_PORTAL_DOMAIN/fullchain.pem | ||
BENTOV2_GATEWAY_INTERNAL_PORTAL_PRIVKEY_RELATIVE_PATH=/live/$BENTOV2_PORTAL_DOMAIN/privkey.pem | ||
BENTOV2_GATEWAY_INTERNAL_FULLCHAIN_RELATIVE_PATH=/live/$BENTOV2_DOMAIN/fullchain.pem | ||
BENTOV2_GATEWAY_INTERNAL_PRIVKEY_RELATIVE_PATH=/live/$BENTOV2_DOMAIN/privkey.pem | ||
``` | ||
|
||
## Obtain certificates | ||
|
||
On a fresh Bento install, the initial SSL certificates can be obtained with a convenience script. | ||
|
||
```bash | ||
bash ./etc/scripts/init_certs_only.sh | ||
|
||
# Answer CertBot prompts | ||
# Does a --dry-run first | ||
|
||
# Check the certificates | ||
ls ./certs/gateway/letsencrypt | ||
ls ./certs/auth/letsencrypt | ||
``` | ||
|
||
## Renew certificates | ||
|
||
To renew the certificates after they are issued, use the convenience script made to this effect: | ||
|
||
```bash | ||
bash ./etc/scripts/renew_certs_and_redeploy.sh | ||
# Answer CertBot prompts | ||
# Does a --dry-run first | ||
|
||
# Check the certificates | ||
ls ./certs/gateway/letsencrypt/live | ||
ls ./certs/auth/letsencrypt/live | ||
``` | ||
|
||
Note that this script will shutdown auth and gateway during the certificate renewal. | ||
|
||
## Permanently redirect a domain | ||
|
||
If a Bento instance must use a new domain, the gateway can redirect requests from the old domain to the new one. | ||
This is advised to prevent dead links, see [301](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301) | ||
response status reference. | ||
|
||
For this to work, you **must** update the old domain's DNS record to point to the new instance's IP, | ||
otherwise you won't be able to obtain the certificates. | ||
|
||
First, declare these variables in the `local.env` file: | ||
|
||
```bash | ||
BENTO_DOMAIN_REDIRECT=old-bento.example.com # The old domain name | ||
BENTO_USE_DOMAIN_REDIRECT='true' # Feature flag for domain redirect | ||
BENTO_GATEWAY_INTERNAL_REDIRECT_FULLCHAIN_RELATIVE_PATH=/live/$BENTO_DOMAIN_REDIRECT/fullchain.pem | ||
BENTO_GATEWAY_INTERNAL_REDIRECT_PRIVKEY_RELATIVE_PATH=/live/$BENTO_DOMAIN_REDIRECT/privkey.pem | ||
``` | ||
|
||
Obtain the certificate for the old domain with certbot: | ||
```bash | ||
# Stop gateway | ||
./bentoctl.bash stop gateway | ||
|
||
# Obtain certificates | ||
docker run -it --rm --name certbot \ | ||
-v "./certs/gateway/letsencrypt:/etc/letsencrypt" \ | ||
-v "./certs/gateway/letsencrypt/lib:/var/lib/letsencrypt" \ | ||
-p 80:80 -p 443:443 \ | ||
certbot/certbot certonly -d old-bento.example.com -d portal.old-bento.example.com | ||
|
||
# Subdomains are optional but recommended, add the ones you want redirected with the '-d' flag | ||
# This creates a single certificate, even if using multiple subdomains. | ||
ls certs/gateway/letsencrypt/live/ | ||
|
||
# Start the gateway | ||
./bentoctl.bash run gateway | ||
``` | ||
|
||
If all went well, the `old-bento.example.com` domain should be redirected to `bento.example.com` in a browser. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ cp ./etc/bento_dev.env local.env | |
cp ./etc/bento_deploy.env local.env | ||
``` | ||
|
||
Then, modify the values as seen; depending on if you're using the instance for development or deployment. | ||
Then, modify the values as needed; depending on if you're using the instance for development or deployment. | ||
|
||
|
||
#### Development example | ||
|
@@ -46,9 +46,14 @@ BENTOV2_CBIOPORTAL_DOMAIN=cbioportal.${BENTOV2_DOMAIN} | |
# Feature switches ---------------------------------------------------- | ||
BENTOV2_USE_EXTERNAL_IDP=0 | ||
BENTOV2_USE_BENTO_PUBLIC=1 | ||
BENTOV2_PRIVATE_MODE=false | ||
|
||
BENTO_CBIOPORTAL_ENABLED=false | ||
# - Switch to enable TLS - defaults to true (i.e., use TLS): | ||
BENTO_GATEWAY_USE_TLS='true' | ||
|
||
BENTO_BEACON_ENABLED='true' | ||
BENTO_BEACON_UI_ENABLED='true' | ||
BENTO_CBIOPORTAL_ENABLED='false' | ||
BENTO_GOHAN_ENABLED='true' | ||
# --------------------------------------------------------------------- | ||
|
||
# set this to a data storage location, optionally within the repo itself, like: /path-to-my-bentov2-repo/data | ||
|
@@ -63,6 +68,8 @@ BENTOV2_SESSION_SECRET=my-very-secret-session-secret # !!! ADD SOMETHING MORE S | |
|
||
# - Set auth DB password if using a local IDP | ||
BENTO_AUTH_DB_PASSWORD=some-secure-password | ||
# - Always set authz DB password | ||
BENTO_AUTHZ_DB_PASSWORD=some-other-secure-password | ||
|
||
BENTOV2_AUTH_ADMIN_USER=admin | ||
BENTOV2_AUTH_ADMIN_PASSWORD=admin # !!! obviously for dev only !!! | ||
|
@@ -89,6 +96,13 @@ BENTO_GIT_NAME=David # Change this to your name | |
[email protected] # Change this to your GitHub account email | ||
``` | ||
|
||
You should at least fill to the following settings in dev mode (it may differ for a production setup), which are not set | ||
in the example file: | ||
* `BENTOV2_SESSION_SECRET` | ||
* `BENTO_AUTH_DB_PASSWORD` | ||
* `BENTO_AUTHZ_DB_PASSWORD` | ||
* `BENTO_WES_CLIENT_SECRET` | ||
|
||
If the internal OIDC identity provider (IdP) is being used (by default, Keycloak), variables specifying default | ||
credentials should also be provided. The *admin* credentials are used to connect to the Keycloak UI for authentication | ||
management (adding users, getting client credentials, ...). The *test* credentials will be used to authenticate on the | ||
|
@@ -243,7 +257,8 @@ which in Keycloak should be a UUID. | |
|
||
### b. Create grants for the Workflow Execution Service (WES) OAuth2 client | ||
|
||
Run the following commands to set up authorization for the WES client: | ||
Run the following commands to set up authorization for the WES client. Don't forget to replace `ISSUER_HERE` by the | ||
issuer URL! | ||
|
||
```bash | ||
# This grant is a temporary hack to get permissions working for v12/v13. In the future, it should be removed. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Migrating to Bento v15.1 | ||
|
||
Migrating to version 15.1 from version 15 should be straightforward. | ||
|
||
|
||
## 1. Update `bentoctl` Python requirements | ||
|
||
Make sure you've entered into the `bentoctl` Python virtual environment, if you've set one up: | ||
|
||
```bash | ||
source env/bin/activate | ||
``` | ||
|
||
Then, install the latest requirements / module versions: | ||
|
||
```bash | ||
pip install -r requirements | ||
``` | ||
|
||
|
||
## 2. Update services and restart | ||
|
||
Run the following commands to pull the latest service images and restart services as needed: | ||
|
||
```bash | ||
./bentoctl.bash pull | ||
./bentoctl.bash start | ||
``` |
Oops, something went wrong.