databricks / cli

Databricks CLI
Other
132 stars 50 forks source link

Fetch output of databricks bundle run #1597

Closed dinjazelena closed 2 months ago

dinjazelena commented 2 months ago

Hey, i am triggering Databricks Job from CI/CD with Github Actions and i want to comment on PR of that Run URL that gets out of:

databricks bundle run job -t dev

I could not find a way, simply redirecting output to a file, does not write anything to it. I would also like to run this command in a attached mode and still get that Run URL. Do u have idea how to handle this?

pietern commented 2 months ago

Were you able to resolve this?

The command should print the task results upon job completion.

dinjazelena commented 2 months ago

Yeah so basically i wanted that Run URL, and Run URL gets printed to stderr while rest of the tasks logs gets printed to stdout.

When i tried by: databricks bundle run job -t dev > output.log It would not print that first line of output. It works with: databricks bundle run job -t dev > output.log 2>&1

Now with these commands output file gets filled after command is executed if someone need while running process: stdbuf -oL databricks bundle run job -dev 2>&1 | tee output.log