Skip to content

Commit 25d5569

Browse files
authored
Merge pull request #87 from 3DBAG/fix/integrate-roofer
Fix/integrate roofer
2 parents 8caf905 + 78d044d commit 25d5569

26 files changed

+240
-643
lines changed

docker/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ DAGSTER_POSTGRES_DB="postgres_db"
66
TOOLS_DIR=/opt/3dbag-pipeline/tools
77

88
BAG3D_VENVS=/3dbag-pipeline/venvs
9+
BAG3D_FILESTORE=/data/volume
10+
BAG3D_RELEASE_VERSION=develop
911
BAG3D_TEST_DATA=/data/volume
1012
BAG3D_FLOORS_ESTIMATION_MODEL=/data/volume/model/pipeline_model1_gbr_untuned.joblib
1113
BAG3D_RELEASE_VERSION=test_version
@@ -27,6 +29,7 @@ TYLER_METADATA_JSON=/opt/3dbag-pipeline/tools/share/tyler/resources/geof/metadat
2729
EXE_PATH_TYLER=/opt/3dbag-pipeline/tools/bin/tyler
2830
EXE_PATH_TYLER_DB=/opt/3dbag-pipeline/tools/bin/tyler-db
2931
EXE_PATH_ROOFER_CROP=/opt/3dbag-pipeline/tools/bin/crop
32+
EXE_PATH_ROOFER_ROOFER=/opt/3dbag-pipeline/tools/bin/roofer
3033
EXE_PATH_ROOFER_RECONSTRUCT=/opt/3dbag-pipeline/tools/bin/geof
3134
FLOWCHART_PATH_RECONSTRUCT=/opt/3dbag-pipeline/tools/share/geoflow-bundle/flowcharts/reconstruct_bag.json
3235
EXE_PATH_OGR2OGR=/opt/3dbag-pipeline/tools/bin/ogr2ogr

docker/compose.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ services:
1111
POSTGRES_DB: $DAGSTER_POSTGRES_DB
1212
networks:
1313
- bag3d-dev-network
14+
volumes:
15+
- bag3d-dev-dagster-postgresql:/var/lib/postgresql/data
1416

1517
# This service stores the asset data that is generated by the pipeline
1618
data-postgresql:
@@ -76,15 +78,21 @@ services:
7678
data-postgresql:
7779
condition: service_healthy
7880
restart: true
81+
# Normally we wouldn't need watch:action:rebuild, but because we are using
82+
# dagster's DockerRunLauncher, it always starts a new container from the image, for
83+
# each run. While, watch:action:sync (or sync+restart)copies the changed local code into the
84+
# 3dbag-pipeline-core-develop container (not the image). But since DockerRunLauncher
85+
# doesn't actaully use this container, but always starts a new one, we have to build
86+
# a new image on each change.
7987
develop:
8088
watch:
81-
- action: sync
89+
- action: rebuild
8290
path: ../packages/common
8391
target: /opt/3dbag-pipeline/packages/common
8492
- action: rebuild
8593
path: ../packages/common/pyproject.toml
8694
target: /opt/3dbag-pipeline/packages/common/pyproject.toml
87-
- action: sync
95+
- action: rebuild
8896
path: ../packages/core
8997
target: /opt/3dbag-pipeline/packages/core
9098
- action: rebuild
@@ -115,13 +123,13 @@ services:
115123
restart: true
116124
develop:
117125
watch:
118-
- action: sync
126+
- action: rebuild
119127
path: ../packages/common
120128
target: /opt/3dbag-pipeline/packages/common
121129
- action: rebuild
122130
path: ../packages/common/pyproject.toml
123131
target: /opt/3dbag-pipeline/packages/common/pyproject.toml
124-
- action: sync
132+
- action: rebuild
125133
path: ../packages/floors_estimation
126134
target: /opt/3dbag-pipeline/packages/floors_estimation
127135
- action: rebuild
@@ -151,13 +159,13 @@ services:
151159
restart: true
152160
develop:
153161
watch:
154-
- action: sync
162+
- action: rebuild
155163
path: ../packages/common
156164
target: /opt/3dbag-pipeline/packages/common
157165
- action: rebuild
158166
path: ../packages/common/pyproject.toml
159167
target: /opt/3dbag-pipeline/packages/common/pyproject.toml
160-
- action: sync
168+
- action: rebuild
161169
path: ../packages/party_walls
162170
target: /opt/3dbag-pipeline/packages/party_walls
163171
- action: rebuild
@@ -228,6 +236,8 @@ volumes:
228236
external: true
229237
bag3d-dev-data-pipeline:
230238
external: true
239+
bag3d-dev-dagster-postgresql:
240+
external: true
231241
bag3d-dev-dagster-home:
232242
external: true
233243

docker/pipeline/bag3d-core.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM 3dgi/3dbag-pipeline-tools:2024.10.31 AS develop
1+
FROM 3dgi/3dbag-pipeline-tools:2024.11.09 AS develop
22
ARG BAG3D_PIPELINE_LOCATION=/opt/3dbag-pipeline
33

44
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"

docker/pipeline/bag3d-floors-estimation.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM 3dgi/3dbag-pipeline-tools:2024.10.31 AS develop
1+
FROM 3dgi/3dbag-pipeline-tools:2024.11.09 AS develop
22
ARG BAG3D_PIPELINE_LOCATION=/opt/3dbag-pipeline
33

44
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"

