Skip to content

Commit 287aa2d

Browse files
merge
2 parents 3158650 + 6ae0a83 commit 287aa2d

File tree

14 files changed

+251
-102
lines changed

14 files changed

+251
-102
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build and Publish The Tools Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches:
8+
- "develop"
9+
- "pc-*"
10+
paths:
11+
- docker/tools/Dockerfile
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set docker image tag
20+
run: echo "DOCKER_TAG=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
21+
- name: Login to Docker Hub
22+
uses: docker/login-action@v3
23+
with:
24+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
25+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
- name: Build and push tools image
29+
uses: docker/build-push-action@v6
30+
with:
31+
context: ./
32+
file: ./docker/tools/Dockerfile
33+
builder: ${{ steps.buildx.outputs.name }}
34+
build-args: |
35+
JOBS=2
36+
VERSION=${{ env.DOCKER_TAG }}
37+
push: true
38+
tags: 3dgi/3dbag-pipeline-tools:${{ env.DOCKER_TAG }}
39+

docker/.env

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ TEMP_CONTAINER="${COMPOSE_PROJECT_NAME}-temp-container"
1212
# Dagster instance configuration
1313
DAGSTER_HOME="/opt/dagster/dagster_home"
1414
DAGSTER_SERVER_PORT=3003
15-
DAGSTER_POSTGRES_USER="postgres_user"
16-
DAGSTER_POSTGRES_PASSWORD="postgres_password"
17-
DAGSTER_POSTGRES_DB="postgres_db"
15+
DAGSTER_POSTGRES_USER="dagster"
16+
DAGSTER_POSTGRES_PASSWORD="dagster_pwd"
17+
DAGSTER_POSTGRES_DB="dagster"
1818

1919
# 3dbag-pipeline resource configuration
2020
DAGSTER_ENVIRONMENT="test"

