Support Databricks Agent API 2.1 and Console URL#1935
Merged
pingsutw merged 18 commits intoDec 12, 2023
Conversation
Signed-off-by: Future Outlier <eric901201@gmai.com>
added 2 commits
November 4, 2023 15:25
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
existing_cluster_id and new_cluster to create a Job
Signed-off-by: Future Outlier <eric901201@gmai.com>
existing_cluster_id and new_cluster to create a Jobexisting_cluster_id and new_cluster options to create a Job
8 tasks
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1935 +/- ##
==========================================
+ Coverage 85.84% 85.86% +0.01%
==========================================
Files 306 306
Lines 22897 22907 +10
Branches 3470 3471 +1
==========================================
+ Hits 19657 19668 +11
+ Misses 2645 2644 -1
Partials 595 595 ☔ View full report in Codecov by Sentry. |
added 11 commits
November 5, 2023 14:23
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
…nto databricks-update-api-version
…nto databricks-update-api-version
Signed-off-by: Future Outlier <eric901201@gmai.com>
existing_cluster_id and new_cluster options to create a Job…nto databricks-update-api-version
…nto databricks-update-api-version Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
pingsutw
approved these changes
Dec 12, 2023
RRap0so
pushed a commit
to RRap0so/flytekit
that referenced
this pull request
Dec 15, 2023
Signed-off-by: Future Outlier <eric901201@gmai.com> Co-authored-by: Future Outlier <eric901201@gmai.com> Signed-off-by: Rafael Raposo <rafaelraposo@spotify.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Currently, we only support Databricks API 2.0 and only the

new_clusterkey in the databricks config.However, some users want to use Databricks API 2.1 and want to use
existing_cluster_idin the databricks config.Here's the update version.
you can find the difference about
existing_cluster_idandnew_clusterType
Are all requirements met?
Complete description
Config yaml in dev mode
Example Code
Test it
Screenshots
Create a job

{ "run_id": 273988794563328 }Get the job (PENDING State)

{ "job_id": 135287260562039, "run_id": 273988794563328, "creator_user_name": "flytesandboxgpu@gmail.com", "number_in_job": 273988794563328, "state": { "life_cycle_state": "PENDING", "state_message": "Waiting for cluster", "user_cancelled_or_timedout": false }, "start_time": 1699085986939, "setup_duration": 0, "execution_duration": 0, "cleanup_duration": 0, "end_time": 0, "run_name": "flytekit databricks plugin example", "run_page_url": "https://359440087090042.2.gcp.databricks.com/?o=359440087090042#job/135287260562039/run/273988794563328", "run_type": "SUBMIT_RUN", "tasks": [ { "run_id": 273988794563328, "task_key": "flytekit_databricks_plugin_example", "spark_python_task": { "python_file": "dbfs:/entrypoint.py", "parameters": [ "pyflyte-fast-execute", "--additional-distribution", "s3://my-s3-bucket/flytesnacks/development/3JXD7OHFEARICCE4MLFDLE5DZU======/fastcb52e4c3f1d4e3c59089536098505a95.tar.gz", "--dest-dir", "/root", "--", "pyflyte-execute", "--inputs", "s3://my-s3-bucket/metadata/propeller/flytesnacks-development-avqvhx759fw9kqt6mh6v/n0/data/inputs.pb", "--output-prefix", "s3://my-s3-bucket/metadata/propeller/flytesnacks-development-avqvhx759fw9kqt6mh6v/n0/data/0", "--raw-output-data-prefix", "s3://my-s3-bucket/data/3d/avqvhx759fw9kqt6mh6v-n0-0", "--checkpoint-path", "s3://my-s3-bucket/data/3d/avqvhx759fw9kqt6mh6v-n0-0/_flytecheckpoints", "--prev-checkpoint", "\"\"", "--resolver", "flytekit.core.python_auto_container.default_task_resolver", "--", "task-module", "spark_local_example", "task-name", "hello_spark" ] }, "new_cluster": { "spark_version": "12.2.x-scala2.12", "spark_conf": { "spark.driver.memory": "1000M", "spark.executor.instances": "2", "spark.driver.cores": "1", "spark.executor.memory": "1000M", "spark.executor.cores": "1" }, "gcp_attributes": { "use_preemptible_executors": false }, "node_type_id": "n2-highmem-4", "enable_elastic_disk": false, "num_workers": 1 }, "state": { "life_cycle_state": "PENDING", "state_message": "Waiting for cluster", "user_cancelled_or_timedout": false }, "run_page_url": "https://359440087090042.2.gcp.databricks.com/?o=359440087090042#job/135287260562039/run/273988794563328", "start_time": 1699085986939, "setup_duration": 0, "execution_duration": 0, "cleanup_duration": 0, "end_time": 0, "cluster_instance": { "cluster_id": "1104-081950-xrvluew0" }, "attempt_number": 0 } ], "format": "MULTI_TASK" }Delete the job