docker/pipeline/bag3d-party-walls.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM 3dgi/3dbag-pipeline-tools:2024.10.31 AS develop
1+
FROM 3dgi/3dbag-pipeline-tools:2024.11.09 AS develop
22
ARG BAG3D_PIPELINE_LOCATION=/opt/3dbag-pipeline
33

44
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"

makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ docker_volume_create:
2525
docker cp docker/dagster/dagster.yaml bag3d-dev-temp-container:/opt/dagster/dagster_home/
2626
docker cp docker/dagster/workspace.yaml bag3d-dev-temp-container:/opt/dagster/dagster_home/
2727
docker rm -f bag3d-dev-temp-container
28+
docker volume create bag3d-dev-dagster-postgresql
2829

2930
docker_volume_rm:
3031
docker volume rm -f bag3d-dev-data-pipeline
3132
docker volume rm -f bag3d-dev-data-postgresql
3233
docker volume rm -f bag3d-dev-dagster-home
34+
docker volume rm -f bag3d-dev-dagster-postgresql
3335

3436
docker_volume_recreate: docker_volume_rm docker_volume_create
3537

packages/common/src/bag3d/common/resources/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040

4141

4242
file_store = FileStoreResource(
43-
data_dir="/tmp", dir_id=os.getenv("BAG3D_RELEASE_VERSION")
43+
data_dir=os.getenv("BAG3D_FILESTORE"), dir_id=os.getenv("BAG3D_RELEASE_VERSION")
4444
)
4545
file_store_fastssd = FileStoreResource(
46-
data_dir="/tmp",
46+
data_dir=os.getenv("BAG3D_FILESTORE"),
4747
dir_id=os.getenv("BAG3D_RELEASE_VERSION"),
4848
)
4949

@@ -62,7 +62,10 @@
6262
exe_tyler=os.getenv("EXE_PATH_TYLER"), exe_tyler_db=os.getenv("EXE_PATH_TYLER_DB")
6363
)
6464

65-
roofer = RooferResource(exe_roofer_crop=os.getenv("EXE_PATH_ROOFER_CROP"))
65+
roofer = RooferResource(
66+
exe_crop=os.getenv("EXE_PATH_ROOFER_CROP"),
67+
exe_roofer=os.getenv("EXE_PATH_ROOFER_ROOFER"),
68+
)
6669

6770
geoflow = GeoflowResource(
6871
exe_geoflow=os.getenv("EXE_PATH_ROOFER_RECONSTRUCT"),

packages/common/src/bag3d/common/resources/executables.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,23 +435,28 @@ def app(self) -> AppImage:
435435
class RooferResource(ConfigurableResource):
436436
"""
437437
A RooferResource can be configured by providing the paths to
438-
Roofer `crop` executable on the local system.
438+
Roofer `crop` and `roofer` executables on the local system.
439439
440440
Example:
441441
442-
roofer_resource = RooferResource(exe_roofer_crop=os.getenv("EXE_PATH_ROOFER_CROP"))
442+
roofer_resource = RooferResource(exe_crop=os.getenv("EXE_PATH_ROOFER_CROP"),
443+
exe_roofer=os.getenv("EXE_PATH_ROOFER_ROOFER"))
443444
444445
After the resource has been instantiated, roofer (AppImage) can
445446
be acquired with the `app` property:
446447
447448
roofer = roofer_resource.app
448449
"""
449450

450-
exe_roofer_crop: str
451+
exe_crop: str
452+
exe_roofer: str
451453

452454
@property
453455
def exes(self) -> Dict[str, str]:
454-
return {"crop": self.exe_roofer_crop}
456+
return {
457+
"crop": self.exe_crop,
458+
"roofer": self.exe_roofer,
459+
}
455460

456461
@property
457462
def with_docker(self) -> bool:

packages/common/src/bag3d/common/utils/geodata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ def ogr2postgres(
216216
"-oo WRITE_GFS=NO",
217217
"-lco UNLOGGED=ON",
218218
"-lco SPATIAL_INDEX=NONE",
219+
"-lco GEOMETRY_NAME=wkb_geometry",
219220
'-f PostgreSQL PG:"{dsn}"',
220221
"/vsizip/{local_path}/{dataset}_{feature_type}.gml {feature_type}",
221222
]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ def ahn_filename(tile_id: str) -> str:
2525

2626

2727
def ahn_dir(root_dir: Path, ahn_version: int) -> Path:
28-
"""Create a directory path where to store the AHN LAZ files for the given AHN
28+
"""Return a directory path where to store the AHN LAZ files for the given AHN
2929
version."""
3030
return Path(root_dir) / "pointcloud" / f"AHN{ahn_version}"
3131

3232

3333
def ahn_laz_dir(root_dir: Path, ahn_version: int) -> Path:
34-
"""Create a directory path where to store the AHN LAZ files for the given AHN
34+
"""Return a directory path where to store the AHN LAZ files for the given AHN
3535
version."""
3636
return ahn_dir(root_dir, ahn_version) / "as_downloaded" / "LAZ"
3737

@@ -69,7 +69,7 @@ def download_ahn_index(
6969
"requestedEpsg": "28992",
7070
"outputFormat": "application/json",
7171
"CountDefault": "2000",
72-
"typeName": "layerId_14b12666-cfbb-4362-905a-8832afe5ffa8",
72+
"typeName": "layerId_1e56b6d6-3802-4246-a7ed-8f49824b85db",
7373
}
7474
logger.info(f"Downloading the AHN tile boundaries from {service_url}")
7575

0 commit comments

Comments
 (0)