Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: environment/Dockerfile.server
file: environment/Dockerfile.runtime
push: true
build-args: |
VERSION=${{ steps.meta.outputs.version }}
Expand Down
File renamed without changes.
43 changes: 23 additions & 20 deletions environment/http/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
name: city2tabula

services:
city2tabula:
container_name: city2tabula-environment
city2tabula-cli:
container_name: city2tabula-cli
build:
context: ./../..
dockerfile: environment/Dockerfile
Expand All @@ -17,8 +17,6 @@ services:
- ./../../data:/app/data # mount full project for development
extra_hosts:
- "host.docker.internal:host-gateway" # Linux compatibility
ports:
- "${HOST_PORT:-5000}:5000" # map host port (configurable) to container port 8080
command: bash # start an interactive shell for development

city2tabula-db:
Expand All @@ -28,7 +26,7 @@ services:
POSTGRES_USER: ${C2T_DB_USER:-postgres}
POSTGRES_PASSWORD: ${C2T_DB_PASSWORD:-postgres}
POSTGRES_DB: ${C2T_DB_NAME:-city2tabula}
# No host port published: city2tabula-server reaches this over the
# No host port published: the city2tabula service reaches this over the
# compose default network by service name. Add one back if a host tool
# (psql, QGIS) needs direct access.
volumes:
Expand All @@ -40,21 +38,19 @@ services:
retries: 5

# The on-request HTTP wrapper (cmd/server), for TentaCron's proxy targets to
# reach. `go run` against the already-COPY'd source in the same dev image —
# no separate build target, matches the interactive `city2tabula` service.
# data/ is .dockerignore'd (mounted at runtime everywhere else in this repo
# too), so the TABULA CSV import needs the same volume mount as above.
city2tabula-server:
container_name: city2tabula-server
# Dockerfile.server, not Dockerfile: the server runs a compiled binary on a
# JRE base, where the interactive service needs the full toolchain image.
# reach. The same image also carries the CLI, so it can be run one-shot as a
# pipeline job without a second artefact.
city2tabula:
container_name: city2tabula
# Dockerfile.runtime, not Dockerfile: this runs compiled binaries on a JRE
# base, where the interactive service needs the full toolchain image.
# With both image and build set, `compose up` builds locally and tags the
# result, while `compose pull` fetches the published tag instead. A
# deployment pins C2T_IMAGE_TAG to a release rather than tracking latest.
image: ghcr.io/thd-spatial-ai/city2tabula-server:${C2T_IMAGE_TAG:-latest}
build:
context: ./../..
dockerfile: environment/Dockerfile.server
dockerfile: environment/Dockerfile.runtime
environment:
DB_HOST: city2tabula-db
DB_PORT: 5432
Expand All @@ -65,10 +61,13 @@ services:
SERVER_PORT: 5000
# PYLOVO_FDW_HOST intentionally unset: no PyLovo dataset behind this
# instance, leaves PyLovo linking a clean no-op (internal/process/pylovo_fdw.go).
# The image already carries data/tabula; this mount adds the 3D datasets
# under data/lod2 and data/lod3, which are gitignored and stay on the host.
# The dataset directories specifically, not data/ as a whole: the image
# bakes data/tabula, and mounting the parent would hide it behind the host's
# copy. A deployment then needs no TABULA files on the host at all, which is
# the configuration the image is built for and this file has to exercise.
volumes:
- ./../../data:/app/data
- ./../../data/lod2:/app/data/lod2
- ./../../data/lod3:/app/data/lod3
depends_on:
city2tabula-db:
condition: service_healthy
Expand All @@ -82,13 +81,17 @@ services:
# default is listed explicitly because naming any network here drops the
# implicit default membership, which is how city2tabula-db is reached.
networks:
- default
- tentacron-net
default: {}
tentacron-net:
# Former container name, kept until TentaCron's proxy targets use
# "city2tabula".
aliases:
- city2tabula-server

volumes:
city2tabula-db-data:

# A cross-repo caller reaches city2tabula-server by attaching to this project's
# A cross-repo caller reaches city2tabula by attaching to this project's
# network, rather than this file joining one another repo owns. Depending on
# another project's network meant depending on its project name, which is a side
# effect of its directory rather than anything it promised to keep: ignis renamed
Expand Down
3 changes: 0 additions & 3 deletions environment/http/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ COUNTRY=germany
# Note: These countries are available based on the TABULA and EPISCOPE project data. Therefore running pipeline on other countries is not supported.


