Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
173 changes: 173 additions & 0 deletions .github/workflows/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Test compose examples

on:
pull_request:
paths:
- 'compose/**'
- '.github/workflows/compose.yaml'
push:
branches:
- main
paths:
- 'compose/**'
- '.github/workflows/compose.yaml'

permissions:
contents: read

jobs:
lint-actions:
name: Lint GitHub Actions workflows
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Lint actions
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color
shell: bash

compose-test:
name: Test ${{ matrix.compose-file }}
needs: lint-actions
strategy:
fail-fast: false
matrix:
compose-file:
- docker-compose.yml
- docker-compose-postgres.yml
- docker-compose-mysql.yml
- docker-compose-mysql-es.yml
- docker-compose-cass-es.yml
- docker-compose-postgres-opensearch.yml
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Print build information
env:
HEAD_REF: ${{ github.head_ref }}
REF: ${{ github.ref }}
COMPOSE_FILE: ${{ matrix.compose-file }}
run: echo "head_ref=$HEAD_REF ref=$REF compose=$COMPOSE_FILE"

- uses: actions/checkout@v6

- name: Start compose stack
working-directory: compose
run: docker compose -f ${{ matrix.compose-file }} up -d

- name: Run validation
working-directory: compose
run: |
docker compose -f ${{ matrix.compose-file }} -f docker-compose-validate.yml up temporal-validate --exit-code-from temporal-validate

- name: Print all logs on failure
if: failure()
working-directory: compose
run: |
echo "=== Printing all container logs ==="
docker compose -f ${{ matrix.compose-file }} ps -a
docker compose -f ${{ matrix.compose-file }} logs

- name: Cleanup
if: always()
working-directory: compose
run: docker compose -f ${{ matrix.compose-file }} -f docker-compose-validate.yml down -v

compose-tls-test:
name: Test docker-compose-tls.yml
needs: lint-actions
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Print build information
env:
HEAD_REF: ${{ github.head_ref }}
REF: ${{ github.ref }}
run: echo "head_ref=$HEAD_REF ref=$REF compose=docker-compose-tls.yml"

- uses: actions/checkout@v6

- name: Generate TLS certificates
working-directory: compose
run: |
docker build -t temporal_tls:test -f tls/Dockerfile.tls .
mkdir -p .pki
docker run --rm -v temporal_tls_pki:/pki -v "${PWD}"/.pki:/pki-out temporal_tls:test

- name: Build TLS images
working-directory: compose
run: COMPOSE_PROJECT_NAME=tls_test docker compose -f docker-compose-tls.yml build --no-cache

- name: Start TLS compose stack
working-directory: compose
run: COMPOSE_PROJECT_NAME=tls_test docker compose -f docker-compose-tls.yml up -d

- name: Run validation
working-directory: compose
run: |
COMPOSE_PROJECT_NAME=tls_test docker compose -f docker-compose-tls.yml -f docker-compose-validate.yml up temporal-validate --exit-code-from temporal-validate

- name: Print all logs on failure
if: failure()
working-directory: compose
run: |
echo "=== Printing all container logs ==="
COMPOSE_PROJECT_NAME=tls_test docker compose -f docker-compose-tls.yml ps -a
COMPOSE_PROJECT_NAME=tls_test docker compose -f docker-compose-tls.yml logs

- name: Cleanup
if: always()
working-directory: compose
run: |
COMPOSE_PROJECT_NAME=tls_test docker compose -f docker-compose-tls.yml -f docker-compose-validate.yml down -v
docker volume rm temporal_tls_pki || true
rm -rf .pki

compose-multirole-test:
name: Test docker-compose-multirole.yaml
needs: lint-actions
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Print build information
env:
HEAD_REF: ${{ github.head_ref }}
REF: ${{ github.ref }}
run: echo "head_ref=$HEAD_REF ref=$REF compose=docker-compose-multirole.yaml"

- uses: actions/checkout@v6

