Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

fix: data-provider waits until rdf4j is up and running #30

Merged
merged 1 commit into from
Oct 13, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ target
*.iml
derby.log
/backend/src/main/resources/META-INF/
/frontend/.env.local
12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
services:

gipod-data-provider:
data-provider:
image: ghcr.io/informatievlaanderen/ldi-orchestrator:20230927142432
container_name: demonstrator_gipod-data-provider
container_name: demonstrator-data-provider
ports:
- 8082:8080
volumes:
- ./gipod.config.yml:/ldio/application.yml:ro
- ./rml:/ldio/rml:ro
- ./sparql:/ldio/sparql:ro
depends_on:
- demonstrator
- rdf4j-server
rdf4j-server:
condition: service_healthy
networks:
- demonstrator

Expand Down Expand Up @@ -51,6 +51,10 @@ services:
- "JAVA_OPTS=-Xms1g -Xmx4g"
ports:
- 8080:8080
restart: on-failure
healthcheck:
test: "curl --fail http://localhost:8080/rdf4j-workbench/repositories/test/summary || exit 1"
interval: 15s
networks:
- demonstrator

Expand Down
4 changes: 4 additions & 0 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# production
VITE_API_BASE_URL=https://demonstrator.smartdataspace.dev-vlaanderen.be
VITE_WS_BASE_URL=wss://demonstrator.smartdataspace.dev-vlaanderen.be

2 changes: 2 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import LeafletMap from './components/map/LeafletMap.vue'
import GlobalHeader from "@/components/headers/GlobalHeader.vue";
import MemberCounter from './components/membercounter/MemberCounter.vue'
import LineChart from "@/components/linechart/LineChart.vue";

console.log(import.meta.env)
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/linechart/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
methods: {
//websocket
connect() {
this.stompClient = new Stomp.client(`wss://demonstrator.smartdataspace.dev-vlaanderen.be/update`, {debug: false});
this.stompClient = new Stomp.client(`${import.meta.env.VITE_WS_BASE_URL}/update`, {debug: false});
this.stompClient.connect(
{},
() => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/map/LeafletMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {

mounted() {
this.connect()

console.log(import.meta.env.VITE_WS_BASE_URL);
this.map = L.map("map", {zoomAnimation: false, zoomControl: false}).setView([50.7747, 4.4852], 8)
L.control.zoom({position: "topright"}).addTo(this.map)
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
Expand Down Expand Up @@ -156,7 +156,7 @@ export default {
//websocket
connect() {
const decolouringTimeout = 1000;
this.stompClient = new Stomp.client(`wss://demonstrator.smartdataspace.dev-vlaanderen.be/update`, {debug: false});
this.stompClient = new Stomp.client(`${import.meta.env.VITE_WS_BASE_URL}/update`, {debug: false});
this.stompClient.connect(
{},
frame => this.subscribe(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/membercounter/MemberCounter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
methods: {
//websocket
connect() {
this.stompClient = new Stomp.client(`wss://demonstrator.smartdataspace.dev-vlaanderen.be/update`, {debug: false});
this.stompClient = new Stomp.client(`${import.meta.env.VITE_WS_BASE_URL}/update`, {debug: false});
this.stompClient.connect(
{},
() => {
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_API_BASE_URL: string
readonly VITE_WS_BASE_URL: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
}
5 changes: 1 addition & 4 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import vue from '@vitejs/plugin-vue'
export default defineConfig(({command, mode}) => {
const env = loadEnv(mode, process.cwd(), '')
return {
define: {
"process.env": env,
},
plugins: [
vue(),
],
Expand All @@ -23,7 +20,7 @@ export default defineConfig(({command, mode}) => {
origin: "*"
},
proxy: {
'/api': `https://demonstrator.smartdataspace.dev-vlaanderen.be`,
'/api': env.VITE_API_BASE_URL,
},

},
Expand Down
4 changes: 2 additions & 2 deletions gipod.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orchestrator:
input:
name: be.vlaanderen.informatievlaanderen.ldes.ldi.client.LdioLdesClient
config:
url: https://private-api.gipod.vlaanderen.be/api/v1/ldes/mobility-hindrances?generatedAtTime=2023-10-05T10:28:37.923Z
url: https://private-api.gipod.vlaanderen.be/api/v1/ldes/mobility-hindrances?generatedAtTime=2024-10-05T10:28:37.923Z
sourceFormat: application/ld+json
outputs:
- name: be.vlaanderen.informatievlaanderen.ldes.ldi.RepositoryMaterialiser
Expand Down Expand Up @@ -42,7 +42,7 @@ orchestrator:
outputs:
- name: be.vlaanderen.informatievlaanderen.ldes.ldi.RepositoryMaterialiser
config:
sparql-host: http://host.docker.internal:8080/rdf4j-server
sparql-host: http://rdf4j-server:8080/rdf4j-server
repository-id: test
- name: be.vlaanderen.informatievlaanderen.ldes.ldio.LdioHttpOut
config:
Expand Down
Loading