Created
June 23, 2023 13:13
-
-
Save johschmidt42/6adb7f4a6b5ce452698ba66d495a2c09 to your computer and use it in GitHub Desktop.
This file contains 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
import uuid | |
from databricks.databricks_service import DatabricksService, SecretsConfig | |
def create_job_run_on_new_cluster(): | |
secret_config: SecretsConfig = SecretsConfig(_env_file="../.env") | |
databricks_service: DatabricksService = DatabricksService(secret_config) | |
job_id: str = str(uuid.uuid4()) | |
image_url: str = "databricksjobrunacr.azurecr.io/databricks-wheel-scripts:latest" | |
package_name: str = "dbscripts" | |
entry_point: str = "dbscript1" | |
databricks_service.create_job_run_on_new_cluster( | |
job_id=job_id, | |
image_url=image_url, | |
package_name=package_name, | |
entry_point=entry_point, | |
positional_arguments=["An argument in a new cluster"], | |
) | |
if __name__ == "__main__": | |
create_job_run_on_new_cluster() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment