You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cloud/features/scheduler/scheduler.md
+35-45Lines changed: 35 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,20 +165,40 @@ This gives you complete control over data security and network access while stil
165
165
166
166
Self-hosted executors as the name indicates are self-hosted workers that take on the responsibility of "executing" changes to the data warehouse. While Tobiko Cloud schedules and plans changes, the executors are responsible for executing those changes. Executors are docker containers that are configured to connect to Tobiko Cloud as well as your data warehouse. Connected to both, the executor pulls work from the cloud, whether it's a plan or scheduled background work from a run, and execute it on your data warehouse.
167
167
168
+
### Deployment Options
169
+
170
+
You can deploy the executor containers using any method that works for your infrastructure and operational requirements. The executors are standard Docker containers that can be deployed in any container environment as long as they're properly configured with the required environment variables.
171
+
172
+
For your convenience, we provide two reference implementations:
173
+
174
+
1. **Kubernetes with Helm Chart**: For production environments, we provide a [Helm chart](./scheduler/hybrid-executors/README.md) that includes robust configurability, secret management, and scaling options.
175
+
176
+
2. **Docker Compose**: For simpler environments or testing, we offer a [Docker Compose setup](./scheduler/hybrid-executors-docker-compose.md) to quickly deploy executors on any machine with Docker.
177
+
178
+
You're free to adapt these reference implementations or create your own deployment method that fits your specific needs. The only requirement is that two executor instances must be running (one for run operations and one for apply operations) and properly configured.
179
+
168
180
### Configuration
169
181
170
-
Exact configuration is left to the user and will vary based on the infrastructure and setup of the user, for example the executors could be run on a Kubernetes cluster or as a standalone pair of Docker containers depending on the user's infrastructure. The following details are an example of how this is done for a Postgres data warehouse and a pair of local containers running in docker.
182
+
The following covers basic configuration concepts for hybrid executors. For detailed configuration options, please refer to the specific documentation for your chosen deployment method above.
183
+
184
+
Tobiko Cloud requires 2 executor instances to be running:
171
185
172
-
Tobiko Cloud requires 2 docker instances to be running, one to pick up runs and one for plan applications. The entrypoint for both is `executor run` and `executor apply` respectively. The executor container can be found on [Docker Hub](https://hub.docker.com/r/tobikodata/tcloud). In addition to running the container, the user will need to configure the executor with environment variables that point to Tobiko Cloud as well as the data warehouse.
186
+
1. **Run Executor**: Handles scheduled model execution
187
+
2. **Apply Executor**: Handles applying changes to the data warehouse
173
188
174
-
To connect to the Tobiko Cloud, the user will need to provide the following environment variables, replaced with the user's own values.
189
+
Both executors need to be properly configured with environment variables to connect to Tobiko Cloud and your data warehouse.
190
+
191
+
#### Basic Environment Variables
192
+
193
+
To connect to Tobiko Cloud, you'll need to provide:
In addition to the above variables, a gateway is needed to provide a connection to a data warehouse. The following details are an example of how this is done for a Postgres data warehouse where the gateway is named `GATEWAY_A`. For more details on how to configure a gateway, see the details on other [engines](../../../integrations/overview.md#execution-engines) and how to [overide variables](../../../guides/configuration.md#overrides) as done below.
201
+
To connect to your data warehouse, configure a gateway:
**Note**: If there are multiple gateways, each gateway will need to have its own set of environment variables. For example, if there are two gateways, `GATEWAY_A` and `GATEWAY_B`, the environment variables will need to be set for both gateways.
213
+
**Note**: For multiple gateways, each gateway needs its own set of environment variables:
Once you have set up both sets of environment variables in a file named `local.env`, you can run the following command to start the executor:
203
-
204
-
```shell
205
-
docker run -d --env-file local.env tobikodata/tcloud:latest -- executor run
206
-
docker run -d --env-file local.env tobikodata/tcloud:latest -- executor apply
207
-
```
222
+
For more details, including secure secret management options, refer to the [Helm chart](./scheduler/hybrid-executors/README.md) or [Docker Compose](./scheduler/hybrid-executors-docker-compose.md) documentation.
208
223
209
-
After the executors are properly configured, they will appear in the cloud UI where they can be used to apply plans and execute scheduled runs.
224
+
After the executors are properly configured and running, they will appear in the cloud UI where they can be used to apply plans and execute scheduled runs.
210
225
211
226

212
227
@@ -224,43 +239,18 @@ While the exact requirements for executors vary depending on the customer's spec
224
239
225
240
Environment variables may also be passed to SQLMesh by mounting a `.env` file into the docker image and specifying it's full path with the environment variable `TCLOUD_ENV_FILE`.
226
241
227
-
**Note** These variables are only read at SQLMesh run time so variables that are used by `tcloud` such as `TCLOUD_URL`, `TCLOUD_TOKEN`, etc. must be passed as variables.
242
+
**Note** These variables are only read at SQLMesh run time so variables that are used by `tcloud` such as `TCLOUD_URL`, `TCLOUD_CLIENT_ID`, `TCLOUD_CLIENT_SECRET`, etc. must be passed as variables.
228
243
229
244
### Health checks
230
245
231
-
In production settings, we recommend setting up health checks as well, as these can be helpful in understanding the health of executors. When calling via the entrypoint, the health checks are as follows:
246
+
In production settings, we recommend setting up health checks to monitor the status of your executors. Health checks help ensure your executors are operating correctly and can identify issues before they impact your workflows.
232
247
233
-
```shell
234
-
docker run -d --env-file local.env tobikodata/tcloud:latest -- executor run --check
235
-
docker run -d --env-file local.env tobikodata/tcloud:latest -- executor apply --check
236
-
```
248
+
For detailed information on implementing health checks:
237
249
238
-
For environments that ignore the container's entrypoint, for example in the case of Kubernetes healthchecks, the health check is invoked as follows:
239
-
240
-
```yaml
241
-
# For the run executor
242
-
readinessProbe:
243
-
exec:
244
-
command:
245
-
- "/app/pex"
246
-
- "executor"
247
-
- "run"
248
-
- "--check"
249
-
timeoutSeconds: 5
250
-
```
250
+
- **Kubernetes/Helm**: See the [Hybrid Executors Helm Chart documentation](./scheduler/hybrid-executors/README.md#verifying-the-installation) for information on health check configuration in Kubernetes.
251
251
252
-
```yaml
253
-
# For the apply executor
254
-
readinessProbe:
255
-
exec:
256
-
command:
257
-
- "/app/pex"
258
-
- "executor"
259
-
- "apply"
260
-
- "--check"
261
-
timeoutSeconds: 5
262
-
```
252
+
- **Docker Compose**: Refer to the [Docker Compose setup documentation](./scheduler/hybrid-executors-docker-compose.md#health-checking) for health check implementation with Docker Compose.
263
253
264
-
Each executor type (run or apply) should have its own health check implemented to ensure proper monitoring of both components.
254
+
Both executor types (run and apply) should have appropriate health checks implemented to ensure proper monitoring and reliability.
265
255
266
-
**Note** Please note the specified timeout. Depending on the allocated resources, sometimes the default timeout is too aggressive.
256
+
**Note** When configuring health checks, ensure timeouts are set appropriately based on your resources. Default timeouts can sometimes be too aggressive depending on the allocated resources.
0 commit comments