-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Dynamically create configuration for N Pipelines #3
Closed
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Dynamically create N number of pipelines from Singer output | ||
|
||
## `meltano.yml` | ||
|
||
```yaml | ||
plugins: | ||
extractors: | ||
# Third-party data source | ||
- name: tap-shopify | ||
|
||
# Configuration sources | ||
- name: tap-postgres--shopify_configs | ||
inherit_from: tap-postgres | ||
select: | ||
- public-shopify_configs.* | ||
|
||
# Third-party destination | ||
loaders: | ||
- name: target-s3-parquet | ||
|
||
schedules: | ||
- name: sync-all-shopify | ||
interval: @hourly | ||
config_source: | ||
tap-shopify: tap-postgres--shopify_configs | ||
extractor: tap-shopify | ||
loader: target-s3-parquet | ||
``` | ||
|
||
Where each key in the `config_source` mapping is a plugin used in the schedule and each value is a **tap** name. | ||
|
||
> [!NOTE] | ||
> TBD: how well the above configuration spec plays with _jobs_ since a job name can be referenced in a schedule. | ||
|
||
> [!NOTE] | ||
> TBD: how to reference a _pipeline_ instead of a plain tap, in case a mapper is required, for example. | ||
|
||
> [!NOTE] | ||
> TBD: This design makes sense for extractors. Do we want to support config sources for loaders too? If so, how could we ensure both collections of configs have the same cardinality and order? | ||
|
||
## Under the hood | ||
|
||
By writing dynamic configurations at the _schedule_ level, `meltano run` would be able to invoke the respective plugin with each of the configurations, but it is TBD whether this is expected of `meltano run`, or if it's the responsibility of the orchestrator (e.g. Meltano Cloud). | ||
|
||
## Alternatives | ||
|
||
* [Annotations](https://docs.meltano.com/concepts/project/#annotations) could be used in the schedule definition: | ||
|
||
```yaml | ||
plugins: ... # same as above | ||
schedules: | ||
- name: sync-all-shopify | ||
interval: @hourly | ||
annotations: | ||
config_source: | ||
tap-shopify: tap-postgres--shopify_configs | ||
extractor: tap-shopify | ||
loader: target-s3-parquet | ||
``` | ||
|
||
This would clearly make it the responsibility of the orchestrator to generate _N_ pipelines. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edgarrmondragon I like this approach b/c it keeps it to Cloud for now and let's us iterate on the spec / structure before requiring it to be fully in the meltano.yml spec.
Can we get a first pass on this up and running on Cloud soon-ish? I think there are a few things we'll have to consider as you start to implement around how to name jobs, logs, etc and I don't see any specs around that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's other things that are not clear to me:
@WillDaSilva do we use annotations for anything in cloud?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edgarrmondragon We currently only use annotations in Meltano Cloud here:
https://github.com/meltano/infra/blob/4d26a7bb575b6f460de97b33ea190d5ff12790a3/services/provisioner/provisioner_api/utils.py#L209-L228
This lets you specify which environments a schedule should run in. If unspecified, the schedule will exist for every environment, and be run for every environment for which there is a deployment in which the schedule is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd think state would mainly play a role in the actual runs on a per-config basis. But for the first iteration we can make an assumption that we pull the fullset of configs each time.
Seems like we'd have to, but you all know more about that than me. @edgarrmondragon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tayloramurphy That depends on how well the Cloud model plays with this approach.
@magreenbaum @WillDaSilva,
since we're going to rely on the orchestrator (Cloud) for this, there's a few questions that have to be answered:
On schedule, we need to execute 1+n pipelines. The first one extracts the configurations, whose cardinality is used to generate n jobs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edgarrmondragon @magreenbaum @BraedonLeonard @tayloramurphy I left my thoughts about this in a discussion in the infra repository, so as to avoid discussing our infra in this public repository: