Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v18 #296

Merged
merged 57 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b859f22
set public and beacon to edge
davidlougheed Dec 4, 2024
07c2457
docs: add empty v18 migration doc
davidlougheed Dec 4, 2024
59a5c26
set web to edge
davidlougheed Dec 4, 2024
9942684
=add minio service to bento
mjdupont12 Dec 5, 2024
fb7aff6
=gateway configuration fixes
mjdupont12 Dec 9, 2024
376caa5
=code review fixes
mjdupont12 Dec 9, 2024
0ade44a
=add minio service to bento
mjdupont12 Dec 5, 2024
58e9cb8
=gateway configuration fixes
mjdupont12 Dec 9, 2024
c1bfc5e
=code review fixes
mjdupont12 Dec 9, 2024
511e99f
Merge branch 'feat/minio' of https://github.com/bento-platform/bento …
mjdupont12 Dec 10, 2024
5513d73
feat: support light/dark background branding
davidlougheed Dec 11, 2024
a3f1b20
docs: more work on v18 migration guide
davidlougheed Dec 11, 2024
8e42c56
docs: v18 migration guide work
davidlougheed Dec 11, 2024
e8def90
public - bind lightbg branding in local mode
davidlougheed Dec 12, 2024
7560722
Merge pull request #298 from bento-platform/feat/light-dark-logo
davidlougheed Dec 12, 2024
8ffbe42
Katsu auth + move Katsu out from private portal URL
davidlougheed Dec 16, 2024
f19c585
feat: minio subdomain revers proxy
v-rocheleau Dec 17, 2024
78ffac9
=code reviews fixes + update migrating docs
mjdupont12 Dec 18, 2024
8a5a916
=fixed trailing whitespace
mjdupont12 Dec 18, 2024
b0a1ee4
=update docs
mjdupont12 Dec 18, 2024
d4deaf0
Merge branch 'releases/v18' into feat/minio
mjdupont12 Dec 18, 2024
c4cbe0c
=change gateway version to edge
mjdupont12 Dec 20, 2024
fd4f9f9
=code review fixes
mjdupont12 Dec 20, 2024
d4f15a3
docs: minio setup and S3 api overview
v-rocheleau Dec 20, 2024
f69bf20
docs: minio docs references
v-rocheleau Dec 20, 2024
edde102
docs: fix reference
v-rocheleau Dec 20, 2024
4af5a30
Merge pull request #297 from bento-platform/feat/minio
mjdupont12 Jan 6, 2025
e915361
Merge remote-tracking branch 'origin/releases/v18' into feat/katsu-auth
davidlougheed Jan 8, 2025
23a2151
docs: start working on service adding docs
davidlougheed Jan 8, 2025
0177f29
docs: adding services continued
davidlougheed Jan 8, 2025
cd16956
docs: adding services - bentoctl notes
davidlougheed Jan 9, 2025
ec66ded
fix: add minio to services which dont have bento user
davidlougheed Jan 9, 2025
678d14f
docs: v18 migrate line wrap
davidlougheed Jan 9, 2025
21157b8
docs: 1st draft of adding services
davidlougheed Jan 9, 2025
6d719ec
docs: links to adding services doc
davidlougheed Jan 9, 2025
f763ce5
set beacon to pr-120
davidlougheed Jan 10, 2025
b091b72
Merge pull request #300 from bento-platform/docs/services
davidlougheed Jan 14, 2025
f446e5b
set katsu and public to edge
davidlougheed Jan 15, 2025
c0bcfb4
Merge pull request #299 from bento-platform/feat/katsu-auth
davidlougheed Jan 15, 2025
1e18d87
update authz to 0.10.3
davidlougheed Jan 20, 2025
dd88b55
add Bento Public flags for showing/hiding header links
davidlougheed Jan 21, 2025
ca96660
docs: mention new customization vars in migration guide
davidlougheed Jan 21, 2025
79db013
Merge pull request #302 from bento-platform/more-bento-public-brandin…
davidlougheed Jan 21, 2025
0fdf2cc
docs: fill in v18 migration guide gaps
davidlougheed Jan 21, 2025
e8a5ef7
fix: minio net aliases and docs
v-rocheleau Jan 23, 2025
8a79fe3
chore: update misc services
davidlougheed Jan 24, 2025
012c96b
Merge pull request #304 from bento-platform/chore/service-bumps
davidlougheed Jan 24, 2025
8312deb
chore: add force catalogue feature for bento public
davidlougheed Jan 24, 2025
d86af34
Merge pull request #305 from bento-platform/chore/force-catalogue-fea…
davidlougheed Jan 24, 2025
af05313
docs: typos
v-rocheleau Jan 24, 2025
b8145d5
Merge pull request #303 from bento-platform/chore/minio-aliases
v-rocheleau Jan 24, 2025
af7de9f
bump event relay to 3.1.8 and beacon to 0.19.0
davidlougheed Jan 24, 2025
36cf5cc
set public to 0.23.0
davidlougheed Jan 31, 2025
a8283db
set web to 7.0.0 and katsu to 10.0.0
davidlougheed Feb 3, 2025
d36d649
docs: typo
v-rocheleau Feb 4, 2025
93d82c3
bump public to 0.23.1
davidlougheed Feb 4, 2025
7e4a179
docs: add init-docker step for migration guide
davidlougheed Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ that make up the Bento platform.
* [`bentoctl`: the Bento deployment command line management tool](./docs/bentoctl.md)
* [Installation](./docs/installation.md)
* [Development](./docs/development.md)
* [Adding services to Bento](./docs/adding-services.md)
* [Troubleshooting guide](./docs/troubleshooting.md)
* [Deployment](./docs/deployment.md)
* [Monitoring](./docs/monitoring.md)
* [Public discovery configuration](./docs/public_discovery.md)
* [Using a reverse proxy in front of Bento](./docs/reverse-proxy.md)
* [MinIO object storage](./docs/minio.md)