docker/compose.yaml

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ services:
44
# and event log storage.
55
dagster-postgresql:
66
image: postgres:16
7-
container_name: bag3d-dagster-postgresql
7+
container_name: bag3d-dagster-postgresql-${BAG3D_DOCKER_IMAGE_TAG}
8+
healthcheck:
9+
test: [ "CMD-SHELL", "pg_isready -d ${DAGSTER_POSTGRES_DB} -U ${DAGSTER_POSTGRES_USER}" ]
10+
interval: 3s
11+
retries: 10
812
environment:
913
POSTGRES_USER: $DAGSTER_POSTGRES_USER
1014
POSTGRES_PASSWORD: $DAGSTER_POSTGRES_PASSWORD
@@ -23,14 +27,11 @@ services:
2327
- pg_pswd=$BAG3D_PG_PASSWORD
2428
- pg_db=$BAG3D_PG_DATABASE
2529
command: ["-c", "shared_buffers=8GB", "-c", "max_connections=200", "-c", "work_mem=30MB", "-c", "logging_collector=on", "-c", "log_statement=all", "-c", "log_directory=/var/log/postgresql/"]
26-
platform: linux/amd64
27-
container_name: bag3d-data-postgresql
30+
container_name: bag3d-data-postgresql-${BAG3D_DOCKER_IMAGE_TAG}
2831
healthcheck:
29-
test: ["CMD-SHELL", "pg_isready -d ${BAG3D_PG_DATABASE}"]
32+
test: ["CMD-SHELL", "pg_isready -d ${BAG3D_PG_DATABASE} -U {BAG3D_PG_USER}"]
3033
interval: 3s
31-
retries: 10
32-
start_period: 30s
33-
timeout: 10s
34+
retries: 20
3435
shm_size: '1gb'
3536
ports:
3637
- "${BAG3D_PG_PORT_ON_HOST}:5432"
@@ -62,9 +63,14 @@ services:
6263
dockerfile: docker/pipeline/bag3d-core.dockerfile
6364
args:
6465
- VERSION=develop
65-
container_name: 3dbag-pipeline-core
6666
image: 3dbag-pipeline-core:${BAG3D_DOCKER_IMAGE_TAG}
6767
pull_policy: build
68+
container_name: 3dbag-pipeline-core-${BAG3D_DOCKER_IMAGE_TAG}
69+
# the port is built into the image
70+
healthcheck:
71+
test: ["CMD-SHELL", "dagster api grpc-health-check -p 4000"]
72+
interval: 2s
73+
retries: 10
6874
restart: always
6975
environment:
7076
DAGSTER_CURRENT_IMAGE: "3dbag-pipeline-core:${BAG3D_DOCKER_IMAGE_TAG}"
@@ -106,9 +112,14 @@ services:
106112
dockerfile: docker/pipeline/bag3d-floors-estimation.dockerfile
107113
args:
108114
- VERSION=develop
109-
container_name: 3dbag-pipeline-floors-estimation
110115
image: 3dbag-pipeline-floors-estimation:${BAG3D_DOCKER_IMAGE_TAG}
111116
pull_policy: build
117+
container_name: 3dbag-pipeline-floors-estimation-${BAG3D_DOCKER_IMAGE_TAG}
118+
# the port is built into the image
119+
healthcheck:
120+
test: [ "CMD-SHELL", "dagster api grpc-health-check -p 4001" ]
121+
interval: 2s
122+
retries: 10
112123
restart: always
113124
environment:
114125
DAGSTER_CURRENT_IMAGE: "3dbag-pipeline-floors-estimation:${BAG3D_DOCKER_IMAGE_TAG}"
@@ -137,15 +148,21 @@ services:
137148
- action: rebuild
138149
path: ../packages/floors_estimation/pyproject.toml
139150
target: /opt/3dbag-pipeline/packages/floors_estimation/pyproject.toml
151+
140152
bag3d-party-walls:
141153
build:
142154
context: ../
143155
dockerfile: docker/pipeline/bag3d-party-walls.dockerfile
144156
args:
145157
- VERSION=develop
146-
container_name: 3dbag-pipeline-party-walls
147158
image: 3dbag-pipeline-party-walls:${BAG3D_DOCKER_IMAGE_TAG}
148159
pull_policy: build
160+
container_name: 3dbag-pipeline-party-walls-${BAG3D_DOCKER_IMAGE_TAG}
161+
# the port is built into the image
162+
healthcheck:
163+
test: [ "CMD-SHELL", "dagster api grpc-health-check -p 4002" ]
164+
interval: 2s
165+
retries: 10
149166
restart: always
150167
environment:
151168
DAGSTER_CURRENT_IMAGE: "3dbag-pipeline-party-walls:${BAG3D_DOCKER_IMAGE_TAG}"
@@ -183,6 +200,7 @@ services:
183200
context: ./dagster
184201
image: 3dgi/3dbag-pipeline-dagster:${BAG3D_DOCKER_IMAGE_TAG}
185202
pull_policy: build
203+
container_name: bag3d-dagster-webserver-${BAG3D_DOCKER_IMAGE_TAG}
186204
entrypoint:
187205
- dagster-webserver
188206
- -h
@@ -191,7 +209,6 @@ services:
191209
- "3000"
192210
- -w
193211
- workspace.yaml
194-
container_name: bag3d-dagster-webserver
195212
expose:
196213
- "3000"
197214
ports:
@@ -204,10 +221,18 @@ services:
204221
networks:
205222
- bag3d-network
206223
depends_on:
207-
- dagster-postgresql
208-
- bag3d-core
209-
- bag3d-floors-estimation
210-
- bag3d-party-walls
224+
dagster-postgresql:
225+
condition: service_healthy
226+
restart: true
227+
bag3d-core:
228+
condition: service_healthy
229+
restart: true
230+
bag3d-floors-estimation:
231+
condition: service_healthy
232+
restart: true
233+
bag3d-party-walls:
234+
condition: service_healthy
235+
restart: true
211236

