Skip to content

Commit

Permalink
Release 1.7.0 (tracks 82106e8784e26035f744363e98e0e8294542c3d0)
Browse files Browse the repository at this point in the history
  • Loading branch information
elementl-devtools committed Apr 4, 2024
1 parent e720269 commit 73633a8
Show file tree
Hide file tree
Showing 46 changed files with 1,620 additions and 779 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import yaml
from typer import Argument, Typer
from typing_extensions import Annotated

from ... import gql, ui
from ...config_utils import dagster_cloud_options
from ...core.artifacts import download_artifact, upload_artifact
from ...core.headers.auth import DagsterCloudInstanceScope
from ...utils import create_stub_app

try:
Expand Down Expand Up @@ -43,3 +46,59 @@ def get_command(
with gql.graphql_client_from_url(url, api_token) as client:
settings = gql.get_deployment_settings(client)
ui.print_yaml(settings)


@app.command(name="upload-artifact")
@dagster_cloud_options(allow_empty=True, requires_url=True)
def upload_artifact_command(
key: Annotated[
str,
Argument(
help="The key for the artifact being uploaded.",
),
],
path: Annotated[
str,
Argument(
help="The path to the file to upload.",
),
],
api_token: str,
url: str,
):
"""Upload a deployment scoped artifact."""
upload_artifact(
url=url,
scope=DagsterCloudInstanceScope.DEPLOYMENT,
api_token=api_token,
key=key,
path=path,
)


@app.command(name="download-artifact")
@dagster_cloud_options(allow_empty=True, requires_url=True)
def download_artifact_command(
key: Annotated[
str,
Argument(
help="The key for the artifact to download.",
),
],
path: Annotated[
str,
Argument(
help="Path to the file that the contents should be written to.",
),
],
api_token: str,
url: str,
):
"""Download a deployment scoped artifact."""
download_artifact(
url=url,
scope=DagsterCloudInstanceScope.DEPLOYMENT,
api_token=api_token,
key=key,
path=path,
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .... import gql, ui
from ....config_utils import dagster_cloud_options
from .config_schema import process_alert_policies_config
from .config_schema import INSIGHTS_ALERT_POLICIES_SCHEMA, process_alert_policies_config

DEFAULT_ALERT_POLICIES_YAML_FILENAME = "alert_policies.yaml"

Expand Down Expand Up @@ -44,7 +44,7 @@ def sync_command(
config = yaml.load(f.read(), Loader=yaml.SafeLoader)

try:
process_alert_policies_config(config)
process_alert_policies_config(config, INSIGHTS_ALERT_POLICIES_SCHEMA)

alert_policies = gql.reconcile_alert_policies(client, config)

Expand Down
Loading

0 comments on commit 73633a8

Please sign in to comment.