### Data ingestion and usage

Expand All @@ -48,6 +50,7 @@ that make up the Bento platform.

### Migration documents

* [v17.1 to v18](./docs/migrating_to_18.md)
* [v17 to v17.1](./docs/migrating_to_17_1.md)
* [v16 to v17](./docs/migrating_to_17.md)
* [v15.2 to v16](./docs/migrating_to_16.md)
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ services:
- ${BENTOV2_DOMAIN}
- ${BENTOV2_PORTAL_DOMAIN}
- ${BENTOV2_AUTH_DOMAIN}
- ${BENTO_MINIO_DOMAIN}
drs-net:
aliases:
- ${BENTOV2_DOMAIN}
- ${BENTOV2_PORTAL_DOMAIN}
- ${BENTOV2_AUTH_DOMAIN}
- ${BENTO_MINIO_DOMAIN}
event-relay-net:
aliases:
- ${BENTOV2_DOMAIN}
Expand Down
1 change: 1 addition & 0 deletions docker-compose.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- ${PWD}/lib/public/en_about.html:/bento-public/src/public/en_about.html
- ${PWD}/lib/public/fr_about.html:/bento-public/src/public/fr_about.html
- ${PWD}/lib/public/branding.png:/bento-public/src/public/assets/branding.png
- ${PWD}/lib/public/branding.lightbg.png:/bento-public/src/public/assets/branding.lightbg.png
- ${PWD}/lib/public/translations/en.json:/bento-public/src/public/locales/en/translation_en.json
- ${PWD}/lib/public/translations/fr.json:/bento-public/src/public/locales/fr/translation_fr.json
environment:
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include:
- lib/gohan/docker-compose.gohan.yaml # Optional feature; controlled by a compose profile
- lib/katsu/docker-compose.katsu.yaml
- lib/logs/docker-compose.logs.yaml
- lib/minio/docker-compose.minio.yaml
- lib/notification/docker-compose.notification.yaml
- lib/public/docker-compose.public.yaml # Optional feature; controlled by a compose profile
- lib/redis/docker-compose.redis.yaml
Expand Down
155 changes: 155 additions & 0 deletions docs/adding-services.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Adding services to Bento

There are two types of services in Bento:

* Bento services, which have been developed by the Bento team specifically for the platform, and
* other services, which support the Bento services or provide additional platform features.


## Aspects to consider when adding any service to Bento

### Environment variables

* Service environment variables, used for configuring the image and some aspects of the service itself, should be added
to `etc/bento.env`. These variables typically include:
* Image
* Image version (tag)
* Container name template
* Service Docker network (**Note:** we typically give each service its own network, and add services to multiple
networks only as needed)
* Debugger ports
* Configuration environment variables, for setting up feature flags and passwords, should be added to
`etc/default_config.env` and the example files `etc/bento_deploy.env` and `etc/bento_dev.env`.
* `etc/default_config.env` contains feature flags and "empty definitions" for passwords/secrets.
* `etc/bento_deploy.env` is an example / template setup (to be copied to `local.env`) for a production deployment.
* `etc/bento_dev.env` is an example / template setup (to be copied to `local.env`) for a development setup.

### Container setup

