Stefan Adelbert
12/07/2021, 12:06 AMdagit
Some of my ops will use a resource that wraps a headless selenium webdriver. I'd like to take screenshots of the pages that the headless webdriver is interacting with and expose them via dagit
so that someone following up on a failed job can see what the headless webdriver was seeing.
Does anyone have any suggestions on how to achieve something like this?
I'd imagined that I could create a failure sensor that would get a screenshot from the webdriver resource and "put" it somewhere.Noah K
12/07/2021, 1:02 AMyield AssetMaterialization(
asset_key=AssetKey(["screenshots", asset["intermediary_bucket"], output_key]),
metadata_entries=[
EventMetadataEntry.md(
f"",
label="image",
),
],
)
Stefan Adelbert
12/07/2021, 1:43 AMAssetMaterialization
would be yielded. I would ideally like the capability to be generic such that the it could be applied to any job and if that job fails, the relevant resources would have their statused recorded, including screenshots for selenium resources.
And that reminds me that I noticed being able to record and retrieve debug info for a job. I'll look into that too.max
12/07/2021, 1:47 AMmrdavidlaing
12/07/2021, 9:04 PMGeorge Pearse
12/08/2021, 12:51 PMsandy
12/09/2021, 9:00 PMNoah K
12/09/2021, 9:04 PMStefan Adelbert
12/09/2021, 10:25 PMEventMetadata.url
to the AssetMaterialization
which allows me to click through to view a screenshot in a GCP Cloud Storage Bucket. The link requires authorization, which is actually a nice side effect. I guess the link could take me to a static HTML page with embedded images, if I wanted more than a simple image.
This'll do me.sandy
12/10/2021, 12:17 AMNoah K
12/10/2021, 12:17 AM