Skip to content

Commit deadba0

Browse files
committed
wip
1 parent e1695a6 commit deadba0

File tree

5 files changed

+51
-29
lines changed

5 files changed

+51
-29
lines changed

.github/workflows/cite.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,50 @@ 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+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
27+
ports:
28+
- 5432:5432
29+
1530
steps:
1631
- name: Checkout
1732
uses: actions/checkout@v4
1833

19-
- name: Setup
20-
run: docker compose up --build -d
21-
22-
- name: Check running containers
23-
run: docker ps -a
24-
25-
- name: Build
26-
run: docker exec ogcapi cargo run -p data-loader -- --input data/ne_110m_admin_0_countries.geojson --collection countries
34+
- name: Load
35+
run: cargo run -p data-loader -- --input data/ne_110m_admin_0_countries.geojson --collection countries
36+
env:
37+
DATABASE_URL: "postgresql://postgres:password@localhost:5432/ogcapi"
2738

2839
- name: Run
29-
run: docker exec -d ogcapi cargo run -p cite-service
40+
run: RUNNER_TRACKING_ID="" && cargo run -p cite-service &
41+
env:
42+
APP_HOST: "0.0.0.0"
43+
APP_PORT: "8484"
44+
DATABASE_URL: "postgresql://postgres:password@localhost:5432/ogcapi"
45+
46+
- name: Check running service
47+
# run: curl --retry 20 --retry-delay 5 -s -o /dev/null http://localhost:8484
48+
run: |
49+
until [ \
50+
"$(curl -s -w '%{http_code}' -o /dev/null "http://localhost:8484/")" \
51+
-eq 200 ]
52+
do
53+
sleep 5
54+
done
55+
3056
3157
- name: Validate
3258
uses: OSGEO/[email protected]
3359
with:
3460
test_suite_identifier: ogcapi-features-1.0
35-
test_session_arguments: iut=http://host.docker.internal:8484
61+
test_session_arguments: iut=http://0.0.0.0:8484

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 & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
use clap::Parser;
22
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
33

4-
use ogcapi::{
5-
processes::{gdal_loader::GdalLoader, geojson_loader::GeoJsonLoader, greeter::Greeter},
6-
services::{AppState, Config, Service},
7-
};
4+
use ogcapi::services::{AppState, Config, Service};
85

96
#[tokio::main]
107
async fn main() {
11-
// setup env
12-
dotenvy::dotenv().ok();
13-
148
// setup tracing
159
tracing_subscriber::registry()
16-
.with(tracing_subscriber::EnvFilter::from_default_env())
10+
.with(tracing_subscriber::EnvFilter::new("cite_service=debug,ogcapi=debug,sqlx=warn"))
1711
.with(tracing_subscriber::fmt::layer().pretty())
1812
.init();
1913

@@ -23,12 +17,6 @@ async fn main() {
2317
// Application state
2418
let state = AppState::new_from(&config).await;
2519

26-
// Register processes/processors
27-
let state = state.processors(vec![
28-
Box::new(Greeter),
29-
Box::new(GeoJsonLoader),
30-
]);
31-
3220
// Build & run with hyper
3321
Service::new_with(&config, state).await.serve().await;
3422
}

0 commit comments

Comments
 (0)