|
| 1 | +--- |
| 2 | +readingTime: PT10M |
| 3 | +audiences: [tre-operator, contributor] |
| 4 | +--- |
| 5 | + |
| 6 | +import { Steps, Callout, Table } from "nextra/components"; |
| 7 | +import { DocMetadata } from "@/components/doc-metadata/DocMetadata"; |
| 8 | + |
| 9 | +<DocMetadata /> |
| 10 | + |
| 11 | +# TRE Layer Components |
| 12 | + |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | +{/* TODO: add link to the context diagram */} |
| 16 | +- Understanding of [Five Safes TES Context C4 diagram](/context-c4-diagram). |
| 17 | + |
| 18 | +## Core Components |
| 19 | + |
| 20 | +### Summary |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +Here is a summary of the required components which make up the TRE Layer: |
| 25 | + |
| 26 | +| Component | Notes | |
| 27 | +| ------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- | |
| 28 | +| **KeyCloak** | The TRE Agent and Egress apps each require a Keycloak realm containing users and clients authorised to access them | |
| 29 | +| **S3 (MinIO or RustFS)** | An Amazon S3 compatible TRE Storage service | |
| 30 | +| **RabbitMQ** | A message broker used for queueing | |
| 31 | +| **PostgreSQL** | A database for the TRE Agent and Egress apps to keep local state | |
| 32 | +| **Hashicorp Vault** | Used for accessing ephemeral credentials as secrets | |
| 33 | +| **OpenLDAP** | Used to provide ephemeral credentials for Trino (if in use as a datasource) | |
| 34 | +| **Camunda Connectors** | A REST API allowing other services (e.g. TRE Agent) to integrate with Camunda | |
| 35 | +| **Camunda Orchestration** | A consolidated service that combines Camunda functionality via [Zeebe + Operate + Tasklist](https://camunda.com/process-orchestration/) | |
| 36 | +| **ElasticSearch** | Used for Camunda's local datastore such as workflow state | |
| 37 | +| **TRE-Camunda** | A service defining the handlers for ephemeral credentials management. Registers the handlers with Camunda, via Zeebe | |
| 38 | +| **TRE Agent API** | A REST API for TRE Agent functionality | |
| 39 | +| **TRE Agent GUI** | A Web Frontend for TRE Admins to log into and interact with the TRE Agent | |
| 40 | +| **Egress API** | A REST API for Egress Portal functionality | |
| 41 | +| **Egress GUI** | A Web Frontend for Egress Officers to log into and interact with the Egress Portal | |
| 42 | +| **TES Backend** | A standard GA4GH TES implementation to execute the analysis | |
| 43 | + |
| 44 | +You may choose how to distribute your own deployment of these components, as long as they are able to communicate with each other over the network. |
| 45 | + |
| 46 | +For some components, such as KeyCloak or S3 (MinIO or RustFS), you may wish to use your own existing deployments. |
| 47 | + |
| 48 | +### User accessible components |
| 49 | + |
| 50 | +A subset of the components will need to be accessible by users, outside of the TRE Layer environment, through a reverse proxy or port forwarding: |
| 51 | + |
| 52 | +| Component | Reason | Sample Port * | |
| 53 | +| ----------------- | :------------------------------------------------------------------------------------------------------------------- | :------| |
| 54 | +| **KeyCloak** | So that users can authenticate and admins can manage the TRE Agent and Egress KeyCloak Realms (if you are using the internal, built-in KeyCloak) | 8085 | |
| 55 | +| **TRE Agent GUI** | So that TRE Admins can log into and interact with the TRE Agent | 8989 | |
| 56 | +| **TRE Agent API** | So that TRE Agent GUI browser functionality, and optionally other services, can interact with the TRE Agent REST API | 8072 | |
| 57 | +| **Egress GUI** | So that Egress Officers can log into and interact with the Egress Portal | 8100 | |
| 58 | +| **S3 UI** | So that Egress Officers can interact with the S3 storage through a web interface | 9003 | |
| 59 | + |
| 60 | +**Note**: Sample ports are provided for reference only. It can be modified to reflect the your own |
| 61 | + infrastructure and configuration choices. |
| 62 | + |
| 63 | +<Callout> |
| 64 | + If you are setting up a reverse proxy for S3 (MinIO or RustFS), the `Websockets Support` should be |
| 65 | + enabled for S3 GUI Proxy host. |
| 66 | +</Callout> |
| 67 | + |
| 68 | +### TRE Database |
| 69 | + |
| 70 | +A TRE database is the database which the analysis query runs against. |
| 71 | + |
| 72 | +If a TRE database is deployed in cloud managed instances (for example, AWS RDS, Azure SQL DB Managed Instance, etc.), this 5 Safes TES implementation requires that you set the TRE Agent with the `admin` credentials of the TRE database, in order to create and revoke ephemeral credentials. This can be done by setting the environment variables `TRE_DATA_USER` and `TRE_DATA_PASSWORD` with the credentials of the user, more details [here](/5s-tes-docs/connect/setup-tre/configuration#general-app-configuration) . |
| 73 | + |
| 74 | +<Callout type="info"> |
| 75 | +- `admin` credentials are the ones used when creating or setting up the TRE DB instance. |
| 76 | +- If the TRE decides to use PostgreSQL as the database, version 16 or later is required. Because, in Postgres 16+, to revoke a user/role, either `superuser` or `admin` privilege is required. More details [here](https://www.postgresql.org/docs/16/sql-droprole.html). |
| 77 | +- A user created with the `CREATEROLE` permission can create ephemeral credentials but cannot revoke them. |
| 78 | +- In the case where a TRE cannot not use `admin` credentials, the TRE database can be hosted in the same `postgresql` database instance, which keeps the local state of TRE Agent, and superuser credentials of the `postgresql` can be used in the environment variables `TRE_DATA_USER` and `TRE_DATA_PASSWORD`. |
| 79 | +</Callout> |
| 80 | + |
| 81 | +<Callout> |
| 82 | + Remember the TES Backend's environment will also need network access to |
| 83 | + project data sources or TRE database, in order for analysis to run against them. |
| 84 | +</Callout> |
0 commit comments