Skip to content

Commit 1182ff9

Browse files
committed
better control of roofer concurrency
1 parent 169601c commit 1182ff9

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

docker/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ DAGSTER_POSTGRES_DB="dagster"
1818
BAG3D_CONCURRENCY_JOB_AHN3=10
1919
BAG3D_CONCURRENCY_JOB_AHN4=10
2020
BAG3D_CONCURRENCY_JOB_AHN5=10
21-
BAG3D_CONCURRENCY_JOB_NL_RECONSTRUCT=10
21+
BAG3D_CONCURRENCY_JOB_NL_RECONSTRUCT=1
2222
BAG3D_CONCURRENCY_JOB_ARCHIVE=10
2323
BAG3D_CONCURRENCY_TOOL_TYLER=10
24+
BAG3D_CONCURRENCY_TOOL_ROOFER=10
2425

2526
# 3dbag-pipeline resource configuration
2627
DAGSTER_ENVIRONMENT="test"

packages/core/src/bag3d/core/assets/reconstruction/reconstruction.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ def __init__(self, schema: str, table_tiles: str, wkt: str = None):
8383
is_required=False,
8484
default_value="info",
8585
),
86+
"concurrency": Field(
87+
int,
88+
description="Roofer --jobs",
89+
is_required=False,
90+
default_value=10,
91+
),
8692
},
8793
)
8894
def reconstructed_building_models_nl(
@@ -114,7 +120,7 @@ def reconstructed_building_models_nl(
114120
try:
115121
return_code, output = context.resources.roofer.app.execute(
116122
exe_name="roofer",
117-
command=f"{{exe}} --config {{local_path}} {output_dir} --loglevel {context.op_config['loglevel']} --skip-pc-check",
123+
command=f"{{exe}} --config {{local_path}} {output_dir} -j {context.op_config['concurrency']} --loglevel {context.op_config['loglevel']} --skip-pc-check",
118124
local_path=roofer_toml,
119125
silent=False,
120126
)

packages/core/src/bag3d/core/jobs.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@
8484
selection=AssetSelection.assets(
8585
["reconstruction", "reconstructed_building_models_nl"]
8686
),
87+
config={
88+
"ops": {
89+
"reconstructed_building_models_nl": {
90+
"config": {
91+
"concurrency": int(getenv("BAG3D_CONCURRENCY_TOOL_ROOFER", 1))
92+
}
93+
}
94+
}
95+
},
8796
)
8897

8998
job_nl_reconstruct_debug = define_asset_job(
@@ -95,7 +104,11 @@
95104
config={
96105
"ops": {
97106
"reconstructed_building_models_nl": {
98-
"config": {"drop_views": False, "loglevel": "debug"}
107+
"config": {
108+
"drop_views": False,
109+
"loglevel": "debug",
110+
"concurrency": int(getenv("BAG3D_CONCURRENCY_TOOL_ROOFER", 1)),
111+
}
99112
}
100113
}
101114
},

0 commit comments

Comments
 (0)