Skip to content

Commit 72effdb

Browse files
committed
wip
1 parent e1695a6 commit 72effdb

File tree

5 files changed

+47
-20
lines changed

5 files changed

+47
-20
lines changed

.github/workflows/cite.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,46 @@ jobs:
1212
name: OGC Cite Validation (Features)
1313
runs-on: ubuntu-latest
1414

15+
services:
16+
db:
17+
image: docker.io/postgis/postgis
18+
env:
19+
POSTGRES_USER: postgres
20+
POSTGRES_PASSWORD: password
21+
POSTGRES_DB: ogcapi
22+
# Set health checks to wait until postgres has started
23+
options: >-
24+
--health-cmd pg_isready
25+
--health-interval 10s
26+
--health-timeout 5s
27+
--health-retries 5
28+
ports:
29+
- 5432:5432
30+
1531
steps:
1632
- name: Checkout
1733
uses: actions/checkout@v4
1834

19-
- name: Setup
20-
run: docker compose up --build -d
35+
- name: Load
36+
run: cargo run -p data-loader -- --input data/ne_110m_admin_0_countries.geojson --collection countries
37+
env:
38+
DATABASE_URL: "postgresql://postgres:password@localhost:5432/ogcapi"
39+
40+
- name: Run
41+
run: cargo run -p cite-service &
42+
env:
43+
APP_HOST: "0.0.0.0"
44+
APP_PORT: "8484"
45+
DATABASE_URL: "postgresql://postgres:password@db:5432/ogcapi"
2146

22-
- name: Check running containers
47+
- name: Check containers
2348
run: docker ps -a
2449

25-
- name: Build
26-
run: docker exec ogcapi cargo run -p data-loader -- --input data/ne_110m_admin_0_countries.geojson --collection countries
50+
- name: Check networks
51+
run: docker network ls
2752

28-
- name: Run
29-
run: docker exec -d ogcapi cargo run -p cite-service
53+
- name: Check running service
54+
run: curl http://host.docker.internal:8484
3055

3156
- name: Validate
3257
uses: OSGEO/[email protected]

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ services:
4747
command: tail -f /dev/null
4848
ports:
4949
- ${APP_PORT}:${APP_PORT}
50+
extra_hosts:
51+
- "host.docker.internal:host-gateway"
5052

5153
minio:
5254
image: docker.io/minio/minio

examples/cite-service/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ version = "0.1.0"
44
edition.workspace = true
55
publish = false
66

7-
[features]
8-
stac = []
97

108
[dependencies]
119
clap = { version = "4.5", features = ["derive", "env"] }
12-
dotenvy = "0.15.7"
1310
tokio = { version = "1.47", features = ["full"] }
1411
tracing = "0.1.41"
1512
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
@@ -18,6 +15,4 @@ ogcapi = { path = "../../ogcapi", version = "0.3", features = [
1815
"services",
1916
"common",
2017
"features",
21-
"greeter",
22-
"geojson-loader",
2318
] }

examples/cite-service/src/main.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ use clap::Parser;
22
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
33

44
use ogcapi::{
5-
processes::{gdal_loader::GdalLoader, geojson_loader::GeoJsonLoader, greeter::Greeter},
5+
processes::{geojson_loader::GeoJsonLoader, greeter::Greeter},
66
services::{AppState, Config, Service},
77
};
88

99
#[tokio::main]
1010
async fn main() {
11-
// setup env
12-
dotenvy::dotenv().ok();
13-
1411
// setup tracing
1512
tracing_subscriber::registry()
1613
.with(tracing_subscriber::EnvFilter::from_default_env())
@@ -24,10 +21,7 @@ async fn main() {
2421
let state = AppState::new_from(&config).await;
2522

2623
// Register processes/processors
27-
let state = state.processors(vec![
28-
Box::new(Greeter),
29-
Box::new(GeoJsonLoader),
30-
]);
24+
let state = state.processors(vec![Box::new(Greeter), Box::new(GeoJsonLoader)]);
3125

3226
// Build & run with hyper
3327
Service::new_with(&config, state).await.serve().await;

0 commit comments

Comments
 (0)