{ }Get the job (TERMINATED State)

{ "job_id": 135287260562039, "run_id": 273988794563328, "creator_user_name": "flytesandboxgpu@gmail.com", "number_in_job": 273988794563328, "state": { "life_cycle_state": "TERMINATED", "result_state": "CANCELED", "state_message": "Run cancelled.", "user_cancelled_or_timedout": true }, "start_time": 1699085986939, "setup_duration": 0, "execution_duration": 0, "cleanup_duration": 23000, "end_time": 1699086010369, "run_name": "flytekit databricks plugin example", "run_page_url": "https://359440087090042.2.gcp.databricks.com/?o=359440087090042#job/135287260562039/run/273988794563328", "run_type": "SUBMIT_RUN", "tasks": [ { "run_id": 273988794563328, "task_key": "flytekit_databricks_plugin_example", "spark_python_task": { "python_file": "dbfs:/entrypoint.py", "parameters": [ "pyflyte-fast-execute", "--additional-distribution", "s3://my-s3-bucket/flytesnacks/development/3JXD7OHFEARICCE4MLFDLE5DZU======/fastcb52e4c3f1d4e3c59089536098505a95.tar.gz", "--dest-dir", "/root", "--", "pyflyte-execute", "--inputs", "s3://my-s3-bucket/metadata/propeller/flytesnacks-development-avqvhx759fw9kqt6mh6v/n0/data/inputs.pb", "--output-prefix", "s3://my-s3-bucket/metadata/propeller/flytesnacks-development-avqvhx759fw9kqt6mh6v/n0/data/0", "--raw-output-data-prefix", "s3://my-s3-bucket/data/3d/avqvhx759fw9kqt6mh6v-n0-0", "--checkpoint-path", "s3://my-s3-bucket/data/3d/avqvhx759fw9kqt6mh6v-n0-0/_flytecheckpoints", "--prev-checkpoint", "\"\"", "--resolver", "flytekit.core.python_auto_container.default_task_resolver", "--", "task-module", "spark_local_example", "task-name", "hello_spark" ] }, "new_cluster": { "spark_version": "12.2.x-scala2.12", "spark_conf": { "spark.driver.memory": "1000M", "spark.executor.instances": "2", "spark.driver.cores": "1", "spark.executor.memory": "1000M", "spark.executor.cores": "1" }, "gcp_attributes": { "use_preemptible_executors": false }, "node_type_id": "n2-highmem-4", "enable_elastic_disk": false, "num_workers": 1 }, "state": { "life_cycle_state": "TERMINATED", "result_state": "CANCELED", "state_message": "Run cancelled.", "user_cancelled_or_timedout": true }, "run_page_url": "https://359440087090042.2.gcp.databricks.com/?o=359440087090042#job/135287260562039/run/273988794563328", "start_time": 1699085986939, "setup_duration": 0, "execution_duration": 0, "cleanup_duration": 23000, "end_time": 1699086010369, "cluster_instance": { "cluster_id": "1104-081950-xrvluew0" }, "attempt_number": 0 } ], "format": "MULTI_TASK" }Test TaskLog proto for Databricks Console.

Tracking Issue
flyteorg/flyte#3936
flyteorg/flyte#4362
Related PRs
#1797
#2021