212237
# This service runs the dagster-daemon process, which is responsible for taking runs
213238
# off of the queue and launching them, as well as creating runs from schedules or sensors.
@@ -216,10 +241,10 @@ services:
216241
context: ./dagster
217242
image: 3dgi/3dbag-pipeline-dagster:${BAG3D_DOCKER_IMAGE_TAG}
218243
pull_policy: build
244+
container_name: bag3d-dagster-daemon-${BAG3D_DOCKER_IMAGE_TAG}
219245
entrypoint:
220246
- dagster-daemon
221247
- run
222-
container_name: bag3d-dagster-daemon
223248
restart: on-failure
224249
env_file:
225250
- ./.env
@@ -229,10 +254,18 @@ services:
229254
networks:
230255
- bag3d-network
231256
depends_on:
232-
- dagster-postgresql
233-
- bag3d-core
234-
- bag3d-floors-estimation
235-
- bag3d-party-walls
257+
dagster-postgresql:
258+
condition: service_healthy
259+
restart: true
260+
bag3d-core:
261+
condition: service_healthy
262+
restart: true
263+
bag3d-floors-estimation:
264+
condition: service_healthy
265+
restart: true
266+
bag3d-party-walls:
267+
condition: service_healthy
268+
restart: true
236269

237270
volumes:
238271
bag3d-data-postgresql:

docker/pipeline/bag3d-core.dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM 3dgi/3dbag-pipeline-tools:2024.12.06 AS develop
1+
FROM 3dgi/3dbag-pipeline-tools:2024.12.14 AS develop
22
ARG BAG3D_PIPELINE_LOCATION=/opt/3dbag-pipeline
33

44
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"
@@ -20,7 +20,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2020
--python $VIRTUAL_ENV/bin/python
2121

2222
COPY . $BAG3D_PIPELINE_LOCATION
23-
COPY ./docker/.env $BAG3D_PIPELINE_LOCATION/.env
2423

2524
# Install the workflow package
2625
RUN --mount=type=cache,target=/root/.cache/uv \
@@ -32,4 +31,4 @@ EXPOSE 4000
3231

3332
# CMD allows this to be overridden from run launchers or executors that want
3433
# to run other commands against your repository
35-
CMD ["dagster", "code-server", "start", "-h", "0.0.0.0", "-p", "4000", "-m", "bag3d.core.code_location", "--inject-env-vars-from-instance"]
34+
CMD ["dagster", "code-server", "start", "-h", "0.0.0.0", "-p", "4000", "-m", "bag3d.core.code_location"]

docker/pipeline/bag3d-floors-estimation.dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM 3dgi/3dbag-pipeline-tools:2024.12.06 AS develop
1+
FROM 3dgi/3dbag-pipeline-tools:2024.12.14 AS develop
22
ARG BAG3D_PIPELINE_LOCATION=/opt/3dbag-pipeline
33

44
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"
@@ -20,7 +20,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \
2020
--python $VIRTUAL_ENV/bin/python
2121

2222
COPY . $BAG3D_PIPELINE_LOCATION
23-
COPY ./docker/.env $BAG3D_PIPELINE_LOCATION/.env
2423

2524
# Install the workflow package
2625
RUN --mount=type=cache,target=/root/.cache/uv \
@@ -32,4 +31,4 @@ EXPOSE 4001
3231

3332
# CMD allows this to be overridden from run launchers or executors that want
3433
# to run other commands against your repository
35-
CMD ["dagster", "code-server", "start", "-h", "0.0.0.0", "-p", "4001", "-m", "bag3d.floors_estimation.code_location", "--inject-env-vars-from-instance"]
34+
CMD ["dagster", "code-server", "start", "-h", "0.0.0.0", "-p", "4001", "-m", "bag3d.floors_estimation.code_location"]

docker/pipeline/bag3d-party-walls.dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM 3dgi/3dbag-pipeline-tools:2024.12.06 AS develop
1+
FROM 3dgi/3dbag-pipeline-tools:2024.12.14 AS develop
22
ARG BAG3D_PIPELINE_LOCATION=/opt/3dbag-pipeline
33

44
LABEL org.opencontainers.image.authors="Balázs Dukai <[email protected]>"
@@ -33,7 +33,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \
3333
--python $VIRTUAL_ENV/bin/python
3434

3535
COPY . $BAG3D_PIPELINE_LOCATION
36-
COPY ./docker/.env $BAG3D_PIPELINE_LOCATION/.env
3736

3837
# Install the workflow package
3938
RUN --mount=type=cache,target=/root/.cache/uv \
@@ -45,4 +44,4 @@ EXPOSE 4002
4544

