291 Commits

Author SHA1 Message Date
Alex Stanfield
f5bae45ec9 fix: admin-tools container ignores SIGTERM until kill deadline (#10187)
## Summary
- The admin-tools container CMD runs `sleep infinity` in the foreground,
which blocks the shell from processing signal traps
- SIGTERM is never handled, so the container hangs until the kubelet
termination deadline before being force-killed
- Background the sleep and use `wait` as the foreground command instead
-- `wait` is a shell builtin that gets interrupted by signals, allowing
the trap handler to exit immediately

## Test plan

Run the following to compare signal handling before and after:

```bash
#!/usr/bin/env bash
set -euo pipefail

STOP_TIMEOUT=5

echo "=== OLD: sleep infinity in foreground (should hang for ${STOP_TIMEOUT}s) ==="
docker run -d --name admin-tools-old alpine:latest \
  sh -c "trap exit INT HUP TERM; sleep infinity" >/dev/null
sleep 1
echo "Container running. Sending SIGTERM..."
start=$(date +%s)
docker stop --timeout "$STOP_TIMEOUT" admin-tools-old >/dev/null
elapsed=$(( $(date +%s) - start ))
echo "Stopped in ${elapsed}s (expected: ${STOP_TIMEOUT}s -- signal was ignored)"
docker rm admin-tools-old >/dev/null

echo ""
echo "=== NEW: sleep infinity & wait (should exit immediately) ==="
docker run -d --name admin-tools-new alpine:latest \
  sh -c "trap exit INT HUP TERM; sleep infinity & wait" >/dev/null
sleep 1
echo "Container running. Sending SIGTERM..."
start=$(date +%s)
docker stop --timeout "$STOP_TIMEOUT" admin-tools-new >/dev/null
elapsed=$(( $(date +%s) - start ))
echo "Stopped in ${elapsed}s (expected: 0s -- signal was handled)"
docker rm admin-tools-new >/dev/null
```

Expected output:
```
=== OLD: sleep infinity in foreground (should hang for 5s) ===
Container running. Sending SIGTERM...
Stopped in 5s (expected: 5s -- signal was ignored)

=== NEW: sleep infinity & wait (should exit immediately) ===
Container running. Sending SIGTERM...
Stopped in 0s (expected: 0s -- signal was handled)
```
2026-05-07 14:52:10 -05:00
Rodrigo Zhou
17ab93a4fd Update dependencies (#10007)
## What changed?
- Update Go 1.26.0 to 1.26.2
- Run `make update-dependencies` (skipped
`github.com/olekukonko/tablewriter`)
- Updated Docker Alpine version to 3.23.4

## Why?
Address CVEs

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
2026-04-21 17:32:21 -07:00
Alex Stanfield
2b383993fc fix(ci): simplify manual docker build and centralize alpine tag (#9530)
## What changed?
- Centralized Alpine base image version to a single source of truth in
\`docker/docker-bake.hcl\` (\`ALPINE_TAG\`).
- Updated Docker targets to consume \`ALPINE_TAG\` from bake args
(removed duplicated Dockerfile defaults).
- Updated build action handling so an empty \`alpine-tag\` input does
not override bake defaults.
- Simplified manual Docker workflow inputs by removing platform/snapshot
toggles and hardcoding snapshot builds + multi-arch behavior for manual
runs.
- Clarified manual workflow input descriptions (\`cli-version\`,
\`alpine-tag\`, and push destination).

## Why?
- Avoid Alpine version drift across multiple files.
- Make manual dispatch safer and less error-prone (empty Alpine input
should use default, not fail with \`alpine:\`).
- Reduce confusing/no-op options in manual workflow while keeping
release behavior unchanged.

## Updating versions

**Alpine base image** — edit the \`ALPINE_TAG\` default in
\`docker/docker-bake.hcl\` (line 41):
```hcl
variable "ALPINE_TAG" {
  default = "3.23.3"  # <-- change this
}
```

**Temporal CLI** — edit the \`defaultCliVersion\` constant in
\`.github/actions/build-docker-images/scripts/main.go\` (line 17):
```go
// defaultCliVersion should be updated to the latest cli version
const defaultCliVersion = "1.6.1"  // <-- change this
```
To pin a different version for a one-off manual run without changing the
default, pass it via the \`cli-version\` workflow dispatch input
instead.

## Validation
- Triggered manual workflow against branch and confirmed branch is
available on upstream.
- Verified bake config resolves default Alpine tag from
\`docker/docker-bake.hcl\`.
2026-04-08 17:31:28 -05:00
Kannan
08e748bda3 Bump grpc to v1.79.3 and upgrade zlib to address security CVEs (#9611)
## Summary

Bumps dependencies to address security CVEs on `main`:

- **CVE-2026-33186 (CRITICAL)**: `google.golang.org/grpc` v1.72.2 →
v1.79.3 — authorization bypass via missing leading `/` in `:path` header
- **CVE-2026-22184 (HIGH)**: Alpine `zlib` 1.3.1-r2 → 1.3.2-r0 — global
buffer overflow in `untgz` utility

Note: The other two CVEs from the v1.30.2 security review are already
addressed on `main`:
- otel/sdk v1.40.0 — already landed via #9442
- Go stdlib — `main` is on Go 1.26.0 (separate release series)

## Risk assessment

- **grpc v1.72.2 → v1.79.3**: 7 minor version jump with ~23 transitive
dependency upgrades. Builds cleanly. Same bump successfully applied to
`release/v1.30.x` in #9610.
- **zlib**: Alpine package upgrade via `apk upgrade --no-cache zlib` in
both server and admin-tools Dockerfiles.

## Test plan

- [ ] CI passes


Made with [Cursor](https://cursor.com)
2026-03-20 22:31:18 -07:00
Pasha Fateev
262328988a Add full SHA OSS image tags (#9448)
## What changed?

Add full commit SHA tags alongside the existing short SHA tags for OSS
`server` and `admin-tools` images. The Docker build action now emits
both tag forms, Docker bake publishes both tags, and the manual Docker
build summary shows the short SHA tag, full SHA tag, and branch tag from
action outputs.

## Why?

This repo has outgrown 7-character SHA uniqueness, so short SHA tags can
collide. Since release engineering automation publishes and consumes
these image tags across workflows, using full SHAs keeps artifact
selection deterministic while preserving short tags for compatibility.

## How did you test it?

- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

---------

Co-authored-by: Alex Stanfield <13949480+chaptersix@users.noreply.github.com>
2026-03-16 16:39:25 -05:00
Alex Stanfield
0a1c2ef317 chore(docker): bump alpine base to 3.23.3 (#9318)
## Summary
- Bump Alpine base image tag default to 3.23.3 for server/admin-tools
images.
- Update defaults in docker build bake args and manual build workflows.
2026-02-13 15:07:29 -06:00
Alex Stanfield
47f96fe4fe Address Docker build warning (#9157)
## What changed?
* Remove redundant docker image platform
* Remove Multi Arch build PR trigger


Th Multi Arch build PR build trigger was added to validate multi arch
builds in PR. It's likely overkill now. There is a single arch docker
build on each PR for the feature tests
2026-01-29 14:29:44 +00:00
Alex Stanfield
a8792a64cd Fix docker image tagging (#8935)
## What changed?
use `sha-<short-hash>` instead of full hash for the image tag

## Why?
replicate tagging from docker-builds:
3906aed484/.github/workflows/docker-build-only.yml (L96)

---------

Co-authored-by: Prathyush PV <prathyush.pv@temporal.io>
2026-01-06 02:13:26 +00:00
Alex Stanfield
abf48a52f3 Fix Docker platform mismatch warning in multi-arch builds (#8931)
https://github.com/temporalio/temporal/pull/8929

fix, contributor issues
2026-01-05 20:39:30 +00:00
Alex Stanfield
85635674d7 New Docker Build GH Actions (#8825)
## What changed?
* updates goreleaser to v2
* add GHA for build admin-tools and server images within this repo.
`docker-builds` will only be used for building pre 1.30 images
* added GHA to promote docker builds from temporaliotest to temproalio
docker image repos
* trivy security scanning gates for image promotion (pulled rom
docker-builds repo). The gate can be overridden

## Why?
* we decided to move away from building images in `docker-builds`. The
complexity is not needed
* updates goreleaser to v2 because the v1 definitions might be no longer
supported at some point and this is a good time to do it
* I used go scripts for the more complex flows instead of js or bash so
we don't introduce another language contributors need to be familiar
with. IMO the js or bash I did use it simple enough to understand.

## How did you test it?
It passes in CI. 

## Potential risks
* these build pipelines are only compatible with the new docker images. 
* merging this PR may break our nightly tests. Will double check before
merging
* flows that are not triggered by opening a PR are untested and
therefore not completely validated
2025-12-18 20:30:58 +00:00
Alex Stanfield
70c2b81dca Update Configuration Loading (#8477)
## What Changed

This PR introduces a new `--config-file` flag (and the
`TEMPORAL_SERVER_CONFIG_FILE_PATH ` environment variable) to remove the
dependency on `dockerize` in the Temporal server Docker image.

When a configuration file is specified using either the CLI flag or the
environment variable, the server will load configuration **only** from
that file.
Users who want templating behavior similar to `dockerize` can enable it
by adding the comment `# enable-template` at the top of the
configuration file.

---

### Key Changes

1. **New `--config-file` flag:**

* Adds a global `--config-file` flag that accepts a path to a single
configuration file (absolute or relative to the project root).
* Can also be set via the `TEMPORAL_SERVER_CONFIG_FILE_PATH `
environment variable.

2. **Deprecated legacy flags:**

* The `--config`, `--env`, and `--zone` flags are now marked as
**deprecated** in CLI help text.
   * These flags still work for backward compatibility.

3. **Embedded config template:**

* The `config_template.yaml` file is now embedded in the binary to
support loading configuration from environment variables.
* Templating is supported if the file includes the `# enable-template`
comment at the top.

4. **Templating support:**

* Configuration files can use templating by including `#
enable-template` at the beginning of the YAML file.

---

### Configuration Loading Priority (Highest to Lowest)

1. **`--config-file` specified** → Load that specific file
2. **`--config`, `--env`, or `--zone` specified** → Load from
configuration directory (**deprecated**)
3. **No configuration specified** → Load from embedded template using
environment variables (default)

---

### Expected Behavior

The following examples illustrate how the new configuration loading
logic behaves:

* **Default behavior:**
Running `temporal start` without flags loads configuration from
environment variables only using the embedded template.

* **Using `--config-file`:**
`temporal --config-file=/path/to/config.yaml start` loads configuration
from the specified file path.

* **Using `TEMPORAL_SERVER_CONFIG_FILE_PATH`:**
Setting `TEMPORAL_SERVER_CONFIG_FILE_PATH=/path/to/config.yaml temporal
start` has the same effect as using the flag.

* **Validation and error handling:**
The CLI returns clear error messages when conflicting flags or
environment variables are used, or when a specified file does not exist.
---

## Breaking Change

The default behavior of `temporal start` has changed.
It now loads configuration **from environment variables** instead of
using a default template path.

---------

Co-authored-by: Alex Stanfield <chaptersix@users.noreply.github.com>
Co-authored-by: michaely520 <michaely520@users.noreply.github.com>
Co-authored-by: Yichao Yang <yichao@temporal.io>
Co-authored-by: David Reiss <david@temporal.io>
2025-11-18 16:23:25 +00:00
Roey Berman
9c8c54cc4c Add internal HTTP port in docker config templates (#8332)
## Why?

This was missed in #8327
2025-09-18 00:14:21 +00:00
Adam Horacek
943d5b3d8e Support for regex pattern in DefaultJWTClaimMapper permission parser (#7574)
## What changed?
Added support for parsing permissions from JWT claim using regular
expression

## Why?
Default JWT Claim Mapper expects permission in form `namespace:role`. If
it's not possible to configure JWT issuer to follow `namespace:role`
permissionsPattern can be set to regular expression with named groups to
parse permission. More details in issue gh-7560

## How did you test it?
- Unit tests
- Local tests
- Self hosted environment (ongoing)

## Potential risks
This change is only activated if new configuration is provided

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
WIP

## Is hotfix candidate?
No
2025-07-07 09:33:07 -07:00
Six
33ffe1b124 Escape BIND_ON_IP values for IPv6 (#6272)
## What changed?
<!-- Describe what has changed in this PR -->
The bindOnIP values in the docker configuration template is wrapped with
a string.

## Why?
<!-- Tell your future self why have you made these changes -->
When attempting to listen on IPv6 in Docker without this change present,
the colons in the IP address are interpreted as part of the YAML. The
strings added allow IPv6 bind addresses to work properly.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
I have not verified this change but I came across this issue when trying
to configure Temporal for IPv6, and this fix is similar as for other
projects I've come across.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
The Temporal server docker image would be broken.

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
N/A

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
Yes
2024-07-12 02:29:16 +00:00
Chetan Gowda
cf1cd8ae21 Set allowed authenticators in tools and via env variables (#6194)
## What changed?
https://github.com/temporalio/temporal/pull/6155 introduced the config
value `allowedAuthenticators`. This PR updates the
`temporal-cassandra-tool` to use this config value. It also updates
`config_template.yaml` so that the config value can be set in docker
images as well.

## Why?
Cassandra supports several authenticators to verify the login
credentials. Gocql implements a subset of them as [default allowed list
of
authenticators](34fdeebefc/conn.go (L27)).
It allows customization of this list to allow supporting additional
authenticators.
So with this change Temporal can connect to Cassandra clusters that have
authenticators other than the default ones provided by Gocql.

## How did you test it?
Ran `./temporal-cassandra-tool` and verified that it picked up the
values in environment variable `CASSANDRA_ALLOWED_AUTHENTICATORS`.
Couldn't test docker build since it's in a different repo.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->

## Is hotfix candidate?
No

---------

Co-authored-by: Rob Holland <rob@temporal.io>
2024-06-28 14:19:48 -07:00
Roey Berman
4b6d0e6a87 Properly dispatch requests for Nexus Worker Endpoints (#5997)
Also changed the semantics of cluster info's HTTPAddress to just be the
address, and not include the scheme.
We now use the TLS configuration to derive the URL scheme.
2024-05-24 18:59:25 +00:00
Rodrigo Zhou
f6937601ef Remove support for standard visibility (#5387)
## What changed?
<!-- Describe what has changed in this PR -->
Remove support for standard visibility

## Why?
<!-- Tell your future self why have you made these changes -->
Standard visibility is deprecated.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
2024-02-29 12:05:20 -06:00
Rodrigo Zhou
2a8a1ae694 Remove support for Cassandra as visibility store (#5237)
## What changed?
<!-- Describe what has changed in this PR -->
Remove support for Cassandra as visibility store.
Updated integration tests that used Cassandra visibility to use
Elasticsearch.

## Why?
<!-- Tell your future self why have you made these changes -->
Deprecating Cassandra visibility.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
Updated tests.

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
No.

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
No.
2024-01-29 11:36:00 -06:00
Alexandre Boucey
0be1a4572e Add postgres12_pgx in docker config template (#5305)
## What changed?
Add the constant `postgres12_pgx` in the docker configuration template
Related PR : https://github.com/temporalio/docker-builds/pull/179

## Why?
Support for `jackc/pgx` was added in #4913 but it wasn't possible to use
it within the provided configuration template

## How did you test it?
Checked template generation with `dockerize`

## Potential risks
Low risks, doesn't change default behavior

## Is hotfix candidate?
No
2024-01-17 11:35:36 -06:00
Chad Retz
c7847968b3 HTTP API support (#4543) 2023-08-18 12:11:49 -05:00
Yimin Chen
981d22bbe2 Remove unused toDC config (#4370)
* Remove unused toDC config
2023-05-19 20:57:05 -07:00
Rodrigo Zhou
2c2fb71fc2 Support ES secondary_visibility index in docker config template (#4213) 2023-04-25 11:54:40 -07:00
Rodrigo Zhou
37cebd0b02 Update vis store dev configs (#4208)
Update visibilityStore in dev configs
2023-04-24 15:36:19 -07:00
Rodrigo Zhou
3b27372d09 Support mysql8 and postgres12 dbs in docker config template (#3941) 2023-02-10 18:21:26 -08:00
Rodrigo Zhou
19d36fb498 Fix docker config template to set only one visibility (#3889) 2023-02-02 12:55:23 -08:00
David Reiss
1a9695e10f Add internal-frontend role (#3706) 2023-01-10 17:44:37 -08:00
Štefan Miklošovič
4d56df95e3 add address translation to Cassandra persistence (#3076) 2022-07-31 16:21:34 -07:00
Alexander Mays
92c866c5e6 Remove rds iam auth plugin (#3079)
* Revert "Fix auth plugin configuration to match the new SQLAuthPlugin config block (#2844)"

This reverts commit 5acbdd70b1.

* Revert rds-iam-auth - current drivers dont support authentication callbacks

Signed-off-by: Alexander Mays <alex@eastside.io>
2022-07-10 14:31:02 -07:00
Alex Shtin
98f4525961 Clean up dynamic configs (#2877) 2022-05-20 10:32:59 -07:00
Alexander Mays
5acbdd70b1 Fix auth plugin configuration to match the new SQLAuthPlugin config block (#2844)
Signed-off-by: Alexander Mays <alex@eastside.io>
2022-05-13 20:12:22 -07:00
Alexander Mays
690ad54276 Add RDS IAM auth plugin for SQL drivers (#2830)
Signed-off-by: Alexander Mays <alex@eastside.io>
Added:
A new environment variable to the CLI: SQL_AUTH_PLUGIN=rds-iam-auth
A new flag arg to the CLI: --sql-auth-plugin rds-iam-auth
2 new docker template variables: authPlugin: {{ default .Env.SQL_AUTH_PLUGIN "" }} and authPlugin: {{ default .Env.SQL_VIS_AUTH_PLUGIN "" }}
A new SQL configuration attribute authPlugin
2022-05-12 16:28:26 -07:00
Ruslan
b7100aeabb Remove docker files (#2456)
* Remove docker files

* Update docker/README.md

Co-authored-by: Alex Shtin <alex@temporal.io>

* address comments

* update docker readme

* Update develop/buildkite/pipeline.yml

Co-authored-by: Alex Shtin <alex@shtin.com>

* Update README.md

Co-authored-by: Alex Shtin <alex@shtin.com>

Co-authored-by: Alex Shtin <alex@temporal.io>
Co-authored-by: Alex Shtin <alex@shtin.com>
2022-03-21 14:22:36 -07:00
Jason Roselander
c8960b5277 Revert "Added mockgen to base-ci-builder Docker image (#2574)" (#2588)
This reverts commit 9cb3f5a61d.
2022-03-15 16:12:11 -07:00
Jeremy Breiding
cafdda9ec5 removing vim from docker images due to CVE (#2604) 2022-03-12 08:26:24 -08:00
Jason Roselander
9cb3f5a61d Added mockgen to base-ci-builder Docker image (#2574) 2022-03-04 17:29:00 -08:00
swyx
b431869d62 [docs] improve documentation for building images (#2557)
Co-authored-by: Jeremy Breiding <jbreiding@users.noreply.github.com>
2022-03-01 03:51:29 +08:00
Alex Shtin
faa1dc135a Clean up auto-setup.sh (#2516) 2022-02-18 11:19:42 -08:00
Alex Shtin
d2f41f0502 Add SKIP_DB_CREATE env to auto-setup.sh (#2495) 2022-02-16 17:15:30 -08:00
Alex Shtin
aff2a82993 Use base-server:1.5.0 after recent update (#2402) 2022-01-21 09:25:32 -08:00
Marcin Maciej Seweryn
7e9a7897b9 Remove go mod init from dockerize build in base-server.Dockerfile (#2393)
Dockerize moved from using Glock to Go modules and introduced
 go.mod and go.sum files into the repository.
Therefore, the Go module initialization command has to be removed
 from the `base-server` Dockerfile as it breaks the build.

See: 6f92b85658
2022-01-20 19:08:55 -08:00
Sergei
c74cb4989a Fix c symbol in caCert variable name (#2397) 2022-01-20 17:03:51 -08:00
swyx
773e18a6c0 [Docker build] fix defaults with variables in templates (#2378) 2022-01-14 04:44:38 +08:00
swyx
86605c4d17 [Docker build] add separate visibility env vars for different db instance (#2362) 2022-01-11 17:01:59 -08:00
swyx
46eafc910d add link to explain docker builds and auto setup (#2346) 2022-01-06 13:07:22 -08:00
David Reiss
bdbfb605fb Use --target for docker builds (#2273) 2021-12-20 22:55:10 -08:00
David Reiss
929c1cd372 Add tzdata to server base image and binary (#2277) 2021-12-20 22:50:12 -08:00
Alex Shtin
4a4cc58b4a Add Makefile targets for arm64 (#2201) 2021-11-30 16:27:24 -08:00
Yimin Chen
d49000975d Upgrade golang to 1.17.3 (#2240)
* Upgrade golang to 1.17.3
* Update base image version
2021-11-30 14:49:16 -08:00
Sergey Bykov
60fb3cd651 Add protection for empty JWT key source URIs (#2142)
* Add JWT key sources in config_template.yaml only when env variables are set

* Add protection for empty JWT key source URIs
2021-11-11 19:09:46 -08:00
Joe Green
851aaec895 Use correct absolute paths to scripts in dockerfile (#2123) 2021-11-03 12:27:33 -07:00