- Please note: I was testing successfully on my local Mac with Intel chipset and amd64 Linux using GitHub CodeSpaces. If you are running into issues as you build/run docker-compose up, it may be worth checking whether you can get it to run in a GitHub Codespace or GitPod.
- There have been reported issues with Apple M1 chips: please click here for more info
- Install on macOS with
brew install go
- Install on Ubuntu with
sudo apt install golang.
- Install on macOS with
brew install protobuf.
- Install on Ubuntu with
sudo apt install protobuf-compiler.
- Homebrew brew
install tctl
- Go install
make update-tctl
or download it from here https://github.com/temporalio/tctl
- In the directory of your choice, clone the temporal git repository
mkdir ~/Documents/GitHub/temporalio
cd ~/Documents/GitHub/temporalio
git clone https://github.com/temporalio/temporal.git
- In bash shell, compile the temporal-sql-tool
cd ~/Documents/GitHub/temporalio
make temporal-sql-tool
- Verify that temporal-sql-tool sucessfully compiled.
./temporal-sql-tool --version
./temporal-sql-tool --help
-
Create an account at https://auth.planetscale.com/sign-up and two databases named
temporal
andtemporal_visibility
(assuming you have not used PlanetScale before, you may need to install the PSCALE CLI. More steps can be found here: https://github.com/planetscale/cli#installation -
After compiling your temporal-sql-tool and creating your 2
temporal
temporal_visibility
PlanetScale databases, you will need to generate passwords & use the connection strings provided in the PlanetScale CLI
Docker compose files for temporal.io with external MySQL databases for temporal and temporal_visibility tables (using PlanetScale as example)
As the docker-compose files 👇 are using PlanetScale's MySQL-compatible Vitess database as an example, each database (temporal and temporal_internal) use different keyspaces and connection strings. Unfortunately, temporalio/auto-setup does not seem to support multiple connection strings for database creation and schema updates (using temporal-sql-tool), so the following commands would need to be run manually before starting up docker-compose:
./temporal-sql-tool --ep $TEMPORAL_PSCALE_HOSTSTRING --user $TEMPORAL_PSCALE_USER --tls --password $TEMPORAL_PASSWORD-p 3306 --plugin mysql --db temporal setup-schema -v 0.0
./temporal-sql-tool --ep $TEMPORAL_PSCALE_HOSTSTRING --user $TEMPORAL_PSCALE_USER --tls --password $TEMPORAL_PASSWORD-p 3306 --plugin mysql --db temporal update-schema -d ./schema/mysql/v57/temporal/versioned
./temporal-sql-tool --ep $TEMPORAL_VISBILITY_PSCALE_HOSTSTRING --user $TEMPORAL_VISBILITY_PSCALE_USER --tls --password $TEMPORAL_VISBILITY_PASSWORD-p 3306 --plugin mysql --db temporal_visibility setup-schema -v 0.0
./temporal-sql-tool --ep $TEMPORAL_VISBILITY_PSCALE_HOSTSTRING --user $TEMPORAL_VISBILITY_PSCALE_USER --tls --password $TEMPORAL_VISBILITY_PASSWORD-p 3306 --plugin mysql --db temporal_visibility update-schema -d ./schema/mysql/v57/visibility/versioned
- Please note that we populated the necessary environment variables from the PlanetScale connection dialog (TEMPORAL_VISIBILITY_USER, TEMPORAL_VISIBILITY_PASSWORD, TEMPORAL_VISIBILITY_PSCALE_HOSTSTRING, TEMPORAL_USER, TEMPORAL_PASSWORD, TEMPORAL_PSCALE_HOSTSTRING
- In the previous step we created the persistence part of Temporal (the DB) and now the next step is to start the Temporal server.
The default configuration file (docker-compose.yml) uses a PostgreSQL database, an Elasticsearch instance, and exposes the Temporal gRPC Frontend on port 7233. The other configuration files in the repo spin up instances of the Temporal Server using different databases and dependencies.
After successful initialization, you can run temporal like this:
cd docker-compose/
docker-compose -f docker-compose-mysql.yml up
# or, if you like advanced visibility
# docker-compose -f docker-compose-mysql-es.yml up