# Application port mapping (host port -> container 8080)
# Change this if 8080 collides with another service
HOST_PORT=5000

# Database connection settings (Connect to host PostgreSQL)
DB_NAME=city2tabula_test
Expand Down
8 changes: 4 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ status: ## Check container status

##@ Application Commands
dev: ## Start development environment with shell
cd environment/http && docker compose --env-file docker.env up -d && docker exec -it city2tabula-environment bash
cd environment/http && docker compose --env-file docker.env up -d && docker exec -it city2tabula-cli bash

create-db: up ## Create database and setup schemas
cd environment/http && docker exec -it city2tabula-environment ./c2t -create-db
cd environment/http && docker exec -it city2tabula-cli ./c2t -create-db

extract-features: up ## Extract building features
cd environment/http && docker exec -it city2tabula-environment ./c2t -extract-features
cd environment/http && docker exec -it city2tabula-cli ./c2t -extract-features

reset-db: up ## Reset the entire database
cd environment/http && docker exec -it city2tabula-environment ./c2t -reset-db
cd environment/http && docker exec -it city2tabula-cli ./c2t -reset-db

##@ Complete Workflows
configure: ## Interactive configuration: select country and enter password
Expand Down
10 changes: 5 additions & 5 deletions setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -309,39 +309,39 @@ goto end
echo Starting development environment...
cd environment\http
docker compose --env-file docker.env up -d
docker exec -it city2tabula-environment bash
docker exec -it city2tabula-cli bash
cd ..\..
goto end

:create-db
call :up
echo Creating database and setting up schemas...
cd environment\http
docker exec -it city2tabula-environment ./c2t -create-db
docker exec -it city2tabula-cli ./c2t -create-db
cd ..\..
goto end

:extract-features
call :up
echo Extracting building features...
cd environment\http
docker exec -it city2tabula-environment ./c2t -extract-features
docker exec -it city2tabula-cli ./c2t -extract-features
cd ..\..
goto end

:reset-db
call :up
echo Resetting the entire database...
cd environment\http
docker exec -it city2tabula-environment ./c2t -reset-db
docker exec -it city2tabula-cli ./c2t -reset-db
cd ..\..
goto end

:version
call :up
echo Checking City2TABULA version...
cd environment\http
docker exec -it city2tabula-environment ./c2t -version
docker exec -it city2tabula-cli ./c2t -version
cd ..\..
goto end

Expand Down
10 changes: 5 additions & 5 deletions setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -198,39 +198,39 @@ function Invoke-Dev {
Write-Host "Starting development environment..." -ForegroundColor Blue
Set-Location "environment/http"
docker compose --env-file docker.env up -d
docker exec -it city2tabula-environment bash
docker exec -it city2tabula-cli bash
Set-Location "../.."
}

function Invoke-CreateDb {
Invoke-Up
Write-Host "Creating database and setting up schemas..." -ForegroundColor Blue
Set-Location "environment/http"
docker exec -it city2tabula-environment ./c2t -create-db
docker exec -it city2tabula-cli ./c2t -create-db
Set-Location "../.."
}

function Invoke-ExtractFeatures {
Invoke-Up
Write-Host "Extracting building features..." -ForegroundColor Blue
Set-Location "environment/http"
docker exec -it city2tabula-environment ./c2t -extract-features
docker exec -it city2tabula-cli ./c2t -extract-features
Set-Location "../.."
}

function Invoke-ResetDb {
Invoke-Up
Write-Host "Resetting the entire database..." -ForegroundColor Blue
Set-Location "environment/http"
docker exec -it city2tabula-environment ./c2t -reset-db
docker exec -it city2tabula-cli ./c2t -reset-db
Set-Location "../.."
}

function Invoke-Version {
Invoke-Up
Write-Host "Checking City2TABULA version..." -ForegroundColor Blue
Set-Location "environment/http"
docker exec -it city2tabula-environment ./c2t -version
docker exec -it city2tabula-cli ./c2t -version
Set-Location "../.."
}

Expand Down
Loading