Skip to content

Releases: Netflix/metaflow

2.9.7

27 Jun 09:21
e11a7c3
Compare
Choose a tag to compare

Features

New commands for managing Argo Workflows through the CLI

This release includes new commands for managing workflows on Argo Workflows.
When needed, commands can be authorized by supplying a production token with --authorize.

argo-workflows delete

A deployed workflow can be deleted through the CLI with

python flow.py argo-workflows delete

argo-workflows terminate

A run can be terminated mid-execution through the CLI with

python flow.py argo-workflows terminate RUN_ID

argo-workflows suspend/unsuspend

A run can be suspended temporarily with

python flow.py argo-workflows suspend RUN_ID

Note that the suspended flow will show up as failed on Metaflow-UI after a period, due to this also suspending the heartbeat process. Unsuspending will resume the flow and its status will show as running again. This can be done with

python flow.py argo-workflows unsuspend RUN_ID

Improvements

Faster Job completion checks for Kubernetes

Previously the status for tasks running on Kubernetes was determined through the pod status, which can take a while to update after the last container finishes. This release changes the status checks to use container statuses directly instead.

What's Changed

Full Changelog: 2.9.6...2.9.7

2.9.6

21 Jun 15:59
4fdec0d
Compare
Choose a tag to compare

Features

AWS Step Function state machines can now be deleted through the CLI

This release introduces the command step-functions delete for deleting state machines through the CLI.

For a regular flow

python flow.py step-functions delete

For another users project branch

Comment out the @project decorator from the flow file, as we do not allow using --name with projects.

python project_flow.py step-functions --name project_a.user.saikonen.ProjectFlow delete

For a production or custom branch flow

python project_flow.py --production step-functions delete
# or
python project_flow.py --branch custom step-functions delete

add --authorize PRODUCTION_TOKEN to the command if you do not have the correct production token locally

Improvements

Fixes a bug with the S3 server side encryption feature with some S3 compliant providers.

This release fixes an issue with the S3 server side encryption support, where some S3 compliant providers do not respond with the expected encryption method in the payload. This bug specifically affected regular operation when using MinIO.

Fixes support for --with environment in Airflow

Fixes a bug with the Airflow support for environment variables, where the env values set in the environment decorator could get overwritten.

What's Changed

Full Changelog: 2.9.5...2.9.6

2.9.5

15 Jun 18:25
3d4f85a
Compare
Choose a tag to compare

Features

Ability to choose server side encryption method for S3 uploads

There is now the possibility to choose which server side encryption method to use for S3 uploads by setting an environment variable METAFLOW_S3_SERVER_SIDE_ENCRYPTION with an appropriate value, for example aws:kms or AES256

Improvements

Fixes double quotes with Parameters on Argo Workflows

This release fixes an issue where using parameters on Argo Workflows caused the values to be unnecessarily quoted.

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.

What's Changed

New Contributors

Full Changelog: 2.9.4...2.9.5

2.9.4

12 Jun 19:27
4a3f51a
Compare
Choose a tag to compare

Improvements

Fix using email addresses as usernames for Argo Workflows

Using an email address as the username when deploying with a @project decorator to Argo Workflows is now possible. This release fixes an issue with some generated resources containing characters that are not permitted in names of Argo Workflow resources.

The secrets decorator now supports assuming roles

This release adds the capability to assume specific roles when accessing secrets with the @secrets decorator. The role for accessing a secret can be defined in the following ways

As a global default

By setting the METAFLOW_DEFAULT_SECRET_ROLE environment variable, this role will be assumed when accessing any secret specified in the decorator.

As a global option in the decorator

This will assume the role secret-iam-role for accessing all of the secrets in the sources list.

@secrets(
  sources=["first-secret-source", "second-secret-source"],
  role="secret-iam-role"
)

Or on a per secret basis

Assuming a different role based on the secret in question can be done as well

@secrets(
  sources=[
    {"type": "aws-secrets-manager", "id": "first-secret-source", "role": "first-secret-role"},
    {"type": "aws-secrets-manager", "id": "second-secret-source", "role": "second-secret-role"}
  ]
)

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.

What's Changed

Full Changelog: 2.9.3...2.9.4

2.9.3

01 Jun 18:13
68a27b6
Compare
Choose a tag to compare

Improvements

Ignore duplicate Metaflow Extensions packages

Duplicate Metaflow Extensions packages were not properly ignored in all cases. This release fixes this and will allow the loading of extensions even if they are present in duplicate form in your sys.path.

Fix package leaks for the environment escape

In some cases, packages from the outside environment (non Conda) could leak into the Conda environment when using the environment escape functionality. This release addresses this issue and ensures that no spurious packages are imported in the Conda environment.

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.

What's Changed

Full Changelog: 2.9.2...2.9.3

2.9.2

22 May 16:17
4c3b771
Compare
Choose a tag to compare

Features

Introduce support for image pull policy for @kubernetes

With this release, Metaflow users can specify image pull policy for their workloads through the @kubernetes decorator for Metaflow tasks.

@kubernetes(image='foo:tag', image_pull_policy='Always') # Allowed values are Always, IfNotPresent, Never
@step
def train(self):
    ... 
    ...

