Skip to main content

prefect_gcp.deployments.steps

Prefect deployment steps for code storage in and retrieval from Google Cloud Storage.

Functions

push_to_gcs

Pushes the contents of the current working directory to a GCS bucket, excluding files and folders specified in the ignore_file. Args:
  • bucket: The name of the GCS bucket where files will be uploaded.
  • folder: The folder in the GCS bucket where files will be uploaded.
  • project: The GCP project the bucket belongs to. If not provided, the project will be inferred from the credentials or the local environment.
  • credentials: A dictionary containing the service account information and project used for authentication. If not provided, the application default credentials will be used.
  • ignore_file: The name of the file containing ignore patterns.
Returns:
  • A dictionary containing the bucket and folder where files were uploaded.
Examples: Push to a GCS bucket:
Push to a GCS bucket using credentials stored in a block:
Push to a GCS bucket using credentials stored in a service account file:

pull_from_gcs

Pulls the contents of a project from an GCS bucket to the current working directory. Args:
  • bucket: The name of the GCS bucket where files are stored.
  • folder: The folder in the GCS bucket where files are stored.
  • project: The GCP project the bucket belongs to. If not provided, the project will be inferred from the credentials or the local environment.
  • credentials: A dictionary containing the service account information and project used for authentication. If not provided, the application default credentials will be used.
Returns:
  • A dictionary containing the bucket, folder, and local directory where files were downloaded.
Examples: Pull from GCS using the default environment credentials:
Pull from GCS using credentials stored in a block:
Pull from to an GCS bucket using credentials stored in a service account file:

Classes

PushToGcsOutput

The output of the push_to_gcs step.

PullFromGcsOutput

The output of the pull_from_gcs step.