Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions databricks_cli/stack/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import os
import json
import warnings
from datetime import datetime
from requests.exceptions import HTTPError

Expand Down Expand Up @@ -72,8 +73,13 @@
DBFS_RESOURCE_IS_DIR = 'is_dir'


STACK_CLI_DEPRECATION = '''Stack CLI is deprecated. Please switch to using
the generally available Databricks Terraform Provider instead:
https://docs.databricks.com/dev-tools/terraform/index.html'''

class StackApi(object):
def __init__(self, api_client):
warnings.warn(STACK_CLI_DEPRECATION, DeprecationWarning)
self.jobs_client = JobsApi(api_client)
self.workspace_client = WorkspaceApi(api_client)
self.dbfs_client = DbfsApi(api_client)
Expand Down
24 changes: 17 additions & 7 deletions databricks_cli/stack/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from databricks_cli.utils import eat_exceptions, CONTEXT_SETTINGS
from databricks_cli.version import print_version_callback, version
from databricks_cli.configure.config import provide_api_client, profile_option, debug_option
from databricks_cli.stack.api import StackApi
from databricks_cli.stack.api import StackApi, STACK_CLI_DEPRECATION

DEBUG_MODE = True

Expand Down Expand Up @@ -88,15 +88,18 @@ def _save_json(path, data):
@provide_api_client
def deploy(api_client, config_path, **kwargs):
"""
Deploy a stack to the databricks workspace given a JSON stack configuration template.
[Deprecated] Deploy a stack to the databricks workspace given a JSON stack configuration
template.

After deployment, a stack status will be saves at <config_file_name>.deployed.json. Please
do not edit or move the file as it is generated through the CLI and is used for future
deployments of the stack. If you run into errors with the stack status at deployment,
please delete the stack status file and try the deployment again. If the problem persists,
please raise a Github issue on the Databricks CLI repository at
https://www.github.com/databricks/databricks-cli/issues
please delete the stack status file and try the deployment again.

Please switch to using the generally available Databricks Terraform Provider instead:
https://docs.databricks.com/dev-tools/terraform/index.html
"""
click.secho('WARNING: ' + STACK_CLI_DEPRECATION, bg='red', fg='white')
click.echo('#' * 80)
click.echo('Deploying stack at: {} with options: {}'.format(config_path, kwargs))
stack_config = _load_json(config_path)
Expand Down Expand Up @@ -127,9 +130,13 @@ def deploy(api_client, config_path, **kwargs):
@provide_api_client
def download(api_client, config_path, **kwargs):
"""
Download workspace notebooks of a stack to the local filesystem given a JSON stack
[Deprecated] Download workspace notebooks of a stack to the local filesystem given a JSON stack
configuration template.

Please switch to using the generally available Databricks Terraform Provider instead:
https://docs.databricks.com/dev-tools/terraform/index.html
"""
click.secho('WARNING: ' + STACK_CLI_DEPRECATION, bg='red', fg='white')
click.echo('#' * 80)
click.echo('Downloading stack at: {} with options: {}'.format(config_path, kwargs))
stack_config = _load_json(config_path)
Expand All @@ -149,7 +156,10 @@ def download(api_client, config_path, **kwargs):
@profile_option
def stack_group(): # pragma: no cover
"""
[Beta] Utility to deploy and download Databricks resource stacks.
[Deprecated] Utility to deploy and download Databricks resource stacks.

Please switch to using the generally available Databricks Terraform Provider instead:
https://docs.databricks.com/dev-tools/terraform/index.html
"""
pass

Expand Down