Workflows
Last updated
Was this helpful?
Last updated
Was this helpful?
New in Quilt 3.3
A Quilt workflow is a quality gate that you set to ensure the quality of your data and metadata before it becomes a Quilt package. You can create as many workflows as you like to accommodate all of your data creation patterns.
Under the hood, Quilt workflows use to check that package metadata have the right shape. Metadata shape determines which keys are defined, their values, and the types of the values.
Ensuring the quality of your data has long-lasting implications:
Consistency - if labels and other metadata don't use a consistent, controlled vocabulary, reuse becomes difficult and trust in data declines
Completeness - if your workflows do not require users to include files, documentation, labels, etc. then your data is on its way towards becoming mystery data and ultimately junk data that no one can use
Context - data can only be reused if users know where it came from, what it means, who touched it, and what the related datasets are
From the standpoint of querying engines like Amazon Athena, data that lacks consistency and completeness is extremely difficult to query longitudinally and depreciates over time (as team members change, platforms change, and tribal knowledge is lost).
Ensure that labels are correct and drawn from a controlled vocabulary (e.g. ensure that the only labels in a package of images are either "bird" or "not bird"; avoid data entry errors like "birb")
Ensure that users provide a README.md for every new package
Ensure that included files are non-empty
Ensure that every new package (or dataset) has enough labels so that it can be reused (e.g. Date, Creator, Type, etc.)
To get started, create a configuration file in your Quilt S3 bucket at s3://BUCKET/.quilt/workflows/config.yml
.
Here's an example:
With the above configuration, you must specify a workflow before you can push:
Let's try with the workflow=
parameter:
The above QuiltException
is caused by is_message_required: true
. Here's how we can pass the workflow:
Now let's push with workflow='beta'
:
Note that superhero
is a required property:
For the gamma
workflow, both is_message_required: true
and metadata_schema
are set, so both message
and package metadata are validated:
If you wish for your users to be able to skip workflows altogether, you can make workflow validation optional with is_workflow_required: false
in your config.yml
, and specify workflow=None
in the API:
Also default_workflow
can be set in the config to specify which workflow will be used if workflow
parameter is not provided.
If you wish to pre-populate dates in the Quilt catalog, you can use the custom keyword dateformat
in your schemas. For example:
In addition to package-level metadata. Quilt workflows enable you to validate package names, and basic file metadata.
You must include the following schema version at the root of your config.yml in order for any catalog-specific features to function:
By default the Quilt catalog auto-fills the package handle prefix according to the following logic:
Packages tab: username (everything before the @ in your sign-in email). Equivalent to
Files tab: parent directory name. Equivalent to
You can customize the default prefix with package_handle
key in one or both of the following places:
Set catalog.package_handle.(files|packages)
at the root of config.yml to affect all workflows
Set workflows.WORKFLOW.catalog.package_handle.(files|packages)
to affect the tabs and workflow in question
Example
By default, patterns are not anchored. You can explicitly add start (
^
) and end ($
) markers as needed.
Example
You can validate the names and sizes of files in the package with WORkFLOW.entries_schema
. The provided schema runs against an array of objects known as package entries. Each package entry defines a logical key (its releative path and name in the parent package) and size (in bytes).
Example
s3://bucket/must-contain-readme.json
s3://bucket/must-contain-readme-summarize-at-least-1byte.json
In Quilt, S3 buckets are like git branches but for data. With quilt3
you can browse
any package and then push
it to any bucket that you choose.
As a rule, cross-bucket pushes or "merges" reflect change in a package's lifecycle. For example, you might push a package from my-staging-bucket to my-production-bucket as it matures and becomes trusted.
If copy_data
is true
(the default), all package entries will be copied to the destination bucket. If copy_data
is false
, all entries will remain in their current locations.
config.yml
JSON SchemaSchemas must be in an S3 bucket for which the Quilt user has read permissions
We encountered another exception because the beta
workflow specifies metadata_schema: superheroes
. Therefore, the test/package
metadata must validate against the at s3://quilt-sergey-dev-metadata/schemas/superheroes.schema.json
:
Quilt workflows support the .
Quilt supports the .
The dateformat
template follows .
You can validate package names with WORKFLOW.handle_pattern
, which accepts .
The catalog's feature can be enabled by adding a successors
property to the config. A successor is a destination bucket.
See and .
Only are supported
Schemas with are not supported