Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sat-etl): Use subprocess instead #134

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions local_archives/sat/eumetsat/eumetsat_iodc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Any

import dagster as dg
from dagster_docker import PipesDockerClient

from constants import LOCATIONS_BY_ENVIRONMENT

Expand All @@ -27,7 +26,7 @@
"source": dg.MetadataValue.text("eumetsat"),
"expected_runtime": dg.MetadataValue.text("TBD"),
},
compute_kind="docker",
compute_kind="subprocess",
automation_condition=dg.AutomationCondition.eager(),
tags={
# "dagster/max_runtime": str(60 * 60 * 10), # Should take 6 ish hours
Expand All @@ -41,27 +40,20 @@
)
def iodc_monthly(
context: dg.AssetExecutionContext,
pipes_docker_client: PipesDockerClient,
pipes_subprocess_client: dg.PipesSubprocessClient,
) -> Any:
image: str = "ghcr.io/openclimatefix/sat-etl:main"
it: dt.datetime = context.partition_time_window.start
return pipes_docker_client.run(
image=image,
return pipes_subprocess_client.run(
command=[
"iodc",
"-m",
"/home/dagster/mambaforge/envs/sat-etl/bin/python",
"/home/dagster/dags/containers/sat/download_process_sat.py",
"--month",
it.strftime("%Y-%m"),
"--path",
f"/store_a_0/sat/eumetsat/india",
f"/mnt/storage_a/sat/eumetsat/india",
"--rm",
],
env={
"EUMETSAT_CONSUMER_KEY": os.environ["EUMETSAT_CONSUMER_KEY"],
"EUMETSAT_CONSUMER_SECRET": os.environ["EUMETSAT_CONSUMER_SECRET"],
},
container_kwargs={
"volumes": [f"/store_a_0/sat/eumetsat/india:/store_a_0/sat/eumetsat/india"],
},
context=context,
).get_results()
).get_materialize_result()

Loading