4645
# CMD allows this to be overridden from run launchers or executors that want
4746
# to run other commands against your repository
48-
CMD ["dagster", "code-server", "start", "-h", "0.0.0.0", "-p", "4002", "-m", "bag3d.party_walls.code_location", "--inject-env-vars-from-instance"]
47+
CMD ["dagster", "code-server", "start", "-h", "0.0.0.0", "-p", "4002", "-m", "bag3d.party_walls.code_location"]

docker/tools/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ FROM roofer AS geoflow-old
100100
ARG JOBS=2
101101
ARG BAG3D_PIPELINE_LOCATION=/opt/3dbag-pipeline
102102

103-
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.04 /usr/local/bin/geof $BAG3D_PIPELINE_LOCATION/tools/bin/geof
104-
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.04 /export /export
105-
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.04 /usr/local/src/FileGDB/lib/. /usr/local/src/FileGDB/lib
106-
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.04 /usr/local/lib/libfgdbunixrtl.so /usr/local/lib/libfgdbunixrtl.so
107-
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.04 /usr/local/lib/LASlib /export/usr/local/lib/
108-
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.04 /usr/local/lib/gdalplugins /export/usr/local/lib/
109-
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.04 /usr/local/lib/geoflow-plugins/. $BAG3D_PIPELINE_LOCATION/tools/share/geoflow-bundle/plugins
103+
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.16 /usr/local/bin/geof $BAG3D_PIPELINE_LOCATION/tools/bin/geof
104+
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.16 /export /export
105+
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.16 /usr/local/src/FileGDB/lib/. /usr/local/src/FileGDB/lib
106+
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.16 /usr/local/lib/libfgdbunixrtl.so /usr/local/lib/libfgdbunixrtl.so
107+
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.16 /usr/local/lib/LASlib /export/usr/local/lib/
108+
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.16 /usr/local/lib/gdalplugins /export/usr/local/lib/
109+
COPY --link --from=3dgi/geoflow-bundle-builder:2024.12.16 /usr/local/lib/geoflow-plugins/. $BAG3D_PIPELINE_LOCATION/tools/share/geoflow-bundle/plugins
110110
ENV GF_PLUGIN_FOLDER=$BAG3D_PIPELINE_LOCATION/tools/share/geoflow-bundle/plugins
111111

112112
RUN echo /export/usr/local/lib >> /etc/ld.so.conf.d/geoflow.conf; \

packages/core/src/bag3d/core/assets/export/metadata.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,17 @@ def feature_evaluation(context):
9999
attributes_to_include = (
100100
"b3_pw_selectie_reden",
101101
"b3_pw_bron",
102-
"b3_puntdichtheid_ahn3",
103-
"b3_puntdichtheid_ahn4",
104-
"b3_mutatie_ahn3_ahn4",
105-
"b3_nodata_fractie_ahn3",
106-
"b3_nodata_fractie_ahn4",
107-
"b3_nodata_radius_ahn3",
108-
"b3_nodata_radius_ahn4",
102+
"b3_puntdichtheid_AHN3",
103+
"b3_puntdichtheid_AHN4",
104+
"b3_puntdichtheid_AHN5",
105+
"b3_mutatie_AHN3_AHN4",
106+
"b3_mutatie_AHN4_AHN5",
107+
"b3_nodata_fractie_AHN3",
108+
"b3_nodata_fractie_AHN4",
109+
"b3_nodata_fractie_AHN5",
110+
"b3_nodata_radius_AHN3",
111+
"b3_nodata_radius_AHN4",
112+
"b3_nodata_radius_AHN5",
109113
)
110114
cityobject_info = {lod: 0 for lod in lods}
111115
cityobject_info["has_geometry"] = False

packages/core/src/bag3d/core/assets/export/tile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def reconstruction_output_tiles_func(context, format: str, **kwargs: dict):
4444
)
4545
# # Set the parallelism in tyler from the dagster instance configuration (the dagster.yaml in $DAGSTER_HOME)
4646
# num_threads = context.instance.run_coordinator.inst_data.config_dict["max_concurrent_runs"]
47-
num_threads = 4
47+
num_threads = 40
4848
cmd = [
4949
f"RAYON_NUM_THREADS={num_threads}",
5050
"RUST_LOG=info",

0 commit comments

Comments
 (0)