Skip to content

Commit

Permalink
Update Scorpio
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Nov 16, 2023
1 parent 3ff91fc commit 32f9acd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 50 deletions.
4 changes: 2 additions & 2 deletions FIWARE Working with @context.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
""
]
},
"description": "New context data entities can be created by making a POST request to the `/ngsi-ld/v1/entities` endpoint and supply an `@context` along with structured **NGSI-LD** data.\n\nThe first request will take some time, as the context broker must navigate and load all of the files mentioned in the\n`@context`.\n\nSince the `Content-Type: application/ld+json` the `@context` is supplied in the body of the request. As with all **NGSI-LD** interactions, the core **NGSI-LD** `@context` ([`https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld`](https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld) is implicitly included as well.)\n\nThis means that the actual `@context` is:\n\n```jsonld\n{\n \"@context\": [\n \"http://context-provider:3000/data-models/ngsi-context.jsonld\",\n \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld\"\n ]\n}\n```\n\nwith the core `@context` being processed **last** and therefore overriding any terms previously defined with the same `@id`."
"description": "New context data entities can be created by making a POST request to the `/ngsi-ld/v1/entities` endpoint and supply an `@context` along with structured **NGSI-LD** data.\n\nThe first request will take some time, as the context broker must navigate and load all of the files mentioned in the\n`@context`.\n\nSince the `Content-Type: application/ld+json` the `@context` is supplied in the body of the request. As with all **NGSI-LD** interactions, the core **NGSI-LD** `@context` ([`https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld`](https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld) is implicitly included as well.)\n\nThis means that the actual `@context` is:\n\n```jsonld\n{\n \"@context\": [\n \"http://context-provider:3000/data-models/ngsi-context.jsonld\",\n \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld\"\n ]\n}\n```\n\nwith the core `@context` being processed **last** and therefore overriding any terms previously defined with the same `@id`."
},
"response": []
},
Expand Down Expand Up @@ -245,7 +245,7 @@
}
]
},
"description": "This example returns the data of all `Building` entities within the context data The `type` parameter is mandatory for\nNGSI-LD and is used to filter the response. The Accept HTTP header is needed to retrieve JSON-LD content in the response body.\n\nSince no explicit `@context` was sent in the request, the response returns the Core `@context` by default (`https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld`) and\nall attributes are expanded whenever possible.\n\n- `id`, `type`, `location` and `name`are defined in the core context and are not expanded.\n- `address` has been mapped to `http://schema.org/address`\n- `category` has been mapped to `https://uri.fiware.org/ns/data-models#category`\n\nNote that if an attribute has not been not associated to an FQN when the entity was created, the short name will\n**always** be displayed."
"description": "This example returns the data of all `Building` entities within the context data The `type` parameter is mandatory for\nNGSI-LD and is used to filter the response. The Accept HTTP header is needed to retrieve JSON-LD content in the response body.\n\nSince no explicit `@context` was sent in the request, the response returns the Core `@context` by default (`https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld`) and\nall attributes are expanded whenever possible.\n\n- `id`, `type`, `location` and `name`are defined in the core context and are not expanded.\n- `address` has been mapped to `http://schema.org/address`\n- `category` has been mapped to `https://uri.fiware.org/ns/data-models#category`\n\nNote that if an attribute has not been not associated to an FQN when the entity was created, the short name will\n**always** be displayed."
},
"response": []
},
Expand Down
2 changes: 1 addition & 1 deletion data-models/ngsi-context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"fiware": "https://uri.fiware.org/ns/dataModels#",
"schema": "https://schema.org/",
"tutorial": "https://ngsi-ld-tutorials.readthedocs.io/en/latest/datamodels.html#",
"Building": "fiware:Building",
"Building": "https://uri.fiware.org/ns/dataModels#Building",
"Device": "fiware:Device",
"Animal": "fiware:Animal",
"Female": "schema:Female",
Expand Down
55 changes: 12 additions & 43 deletions docker-compose/scorpio-aaio.yml → docker-compose/scorpio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,20 @@
# see: https://github.com/FIWARE/helm-charts/
#
version: "3.9"

services:
zookeeper:
labels:
org.fiware: 'tutorial'
image: zookeeper
hostname: zookeeper
container_name: zookeeper
networks:
- default
ports:
- "2181"
logging:
driver: none
kafka:
# Scorpio is the context broker
scorpio:
labels:
org.fiware: 'tutorial'
image: bitnami/kafka
hostname: kafka
container_name: kafka
image: quay.io/fiware/scorpio:java-${SCORPIO_VERSION}
hostname: scorpio
container_name: fiware-scorpio
networks:
- default
ports:
- "9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_PORT: 9092
KAFKA_LOG_RETENTION_MS: 10000
KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS: 5000
ALLOW_PLAINTEXT_LISTENER: "yes"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "${EXPOSED_PORT}:${SCORPIO_PORT}"
depends_on:
- zookeeper
logging:
driver: none
- postgres
postgres:
labels:
org.fiware: 'tutorial'
Expand All @@ -70,19 +47,8 @@ services:
POSTGRES_DB: ngb
logging:
driver: none
scorpio:
labels:
org.fiware: 'tutorial'
image: scorpiobroker/all-in-one-runner:java-kafka-${SCORPIO_VERSION}
hostname: scorpio
container_name: fiware-scorpio
networks:
- default
ports:
- "${EXPOSED_PORT}:${SCORPIO_PORT}"
depends_on:
- postgres
- kafka
volumes:
- postgres-db:/var/lib/postgresql/data

# Tutorial acts as a series of dummy IoT Sensors over HTTP and connects to the Scorpio Broker
tutorial:
Expand All @@ -91,3 +57,6 @@ services:
- DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT} # Port used by the dummy IOT devices to receive commands
- DUMMY_DEVICES_TRANSPORT=HTTP # Default transport used by dummy Io devices
- CONTEXT_BROKER=http://scorpio:${SCORPIO_PORT}/ngsi-ld/v1 # URL of the context broker to update context

volumes:
postgres-db: ~
8 changes: 4 additions & 4 deletions services
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ waitForScorpio () {
while [ "${response}" -eq 000 ]
do
echo -e "Context Broker HTTP state: ${response} (waiting for 500)"
pause 60
pause 6
getHeartbeat "${SCORPIO}"
done
}
Expand Down Expand Up @@ -173,10 +173,10 @@ case "${command}" in
export $(cat .env | grep "#" -v)
stoppingContainers
waitForCoreContext
echo -e "Starting containers: \033[1;34mScorpio\033[0m, \033[1mKafka\033[0m, \033[1mZookeeper\033[0m, a linked data \033[1mContext\033[0m and a \033[1mPostgres\033[0m database."
echo -e "Starting containers: \033[1;34mScorpio\033[0m, a linked data \033[1mContext\033[0m and a \033[1mPostgres\033[0m database."
echo -e "- \033[1;34mScorpio\033[0m is the context broker"
echo -e "- Data models \033[1m@context\033[0m (Smart Farm) is supplied externally"
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio-aaio.yml up -d --remove-orphans --renew-anon-volumes
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio.yml up -d --remove-orphans --renew-anon-volumes
displayServices "scorpio|fiware"
waitForScorpio
waitForUserContext
Expand Down Expand Up @@ -207,7 +207,7 @@ case "${command}" in
export $(cat .env | grep "#" -v)
echo "Pulling Docker images"
docker pull -q quay.io/curl/curl
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio-aaio.yml -f docker-compose/orion-ld.yml -f docker-compose/stellio.yml pull
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio.yml -f docker-compose/orion-ld.yml -f docker-compose/stellio.yml pull
;;
*)
echo "Command not Found."
Expand Down

0 comments on commit 32f9acd

Please sign in to comment.