* WIP Convert airbyte-workers to Micronaut framework * Rebase cleanup * Fix broken tests * Simplify code * Support control vs data plane configuration * make WORFKLOW_PROXY_CACHE non-static to avoid cacheing mocks in unit tests * Formatting * Pairing on Worker Micronaut (#16364) * add RouteToSyncTaskQueue activity * use new route activity in connection manager workflow * format * call router service for task queue * Revert temporal proxy changes * Formatting * Fix default value * register new route activity in test * fix SyncWorkflowTest now that it isn't doing any routing * Update dependencies * More dependency updates * Update dependencies * WIP Convert airbyte-workers to Micronaut framework * Rebase cleanup * Fix broken tests * Simplify code * Support control vs data plane configuration * make WORFKLOW_PROXY_CACHE non-static to avoid cacheing mocks in unit tests * Formatting * Pairing on Worker Micronaut (#16364) * add RouteToSyncTaskQueue activity * use new route activity in connection manager workflow * format * call router service for task queue * Revert temporal proxy changes * Formatting * Fix default value * register new route activity in test * fix SyncWorkflowTest now that it isn't doing any routing * Update dependencies * More dependency updates * Update dependencies * WIP Convert airbyte-workers to Micronaut framework * Rebase cleanup * Fix broken tests * Simplify code * Support control vs data plane configuration * make WORFKLOW_PROXY_CACHE non-static to avoid cacheing mocks in unit tests * Formatting * Pairing on Worker Micronaut (#16364) * add RouteToSyncTaskQueue activity * use new route activity in connection manager workflow * format * call router service for task queue * Revert temporal proxy changes * Formatting * Fix default value * register new route activity in test * fix SyncWorkflowTest now that it isn't doing any routing * Update dependencies * More dependency updates * Update dependencies * Add the injected temporal client to airbyte-cron * Update cron to make it work * Remove useless Bean factory * PR comments * WIP Convert airbyte-workers to Micronaut framework * Rebase cleanup * Fix broken tests * Simplify code * Support control vs data plane configuration * make WORFKLOW_PROXY_CACHE non-static to avoid cacheing mocks in unit tests * Formatting * Pairing on Worker Micronaut (#16364) * add RouteToSyncTaskQueue activity * use new route activity in connection manager workflow * format * call router service for task queue * Revert temporal proxy changes * Formatting * Fix default value * register new route activity in test * fix SyncWorkflowTest now that it isn't doing any routing * Update dependencies * More dependency updates * Update dependencies * Improve conditional bean check * Match existing Optional functionality * Add notEquals check * Add missing env var to Helm chart * Fix typo * Mark LogConfigs as Singleton * WIP Convert airbyte-workers to Micronaut framework * Rebase cleanup * Fix broken tests * Simplify code * Support control vs data plane configuration * make WORFKLOW_PROXY_CACHE non-static to avoid cacheing mocks in unit tests * Formatting * Pairing on Worker Micronaut (#16364) * add RouteToSyncTaskQueue activity * use new route activity in connection manager workflow * format * call router service for task queue * Revert temporal proxy changes * Formatting * Fix default value * register new route activity in test * fix SyncWorkflowTest now that it isn't doing any routing * Update dependencies * More dependency updates * Update dependencies * Improve conditional bean check * Match existing Optional functionality * Add notEquals check * Add missing env var to Helm chart * Fix typo * Mark LogConfigs as Singleton * Env vars for log/state storage type * Remove use of Optional in bean declarations * Fix typo in config property name * Support Temporal Cloud namespace * Change to @Value * Use correct value for conditional check * Upgrade Micronaut * Fix merge conflict * Formatting * Add missing env var * Use sync task queue environment variable * Handle sync task queue as set * format and force http * Handle case where sync task queue is empty * Add correct path to config property * Remove unused import * Remove conflict * Remove unused parameter * Formatting * Use pattern for condition process factory beans * Cleanup * PR feedback * Revert hack for testing * Fix temporal restart by status (#16447) * Update application.yml * Re add worker dep * Add missing env var * PR comments * Bmoric/move temporal client (#16778) * tmp * tmp * View diff * Move part of the temporal client * tmp * copy Temporal Utils test * Uniq Temporal Utils * Uniq Temporal Workflow Utils * Move CancellationHandler * Move commons-temporal to being shared between platform, connector and CLI * Rm worker dependency from cron * Fix build * Update with right value for cron. * Fix dep conflict Co-authored-by: jdpgrailsdev <jpearlin1@gmail.com> Co-authored-by: pmossman <parker@airbyte.io> Co-authored-by: Jonathan Pearlin <jonathan@airbyte.io>
airbyte-workers
This module contains the logic for how Jobs are executed. Jobs are executed using a tool called Temporal.
Temporal Development
Versioning
Temporal is maintaining an internal history of the activity it runs. This history is based on a specific order. If we restart a temporal workflow with a new implementation that has a different order, the workflow will be stuck and will need manual action to be properly restarted. Temporal provides an API to be able to manage those changes smoothly. However, temporal is very permissive with version rules. Airbyte will follow the following rules:
- There will be one global version per workflow, meaning that we will use a single tag per workflow.
- All the following code modifications will need to bump the version number, it won't be limited to a release of a new airbyte version
- Addition of an activity
- Deletion of an activity
- Change of the input of an activity
- Addition of a temporal sleep timer
The way to use this version should be the following:
If no prior version usage is present:
final int version = Workflow.getVersion(VERSION_LABEL, MINIMAL_VERSION, CURRENT_VERSION);
if (version >= CURRENT_VERSION) {
// New implemenation
}
if some prior version usage is present (we bump the version from 4 to 5 in this example):
final int version = Workflow.getVersion(VERSION_LABEL, MINIMAL_VERSION, CURRENT_VERSION);
if (version <= 4 && version >= MINIMAL_VERSION) {
// old implemenation
} else if (version >= CURRENT_VERSION) {
// New implemenation
}
Removing a version
Removing a version is a potential breaking change and should be done version carefully. We should maintain a MINIMAL_VERSION to keep track of the current minimal version. Both MINIMAL_VERSION and CURRENT_VERSION needs to be present on the workflow file even if they are unused (if they have been used once).