The service's Docker container must be set up via a Compose file in `lib/<service>/docker-compose.<service>.yaml`.
This must then be included in the main `docker-compose.yaml` file, in the `include` block.

The service's network (and potentially feature flag, if applicable), as well as container name and port environment
variables must be added to the gateway compose file (`lib/gateway/docker-compose.gateway.yaml`) if the service is to be
externally accessible.

### Gateway configuration

*As needed,* a gateway NGINX config must be placed into `lib/gateway/<public_services|services>`.

### Required `bentoctl` changes

Inside the `py_bentoctl` Python module:

* If the service is locked behind a feature flag, add the feature (as an `BentoOptionalFeature` instance) to
`config.py`, modeling it after other definitions.
* Add the service image environment variables to the `service_image_vars` variable in `services.py`.
* If the service is not a Bento service (or does not have the `bento` user in the Docker image), add the service to the
`BENTO_USER_EXCLUDED_SERVICES` variable.
* In `other_helpers.py`:
* If the service has a data directory that needs to be initialized, add an entry to the `data_dir_vars` variable
in the `init_dirs(...)` function containing the name of the environment variable which points to the data volume
directory.
* Add any entry with the name of the environment variable storing the name of the Docker network to the `networks`
variable in the `init_docker(...)` function.
* If new certificates are needed, add new entries to the `init_self_signed_certs` function (for development purposes).

### Documentation changes

* Make sure to add a note about how to set up the service for the first time to the
[Installation guide](./installation.md), as well as the migration guide for the version the service is introduced in.
* If additional deployment steps are needed (i.e., new certificates), add a note to the
[Deployment guide](./deployment.md).

### Additional notes

Non-Bento services **MUST NOT** be put into `etc/bento_services.json`; this file is for Bento services only (see below).


## Additional considerations when adding new Bento services

### User and base image

