Skip to content

Instantly share code, notes, and snippets.

@Geremie
Created December 16, 2020 10:16
Show Gist options
  • Save Geremie/91975bdb81634cc80ed59a974f407f40 to your computer and use it in GitHub Desktop.
Save Geremie/91975bdb81634cc80ed59a974f407f40 to your computer and use it in GitHub Desktop.
Automate your ML model retraining with Kubeflow
def download_blob(source_bucket_name: str, source_blob_name: str, dest_file_path: OutputPath()):
from google.cloud import storage
storage_client = storage.Client()
bucket = storage_client.bucket(source_bucket_name)
blob = bucket.blob(source_blob_name)
blob.download_to_filename(dest_file_path)
DOWNLOAD_BLOB_OP = comp.create_component_from_func(func=download_blob,
packages_to_install=['google-cloud-storage==1.26.0'])
download_blob_task = DOWNLOAD_BLOB_OP(bucket_name, 'tmp/metrics.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment