From 6fe758ef7be5ade78cbea53c0e2cb492d3fe09c0 Mon Sep 17 00:00:00 2001 From: Tasha Alfano Date: Wed, 28 Jan 2026 15:19:23 -0600 Subject: [PATCH 1/8] docs: update for Docker image restructuring and deprecations Document breaking changes for upcoming Temporal Server 1.30+ release including auto-setup image deprecation, server/admin-tools image streamlining, dockerize to sprig migration, and Helm chart compatibility requirements to prepare users for the security and maintenance improvements. --- .../self-hosted-guide/deployment.mdx | 69 +++++++++++++++++-- .../self-hosted-guide/namespaces.mdx | 8 ++- .../self-hosted-guide/visibility.mdx | 42 +++++++++-- 3 files changed, 106 insertions(+), 13 deletions(-) diff --git a/docs/production-deployment/self-hosted-guide/deployment.mdx b/docs/production-deployment/self-hosted-guide/deployment.mdx index 9da0d35d1a..c9f793814d 100644 --- a/docs/production-deployment/self-hosted-guide/deployment.mdx +++ b/docs/production-deployment/self-hosted-guide/deployment.mdx @@ -39,9 +39,14 @@ If you have Docker and Docker Compose installed, all you need to do is clone the The `temporalio/docker-compose` repo comes loaded with a variety of configuration templates that enable you to try all three databases that the Temporal Platform supports (PostgreSQL, MySQL, Cassandra). It also enables you to try [Advanced Visibility](/visibility#advanced-visibility) using [Search Attributes](/search-attribute), emit metrics, and even play with the [Archival](/temporal-service/archival) feature. -The Docker images in this repo are produced using the Temporal Server [auto-setup.sh](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh) script. -This script defaults to creating images that run all the Temporal Server services in a single process. -You can use this script as a starting point for producing your own images. + +:::warning Docker Image Changes + +The `temporalio/auto-setup` image is **deprecated** and no longer receives updates. + +For example configurations and setup guidance, refer to the [samples-server repository](https://github.com/temporalio/samples-server) instead. + +::: The following commands start and run a Temporal Service in Docker using the default configuration: @@ -74,10 +79,48 @@ docker run temporalio/server: ``` -The environment variables supported by the Temporal Docker images are documented [on Docker Hub](https://hub.docker.com/r/temporalio/auto-setup). +:::note Server Image Changes + +The `temporalio/server` image has been streamlined to include only production-essential components. The following tools have been removed: + +- `temporal` CLI +- `dockerize` (replaced with embedded `sprig` templating) +- `curl` +- `bash` + +Configuration templating now uses embedded `sprig` instead of `dockerize`. See [Configuration Templating](#configuration-templating) for details. + +::: + +The environment variables supported by the Temporal Docker images are documented [on Docker Hub](https://hub.docker.com/r/temporalio/server). + +:::warning Deprecated: Auto Setup Image + +The `temporalio/auto-setup` Docker image is deprecated and no longer receives updates. For initial schema setup and example configurations, refer to: + +- [samples-server repository](https://github.com/temporalio/samples-server) for setup examples +- Manual schema setup instructions in the [Visibility guide](/self-hosted-guide/visibility) +- The `temporal-elasticsearch-tool` in the `temporalio/admin-tools` image for Elasticsearch setup + +::: -Each Temporal Server release ships an [Auto Setup](https://temporal.io/blog/auto-setup) Docker image that includes an [auto-setup.sh](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh) script. -We recommend using this script for initial schema setup of each supported database. +### Configuration Templating + +Configuration templating has changed from using the external `dockerize` tool to embedded `sprig` templating built directly into the Temporal Server binary. + +#### What Changed + +- **Previously:** `dockerize` processed configuration templates with custom helper functions +- **Now:** `sprig` templating is embedded in the server binary, and the default config template is embedded (not a separate file) + +#### Migration Notes + +If you use custom configuration templates, be aware that: +- Some template syntax has changed (particularly `.Env` and `default` function usage) +- Refer to the [sprig documentation](http://masterminds.github.io/sprig/) for supported template functions +- Use `temporal-server render-config` to verify your templates render correctly + +Default configuration loading now uses the embedded template instead of searching the filesystem. ### Importing the Server package @@ -93,3 +136,17 @@ This requires Go v1.19 or later, as specified in the Temporal Server [Build prer [Temporal Helm charts](https://github.com/temporalio/helm-charts) enable you to get a Temporal Service running on [Kubernetes](https://kubernetes.io/) by deploying the Temporal Server services to individual pods and connecting them to your existing database and Elasticsearch instances. The Temporal Helm charts repo contains [extensive documentation](https://github.com/temporalio/helm-charts/blob/main/README.md) about Kubernetes deployments. + +:::warning Helm Chart Breaking Changes + +**Important compatibility requirements:** + +- Existing Helm chart versions are **not compatible** with `server` and `admin-tools` images **version 1.30 and later** +- You **cannot** override existing chart versions with newer images +- **Required Helm chart version:** [temporal-0.73.1](https://github.com/temporalio/helm-charts/releases/tag/temporal-0.73.1) **or later** + +If you are using Temporal Server images 1.30+, you must upgrade to Helm chart version 0.73.1 or later. + +**Note:** Temporal Cloud deployments are not impacted by these changes. + +::: diff --git a/docs/production-deployment/self-hosted-guide/namespaces.mdx b/docs/production-deployment/self-hosted-guide/namespaces.mdx index d625f40749..c0846d88ce 100644 --- a/docs/production-deployment/self-hosted-guide/namespaces.mdx +++ b/docs/production-deployment/self-hosted-guide/namespaces.mdx @@ -39,9 +39,13 @@ You can create Namespaces using: If no Namespace is specified, SDKs and CLI use the `default` Namespace. You must register this Namespace before using it. -When deploying with Docker Compose or the [auto-setup image](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh), the `default` Namespace is created automatically. +:::warning Deprecated: auto-setup Image -When deploying with [Helm charts](https://github.com/temporalio/helm-charts), create it manually: +The `temporalio/auto-setup` image is deprecated and no longer receives updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). + +::: + +For all deployment methods, create the `default` Namespace manually using the Temporal CLI: ```bash temporal operator namespace create --namespace default diff --git a/docs/production-deployment/self-hosted-guide/visibility.mdx b/docs/production-deployment/self-hosted-guide/visibility.mdx index 5bcedea8ee..cfdd1be3d4 100644 --- a/docs/production-deployment/self-hosted-guide/visibility.mdx +++ b/docs/production-deployment/self-hosted-guide/visibility.mdx @@ -113,7 +113,13 @@ Visibility data is stored in a database table called `executions_visibility` tha - [MySQL v8.0.17 and later](https://github.com/temporalio/temporal/tree/main/schema/mysql/v8/visibility) -The following example shows how the [auto-setup.sh](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh) script sets up your Visibility store. +:::warning Deprecated: auto-setup.sh Script + +The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). + +::: + +The following example shows how to set up your MySQL Visibility store using `temporal-sql-tool`: ```bash #... @@ -198,7 +204,13 @@ Visibility data is stored in a database table called `executions_visibility` tha - [PostgreSQL v12 and later](https://github.com/temporalio/temporal/tree/main/schema/postgresql/v12/visibility) -The following example shows how the [auto-setup.sh](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh) script sets up your PostgreSQL Visibility store. +:::warning Deprecated: auto-setup.sh Script + +The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). + +::: + +The following example shows how to set up your PostgreSQL Visibility store using `temporal-sql-tool`: ```bash #... @@ -334,7 +346,13 @@ persistence: Visibility data is stored in a database table called `executions_visibility` that must be set up according to the schemas defined (by supported versions) in https://github.com/temporalio/temporal/tree/main/schema/cassandra/visibility. -The following example shows how the [auto-setup.sh](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh) script sets up your Visibility store. +:::warning Deprecated: auto-setup.sh Script + +The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). + +::: + +The following example shows how to set up your Cassandra Visibility store using `temporal-cassandra-tool`: ```bash #... @@ -399,7 +417,15 @@ persistence: **Index schema and index** -The following example shows how the [auto-setup.sh](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh) script sets up an Elasticsearch Visibility store. +:::warning Deprecated: auto-setup.sh Script + +The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. + +For Elasticsearch setup, use the `temporal-elasticsearch-tool` available in the `temporalio/admin-tools` image (version 1.30+). For examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). + +::: + +The following example shows how to set up an Elasticsearch Visibility store using `temporal-elasticsearch-tool`: ```bash #... @@ -785,7 +811,13 @@ temporal operator search-attribute create --name="CustomSA" --type="Keyword" --n You can also create multiple custom Search Attributes when you set up your Visibility store. -For example, the [auto-setup.sh](https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh) script that is used to set up your local [docker-compose Temporal Service](https://github.com/temporalio/docker-compose) creates custom Search Attributes in the Visibility store, as shown in the following code snippet from the script (for SQL databases). +:::warning Deprecated: auto-setup.sh Script + +The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). + +::: + +The following example shows how custom Search Attributes can be created during Visibility store setup (for SQL databases). ```bash add_custom_search_attributes() { From 0b70635104b4287d8b27253939992b65b9b3ae73 Mon Sep 17 00:00:00 2001 From: Tasha Alfano Date: Wed, 28 Jan 2026 15:57:18 -0600 Subject: [PATCH 2/8] docs: add Helm chart configuration options for sprig migration --- .../self-hosted-guide/deployment.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/production-deployment/self-hosted-guide/deployment.mdx b/docs/production-deployment/self-hosted-guide/deployment.mdx index c9f793814d..96874a95ab 100644 --- a/docs/production-deployment/self-hosted-guide/deployment.mdx +++ b/docs/production-deployment/self-hosted-guide/deployment.mdx @@ -122,6 +122,16 @@ If you use custom configuration templates, be aware that: Default configuration loading now uses the embedded template instead of searching the filesystem. +#### Helm Chart Configuration + +When deploying with Helm charts (version 0.73.1 or later), the following configuration options control the dockerize to sprig migration: + +| Configuration Option | Description | Default | +|---------------------|-------------|---------| +| `server.useEntrypointScript` | Use entrypoint script that auto-detects dockerize vs sprig | `false` | +| `server.configMapsToMount` | Which config template to mount: `"dockerize"`, `"sprig"`, or `"both"` | `"dockerize"` | +| `server.setConfigFilePath` | Set `TEMPORAL_SERVER_CONFIG_FILE_PATH` env var (required for sprig) | `false` | + ### Importing the Server package The Temporal Server is a standalone Go application that can be [imported](/references/server-options) into another project. From 8f18b17bc27a99d843afe99cbcd771805adaf6db Mon Sep 17 00:00:00 2001 From: Tasha Alfano Date: Wed, 28 Jan 2026 16:05:09 -0600 Subject: [PATCH 3/8] docs: add temporal server start-dev as local development alternative --- .../self-hosted-guide/deployment.mdx | 18 ++++++++++++++++++ .../self-hosted-guide/namespaces.mdx | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/production-deployment/self-hosted-guide/deployment.mdx b/docs/production-deployment/self-hosted-guide/deployment.mdx index 96874a95ab..ec8764d146 100644 --- a/docs/production-deployment/self-hosted-guide/deployment.mdx +++ b/docs/production-deployment/self-hosted-guide/deployment.mdx @@ -48,6 +48,24 @@ For example configurations and setup guidance, refer to the [samples-server repo ::: +:::tip Local Development Alternative + +For local development and testing, use the Temporal CLI's built-in development server: + +```bash +temporal server start-dev +``` + +This provides: +- A local Temporal Server with Web UI (http://localhost:8233) +- Automatic creation of the `default` Namespace +- Optional persistence with `--db-filename` for SQLite storage +- Custom Search Attributes with `--search-attribute` + +See [`temporal server start-dev`](/cli/server#start-dev) for all options. + +::: + The following commands start and run a Temporal Service in Docker using the default configuration: ```bash diff --git a/docs/production-deployment/self-hosted-guide/namespaces.mdx b/docs/production-deployment/self-hosted-guide/namespaces.mdx index c0846d88ce..fc89a1c973 100644 --- a/docs/production-deployment/self-hosted-guide/namespaces.mdx +++ b/docs/production-deployment/self-hosted-guide/namespaces.mdx @@ -45,7 +45,9 @@ The `temporalio/auto-setup` image is deprecated and no longer receives updates. ::: -For all deployment methods, create the `default` Namespace manually using the Temporal CLI: +For local development, the [`temporal server start-dev`](/cli/server#start-dev) command automatically creates the `default` Namespace. + +For all other deployment methods, create the `default` Namespace manually using the Temporal CLI: ```bash temporal operator namespace create --namespace default From 1cb019c16ef6687d0b87bb8d4bb3c841f548d76f Mon Sep 17 00:00:00 2001 From: Lenny Chen Date: Thu, 29 Jan 2026 14:51:48 -0800 Subject: [PATCH 4/8] edits to reduce admonitions --- .../self-hosted-guide/deployment.mdx | 187 ++++++++---------- 1 file changed, 80 insertions(+), 107 deletions(-) diff --git a/docs/production-deployment/self-hosted-guide/deployment.mdx b/docs/production-deployment/self-hosted-guide/deployment.mdx index ec8764d146..fd9a25dcff 100644 --- a/docs/production-deployment/self-hosted-guide/deployment.mdx +++ b/docs/production-deployment/self-hosted-guide/deployment.mdx @@ -2,7 +2,9 @@ id: deployment title: Deploying a Temporal Service sidebar_label: Deployment -description: Deploy a Temporal Service using Docker, Kubernetes, or from scratch. Requires a database such as Apache Cassandra, MySQL, or PostgreSQL. Customize setup for your infrastructure and tooling. +description: + Deploy a Temporal Service using Docker, Kubernetes, or from scratch. Requires a database such as Apache Cassandra, + MySQL, or PostgreSQL. Customize setup for your infrastructure and tooling. slug: /self-hosted-guide/deployment toc_max_heading_level: 4 keywords: @@ -15,78 +17,64 @@ tags: - Self-hosting --- -There are many ways to self-host a [Temporal Service](/temporal-service). -The right way for you depends entirely on your use case and where you plan to run it. +There are many ways to self-host a [Temporal Service](/temporal-service). The right way for you depends entirely on your +use case and where you plan to run it. -For step-by-step guides on deploying and configuring Temporal, refer to our [Infrastructure tutorials](https://learn.temporal.io/tutorials/infrastructure/). +This page provides instructions for deploying a Temporal Service for production. If you are deploying a Temporal Service +for development, you can use the Temporal CLI to [start a local Temporal Service](/cli/start-dev-server). -### Minimum requirements +## Docker & Docker Compose -The Temporal Server depends on a database. +You can run a Temporal Service in [Docker](https://docs.docker.com/engine/install) containers using +[Docker Compose](https://docs.docker.com/compose/install). -Supported databases include the following: +### Prerequisites -- [Apache Cassandra](/self-hosted-guide/visibility#cassandra) -- [MySQL](/self-hosted-guide/visibility#mysql) -- [PostgreSQL](/self-hosted-guide/visibility#postgresql) -- [SQLite](/self-hosted-guide/visibility#sqlite) +- You have Docker Compose installed. +- Docker is running and the daemon is available. +- Git is installed and available. -### Docker & Docker Compose +### Procedure -You can run a Temporal Service in [Docker](https://docs.docker.com/engine/install) containers using [Docker Compose](https://docs.docker.com/compose/install). +1. Clone the [temporalio/samples-server](https://github.com/temporalio/samples-server) repository. -If you have Docker and Docker Compose installed, all you need to do is clone the [temporalio/docker-compose](https://github.com/temporalio/docker-compose) repo and run the `docker compose up` command from its root. +2. Change into the `compose` directory. -The `temporalio/docker-compose` repo comes loaded with a variety of configuration templates that enable you to try all three databases that the Temporal Platform supports (PostgreSQL, MySQL, Cassandra). -It also enables you to try [Advanced Visibility](/visibility#advanced-visibility) using [Search Attributes](/search-attribute), emit metrics, and even play with the [Archival](/temporal-service/archival) feature. + ``` + cd samples-server/compose + ``` -:::warning Docker Image Changes +3. Run the `docker compose up` command. This uses the default configuration from the `docker-compose.yaml` file, which + includes a PostgreSQL database, an Elasticsearch instance, and exposes the Temporal gRPC Frontend on port 7233. -The `temporalio/auto-setup` image is **deprecated** and no longer receives updates. + ``` + docker compose up + ``` -For example configurations and setup guidance, refer to the [samples-server repository](https://github.com/temporalio/samples-server) instead. + The Temporal Service will be available at `http://localhost:8233`. The Temporal Web UI will be available at + `http://localhost:8080`. -::: - -:::tip Local Development Alternative +4. (Optional) Review + [the additional configuration options](https://github.com/temporalio/samples-server/tree/main/compose#other-configuration-files) + available in the samples-server repository and use `docker compose up` with the corresponding configuration file to + try them out. The configurations include different databases, different visibility stores, and TLS settings. -For local development and testing, use the Temporal CLI's built-in development server: +## Temporal Server binaries -```bash -temporal server start-dev -``` +You can run a complete Temporal Server by deploying two Go binaries -- the +[core Temporal Server](https://github.com/temporalio/temporal/releases/), and the +[Temporal UI Server](https://github.com/temporalio/ui-server/releases). -This provides: -- A local Temporal Server with Web UI (http://localhost:8233) -- Automatic creation of the `default` Namespace -- Optional persistence with `--db-filename` for SQLite storage -- Custom Search Attributes with `--search-attribute` - -See [`temporal server start-dev`](/cli/server#start-dev) for all options. - -::: +Each service can be deployed separately. Refer to +[How to Configure a Temporal Service without a Proxy](https://learn.temporal.io/tutorials/infrastructure/configuring-sqlite-binary/) +to deploy each service using `systemd`. If you need to run the Temporal Server behind a reverse proxy, refer to our +tutorials to deploy the Temporal Service behind an +[Nginx reverse proxy](https://learn.temporal.io/tutorials/infrastructure/nginx-sqlite-binary/) or an +[Envoy edge proxy](https://learn.temporal.io/tutorials/infrastructure/envoy-sqlite-binary/). -The following commands start and run a Temporal Service in Docker using the default configuration: - -```bash -git clone https://github.com/temporalio/docker-compose.git -cd docker-compose -docker compose up -``` - -Local [Temporal Clients](/encyclopedia/temporal-sdks#temporal-client) and [Workers](/workers) can connect to the Temporal Service running in Docker at 127.0.0.1:7233 (default connection for most SDKs) and the Temporal Web UI at 127.0.0.1:8080. - -To try other configurations (different dependencies and databases), or to try a custom Docker image, follow the [temporalio/docker-compose README](https://github.com/temporalio/docker-compose/blob/main/README.md). - -### Temporal Server binaries - -You can run a complete Temporal Server by deploying just two Go binaries -- the [core Temporal Server](https://github.com/temporalio/temporal/releases/), and the [Temporal UI Server](https://github.com/temporalio/ui-server/releases). -Refer to our [tutorial site](https://learn.temporal.io/) for more details on how to deploy Temporal binaries behind an [Nginx reverse proxy](https://learn.temporal.io/tutorials/infrastructure/nginx-sqlite-binary/) or an [Envoy edge proxy](https://learn.temporal.io/tutorials/infrastructure/envoy-sqlite-binary/). - -Each service can also be deployed separately. -For example, if you are using Kubernetes, you could have one service per pod, so they can scale independently in the future. - -In Docker, you could run each service in its own container, using the `SERVICES` flag to specify the service: +In Docker, you could run each service in its own container, using the `SERVICES` flag to specify the service. Refer to +the [Temporal Server Docker image documentation](https://hub.docker.com/r/temporalio/server) for the environment +variables supported by the Temporal Docker images. ```bash docker run @@ -97,84 +85,69 @@ docker run temporalio/server: ``` -:::note Server Image Changes - -The `temporalio/server` image has been streamlined to include only production-essential components. The following tools have been removed: - -- `temporal` CLI -- `dockerize` (replaced with embedded `sprig` templating) -- `curl` -- `bash` +:::info -Configuration templating now uses embedded `sprig` instead of `dockerize`. See [Configuration Templating](#configuration-templating) for details. +The `temporalio/server` image includes only production-essential components. It does not have the `temporal` CLI, +`dockerize`, `curl`, or `bash` tools. ::: -The environment variables supported by the Temporal Docker images are documented [on Docker Hub](https://hub.docker.com/r/temporalio/server). +### Configuration templating -:::warning Deprecated: Auto Setup Image +Configuration templating is how the Temporal Server turns a template config file into the final `config.yaml` it runs +with. It lets you reuse one template across environments by filling in values from environment variables (for example, +database endpoints, TLS paths, or feature flags). -The `temporalio/auto-setup` Docker image is deprecated and no longer receives updates. For initial schema setup and example configurations, refer to: - -- [samples-server repository](https://github.com/temporalio/samples-server) for setup examples -- Manual schema setup instructions in the [Visibility guide](/self-hosted-guide/visibility) -- The `temporal-elasticsearch-tool` in the `temporalio/admin-tools` image for Elasticsearch setup - -::: +If you are **not** using a custom config template, you can skip this section. The default configuration is rendered +automatically by the server. -### Configuration Templating +#### Template compatibility -Configuration templating has changed from using the external `dockerize` tool to embedded `sprig` templating built directly into the Temporal Server binary. +If you use a custom configuration template, be aware of the following: -#### What Changed - -- **Previously:** `dockerize` processed configuration templates with custom helper functions -- **Now:** `sprig` templating is embedded in the server binary, and the default config template is embedded (not a separate file) - -#### Migration Notes - -If you use custom configuration templates, be aware that: -- Some template syntax has changed (particularly `.Env` and `default` function usage) +- The server renders templates with embedded `sprig`, so any `dockerize`-specific syntax or helpers will fail +- Some template syntax differs (particularly `.Env` and `default` function usage) - Refer to the [sprig documentation](http://masterminds.github.io/sprig/) for supported template functions - Use `temporal-server render-config` to verify your templates render correctly -Default configuration loading now uses the embedded template instead of searching the filesystem. +#### Helm Chart configuration -#### Helm Chart Configuration +When deploying with Helm charts (version 0.73.1 or later), the following configuration options control the dockerize to +sprig migration: -When deploying with Helm charts (version 0.73.1 or later), the following configuration options control the dockerize to sprig migration: +| Configuration Option | Description | Default | +| ---------------------------- | --------------------------------------------------------------------- | ------------- | +| `server.useEntrypointScript` | Use entrypoint script that auto-detects dockerize vs sprig | `false` | +| `server.configMapsToMount` | Which config template to mount: `"dockerize"`, `"sprig"`, or `"both"` | `"dockerize"` | +| `server.setConfigFilePath` | Set `TEMPORAL_SERVER_CONFIG_FILE_PATH` env var (required for sprig) | `false` | -| Configuration Option | Description | Default | -|---------------------|-------------|---------| -| `server.useEntrypointScript` | Use entrypoint script that auto-detects dockerize vs sprig | `false` | -| `server.configMapsToMount` | Which config template to mount: `"dockerize"`, `"sprig"`, or `"both"` | `"dockerize"` | -| `server.setConfigFilePath` | Set `TEMPORAL_SERVER_CONFIG_FILE_PATH` env var (required for sprig) | `false` | +## Importing the Server package -### Importing the Server package +The Temporal Server is a standalone Go application that can be [imported](/references/server-options) into another +project. -The Temporal Server is a standalone Go application that can be [imported](/references/server-options) into another project. +You might want to do this to pass custom plugins or any other customizations through the +[Server Options](/references/server-options). Then you can build and run a binary that contains your customizations. -You might want to do this to pass custom plugins or any other customizations through the [Server Options](/references/server-options). -Then you can build and run a binary that contains your customizations. +This requires Go v1.19 or later, as specified in the Temporal Server +[Build prerequisites](https://github.com/temporalio/temporal/blob/main/CONTRIBUTING.md#build-prerequisites). -This requires Go v1.19 or later, as specified in the Temporal Server [Build prerequisites](https://github.com/temporalio/temporal/blob/main/CONTRIBUTING.md#build-prerequisites). +## Helm charts -### Helm charts +[Temporal Helm charts](https://github.com/temporalio/helm-charts) enable you to get a Temporal Service running on +[Kubernetes](https://kubernetes.io/) by deploying the Temporal Server services to individual pods and connecting them to +your existing database and Elasticsearch instances. -[Temporal Helm charts](https://github.com/temporalio/helm-charts) enable you to get a Temporal Service running on [Kubernetes](https://kubernetes.io/) by deploying the Temporal Server services to individual pods and connecting them to your existing database and Elasticsearch instances. - -The Temporal Helm charts repo contains [extensive documentation](https://github.com/temporalio/helm-charts/blob/main/README.md) about Kubernetes deployments. +The Temporal Helm charts repo contains +[extensive documentation](https://github.com/temporalio/helm-charts/blob/main/README.md) about Kubernetes deployments. :::warning Helm Chart Breaking Changes -**Important compatibility requirements:** - - Existing Helm chart versions are **not compatible** with `server` and `admin-tools` images **version 1.30 and later** - You **cannot** override existing chart versions with newer images -- **Required Helm chart version:** [temporal-0.73.1](https://github.com/temporalio/helm-charts/releases/tag/temporal-0.73.1) **or later** +- **Required Helm chart version:** + [temporal-0.73.1](https://github.com/temporalio/helm-charts/releases/tag/temporal-0.73.1) **or later** If you are using Temporal Server images 1.30+, you must upgrade to Helm chart version 0.73.1 or later. -**Note:** Temporal Cloud deployments are not impacted by these changes. - ::: From 855318800bbb9b2dae57a2b931d94d05d6f949f3 Mon Sep 17 00:00:00 2001 From: Lenny Chen Date: Thu, 29 Jan 2026 15:32:38 -0800 Subject: [PATCH 5/8] update for readability --- .../self-hosted-guide/deployment.mdx | 53 ++++++------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/docs/production-deployment/self-hosted-guide/deployment.mdx b/docs/production-deployment/self-hosted-guide/deployment.mdx index fd9a25dcff..c3833f9cb3 100644 --- a/docs/production-deployment/self-hosted-guide/deployment.mdx +++ b/docs/production-deployment/self-hosted-guide/deployment.mdx @@ -20,10 +20,11 @@ tags: There are many ways to self-host a [Temporal Service](/temporal-service). The right way for you depends entirely on your use case and where you plan to run it. -This page provides instructions for deploying a Temporal Service for production. If you are deploying a Temporal Service -for development, you can use the Temporal CLI to [start a local Temporal Service](/cli/start-dev-server). +This page provides instructions for deploying a Temporal Service for sustained workloads that exceed what the +[development server](/cli#start-dev-server) is designed to handle. For local development or testing, you can use the +Temporal CLI to [start a local development Temporal Service](/cli#start-dev-server). -## Docker & Docker Compose +## Use Docker Compose You can run a Temporal Service in [Docker](https://docs.docker.com/engine/install) containers using [Docker Compose](https://docs.docker.com/compose/install). @@ -57,9 +58,9 @@ You can run a Temporal Service in [Docker](https://docs.docker.com/engine/instal 4. (Optional) Review [the additional configuration options](https://github.com/temporalio/samples-server/tree/main/compose#other-configuration-files) available in the samples-server repository and use `docker compose up` with the corresponding configuration file to - try them out. The configurations include different databases, different visibility stores, and TLS settings. + try them out. The configurations include different databases, visibility stores, and TLS settings. -## Temporal Server binaries +## Use Temporal Server binaries You can run a complete Temporal Server by deploying two Go binaries -- the [core Temporal Server](https://github.com/temporalio/temporal/releases/), and the @@ -72,41 +73,21 @@ tutorials to deploy the Temporal Service behind an [Nginx reverse proxy](https://learn.temporal.io/tutorials/infrastructure/nginx-sqlite-binary/) or an [Envoy edge proxy](https://learn.temporal.io/tutorials/infrastructure/envoy-sqlite-binary/). -In Docker, you could run each service in its own container, using the `SERVICES` flag to specify the service. Refer to -the [Temporal Server Docker image documentation](https://hub.docker.com/r/temporalio/server) for the environment -variables supported by the Temporal Docker images. - -```bash -docker run - # persistence/schema setup flags omitted - -e SERVICES=history \ -- Spin up one or more: history, matching, worker, frontend - -e LOG_LEVEL=debug,info \ -- Logging level - -e DYNAMIC_CONFIG_FILE_PATH=config/foo.yaml -- Dynamic config file to be watched - temporalio/server: -``` - -:::info - -The `temporalio/server` image includes only production-essential components. It does not have the `temporal` CLI, -`dockerize`, `curl`, or `bash` tools. - -::: - ### Configuration templating Configuration templating is how the Temporal Server turns a template config file into the final `config.yaml` it runs -with. It lets you reuse one template across environments by filling in values from environment variables (for example, -database endpoints, TLS paths, or feature flags). +with. It lets you reuse one template across environments by filling in values from environment variables. For example, +database endpoints, TLS paths, or feature flags. If you are **not** using a custom config template, you can skip this section. The default configuration is rendered -automatically by the server. +automatically by the server and can be found in the `config` directory when you download the #### Template compatibility If you use a custom configuration template, be aware of the following: - The server renders templates with embedded `sprig`, so any `dockerize`-specific syntax or helpers will fail -- Some template syntax differs (particularly `.Env` and `default` function usage) +- Some template syntax differs, particularly `.Env` and `default` function usage. - Refer to the [sprig documentation](http://masterminds.github.io/sprig/) for supported template functions - Use `temporal-server render-config` to verify your templates render correctly @@ -121,7 +102,7 @@ sprig migration: | `server.configMapsToMount` | Which config template to mount: `"dockerize"`, `"sprig"`, or `"both"` | `"dockerize"` | | `server.setConfigFilePath` | Set `TEMPORAL_SERVER_CONFIG_FILE_PATH` env var (required for sprig) | `false` | -## Importing the Server package +## Import the Server package The Temporal Server is a standalone Go application that can be [imported](/references/server-options) into another project. @@ -132,7 +113,7 @@ You might want to do this to pass custom plugins or any other customizations thr This requires Go v1.19 or later, as specified in the Temporal Server [Build prerequisites](https://github.com/temporalio/temporal/blob/main/CONTRIBUTING.md#build-prerequisites). -## Helm charts +## Use Helm charts [Temporal Helm charts](https://github.com/temporalio/helm-charts) enable you to get a Temporal Service running on [Kubernetes](https://kubernetes.io/) by deploying the Temporal Server services to individual pods and connecting them to @@ -141,13 +122,11 @@ your existing database and Elasticsearch instances. The Temporal Helm charts repo contains [extensive documentation](https://github.com/temporalio/helm-charts/blob/main/README.md) about Kubernetes deployments. -:::warning Helm Chart Breaking Changes - -- Existing Helm chart versions are **not compatible** with `server` and `admin-tools` images **version 1.30 and later** -- You **cannot** override existing chart versions with newer images -- **Required Helm chart version:** - [temporal-0.73.1](https://github.com/temporalio/helm-charts/releases/tag/temporal-0.73.1) **or later** +:::caution Helm Chart version compatibility If you are using Temporal Server images 1.30+, you must upgrade to Helm chart version 0.73.1 or later. +Helm chart versions below 0.73.1 are **not compatible** with `server` and `admin-tools` images **version 1.30 and +later**. You **cannot** override old chart versions with newer images. + ::: From 8030466b4a9e93d468c8614a49cc7016e01b93c6 Mon Sep 17 00:00:00 2001 From: Lenny Chen Date: Thu, 29 Jan 2026 15:39:02 -0800 Subject: [PATCH 6/8] docs: small correction --- docs/production-deployment/self-hosted-guide/deployment.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/production-deployment/self-hosted-guide/deployment.mdx b/docs/production-deployment/self-hosted-guide/deployment.mdx index c3833f9cb3..946fe1ef1d 100644 --- a/docs/production-deployment/self-hosted-guide/deployment.mdx +++ b/docs/production-deployment/self-hosted-guide/deployment.mdx @@ -80,7 +80,7 @@ with. It lets you reuse one template across environments by filling in values fr database endpoints, TLS paths, or feature flags. If you are **not** using a custom config template, you can skip this section. The default configuration is rendered -automatically by the server and can be found in the `config` directory when you download the +automatically by the server and embedded in the binary. #### Template compatibility From 45c64fa95a2dde5dd5ef9de3d77c3ae282ffc6f1 Mon Sep 17 00:00:00 2001 From: Lenny Chen Date: Thu, 29 Jan 2026 17:51:50 -0800 Subject: [PATCH 7/8] docs: update visibility setup scripts --- .../self-hosted-guide/namespaces.mdx | 57 ++- .../self-hosted-guide/visibility.mdx | 469 ++++++++++-------- 2 files changed, 297 insertions(+), 229 deletions(-) diff --git a/docs/production-deployment/self-hosted-guide/namespaces.mdx b/docs/production-deployment/self-hosted-guide/namespaces.mdx index fc89a1c973..8d719eaf85 100644 --- a/docs/production-deployment/self-hosted-guide/namespaces.mdx +++ b/docs/production-deployment/self-hosted-guide/namespaces.mdx @@ -2,7 +2,8 @@ id: namespaces title: Managing Namespaces sidebar_label: Namespaces -description: How to create and manage Namespaces in open source Temporal, including registration, configuration, and security. +description: + How to create and manage Namespaces in open source Temporal, including registration, configuration, and security. slug: /self-hosted-guide/namespaces keywords: - namespaces @@ -13,19 +14,18 @@ tags: - Self-hosting --- -:::info Open source Temporal -This page covers namespace operations for **open source Temporal**. -For core namespace concepts, see [Temporal Namespace](/namespaces). -For Temporal Cloud, see [Temporal Cloud Namespaces](/cloud/namespaces). +:::info Open source Temporal This page covers namespace operations for **open source Temporal**. For core namespace +concepts, see [Temporal Namespace](/namespaces). For Temporal Cloud, see [Temporal Cloud Namespaces](/cloud/namespaces). ::: -A [Namespace](/namespaces) is a unit of isolation within the Temporal Platform. -Before you can run Workflows, you must register at least one Namespace with your Temporal Service. +A [Namespace](/namespaces) is a unit of isolation within the Temporal Platform. Before you can run Workflows, you must +register at least one Namespace with your Temporal Service. ## Create a Namespace -Registering a Namespace creates it on the Temporal Service. -When you register a Namespace, you must set a [Retention Period](/temporal-service/temporal-server#retention-period) that determines how long closed Workflow execution history is kept. +Registering a Namespace creates it on the Temporal Service. When you register a Namespace, you must set a +[Retention Period](/temporal-service/temporal-server#retention-period) that determines how long closed Workflow +execution history is kept. You can create Namespaces using: @@ -36,16 +36,11 @@ You can create Namespaces using: ### The default Namespace -If no Namespace is specified, SDKs and CLI use the `default` Namespace. -You must register this Namespace before using it. +If no Namespace is specified, SDKs and CLI use the `default` Namespace. You must register this Namespace before using +it. -:::warning Deprecated: auto-setup Image - -The `temporalio/auto-setup` image is deprecated and no longer receives updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). - -::: - -For local development, the [`temporal server start-dev`](/cli/server#start-dev) command automatically creates the `default` Namespace. +For local development, the [`temporal server start-dev`](/cli/server#start-dev) command automatically creates the +`default` Namespace. For all other deployment methods, create the `default` Namespace manually using the Temporal CLI: @@ -53,21 +48,22 @@ For all other deployment methods, create the `default` Namespace manually using temporal operator namespace create --namespace default ``` -Namespace registration takes up to 15 seconds to complete. -Wait for this process to finish before making calls to the Namespace. +Namespace registration takes up to 15 seconds to complete. Wait for this process to finish before making calls to the +Namespace. ## Manage Namespaces Common namespace management operations: -| Operation | CLI Command | Description | -|-----------|-------------|-------------| -| List | [`temporal operator namespace list`](/cli/operator#list) | List all registered Namespaces | -| Describe | [`temporal operator namespace describe`](/cli/operator#describe) | Get details for a Namespace | -| Update | [`temporal operator namespace update`](/cli/operator#update) | Update Namespace configuration | -| Delete | [`temporal operator namespace delete`](/cli/operator#delete) | Delete a Namespace and all its data | +| Operation | CLI Command | Description | +| --------- | ---------------------------------------------------------------- | ----------------------------------- | +| List | [`temporal operator namespace list`](/cli/operator#list) | List all registered Namespaces | +| Describe | [`temporal operator namespace describe`](/cli/operator#describe) | Get details for a Namespace | +| Update | [`temporal operator namespace update`](/cli/operator#update) | Update Namespace configuration | +| Delete | [`temporal operator namespace delete`](/cli/operator#delete) | Delete a Namespace and all its data | For SDK-based namespace management: + - [Go SDK namespace management](/develop/go/namespaces#manage-namespaces) - [Java SDK namespace management](/develop/java/namespaces#manage-namespaces) - [TypeScript SDK namespace management](/develop/typescript/namespaces#manage-namespaces) @@ -79,12 +75,15 @@ For SDK-based namespace management: ## Security -Use a custom [Authorizer](/self-hosted-guide/security#authorizer-plugin) on your Frontend Service to control who can create, update, or deprecate Namespaces. +Use a custom [Authorizer](/self-hosted-guide/security#authorizer-plugin) on your Frontend Service to control who can +create, update, or deprecate Namespaces. Without an Authorizer configured, Temporal uses the `nopAuthority` authorizer that allows all API calls unconditionally. -For Temporal Cloud, [role-based access controls](/cloud/users#namespace-level-permissions) provide namespace-level authorization without custom configuration. +For Temporal Cloud, [role-based access controls](/cloud/users#namespace-level-permissions) provide namespace-level +authorization without custom configuration. ## Best practices -For namespace naming conventions, organizational patterns, and production safeguards, see [Namespace Best Practices](/best-practices/managing-namespace). +For namespace naming conventions, organizational patterns, and production safeguards, see +[Namespace Best Practices](/best-practices/managing-namespace). diff --git a/docs/production-deployment/self-hosted-guide/visibility.mdx b/docs/production-deployment/self-hosted-guide/visibility.mdx index cfdd1be3d4..4836acca6a 100644 --- a/docs/production-deployment/self-hosted-guide/visibility.mdx +++ b/docs/production-deployment/self-hosted-guide/visibility.mdx @@ -2,7 +2,10 @@ id: visibility title: Self-hosted Visibility feature setup sidebar_label: Visibility -description: A Visibility store is essential for your Temporal Service, supporting features like batch operations and custom Search Attributes for filtering Workflow Executions. Upgrade to PostgreSQL 12, MySQL 8.0.17, or SQLite 3.31.0 with Temporal Server 1.20+ for advanced Visibility +description: + A Visibility store is essential for your Temporal Service, supporting features like batch operations and custom Search + Attributes for filtering Workflow Executions. Upgrade to PostgreSQL 12, MySQL 8.0.17, or SQLite 3.31.0 with Temporal + Server 1.20+ for advanced Visibility slug: /self-hosted-guide/visibility toc_max_heading_level: 4 keywords: @@ -16,45 +19,53 @@ tags: - Visibility --- -A [Visibility](/temporal-service/visibility) store is set up as a part of your [Persistence store](/temporal-service/persistence) to enable listing and filtering details about Workflow Executions that exist on your Temporal Service. +A [Visibility](/temporal-service/visibility) store is set up as a part of your +[Persistence store](/temporal-service/persistence) to enable listing and filtering details about Workflow Executions +that exist on your Temporal Service. -A Visibility store is required in a Temporal Service setup because it is used by Temporal Web UI and CLI to pull Workflow Execution data and enables features like batch operations on a group of Workflow Executions. +A Visibility store is required in a Temporal Service setup because it is used by Temporal Web UI and CLI to pull +Workflow Execution data and enables features like batch operations on a group of Workflow Executions. -With the Visibility store, you can use [List Filters](/list-filter) with [Search Attributes](/search-attribute) to list and filter Workflow Executions that you want to review. +With the Visibility store, you can use [List Filters](/list-filter) with [Search Attributes](/search-attribute) to list +and filter Workflow Executions that you want to review. -Setting up [advanced Visibility](/visibility#advanced-visibility) enables access to creating and using multiple custom Search Attributes with your List Filters. +Setting up [advanced Visibility](/visibility#advanced-visibility) enables access to creating and using multiple custom +Search Attributes with your List Filters. For details, see [Search Attributes](/search-attribute). -Note that if you use MySQL, PostgreSQL, or SQLite as your Visibility store, Temporal Server version 1.20 and later supports advanced Visibility features on MySQL (version 8.0.17 and later), PostgreSQL (version 12 and later) and SQLite (v3.31.0 and later), in addition to Elasticsearch. +Note that if you use MySQL, PostgreSQL, or SQLite as your Visibility store, Temporal Server version 1.20 and later +supports advanced Visibility features on MySQL (version 8.0.17 and later), PostgreSQL (version 12 and later) and SQLite +(v3.31.0 and later), in addition to Elasticsearch. To enable advanced Visibility on your SQL databases, ensure that you do the following: - [Upgrade your Temporal Server](/self-hosted-guide/upgrade-server#upgrade-server) to version 1.20 or later. -- [Update your database schemas](/self-hosted-guide/upgrade-server#upgrade-server) for MySQL to version 8.0.17 (or later), PostgreSQL to version 12 (or later), or SQLite to v3.31.0 (or later). +- [Update your database schemas](/self-hosted-guide/upgrade-server#upgrade-server) for MySQL to version 8.0.17 (or + later), PostgreSQL to version 12 (or later), or SQLite to v3.31.0 (or later). -Beginning with Temporal Server v1.21, you can set up a secondary Visibility store in your Temporal Service to enable [Dual Visibility](/dual-visibility). -This is useful for migrating your Visibility store database. +Beginning with Temporal Server v1.21, you can set up a secondary Visibility store in your Temporal Service to enable +[Dual Visibility](/dual-visibility). This is useful for migrating your Visibility store database. #### Supported databases The following databases are supported as Visibility stores: -- [MySQL](#mysql) v5.7 and later. - Use v8.0.17 (or later) with Temporal Server v1.20 or later for advanced Visibility capabilities. - Because standard Visibility is deprecated beginning with Temporal Server v1.21, support for older versions of MySQL will be dropped. -- [PostgreSQL](#postgresql) v9.6 and later. - Use v12 (or later) with Temporal Server v1.20 or later for advanced Visibility capabilities. - Because standard Visibility is deprecated beginning with Temporal Server v1.21, support for older versions of PostgreSQL will be dropped. +- [MySQL](#mysql) v5.7 and later. Use v8.0.17 (or later) with Temporal Server v1.20 or later for advanced Visibility + capabilities. Because standard Visibility is deprecated beginning with Temporal Server v1.21, support for older + versions of MySQL will be dropped. +- [PostgreSQL](#postgresql) v9.6 and later. Use v12 (or later) with Temporal Server v1.20 or later for advanced + Visibility capabilities. Because standard Visibility is deprecated beginning with Temporal Server v1.21, support for + older versions of PostgreSQL will be dropped. - [SQLite](#sqlite) v3.31.0 and later for advanced Visibility capabilities. -- [Cassandra](#cassandra). - Support for Cassandra as a Visibility database is deprecated beginning with Temporal Server v1.21. - For information on migrating from Cassandra to any of the supported databases, see [Migrating Visibility database](#migrating-visibility-database). -- [Elasticsearch](#elasticsearch) supported versions. - We recommend operating a Temporal Service with Elasticsearch as your Visibility store for any use case that spawns more than a few Workflow Executions. +- [Cassandra](#cassandra). Support for Cassandra as a Visibility database is deprecated beginning with Temporal Server + v1.21. For information on migrating from Cassandra to any of the supported databases, see + [Migrating Visibility database](#migrating-visibility-database). +- [Elasticsearch](#elasticsearch) supported versions. We recommend operating a Temporal Service with Elasticsearch as + your Visibility store for any use case that spawns more than a few Workflow Executions. -You can use any combination of the supported databases for your Persistence and Visibility stores. -For updates, check [Server release notes](https://github.com/temporalio/temporal/releases). +You can use any combination of the supported databases for your Persistence and Visibility stores. For updates, check +[Server release notes](https://github.com/temporalio/temporal/releases). ## How to set up MySQL Visibility store {#mysql} @@ -66,16 +77,20 @@ For updates, check [Server release notes](https://github.com/temporalio/temporal ::: -You can set MySQL as your [Visibility store](/temporal-service/visibility). -Verify [supported versions](/self-hosted-guide/visibility) before you proceed. +You can set MySQL as your [Visibility store](/temporal-service/visibility). Verify +[supported versions](/self-hosted-guide/visibility) before you proceed. -If using MySQL v8.0.17 or later as your Visibility store with Temporal Server v1.20 and later, any [custom Search Attributes](/search-attribute#custom-search-attribute) that you create must be associated with a Namespace in that Temporal Service. +If using MySQL v8.0.17 or later as your Visibility store with Temporal Server v1.20 and later, any +[custom Search Attributes](/search-attribute#custom-search-attribute) that you create must be associated with a +Namespace in that Temporal Service. -**Persistence configuration** +### Persistence configuration -Set your MySQL Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. +Set your MySQL Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then +define the Visibility store configuration under `datastores`. -The following example shows how to set a Visibility store `mysql-visibility` and define the datastore configuration in your Temporal Service configuration YAML. +The following example shows how to set a Visibility store `mysql-visibility` and define the datastore configuration in +your Temporal Service configuration YAML. ```yaml #... @@ -100,56 +115,51 @@ persistence: #... ``` -For details on the configuration parameters and values, see [Temporal Service configuration](/references/configuration#sql). +For details on the configuration parameters and values, see +[Temporal Service configuration](/references/configuration#sql). -To enable advanced Visibility features on your MySQL Visibility store, upgrade to MySQL v8.0.17 or later with Temporal Server v1.20 or later. -See [Upgrade Server](/self-hosted-guide/upgrade-server#upgrade-server) on how to upgrade your Temporal Server and database schemas. +To enable advanced Visibility features on your MySQL Visibility store, upgrade to MySQL v8.0.17 or later with Temporal +Server v1.20 or later. See [Upgrade Server](/self-hosted-guide/upgrade-server#upgrade-server) on how to upgrade your +Temporal Server and database schemas. -For example configuration templates, see [MySQL Visibility store configuration](https://github.com/temporalio/temporal/blob/main/config/development-mysql8.yaml). +For example configuration templates, see +[MySQL Visibility store configuration](https://github.com/temporalio/temporal/blob/main/config/development-mysql8.yaml). -**Database schema and setup** +### Database schema and setup -Visibility data is stored in a database table called `executions_visibility` that must be set up according to the schemas defined (by supported versions): +Visibility data is stored in a database table called `executions_visibility` and must be created using the schema for +[MySQL v8.0.17 and later](https://github.com/temporalio/temporal/tree/main/schema/mysql/v8/visibility). -- [MySQL v8.0.17 and later](https://github.com/temporalio/temporal/tree/main/schema/mysql/v8/visibility) +The following example shows how to set up your MySQ as both your persistence and Visibility store using +`temporal-sql-tool`. Refer to the +[samples-server repository](https://github.com/temporalio/samples-server/tree/main/compose/scripts) for more examples +with different databases. -:::warning Deprecated: auto-setup.sh Script +```bash +#!/bin/sh +set -eu -The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). +echo 'Starting MySQL schema setup...' +echo 'Waiting for MySQL port to be available...' +nc -z -w 10 mysql 3306 +echo 'MySQL port is available' -::: +# Create and setup temporal database +temporal-sql-tool --plugin mysql8 --ep mysql -u root -p 3306 --db temporal create +temporal-sql-tool --plugin mysql8 --ep mysql -u root -p 3306 --db temporal setup-schema -v 0.0 +temporal-sql-tool --plugin mysql8 --ep mysql -u root -p 3306 --db temporal update-schema -d /etc/temporal/schema/mysql/v8/temporal/versioned -The following example shows how to set up your MySQL Visibility store using `temporal-sql-tool`: +# Create and setup visibility database +temporal-sql-tool --plugin mysql8 --ep mysql -u root -p 3306 --db temporal_visibility create +temporal-sql-tool --plugin mysql8 --ep mysql -u root -p 3306 --db temporal_visibility setup-schema -v 0.0 +temporal-sql-tool --plugin mysql8 --ep mysql -u root -p 3306 --db temporal_visibility update-schema -d /etc/temporal/schema/mysql/v8/visibility/versioned -```bash -#... -# set your MySQL environment variables -: "${DBNAME:=temporal}" -: "${VISIBILITY_DBNAME:=temporal_visibility}" -: "${DB_PORT:=}" -: "${MYSQL_SEEDS:=}" -: "${MYSQL_USER:=}" -: "${MYSQL_PWD:=}" -: "${MYSQL_TX_ISOLATION_COMPAT:=false}" - -#... -# set connection details -#... -# set up MySQL schema -setup_mysql_schema() { - #... - # use valid schema for the version of the database you want to set up for Visibility - VISIBILITY_SCHEMA_DIR=${TEMPORAL_HOME}/schema/mysql/${MYSQL_VERSION_DIR}/visibility/versioned - if [[ ${SKIP_DB_CREATE} != true ]]; then - temporal-sql-tool --ep "${MYSQL_SEEDS}" -u "${MYSQL_USER}" -p "${DB_PORT}" "${MYSQL_CONNECT_ATTR[@]}" --db "${VISIBILITY_DBNAME}" create - fi - temporal-sql-tool --ep "${MYSQL_SEEDS}" -u "${MYSQL_USER}" -p "${DB_PORT}" "${MYSQL_CONNECT_ATTR[@]}" --db "${VISIBILITY_DBNAME}" setup-schema -v 0.0 - temporal-sql-tool --ep "${MYSQL_SEEDS}" -u "${MYSQL_USER}" -p "${DB_PORT}" "${MYSQL_CONNECT_ATTR[@]}" --db "${VISIBILITY_DBNAME}" update-schema -d "${VISIBILITY_SCHEMA_DIR}" -#... -} +echo 'MySQL schema setup complete' ``` -Note that the script uses [temporal-sql-tool](https://github.com/temporalio/temporal/blob/3b982585bf0124839e697952df4bba01fe4d9543/tools/sql/main.go) to run the setup. +Note that the script uses +[temporal-sql-tool](https://github.com/temporalio/temporal/blob/3b982585bf0124839e697952df4bba01fe4d9543/tools/sql/main.go) +to run the setup. ## How to set up PostgreSQL Visibility store {#postgresql} @@ -157,20 +167,25 @@ Note that the script uses [temporal-sql-tool](https://github.com/temporalio/temp - PostgreSQL v9.6 and later. - With Temporal Service version 1.20 and later, advanced Visibility is available on PostgreSQL v12 and later. -- Support for PostgreSQL v9.6 through v11 will be deprecated for all Temporal Server versions after v1.20; we recommend upgrading to PostgreSQL 12 or later. +- Support for PostgreSQL v9.6 through v11 will be deprecated for all Temporal Server versions after v1.20; we recommend + upgrading to PostgreSQL 12 or later. ::: -You can set PostgreSQL as your [Visibility store](/temporal-service/visibility). -Verify [supported versions](/self-hosted-guide/visibility) before you proceed. +You can set PostgreSQL as your [Visibility store](/temporal-service/visibility). Verify +[supported versions](/self-hosted-guide/visibility) before you proceed. -If using PostgreSQL v12 or later as your Visibility store with Temporal Server v1.20 and later, any [custom Search Attributes](/search-attribute#custom-search-attribute) that you create must be associated with a Namespace in that Temporal Service. +If using PostgreSQL v12 or later as your Visibility store with Temporal Server v1.20 and later, any +[custom Search Attributes](/search-attribute#custom-search-attribute) that you create must be associated with a +Namespace in that Temporal Service. -**Persistence configuration** +### Persistence configuration -Set your PostgreSQL Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. +Set your PostgreSQL Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then +define the Visibility store configuration under `datastores`. -The following example shows how to set a Visibility store `postgres-visibility` and define the datastore configuration in your Temporal Service configuration YAML. +The following example shows how to set a Visibility store `postgres-visibility` and define the datastore configuration +in your Temporal Service configuration YAML. ```yaml #... @@ -195,49 +210,45 @@ persistence: #... ``` -To enable advanced Visibility features on your PostgreSQL Visibility store, upgrade to PostgreSQL v12 or later with Temporal Server v1.20 or later. -See [Upgrade Server](/self-hosted-guide/upgrade-server#upgrade-server) for details on how to upgrade your Temporal Server and database schemas. - -**Database schema and setup** - -Visibility data is stored in a database table called `executions_visibility` that must be set up according to the schemas defined (by supported versions): +To enable advanced Visibility features on your PostgreSQL Visibility store, upgrade to PostgreSQL v12 or later with +Temporal Server v1.20 or later. See [Upgrade Server](/self-hosted-guide/upgrade-server#upgrade-server) for details on +how to upgrade your Temporal Server and database schemas. -- [PostgreSQL v12 and later](https://github.com/temporalio/temporal/tree/main/schema/postgresql/v12/visibility) +### Database schema and setup -:::warning Deprecated: auto-setup.sh Script +Visibility data is stored in a database table called `executions_visibility` and must be created using the schema for +[PostgreSQL v12 and later](https://github.com/temporalio/temporal/tree/main/schema/postgresql/v12/visibility) -The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). +The following example shows how to set up your PostgreSQL as both persistence and Visibility store using +`temporal-sql-tool`. Refer to the +[samples-server repository](https://github.com/temporalio/samples-server/tree/main/compose/scripts) for more examples +with different databases. -::: +```bash +#!/bin/sh +set -eu -The following example shows how to set up your PostgreSQL Visibility store using `temporal-sql-tool`: +echo 'Starting PostgreSQL schema setup...' +echo 'Waiting for PostgreSQL port to be available...' +nc -z -w 10 postgresql 5432 +echo 'PostgreSQL port is available' -```bash -#... -# set your PostgreSQL environment variables -: "${DBNAME:=temporal}" -: "${VISIBILITY_DBNAME:=temporal_visibility}" -: "${DB_PORT:=}" -: "${POSTGRES_SEEDS:=}" -: "${POSTGRES_USER:=}" -: "${POSTGRES_PWD:=}" +# Create and setup temporal database +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal create +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal setup-schema -v 0.0 +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal update-schema -d /etc/temporal/schema/postgresql/v12/temporal/versioned -#... set connection details -# set up PostgreSQL schema -setup_postgres_schema() { - #... +# Create and setup visibility database +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal_visibility create +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal_visibility setup-schema -v 0.0 +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal_visibility update-schema -d /etc/temporal/schema/postgresql/v12/visibility/versioned - # use valid schema for the version of the database you want to set up for Visibility - VISIBILITY_SCHEMA_DIR=${TEMPORAL_HOME}/schema/postgresql/${POSTGRES_VERSION_DIR}/visibility/versioned - if [[ ${VISIBILITY_DBNAME} != "${POSTGRES_USER}" && ${SKIP_DB_CREATE} != true ]]; then - temporal-sql-tool --plugin postgres --ep "${POSTGRES_SEEDS}" -u "${POSTGRES_USER}" -p "${DB_PORT}" --db "${VISIBILITY_DBNAME}" create - fi - temporal-sql-tool --plugin postgres --ep "${POSTGRES_SEEDS}" -u "${POSTGRES_USER}" -p "${DB_PORT}" --db "${VISIBILITY_DBNAME}" update-schema -d "${VISIBILITY_SCHEMA_DIR}" - #... -} +echo 'PostgreSQL schema setup complete' ``` -Note that the script uses [temporal-sql-tool](https://github.com/temporalio/temporal/blob/3b982585bf0124839e697952df4bba01fe4d9543/tools/sql/main.go) to run the setup. +Note that the script uses +[temporal-sql-tool](https://github.com/temporalio/temporal/blob/3b982585bf0124839e697952df4bba01fe4d9543/tools/sql/main.go) +to run the setup. ## How to set up SQLite Visibility store {#sqlite} @@ -247,21 +258,27 @@ Note that the script uses [temporal-sql-tool](https://github.com/temporalio/temp ::: -You can set SQLite as your [Visibility store](/temporal-service/visibility). -Verify [supported versions](/self-hosted-guide/visibility) before you proceed. +You can set SQLite as your [Visibility store](/temporal-service/visibility). Verify +[supported versions](/self-hosted-guide/visibility) before you proceed. -Temporal supports only an in-memory database with SQLite; this means that the database is automatically created when Temporal Server starts and is destroyed when Temporal Server stops. +Temporal supports only an in-memory database with SQLite; this means that the database is automatically created when +Temporal Server starts and is destroyed when Temporal Server stops. You can change the configuration to use a file-based database so that it is preserved when Temporal Server stops. -However, if you use a file-based SQLite database, upgrading your database schema to enable advanced Visibility features is not supported; in this case, you must delete the database and create it again to upgrade. +However, if you use a file-based SQLite database, upgrading your database schema to enable advanced Visibility features +is not supported; in this case, you must delete the database and create it again to upgrade. -If using SQLite v3.31.0 and later as your Visibility store with Temporal Server v1.20 and later, any [custom Search Attributes](/search-attribute#custom-search-attribute) that you create must be associated with a Namespace in that Temporal Service. +If using SQLite v3.31.0 and later as your Visibility store with Temporal Server v1.20 and later, any +[custom Search Attributes](/search-attribute#custom-search-attribute) that you create must be associated with a +Namespace in that Temporal Service. **Persistence configuration** -Set your SQLite Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. +Set your SQLite Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then +define the Visibility store configuration under `datastores`. -The following example shows how to set a Visibility store `sqlite-visibility` and define the datastore configuration in your Temporal Service configuration YAML. +The following example shows how to set a Visibility store `sqlite-visibility` and define the datastore configuration in +your Temporal Service configuration YAML. ```yaml persistence: @@ -297,34 +314,43 @@ SQLite (v3.31.0 and later) has advanced Visibility enabled by default. **Database schema and setup** -Visibility data is stored in a database table called `executions_visibility` that must be set up according to the schemas defined (by supported versions) in https://github.com/temporalio/temporal/blob/main/schema/sqlite/v3/visibility/schema.sql. +Visibility data is stored in a database table called `executions_visibility` that must be set up according to the +schemas defined (by supported versions) in +https://github.com/temporalio/temporal/blob/main/schema/sqlite/v3/visibility/schema.sql. -For an example of setting up the SQLite schema, see [Temporalite](https://github.com/temporalio/temporalite/blob/main/server.go) setup. +For an example of setting up the SQLite schema, see +[Temporalite](https://github.com/temporalio/temporalite/blob/main/server.go) setup. ## How to set up Cassandra Visibility store {#cassandra} :::tip Support, stability, and dependency info -- Support for Cassandra as a Visibility database is deprecated beginning with Temporal Server v1.21. For updates, check the [Temporal Server release notes](https://github.com/temporalio/temporal/releases). +- Support for Cassandra as a Visibility database is deprecated beginning with Temporal Server v1.21. For updates, check + the [Temporal Server release notes](https://github.com/temporalio/temporal/releases). - We recommend migrating from Cassandra to any of the other supported databases for Visibility. ::: -You can set Cassandra as your [Visibility store](/temporal-service/visibility). -Verify [supported versions](/self-hosted-guide/visibility) before you proceed. +You can set Cassandra as your [Visibility store](/temporal-service/visibility). Verify +[supported versions](/self-hosted-guide/visibility) before you proceed. Advanced Visibility is not supported with Cassandra. -To enable advanced Visibility features, use any of the supported databases, such as MySQL, PostgreSQL, SQLite, or Elasticsearch, as your Visibility store. -We recommend using Elasticsearch for any Temporal Service setup that handles more than a few Workflow Executions because it supports the request load on the Visibility store and helps optimize performance. +To enable advanced Visibility features, use any of the supported databases, such as MySQL, PostgreSQL, SQLite, or +Elasticsearch, as your Visibility store. We recommend using Elasticsearch for any Temporal Service setup that handles +more than a few Workflow Executions because it supports the request load on the Visibility store and helps optimize +performance. -To migrate from Cassandra to a supported SQL database, see [Migrating Visibility database](#migrating-visibility-database). +To migrate from Cassandra to a supported SQL database, see +[Migrating Visibility database](#migrating-visibility-database). **Persistence configuration** -Set your Cassandra Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. +Set your Cassandra Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then +define the Visibility store configuration under `datastores`. -The following example shows how to set a Visibility store `cass-visibility` and define the datastore configuration in your Temporal Service configuration YAML. +The following example shows how to set a Visibility store `cass-visibility` and define the datastore configuration in +your Temporal Service configuration YAML. ```yaml #... @@ -344,11 +370,13 @@ persistence: **Database schema and setup** -Visibility data is stored in a database table called `executions_visibility` that must be set up according to the schemas defined (by supported versions) in https://github.com/temporalio/temporal/tree/main/schema/cassandra/visibility. +Visibility data is stored in a database table called `executions_visibility` that must be set up according to the +schemas defined (by supported versions) in https://github.com/temporalio/temporal/tree/main/schema/cassandra/visibility. :::warning Deprecated: auto-setup.sh Script -The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). +The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup +examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). ::: @@ -388,16 +416,19 @@ setup_cassandra_schema() { ## How to integrate Elasticsearch into a Temporal Service {#elasticsearch} -You can integrate Elasticsearch with your Temporal Service as your Visibility store. -We recommend using Elasticsearch for large-scale operations on the Temporal Service. +You can integrate Elasticsearch with your Temporal Service as your Visibility store. We recommend using Elasticsearch +for large-scale operations on the Temporal Service. -To integrate Elasticsearch with your Temporal Service, edit the `persistence` section of your `development.yaml` configuration file to add Elasticsearch as the `visibilityStore`, and run the index schema setup commands. +To integrate Elasticsearch with your Temporal Service, edit the `persistence` section of your `development.yaml` +configuration file to add Elasticsearch as the `visibilityStore`, and run the index schema setup commands. **Persistence configuration** -Set your Elasticsearch Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. +Set your Elasticsearch Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and +then define the Visibility store configuration under `datastores`. -The following example shows how to set a Visibility store named `es-visibility` and define the datastore configuration in your Temporal Service configuration YAML. +The following example shows how to set a Visibility store named `es-visibility` and define the datastore configuration +in your Temporal Service configuration YAML. ```yaml persistence: @@ -421,7 +452,8 @@ persistence: The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. -For Elasticsearch setup, use the `temporal-elasticsearch-tool` available in the `temporalio/admin-tools` image (version 1.30+). For examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). +For Elasticsearch setup, use the `temporal-elasticsearch-tool` available in the `temporalio/admin-tools` image (version +1.30+). For examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). ::: @@ -461,22 +493,29 @@ curl --user "${ES_USER}":"${ES_PWD}" -X PUT "${INDEX_URL}" --write-out "\n" Ensure that the following privileges are granted for the Elasticsearch Temporal index: - **Read** - - [index privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices): `create`, `index`, `delete`, `read` + - [index privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices): + `create`, `index`, `delete`, `read` - **Write** - - [index privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices): `write` + - [index privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices): + `write` - **Custom Search Attributes** - - [index privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices): `manage` - - [cluster privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-cluster): `monitor` or `manage`. + - [index privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices): + `manage` + - [cluster privileges](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-cluster): + `monitor` or `manage`. ## How to set up Dual Visibility {#dual-visibility} -To enable [Dual Visibility](/dual-visibility), set up a secondary Visibility store with your primary Visibility store, and configure your Temporal Service to enable read and/or write operations on the secondary Visibility store. +To enable [Dual Visibility](/dual-visibility), set up a secondary Visibility store with your primary Visibility store, +and configure your Temporal Service to enable read and/or write operations on the secondary Visibility store. -With Dual Visibility, you can read from only one Visibility store at a time, but can configure your Temporal Service to write to primary only, secondary only, or to both primary and secondary stores. +With Dual Visibility, you can read from only one Visibility store at a time, but can configure your Temporal Service to +write to primary only, secondary only, or to both primary and secondary stores. #### Set up secondary Visibility store -Set the secondary store with the `secondaryVisibilityStore` configuration key in your Persistence configuration, and then define the secondary Visibility store configuration under `datastores`. +Set the secondary store with the `secondaryVisibilityStore` configuration key in your Persistence configuration, and +then define the secondary Visibility store configuration under `datastores`. You can configure any of the [supported databases](/self-hosted-guide/visibility) as your secondary store. @@ -503,7 +542,8 @@ persistence: password: 'temporal' ``` -To configure Elasticsearch as both your primary and secondary store, use the configuration key `elasticsearch.indices.secondary_visibility`, as shown in the following example. +To configure Elasticsearch as both your primary and secondary store, use the configuration key +`elasticsearch.indices.secondary_visibility`, as shown in the following example. ```yaml persistence: @@ -590,7 +630,8 @@ setup_mysql_schema() { } ``` -For Elasticsearch as both primary and secondary Visibility store configuration in the previous example, an example setup script would be as follows. +For Elasticsearch as both primary and secondary Visibility store configuration in the previous example, an example setup +script would be as follows. ```bash #... @@ -635,9 +676,12 @@ setup_es_index() { #### Update Temporal Service configuration -With the primary and secondary stores set, update the `system.secondaryVisibilityWritingMode` and `system.enableReadFromSecondaryVisibility` configuration keys in your self-hosted Temporal Service's dynamic configuration YAML file to enable read and/or write operations to the secondary Visibility store. +With the primary and secondary stores set, update the `system.secondaryVisibilityWritingMode` and +`system.enableReadFromSecondaryVisibility` configuration keys in your self-hosted Temporal Service's dynamic +configuration YAML file to enable read and/or write operations to the secondary Visibility store. -For example, to enable write operations to both primary and secondary stores, but disable reading from the secondary store, use the following. +For example, to enable write operations to both primary and secondary stores, but disable reading from the secondary +store, use the following. ```yaml system.secondaryVisibilityWritingMode: @@ -655,7 +699,9 @@ For details on the configuration options, see: ## How to migrate Visibility database {#migrating-visibility-database} -To migrate your Visibility database, [set up a secondary Visibility store](#dual-visibility) to enable [Dual Visibility](/dual-visibility), and update the dynamic configuration in your Temporal Service to update the read and write operations for the Visibility store. +To migrate your Visibility database, [set up a secondary Visibility store](#dual-visibility) to enable +[Dual Visibility](/dual-visibility), and update the dynamic configuration in your Temporal Service to update the read +and write operations for the Visibility store. Dual Visibility setup is optional but useful in gradually migrating your Visibility data to another database. @@ -663,14 +709,17 @@ Before you begin, verify [supported databases and versions](/self-hosted-guide/v The following steps describe how to migrate your Visibility database. -After you make any changes to your [Temporal Service configuration](/temporal-service/configuration), ensure that you restart your services. +After you make any changes to your [Temporal Service configuration](/temporal-service/configuration), ensure that you +restart your services. #### Set up secondary Visibility store -1. In your Temporal Service configuration, [add a secondary Visibility store](/references/configuration#secondaryvisibilitystore) to your Visibility setup under the Persistence configuration. +1. In your Temporal Service configuration, + [add a secondary Visibility store](/references/configuration#secondaryvisibilitystore) to your Visibility setup under + the Persistence configuration. - Example: To migrate from Cassandra to Elasticsearch, add Elasticsearch as your secondary database and set it up. - For details, see [secondary Visibility database schema and setup](#dual-visibility). + Example: To migrate from Cassandra to Elasticsearch, add Elasticsearch as your secondary database and set it up. For + details, see [secondary Visibility database schema and setup](#dual-visibility). ```yaml persistence: @@ -693,8 +742,8 @@ After you make any changes to your [Temporal Service configuration](/temporal-se closeIdleConnectionsInterval: 15s ``` -1. Update the [dynamic configuration](/temporal-service/configuration#dynamic-configuration) keys on your self-hosted Temporal Service to enable write operations to the secondary store and disable read operations. - Example: +1. Update the [dynamic configuration](/temporal-service/configuration#dynamic-configuration) keys on your self-hosted + Temporal Service to enable write operations to the secondary store and disable read operations. Example: ```yaml system.secondaryVisibilityWritingMode: @@ -705,35 +754,39 @@ After you make any changes to your [Temporal Service configuration](/temporal-se constraints: {} ``` -At this point, Visibility data is read from the primary store, and all Visibility data is written to both the primary and secondary store. -This setting applies only to new Visibility data generated after Dual Visibility is enabled. -It does not migrate any existing data in the primary store to the secondary store. +At this point, Visibility data is read from the primary store, and all Visibility data is written to both the primary +and secondary store. This setting applies only to new Visibility data generated after Dual Visibility is enabled. It +does not migrate any existing data in the primary store to the secondary store. -For details on write options to the secondary store, see [Secondary Visibility dynamic configuration reference](/references/dynamic-configuration#secondary-visibility-settings). +For details on write options to the secondary store, see +[Secondary Visibility dynamic configuration reference](/references/dynamic-configuration#secondary-visibility-settings). #### Run in dual mode -When you enable a secondary store, only new Visibility data is written to both primary and secondary stores. -The primary store still holds the Workflow Execution data from before the secondary store was set up. +When you enable a secondary store, only new Visibility data is written to both primary and secondary stores. The primary +store still holds the Workflow Execution data from before the secondary store was set up. -Running in dual mode lets you plan for closed and open Workflow Executions data from before the secondary store was set up in your self-hosted Temporal Service. +Running in dual mode lets you plan for closed and open Workflow Executions data from before the secondary store was set +up in your self-hosted Temporal Service. Example: -- To manage closed Workflow Executions data, run in dual mode until the Namespace [Retention Period](/temporal-service/temporal-server#retention-period) is reached. - After the Retention Period, Workflow Execution data is removed from the Persistence and Visibility stores. - If you want to keep the closed Workflow Executions data after the set Retention Period, you must set up [Archival](/self-hosted-guide/archival). -- To manage data for all open Workflow Executions, run in dual mode until all the Workflow Executions started before enabling Dual Visibility mode are closed. - After the Workflow Executions are closed, verify the Retention Period and set up Archival if you need to keep the data beyond the Retention Period. +- To manage closed Workflow Executions data, run in dual mode until the Namespace + [Retention Period](/temporal-service/temporal-server#retention-period) is reached. After the Retention Period, + Workflow Execution data is removed from the Persistence and Visibility stores. If you want to keep the closed Workflow + Executions data after the set Retention Period, you must set up [Archival](/self-hosted-guide/archival). +- To manage data for all open Workflow Executions, run in dual mode until all the Workflow Executions started before + enabling Dual Visibility mode are closed. After the Workflow Executions are closed, verify the Retention Period and + set up Archival if you need to keep the data beyond the Retention Period. -You can run your Visibility setup in dual mode for an indefinite period, or until you are ready to deprecate the primary store and move completely to the secondary store without losing data. +You can run your Visibility setup in dual mode for an indefinite period, or until you are ready to deprecate the primary +store and move completely to the secondary store without losing data. #### Deprecate primary Visibility store When you are ready to deprecate your primary store, follow these steps. -1. Update the dynamic configuration YAML to enable read operations from the secondary store. - Example: +1. Update the dynamic configuration YAML to enable read operations from the secondary store. Example: ```yaml system.secondaryVisibilityWritingMode: @@ -744,11 +797,12 @@ When you are ready to deprecate your primary store, follow these steps. constraints: {} ``` - At this point, Visibility data is read from the secondary store only. - Verify whether data on the secondary store is correct. + At this point, Visibility data is read from the secondary store only. Verify whether data on the secondary store is + correct. -1. When the secondary store is vetted and ready to replace your current primary store, change your Temporal Service configuration to set the secondary store as your primary, and remove the dynamic configuration set in the previous steps. - Example: +1. When the secondary store is vetted and ready to replace your current primary store, change your Temporal Service + configuration to set the secondary store as your primary, and remove the dynamic configuration set in the previous + steps. Example: ```yaml persistence: @@ -768,33 +822,40 @@ When you are ready to deprecate your primary store, follow these steps. ## Managing custom Search Attributes {#custom-search-attributes} -To manage your custom Search Attributes on Temporal Cloud, use `tcld`. -With Temporal Cloud, you can create and rename custom Search Attributes. +To manage your custom Search Attributes on Temporal Cloud, use `tcld`. With Temporal Cloud, you can create and rename +custom Search Attributes. -To manage your custom Search Attributes on self-hosted Temporal Clusters, use Temporal CLI. With self-hosted Temporal Service, you can create and remove custom Search Attributes. -Note that if you use [SQL databases](/self-hosted-guide/visibility) with Temporal Server v1.20 and later, creating a custom Search Attribute creates a mapping with a database field name in the Visibility store `custom_search_attributes` table. -Removing a custom Search Attribute removes this mapping with the database field name but does not remove the data. -If you remove a custom Search Attribute and add a new one, the new custom Search Attribute might be mapped to the database field of the one that was recently removed. -This might cause unexpected results when you use the List API to retrieve results using the new custom Search Attribute. -These constraints do not apply if you use Elasticsearch. +To manage your custom Search Attributes on self-hosted Temporal Clusters, use Temporal CLI. With self-hosted Temporal +Service, you can create and remove custom Search Attributes. Note that if you use +[SQL databases](/self-hosted-guide/visibility) with Temporal Server v1.20 and later, creating a custom Search Attribute +creates a mapping with a database field name in the Visibility store `custom_search_attributes` table. Removing a custom +Search Attribute removes this mapping with the database field name but does not remove the data. If you remove a custom +Search Attribute and add a new one, the new custom Search Attribute might be mapped to the database field of the one +that was recently removed. This might cause unexpected results when you use the List API to retrieve results using the +new custom Search Attribute. These constraints do not apply if you use Elasticsearch. ### How to create custom Search Attributes {#create-custom-search-attributes} -Add custom Search Attributes to your Visibility store using the Temporal CLI for a self-hosted Temporal Service and `tcld` for Temporal Cloud. +Add custom Search Attributes to your Visibility store using the Temporal CLI for a self-hosted Temporal Service and +`tcld` for Temporal Cloud. -Creating a custom Search Attribute in your Visibility store makes it available to use in your Workflow metadata and [List Filters](/list-filter). +Creating a custom Search Attribute in your Visibility store makes it available to use in your Workflow metadata and +[List Filters](/list-filter). **On Temporal Cloud** -To create custom Search Attributes on Temporal Cloud, use [`tcld namespace search-attributes add`](/cloud/tcld/namespace/#search-attributes). -For example, to add a custom Search Attributes "CustomSA" to your Temporal Cloud Namespace "YourNamespace", run the following command. +To create custom Search Attributes on Temporal Cloud, use +[`tcld namespace search-attributes add`](/cloud/tcld/namespace/#search-attributes). For example, to add a custom Search +Attributes "CustomSA" to your Temporal Cloud Namespace "YourNamespace", run the following command. `tcld namespace search-attributes add --namespace YourNamespace --search-attribute "CustomSA"` **On self-hosted Temporal Service** -If you're self-hosting your Temporal Service, verify whether your [Visibility database](/self-hosted-guide/visibility) version supports advanced Visibility features. +If you're self-hosting your Temporal Service, verify whether your [Visibility database](/self-hosted-guide/visibility) +version supports advanced Visibility features. -To create custom Search Attributes in your self-hosted Temporal Service Visibility store, use `temporal operator search-attribute create` with `--name` and `--type` command options. +To create custom Search Attributes in your self-hosted Temporal Service Visibility store, use +`temporal operator search-attribute create` with `--name` and `--type` command options. For example, to create a Search Attribute called `CustomSA` of type `Keyword`, run the following command: @@ -802,8 +863,8 @@ For example, to create a Search Attribute called `CustomSA` of type `Keyword`, r temporal operator search-attribute create --name="CustomSA" --type="Keyword" ``` -Note that if you use a SQL database with advanced Visibility capabilities, you are required to specify a Namespace when creating a custom Search Attribute. -For example: +Note that if you use a SQL database with advanced Visibility capabilities, you are required to specify a Namespace when +creating a custom Search Attribute. For example: ``` temporal operator search-attribute create --name="CustomSA" --type="Keyword" --namespace="yournamespace" @@ -813,11 +874,13 @@ You can also create multiple custom Search Attributes when you set up your Visib :::warning Deprecated: auto-setup.sh Script -The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). +The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup +examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). ::: -The following example shows how custom Search Attributes can be created during Visibility store setup (for SQL databases). +The following example shows how custom Search Attributes can be created during Visibility store setup (for SQL +databases). ```bash add_custom_search_attributes() { @@ -840,9 +903,11 @@ add_custom_search_attributes() { } ``` -Note that this script has been updated for Temporal Server v1.20, which requires associating every custom Search Attribute with a Namespace when using a SQL database. +Note that this script has been updated for Temporal Server v1.20, which requires associating every custom Search +Attribute with a Namespace when using a SQL database. -For Temporal Server v1.19 and earlier, or if using Elasticsearch for advanced Visibility, you can create custom Search Attributes without a Namespace association, as shown in the following example. +For Temporal Server v1.19 and earlier, or if using Elasticsearch for advanced Visibility, you can create custom Search +Attributes without a Namespace association, as shown in the following example. {/* CHECK FOR ACCURACY */} @@ -860,21 +925,24 @@ add_custom_search_attributes() { } ``` -When your Visibility store is set up and running, these custom Search Attributes are available to use in your Workflow code. +When your Visibility store is set up and running, these custom Search Attributes are available to use in your Workflow +code. ### How to remove custom Search Attributes {#remove-custom-search-attributes} -To remove a Search Attribute key from your self-hosted Temporal Service Visibility store, use the command `temporal operator search-attribute remove`. -Removing Search Attributes is not supported on Temporal Cloud. +To remove a Search Attribute key from your self-hosted Temporal Service Visibility store, use the command +`temporal operator search-attribute remove`. Removing Search Attributes is not supported on Temporal Cloud. -For example, if using Elasticsearch for advanced Visibility, to remove a custom Search Attribute called `CustomSA` of type Keyword use the following command: +For example, if using Elasticsearch for advanced Visibility, to remove a custom Search Attribute called `CustomSA` of +type Keyword use the following command: ``` temporal operator search-attribute remove \ --name="your_custom_attribute" ``` -With Temporal Server v1.20, if using a SQL database for advanced Visibility, you need to specify the Namespace in your command, as shown in the following command: +With Temporal Server v1.20, if using a SQL database for advanced Visibility, you need to specify the Namespace in your +command, as shown in the following command: ``` temporal operator search-attribute remove \ @@ -890,15 +958,16 @@ temporal operator search-attribute list and check the list. -If you're on Temporal Server v1.20 and later, specify the Namespace from which you removed the Search Attribute. -For example, +If you're on Temporal Server v1.20 and later, specify the Namespace from which you removed the Search Attribute. For +example, ``` temporal search-attribute list --namespace="yournamespace" ``` -Note that if you use [SQL databases](/self-hosted-guide/visibility) with Temporal Server v1.20 and later, a new custom Search Attribute is mapped to a database field name in the Visibility store `custom_search_attributes` table. -Removing this custom Search Attribute removes the mapping with the database field name but does not remove the data. -If you remove a custom Search Attribute and add a new one, the new custom Search Attribute might be mapped to the database field of the one that was recently removed. -This might cause unexpected results when you use the List API to retrieve results using the new custom Search Attribute. -These constraints do not apply if you use Elasticsearch. +Note that if you use [SQL databases](/self-hosted-guide/visibility) with Temporal Server v1.20 and later, a new custom +Search Attribute is mapped to a database field name in the Visibility store `custom_search_attributes` table. Removing +this custom Search Attribute removes the mapping with the database field name but does not remove the data. If you +remove a custom Search Attribute and add a new one, the new custom Search Attribute might be mapped to the database +field of the one that was recently removed. This might cause unexpected results when you use the List API to retrieve +results using the new custom Search Attribute. These constraints do not apply if you use Elasticsearch. From fbb4375bace28adedef1edea122c6a99c2e86493 Mon Sep 17 00:00:00 2001 From: Lenny Chen Date: Thu, 29 Jan 2026 18:10:07 -0800 Subject: [PATCH 8/8] update scripts --- .../self-hosted-guide/visibility.mdx | 126 ++++++++++-------- 1 file changed, 69 insertions(+), 57 deletions(-) diff --git a/docs/production-deployment/self-hosted-guide/visibility.mdx b/docs/production-deployment/self-hosted-guide/visibility.mdx index 4836acca6a..e159dc49b6 100644 --- a/docs/production-deployment/self-hosted-guide/visibility.mdx +++ b/docs/production-deployment/self-hosted-guide/visibility.mdx @@ -130,7 +130,7 @@ For example configuration templates, see Visibility data is stored in a database table called `executions_visibility` and must be created using the schema for [MySQL v8.0.17 and later](https://github.com/temporalio/temporal/tree/main/schema/mysql/v8/visibility). -The following example shows how to set up your MySQ as both your persistence and Visibility store using +The following example shows how to set up your MySQL as both your persistence and Visibility store using `temporal-sql-tool`. Refer to the [samples-server repository](https://github.com/temporalio/samples-server/tree/main/compose/scripts) for more examples with different databases. @@ -272,7 +272,7 @@ If using SQLite v3.31.0 and later as your Visibility store with Temporal Server [custom Search Attributes](/search-attribute#custom-search-attribute) that you create must be associated with a Namespace in that Temporal Service. -**Persistence configuration** +### Persistence configuration Set your SQLite Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. @@ -312,7 +312,7 @@ persistence: SQLite (v3.31.0 and later) has advanced Visibility enabled by default. -**Database schema and setup** +### Database schema and setup Visibility data is stored in a database table called `executions_visibility` that must be set up according to the schemas defined (by supported versions) in @@ -344,7 +344,7 @@ performance. To migrate from Cassandra to a supported SQL database, see [Migrating Visibility database](#migrating-visibility-database). -**Persistence configuration** +### Persistence configuration Set your Cassandra Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. @@ -368,19 +368,14 @@ persistence: #... ``` -**Database schema and setup** +### Database schema and setup Visibility data is stored in a database table called `executions_visibility` that must be set up according to the schemas defined (by supported versions) in https://github.com/temporalio/temporal/tree/main/schema/cassandra/visibility. -:::warning Deprecated: auto-setup.sh Script - -The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup -examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). - -::: - -The following example shows how to set up your Cassandra Visibility store using `temporal-cassandra-tool`: +The following example shows how to set up your Cassandra Visibility store using `temporal-cassandra-tool`. For more +examples with different databases, refer to the +[samples-server repository](https://github.com/temporalio/samples-server/tree/main/compose/scripts). ```bash #... @@ -422,7 +417,7 @@ for large-scale operations on the Temporal Service. To integrate Elasticsearch with your Temporal Service, edit the `persistence` section of your `development.yaml` configuration file to add Elasticsearch as the `visibilityStore`, and run the index schema setup commands. -**Persistence configuration** +### Persistence configuration Set your Elasticsearch Visibility store name in the `visibilityStore` parameter in your Persistence configuration, and then define the Visibility store configuration under `datastores`. @@ -446,49 +441,73 @@ persistence: visibility: temporal_visibility_v1_dev ``` -**Index schema and index** +### Index schema and index -:::warning Deprecated: auto-setup.sh Script +To set up Elasticsearch as your Visibility store, use the `temporal-elasticsearch-tool` available in the +`temporalio/admin-tools` image. -The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. +The following example shows how to set up an Elasticsearch Visibility store with a PostgresSQL persistence store using +`temporal-elasticsearch-tool`. For more examples with different databases, refer to the +[samples-server repository](https://github.com/temporalio/samples-server/tree/main/compose/scripts). -For Elasticsearch setup, use the `temporal-elasticsearch-tool` available in the `temporalio/admin-tools` image (version -1.30+). For examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). +```bash +#!/bin/sh +set -eu -::: +# Validate required environment variables +: "${ES_SCHEME:?ERROR: ES_SCHEME environment variable is required}" +: "${ES_HOST:?ERROR: ES_HOST environment variable is required}" +: "${ES_PORT:?ERROR: ES_PORT environment variable is required}" +: "${ES_VISIBILITY_INDEX:?ERROR: ES_VISIBILITY_INDEX environment variable is required}" +: "${ES_VERSION:?ERROR: ES_VERSION environment variable is required}" -The following example shows how to set up an Elasticsearch Visibility store using `temporal-elasticsearch-tool`: +echo 'Starting PostgreSQL and Elasticsearch schema setup...' +echo 'Waiting for PostgreSQL port to be available...' +nc -z -w 10 postgresql 5432 +echo 'PostgreSQL port is available' -```bash -#... -# Elasticsearch -: "${ENABLE_ES:=false}" -: "${ES_SCHEME:=http}" -: "${ES_SEEDS:=}" -: "${ES_PORT:=9200}" -: "${ES_USER:=}" -: "${ES_PWD:=}" -: "${ES_VERSION:=v7}" -: "${ES_VIS_INDEX:=temporal_visibility_v1}" -: "${ES_SEC_VIS_INDEX:=}" -: "${ES_SCHEMA_SETUP_TIMEOUT_IN_SECONDS:=0}" -#... -# Validate your ES environment -#... -# Wait for ES to start -#... -# ES_SERVER is the URL of Elasticsearch server; for example, "http://localhost:9200". -SETTINGS_URL="${ES_SERVER}/_cluster/settings" -SETTINGS_FILE=${TEMPORAL_HOME}/schema/elasticsearch/visibility/cluster_settings_${ES_VERSION}.json -TEMPLATE_URL="${ES_SERVER}/_template/temporal_visibility_v1_template" -SCHEMA_FILE=${TEMPORAL_HOME}/schema/elasticsearch/visibility/index_template_${ES_VERSION}.json -INDEX_URL="${ES_SERVER}/${ES_VIS_INDEX}" -curl --fail --user "${ES_USER}":"${ES_PWD}" -X PUT "${SETTINGS_URL}" -H "Content-Type: application/json" --data-binary "@${SETTINGS_FILE}" --write-out "\n" -curl --fail --user "${ES_USER}":"${ES_PWD}" -X PUT "${TEMPLATE_URL}" -H 'Content-Type: application/json' --data-binary "@${SCHEMA_FILE}" --write-out "\n" -curl --user "${ES_USER}":"${ES_PWD}" -X PUT "${INDEX_URL}" --write-out "\n" +# Create and setup temporal database +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal create +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal setup-schema -v 0.0 +temporal-sql-tool --plugin postgres12 --ep postgresql -u temporal -p 5432 --db temporal update-schema -d /etc/temporal/schema/postgresql/v12/temporal/versioned + +# Setup Elasticsearch index +# temporal-elasticsearch-tool is available in v1.30+ server releases +if [ -x /usr/local/bin/temporal-elasticsearch-tool ]; then + echo 'Using temporal-elasticsearch-tool for Elasticsearch setup' + temporal-elasticsearch-tool --ep "$ES_SCHEME://$ES_HOST:$ES_PORT" setup-schema + temporal-elasticsearch-tool --ep "$ES_SCHEME://$ES_HOST:$ES_PORT" create-index --index $ES_VISIBILITY_INDEX +else + echo 'Using curl for Elasticsearch setup' + echo 'WARNING: curl will be removed from admin-tools in v1.30.' + echo 'Waiting for Elasticsearch to be ready...' + max_attempts=30 + attempt=0 + until curl -s -f "$ES_SCHEME://$ES_HOST:$ES_PORT/_cluster/health?wait_for_status=yellow&timeout=1s"; do + attempt=$((attempt + 1)) + if [ $attempt -ge $max_attempts ]; then + echo "ERROR: Elasticsearch did not become ready after $max_attempts attempts" + echo "Last error from curl:" + curl "$ES_SCHEME://$ES_HOST:$ES_PORT/_cluster/health?wait_for_status=yellow&timeout=1s" 2>&1 || true + exit 1 + fi + echo "Elasticsearch not ready yet, waiting... (attempt $attempt/$max_attempts)" + sleep 2 + done + echo '' + echo 'Elasticsearch is ready' + echo 'Creating index template...' + curl -X PUT --fail "$ES_SCHEME://$ES_HOST:$ES_PORT/_template/temporal_visibility_v1_template" -H 'Content-Type: application/json' --data-binary "@/etc/temporal/schema/elasticsearch/visibility/index_template_$ES_VERSION.json" + echo '' + echo 'Creating index...' + curl --head --fail "$ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX" 2>/dev/null || curl -X PUT --fail "$ES_SCHEME://$ES_HOST:$ES_PORT/$ES_VISIBILITY_INDEX" + echo '' +fi + +echo 'PostgreSQL and Elasticsearch setup complete' ``` -**Elasticsearch privileges** +### Elasticsearch privileges Ensure that the following privileges are granted for the Elasticsearch Temporal index: @@ -872,15 +891,8 @@ temporal operator search-attribute create --name="CustomSA" --type="Keyword" --n You can also create multiple custom Search Attributes when you set up your Visibility store. -:::warning Deprecated: auto-setup.sh Script - -The `auto-setup.sh` script and `temporalio/auto-setup` image are deprecated and no longer receive updates. For setup -examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server). - -::: - The following example shows how custom Search Attributes can be created during Visibility store setup (for SQL -databases). +databases). For setup examples, refer to the [samples-server repository](https://github.com/temporalio/samples-server) ```bash add_custom_search_attributes() {