It is expected that Bento services will use one of the
[Bento base images](https://github.com/bento-platform/bento_base_images).

These images provide a `bento` user, whose UID is set to the host user's UID.

### `/service-info` and service record in `bento_services.json`

Bento services **MUST** implement the GA4GH [Service Info](https://www.ga4gh.org/product/service-info/) API.
They must also be registered in the `etc/bento_services.json` file, which allows them to be loaded into the
[Bento Service Registry](https://github.com/bento-platform/bento_service_registry).

Each entry of this file follows the format:

```js
{
// ...
"<compose ID>": {
"service_kind": "<service kind>",
"url_template": "{BENTO_PUBLIC_URL}/api/{service_kind}",
"repository": "[email protected]:bento-platform/<...>"
},
// ...
}
```

In this format:
* `<compose ID>` is the key of the service in its `docker-compose.<...>.yaml` file
* `<service kind>` is a special Bento-unique identifier for the service, allowing front ends to look up services.
* The `url_template` key is a template for the base URL used to access the service's API.
* The `repository` key is an SSH Git repository URL for the service code, so it can be cloned into the `repos` folder
for development.


### Making service-to-service requests go through the gateway (dev)

Bento relies on three mechanisms to resolve hostnames to IP addresses:
- DNS records (production only)
- `/etc/hosts` entries when in local dev
- For requests originating outside of the Docker networks (e.g. web browsers)
- Container names (production & dev)
- When two containers are on the same Docker network and need to talk to each other directly
- Docker resolves a container's name to its IP on a Docker network
- e.g. Katsu can talk directly to DRS with `http://${BENTOV2_DRS_CONTAINER_NAME}:${BENTOV2_DRS_INTERNAL_PORT}`
- Docker network aliases (dev only)
- When two services need to communicate with each other via the gateway only.
- In production, this is taken care of by DNS records

When developing locally, some services may need to be interacted with strictly through the gateway.
This is the case for Keycloak (auth) and Minio, as both services require a subdomain and HTTPS.

As such, drop-box cannot use the Docker resolver in order to connect to Minio.

Since we are in local, there is no DNS record to resolve Minio's domain,
and the host's `/etc/hosts` entries will not be of help from the container's perspective.

For these situations, we rely on [Docker network aliases.](https://docs.docker.com/reference/compose-file/services/#aliases)

Taking the Minio example, we need:
- Drop-Box to interact with Minio via the gateway
- DRS to interact with Minio via the gateway

Enabling this is done by adding `${BENTO_MINIO_DOMAIN}` to the respective service networks aliases.

This snippet comes from [docker-compose.dev.yaml](../docker-compose.dev.yaml):
```yaml
services:
gateway:
networks:
drop-box-net:
aliases:
- ${BENTOV2_DOMAIN}
- ${BENTOV2_PORTAL_DOMAIN}
- ${BENTOV2_AUTH_DOMAIN}
- ${BENTO_MINIO_DOMAIN}
drs-net:
aliases:
- ${BENTOV2_DOMAIN}
- ${BENTOV2_PORTAL_DOMAIN}
- ${BENTOV2_AUTH_DOMAIN}
- ${BENTO_MINIO_DOMAIN}
```

Doing so, we make sure that `${BENTO_MINIO_DOMAIN}` is resolved to the gateway for drop-box and DRS.
1 change: 1 addition & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ BENTOV2_DOMAIN=bento.example.com
BENTOV2_PORTAL_DOMAIN=portal.${BENTOV2_DOMAIN}
BENTOV2_AUTH_DOMAIN=auth.${BENTOV2_DOMAIN}
BENTOV2_CBIOPORTAL_DOMAIN=cbioportal.${BENTOV2_DOMAIN}
BENTO_MINIO_DOMAIN=minio.${BENTOV2_DOMAIN}
```

For a real deployment, make sure that your `local.env` file uses valid domain names for which SSL certificates
Expand Down
5 changes: 5 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ If subsequent modifications are made to the package's code, you will need to cre
and install it again in the app with `npm install`.


## Adding services

See [`adding-services.md`](./adding-services.md) for some considerations when adding new services to Bento.


## Using Adminer

An [Adminer](https://www.adminer.org/) container is deployed in dev and local mode, it can be used to inspect the
Expand Down
Binary file added docs/img/minio_object_store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,18 @@ value in the `BENTOV2_AUTH_CLIENT_ID` environment variable. On local instances,
this is set to `local_bentov2` by default.


## 7. *Production only:* set up translations for Bento-Public
## 7. *Production only:* set up translations and branding

Now that Bento Public has been initialized by either `./bentoctl.bash init-all` or `./bentoctl.bash init-web public`,
adjust the default translation set as necessary:
Now that Bento Public and Web have been initialized by either `./bentoctl.bash init-all` or
`./bentoctl.bash init-web <public|web>`, translation files and branding (logos) can be configured as necessary.

**For branding (logos)**, copy files to the following paths:

* A logo which works on dark backgrounds should be placed at `lib/public/branding.png` and `lib/web/branding.png`.
* A logo which works on light backgrounds should be placed at `lib/public/branding.lightbg.png`. This is primarily
useful for Beacon Network.

**For translations** (which apply only to Bento Public), adjust the default translation set as necessary:

```js
// lib/public/translations/<en|fr>.json
Expand Down
56 changes: 56 additions & 0 deletions docs/migrating_to_18.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Migrating to Bento v18

* Bento v18 implements some new features for branding, which may require changes as described below.
* It also adds MinIO as a backend for future S3-compatible object storage.
* This can be enabled now, but will not be used until a future version.
* For instances hosted on the Secure Data for Health (SD4H) infrastructure, the SD4H object store should be used for
production instances when S3-compatible services become ready in a future version.


## 1. Stop and update services

```bash
./bentoctl.bash stop
./bentoctl.bash pull
```


## 2. Set up light and dark-background branding for Bento Public

* Make sure `lib/public/branding.png` and `lib/web/branding.png` are images which work on dark backgrounds.
* **If you have a light-background logo to add:** put this file at `lib/public/branding.lightbg.png`.
* **If you do not have a light-background logo:** run `./bentoctl.bash init-web public` to copy the Bento logo to the
above location, or copy `branding.png` to `branding.lightbg.png`


## 3. If desired, disable Bento Public sign in / portal links

Version 18 includes two new Bento Public environment variables for customizing an instance:

* `BENTO_PUBLIC_SHOW_PORTAL_LINK`: Whether to show a link to the private data portal in the header
* `BENTO_PUBLIC_SHOW_SIGN_IN`: Whether to show a "Sign In" button in the header
* `BENTO_PUBLIC_FORCE_CATALOGUE`: Whether to force the data catalogue to display, even with only a single project.

The first two are set to `true` by default, and the last is set to `false`. If desired, they can be toggled to
non-default settings by modifying `local.env`, for example:

```bash
# ...
BENTO_PUBLIC_SHOW_PORTAL_LINK='false'
BENTO_PUBLIC_SHOW_SIGN_IN='false'
BENTO_PUBLIC_FORCE_CATALOGUE='true'
# ...
```


## 4. Enabling MinIO

To enable the deployment of a MinIO server for S3 storage, refer to the documentation on
[configuring MinIO for Bento](/docs/minio.md).


## 5. Restart services

```bash
./bentoctl.bash start
```
Loading