Jim Nisivoccia
03/09/2023, 9:29 PMJim Nisivoccia
03/09/2023, 9:39 PMZach
03/10/2023, 1:16 AMJim Nisivoccia
03/10/2023, 1:16 AMZach
03/10/2023, 1:19 AMZach
03/10/2023, 1:20 AMJim Nisivoccia
03/10/2023, 1:23 AMowen
03/10/2023, 10:46 PMJim Nisivoccia
03/13/2023, 4:23 PMJim Nisivoccia
03/13/2023, 4:25 PMowen
03/13/2023, 4:36 PMdatabricks_pyspark_step_launcher.configured(
{
"run_config": {
"run_name": "test_dagster",
"cluster": {"existing": "1111-111111-1111aaa1"},
"libraries": [
{"pypi": {"package": "dagster==1.2.1"}},
{"pypi": {"package": "dagster-pyspark==0.18.1"}},
{"pypi": {"package": "dagster-aws==0.18.1"}},
{"pypi": {"package": "dagster-databricks==0.18.1"}},
],
},
"databricks_host": "<http://dbc-1111111-1111.cloud.databricks.com|dbc-1111111-1111.cloud.databricks.com>",
"databricks_token": "dapi1111111111111111111111111",
"local_pipeline_package_path": str(Path(__file__).parent),
"secrets_to_env_variables": [],
"storage": {
"s3": {
"access_key_key": "access_key_key",
"secret_key_key": "secret_key_key",
"secret_scope": "secret-scope",
}
},
}
)
it looks mostly identical to what you shared, although it's possible that some of the values that were elided above might not be in the expected formatowen
03/13/2023, 4:38 PMSai Gopinath
03/13/2023, 5:11 PMowen
03/13/2023, 6:05 PMdatabricks_host
? also cc @rex if you've seen this beforerex
03/13/2023, 6:06 PMdatabricks_host
needs to start with `https://`: we switched to using the official Databricks Python client, which requires this formatSai Gopinath
03/13/2023, 6:36 PMhttps://
fixed the request issue in Uploading main file to DBFS
step. However, we are again getting the same error (attached) in Waiting for Databricks run 20643 to complete...
step. Thank youSai Gopinath
03/13/2023, 9:20 PM[0;31mUnboundLocalError[0m: local variable 'stderr_filepath' referenced before assignment
i think the file is databricks_step_main.py
Sai Gopinath
03/14/2023, 3:44 PMZach
03/14/2023, 4:08 PMdatabricks_step_main.py
either when I look at the latest version on github - https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-databricks/dagster_databricks/databricks_step_main.py#L112-L144
any chance that the /dagster_staging
prefix still needs to be created? I believe the directory needs to be accessible via /dbfs, so if you can't access it from within a notebook in Databricks then you won't be able to access it using Dagster. Have you tried pointing the staging_prefix
to a directory you've already mounted with /dbfs?Sai Gopinath
03/14/2023, 5:42 PMs3://
then it gave an error it needs to be absolute path. then tried with /bucket-name/....
, it failed again with the same error. Yes correct, dbfs is mounted on s3 in our case. How about your case? are you using S3 or Azure? Thats a good point you noted, i am going to next try with the inbuilt Databricks notebook. If it fails on Notebook, then we will have to look into the AWS policies. but another point though is that Databricks is able to create /cluster-logs/..
on S3 (dbfs:/ mounted on S3) while creating a new cluster that means it should have access to dbfs:/. Thanks once again.Zach
03/14/2023, 6:06 PM/dagster_staging
prefix where you'd expect it to be in S3 - it's obviously getting uploaded somewhere as the step launcher is getting to the point that it launches the job, but then when Databricks is trying to find the entrypoint file it doesn't seem to be able to, which says to me that the location the step launcher is uploading the step resources to is inaccessible from within your Databricks accountSai Gopinath
03/14/2023, 8:15 PM/dagster_staging
is present on s3 but /stdout.
file is not there (attached)
Is Databricks supposed to create this new file stdout
on dbfs and write its contents or is Databricks supposed to only update the existing file, which is previously created by Dagster?
Thanks for your helpZach
03/14/2023, 8:26 PMdagster-databricks==0.18.1
? I believe the error you're encountering is happening around [here](https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-databricks/dagster_databricks/databricks_pyspark_step_launcher.py#L276-L279) as the exception error message matches, but it should be trapping the exception and continuing without failing the jobZach
03/14/2023, 8:27 PMSai Gopinath
03/14/2023, 8:34 PMdagster-databricks==0.18.1
on both our local and Databricks clusterSai Gopinath
03/14/2023, 8:37 PMZach
03/14/2023, 8:54 PMSai Gopinath
03/14/2023, 9:13 PM[0;31mUnboundLocalError[0m: local variable 'stderr_filepath' referenced before assignment
Sai Gopinath
03/14/2023, 9:15 PMZach
03/14/2023, 9:22 PMSai Gopinath
03/14/2023, 10:33 PMZach
03/15/2023, 11:13 PMSai Gopinath
03/16/2023, 1:23 PMKeith Gross
03/16/2023, 3:27 PMRoman Maliushkin
06/06/2023, 11:20 AMRun `49361868` failed with result state: `FAILED`. Message: .
13:03:53.853
test
ERROR
Encountered exception 404 Client Error: Not Found for url: <https://HOST/api/2.0/dbfs/read?path=%2Fdagster_local%2Ff046fea8-92e9-458e-940c-0bae6c6df82e%2Ftest%2Fstdout&length=1048576>
Response from server:
{ 'error_code': 'RESOURCE_DOES_NOT_EXIST',
'message': 'No file or directory exists on path '
'/dagster_local/f046fea8-92e9-458e-940c-0bae6c6df82e/test/stdout.'} when attempting to load stdout logs for step test. Check the databricks console for more info.
13:03:54.455
test
ERROR
Encountered exception 404 Client Error: Not Found for url: <https://HOST/api/2.0/dbfs/read?path=%2Fdagster_local%2Ff046fea8-92e9-458e-940c-0bae6c6df82e%2Ftest%2Fstderr&length=1048576>
Response from server:
{ 'error_code': 'RESOURCE_DOES_NOT_EXIST',
'message': 'No file or directory exists on path '
'/dagster_local/f046fea8-92e9-458e-940c-0bae6c6df82e/test/stderr.'} when attempting to load stderr logs for step test. Check the databricks console for more info.
It is what is going on when try to run some JOB in local stage, but everything works on remote side. My Databricks resource config:
"local_dagster_job_package_path": str(Path(__file__).parent.parent.parent.parent),
"staging_prefix": "/dagster_local",
"databricks_host": "<https://HOST>",
"databricks_token": {"env": "DATABRICKS_TOKEN"},
"run_config": {
"run_name": "test_job",
"cluster": {"existing": "CLUSTER"},
},
"secrets_to_env_variables": [
{
"scope": "dagster",
"name": "DATABRICKS_TOKEN",
"key": "DATABRICKS_TOKEN",
},
"storage": {
"s3": {
"secret_scope": "global",
"access_key_key": "aws-access-key",
"secret_key_key": "aws-secret-key",
}
}
Rohan Meringenti
07/06/2023, 3:00 PMRohan Meringenti
07/06/2023, 3:33 PMdatabricks secrets list-secrets test_cluster
[
{
"key":"s3_access_key_key",
"last_updated_timestamp":1688610889511
},
{
"key":"s3_secret_key_key",
"last_updated_timestamp":1688610951504
}
]
and my resources defined as:
"pyspark_step_launcher": databricks_pyspark_step_launcher.configured(
{
"databricks_host": "<https://dbc-xxxxxx.cloud.databricks.com>",
"databricks_token": "dapixxxxxxxxx",
"run_config": {
"run_name": "dagster_run",
"cluster": {
"existing": "existing cluster"
},
"libraries": [
{"pypi": {"package": "dagster==1.2.1"}},
{"pypi": {"package": "dagster-pyspark==0.18.1"}},
{"pypi": {"package": "dagster-aws==0.18.1"}},
{"pypi": {"package": "dagster-databricks==0.18.1"}},
],
},
"secrets_to_env_variables": [],
"local_pipeline_package_path": str(Path(__file__).parent.parent),
"storage": {
"s3": {
"secret_scope": "test_cluster",
"access_key_key": "s3_access_key_key",
"secret_key_key": "s3_secret_key_key"
}
}
}
)
I think I did that rightRohan Meringenti
07/06/2023, 4:06 PM[0;31mUnboundLocalError[0m: local variable 'stderr_filepath' referenced before assignment
Rohan Meringenti
07/06/2023, 4:30 PM[0;31mFileNotFoundError[0m: [Errno 2] No such file or directory: '/dbfs//dagster_staging/a54d6b86-1909-4237-86df-fceec64b4601/databricks_test_table/code.zip'
I'm wondering if the //
after dbfs means it's looking in the wrong locationRohan Meringenti
07/06/2023, 5:28 PM