If an image pull policy is not specified, and the tag for the container image is :latest or the tag for the container image is not specified, image pull policy is automatically set to Always.

If an image pull policy is not specified, and the tag for the container image is specified as a value that is not :latest, image pull policy is automatically set to IfNotPresent.

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.


What's Changed

Full Changelog: 2.9.1...2.9.2

2.9.1

16 May 02:15
86b99fe
Compare
Choose a tag to compare

Features

Introduce Slack notifications support for workflow running on Argo Workflows

With this release, Metaflow users can get notified on Slack when their workflows succeed or fail on Argo Workflows. Using this feature is quite straightforward

  1. Follow these instructions on Slack to set up incoming webhooks for your Slack workspace.
  2. You should now have a webhook URL that Slack provides. Here is an example webhook:
    https://hooks.slack.com/services/T0XXXXXXXXX/B0XXXXXXXXX/qZXXXXXX
    
  3. To enable notifications on Slack when your Metaflow flow running on Argo Workflows succeeds or fails, deploy it using the --notify-on-error or --notify-on-success flags:
    python flow.py argo-workflows create --notify-on-error --notify-on-success --notify-slack-webhook-url <slack-webhook-url>
    
  4. You can also set METAFLOW_ARGO_WORKFLOWS_CREATE_NOTIFY_SLACK_WEBHOOK_URL=<slack-webhook-url> in your environment instead of specifying --notify-slack-webhook-url on the CLI everytime.
  5. Next time your workflow succeeds or fails on Argo Workflows, you will get a helpful notification on Slack.

FAQ

I deployed my workflow following the instructions above, but I haven’t received any notifications yet?

This issue may very well happen if you are running Kubernetes v1.24 or newer.

Since v1.24, Kubernetes stopped automatically creating a secret for every serviceAccount. Argo Workflows relies on the existence of these secrets to run lifecycle hooks responsible for the emission of these notifications.

Follow these steps for explicitly creating a secret for the service account that responsible for executing Argo Workflows steps:

  1. Run the following command, replacing service-account.name with the serviceAccount in your deployment. Also change the name of the secret to correctly reflect the name of the _serviceAccount _for which this secret is
    cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: Secret
    metadata:
      name: default-sa-token #change according to the name of the sa
      annotations:
        kubernetes.io/service-account.name: default #replace with your sa
    type: kubernetes.io/service-account-token
    EOF
    
  2. Edit the serviceAccount object so as to add the name of the above secret in it. You can use kubectl edit for this. The serviceAccount yaml should look like the following
    $ kubectl edit sa default -n mynamespace
    ...
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      creationTimestamp: "2023-05-05T20:58:58Z"
      name: default
      namespace: jobs-default
      resourceVersion: "6739507"
      uid: 4a708eff-d6ba-4dd8-80ee-8fb3c4c1e1c7
    secrets:
    - name: default-sa-token # should match the secret above
    
  3. That’s it! Try executing your workflow again on Argo Workflows. If you are still running into issues, reach out to us!

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.


What's Changed

Full Changelog: 2.8.6...2.9.0

2.9.0

16 May 00:39
4965335
Compare
Choose a tag to compare

Features

Introduce support for composing multiple interrelated workflows through external events

With this release, Metaflow users can architect sequences of workflows that conduct data across teams, all the way from ETL and data warehouse to final ML outputs. Detailed documentation and a blog post to follow very shortly! Keep watching this space.

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.


What's Changed

Full Changelog: 2.8.6...2.9.0

2.8.6

10 May 17:51
0386164
Compare
Choose a tag to compare

Features

Introduce support for persistent volume claims for executions on Kubernetes

With this release, Metaflow users can attach existing persistent volume claims to Metaflow tasks running on a Kubernetes cluster.

To use this functionality, simply list your persistent volume claim and mount point using the persistent_volume_claims arg in @kubernetes decorator - @kubernetes(persistent_volume_claims={"pvc-claim-name": "mount-point", "another-pvc-claim-name": "another-mount-point"}).

Here is an example:

from metaflow import FlowSpec, step, kubernetes, current
import os

class MountPVCFlow(FlowSpec):

    @kubernetes(persistent_volume_claims={"test-pvc-feature-claim": "/mnt/testvol"})
    @step
    def start(self):
        print('testing PVC')
        mount = "/mnt/testvol"
        file = f"zeros_run_{current.run_id}"
        with open(os.path.join(mount, file), "w+") as f:
            f.write("\0" * 50)
            f.flush()
        
        print(f"mount folder contents: {os.listdir(mount)}")
        self.next(self.end)

    @step
    def end(self):
        print("finished")

if __name__=="__main__":
    MountPVCFlow()

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.

What's Changed

Full Changelog: 2.8.5...2.8.6

2.8.5

05 May 22:53
e47f5d7
Compare
Choose a tag to compare

Improvements

Improvements

Make pickled Metaflow client objects accessible across namespaces

The previous release resulted in disabling a sequence of user operations that worked previously:

  1. Pickle a Metaflow object
  2. Access this Metaflow object in a different namespace
  3. Access a child or parent object of this object

This release restores the previous behavior.

In case you need any assistance or have feedback for us, ping us at chat.metaflow.org or open a GitHub issue.

What's Changed

Full Changelog: 2.8.4...2.8.5