- name: Install loki Docker plugin
run: docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions

- name: Start multirole compose stack
working-directory: compose
run: docker compose -f docker-compose-multirole.yaml up -d

- name: Run validation
working-directory: compose
run: |
docker compose -f docker-compose-multirole.yaml -f docker-compose-validate-multirole.yml up temporal-validate --exit-code-from temporal-validate

- name: Verify temporal services are running
working-directory: compose
run: |
docker compose -f docker-compose-multirole.yaml ps temporal-history temporal-frontend temporal-matching temporal-worker

- name: Print all logs on failure
if: failure()
working-directory: compose
run: |
echo "=== Printing all container logs ==="
docker compose -f docker-compose-multirole.yaml ps -a
docker compose -f docker-compose-multirole.yaml logs

- name: Cleanup
if: always()
working-directory: compose
run: docker compose -f docker-compose-multirole.yaml -f docker-compose-validate-multirole.yml down -v
10 changes: 7 additions & 3 deletions .github/workflows/extensibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Print build information
run: 'echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}, os: ${{ matrix.os }}'
- uses: actions/checkout@v2
env:
HEAD_REF: ${{ github.head_ref }}
REF: ${{ github.ref }}
OS: ${{ matrix.os }}
run: echo "head_ref=$HEAD_REF ref=$REF os=$OS"
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v3.0.0
uses: actions/setup-go@v6
with:
go-version: '1.22'
- name: build
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/promql-to-dd-go_build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Setup Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
Expand All @@ -41,7 +41,7 @@ jobs:
type=sha

- name: Build and Push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: cloud/observability/promql-to-dd-go
tags: ${{ steps.meta.outputs.tags }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/promql-to-dd-go_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Print build information
run: 'echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}, os: ${{ matrix.os }}'
- uses: actions/checkout@v2
env:
HEAD_REF: ${{ github.head_ref }}
REF: ${{ github.ref }}
OS: ${{ matrix.os }}
run: echo "head_ref=$HEAD_REF ref=$REF os=$OS"
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v3.0.0
uses: actions/setup-go@v6
with:
go-version: '1.20'
- name: build
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/promql-to-scrape.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -41,7 +41,7 @@ jobs:

- name: Setup Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
Expand All @@ -53,7 +53,7 @@ jobs:
type=sha

- name: Build and Push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: cloud/observability/promql-to-scrape
tags: ${{ steps.meta.outputs.tags }}
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Temporal Customization Samples
These samples show how to customize Temporal server for specific production scenarios.
# Temporal Server Samples
These samples show how to run and customize Temporal server for local development and production scenarios.

Learn more about Temporal at:
* Documentation: https://docs.temporal.io
Expand All @@ -16,6 +16,7 @@ Please follow instructions from README.md file in every sample directory.

## Samples

- **[Docker Compose](./compose/)**: docker-compose files to run a local Temporal Server with various database and dependency configurations (PostgreSQL, MySQL, Cassandra, Elasticsearch, OpenSearch).
- **[TLS](./tls/)**: how to configure Transport Layer Security (TLS) to secure network communication with and within Temporal cluster.
- **[Authorizer](./extensibility/authorizer)**: how to inject a low-level authorizer component that can control access to all API calls.

Expand Down
12 changes: 12 additions & 0 deletions compose/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
COMPOSE_PROJECT_NAME=temporal
CASSANDRA_VERSION=3.11.9
ELASTICSEARCH_VERSION=7.17.27
MYSQL_VERSION=8
TEMPORAL_VERSION=1.29.1
TEMPORAL_ADMINTOOLS_VERSION=1.29.1-tctl-1.18.4-cli-1.5.0
TEMPORAL_UI_VERSION=2.34.0
POSTGRESQL_VERSION=16
POSTGRES_PASSWORD=temporal
POSTGRES_USER=temporal
POSTGRES_DEFAULT_PORT=5432
OPENSEARCH_VERSION=2.5.0
Loading