Skip to content

Commit 52041bb

Browse files
authored
CKN v0.2.0 Release (#43)
* update doc * update doc * update doc * update doc * update file location * update topics * update readthedocs * add CHANGELOG.md
1 parent 48c2a07 commit 52041bb

File tree

4 files changed

+376
-385
lines changed

4 files changed

+376
-385
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## [v0.2.0] - 2025-06-10
2+
3+
### Added
4+
- **Plugins:**
5+
- **ckn-mqtt-cameratraps**: MQTT-based camera trap ingestion plugin for edge event and image streaming. Enables scalable, decoupled data collection from edge devices. _(ICICLE)_
6+
- **experiment-alerts**: Automated experiment monitoring and alerting plugin. Detects low-accuracy experiments and publishes alerts to Kafka for downstream workflows. _(ICICLE)_
7+
- **ckn_inference_daemon**: Edge inference research plugin implementing FastAPI-based serving and model management. Intended for prototyping and experimentation. _(Research / Experimental)_
8+
- **Documentation:**
9+
- Added comprehensive documentation for new plugins and event topics (`docs/topics.md`), plugin usage, and deployment.
10+
- **Database:**
11+
- Introduced additional Neo4j indexes to improve query and analytics performance.
12+
13+
### Fixed
14+
- Improved experiment completion detection and ensured robust accuracy reporting in monitoring and alerting workflows.
15+
- Minor bug fixes, typo corrections, and formatting improvements throughout documentation and example configs.

README.md

Lines changed: 24 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,19 @@ CKN facilitates seamless connectivity between edge devices and the cloud through
2020

2121
CKN comprises several core components:
2222

23-
- **CKNDaemon** – A lightweight service that resides on each edge server. It manages communication with edge devices, handles requests, captures performance data, and deploys AI models as needed. The daemon connects with the cloud‑based CKN system via a pub/sub system, capturing real‑time events from edge devices (model usage, resource consumption, prediction accuracy, latency, and more).
23+
- **CKN Daemon** – A lightweight service that resides on each edge server. It manages communication with edge devices, handles requests, captures performance data, and deploys AI models as needed. The daemon connects with the cloud‑based CKN system via a pub/sub system, capturing real‑time events from edge devices (model usage, resource consumption, prediction accuracy, latency, and more).
2424
- **Event Streaming & Processing** – Stream‑processing techniques (for example, tumbling windows) aggregate events and generate real‑time alerts from edge‑device streams.
2525
- **Knowledge Graph** – A Neo4j graph database that stores historical and provenance information about applications, models, and edge events. This comprehensive view of the system enables CKN to track model usage and analyse performance over time.
2626

27-
The primary objective of CKN is to provide a robust framework for optimising AI‑application deployment and resource allocation at the edge. Leveraging real‑time event streaming and knowledge graphs, CKN efficiently handles AI workloads, adapts to changing requirements, and supports scalable edge–cloud collaboration.
28-
The CKN topics and their details are mentioned [here](https://github.com/Data-to-Insight-Center/cyberinfrastructure-knowledge-network/blob/main/docs/topics.md).
27+
The primary objective of CKN is to provide a robust framework for optimising AI‑application deployment and resource allocation at the edge. Leveraging real‑time event streaming and knowledge graphs, CKN efficiently handles AI workloads, adapts to changing requirements, and supports scalable edge–cloud collaboration.
2928

3029
Refer to this paper for more information: [https://ieeexplore.ieee.org/document/10254827](https://ieeexplore.ieee.org/document/10254827).
3130

3231
![CKN Design](docs/ckn-design.png)
3332

3433
---
3534

36-
## How‑To Guide
35+
## How‑To Guide
3736

3837
See the full [documentation](https://cyberinfrastructure-knowledge-network.readthedocs.io/en/latest/) for detailed instructions on creating custom plug‑ins and streaming events to the knowledge graph.
3938

@@ -69,38 +68,21 @@ docker compose ps
6968
docker compose -f examples/docker-compose.yml up -d --build
7069
```
7170

72-
- View the streamed data on the CKN dashboard: [http://localhost:8502/Camera\_Traps](http://localhost:8502/Camera_Traps)
73-
74-
- Access the Neo4j Browser: [http://localhost:7474/browser/](http://localhost:7474/browser/) (username `neo4j`, password `PWD_HERE`). Run:
75-
76-
```cypher
77-
MATCH (n) RETURN n;
78-
```
79-
80-
- Shut down services:
81-
82-
```bash
83-
make down
84-
docker compose -f examples/docker-compose.yml down
85-
```
86-
87-
## Tutorial
88-
89-
### Step 1 | Set Up Your Environment
71+
View the streamed data on the [CKN dashboard](http://localhost:8502/Camera_Traps) or open the [neo4j browser](http://localhost:7474/browser/) and log in with the credentials mentioned in the docker-compose file. Run `MATCH (n) RETURN n` to view the streamed data.
9072

73+
Shut down services using:
9174
```bash
92-
git clone https://github.com/Data-to-Insight-Center/cyberinfrastructure-knowledge-network.git
93-
cd cyberinfrastructure-knowledge-network
94-
make up # launches Kafka, Neo4j, and supporting services
75+
make down
76+
docker compose -f examples/docker-compose.yml down
9577
```
9678

97-
*Wait a few moments for all services to initialise.*
79+
## Tutorial: Create a Custom CKN Plug-in
9880

99-
### Step 2 | Create a CKN Topic
81+
#### 1. Create a CKN Topic
10082

101-
We will create a CKN topic named `temperature-sensor-data` to store temperature events.
83+
We will create a CKN topic named `temperature-sensor-data` to store temperature events. The CKN topics and their details are mentioned [here](docs/topics.md).
10284

103-
**Update `docker-compose.yml`** (root directory) and add the topic to the broker environment:
85+
Update `docker-compose.yml` (root directory) and add the topic to the broker environment:
10486

10587
```yaml
10688
services:
@@ -117,30 +99,19 @@ make up
11799
```
118100

119101

120-
### Step 3 | Produce Events
102+
#### 2. Produce Events
121103

122-
#### Install required libraries
123-
124-
```bash
125-
python -m venv venv
126-
source venv/bin/activate # or .\venv\Scripts\activate on Windows
127-
pip install confluent-kafka # <https://pypi.org/project/confluent-kafka/>
128-
```
129-
130-
#### Create the producer script – `produce_temperature_events.py`
104+
Create a producer script `produce_temperature_events.py` and run it.
131105

132106
```python
133107
from confluent_kafka import Producer
134108
import json, time
135109

136-
kafka_conf = {"bootstrap.servers": "localhost:9092"}
137-
producer = Producer(kafka_conf)
138-
139-
sensors = ["sensor_1", "sensor_2", "sensor_3"]
110+
producer = Producer({"bootstrap.servers": "localhost:9092"})
140111

141112
try:
142113
for i in range(10):
143-
for sensor_id in sensors:
114+
for sensor_id in ["sensor_1", "sensor_2", "sensor_3"]:
144115
event = {
145116
"sensor_id": sensor_id,
146117
"temperature": round(20 + 10 * (0.5 - time.time() % 1), 2),
@@ -154,33 +125,16 @@ except Exception as e:
154125
print(f"An error occurred: {e}")
155126
```
156127

157-
Run the producer:
128+
Open a shell inside the broker container and start the consumer. You should see JSON‑formatted temperature events.
158129

159130
```bash
160-
python produce_temperature_events.py
131+
kafka-console-consumer --bootstrap-server localhost:9092 --topic temperature-sensor-data --from-beginning
161132
```
162133

163-
### Step 4 | Consume and View Events
164-
165-
1. **Open a shell inside the broker container**
166-
167-
```bash
168-
docker exec -it broker bash # replace "broker" with the container name if different
169-
```
170-
171-
2. **Start the consumer**
172134

173-
```bash
174-
kafka-console-consumer --bootstrap-server localhost:9092 --topic temperature-sensor-data --from-beginning
175-
```
135+
#### 3. Connect to a Data Sink
176136

177-
You should see JSON‑formatted temperature events.
178-
179-
Press **Ctrl +C** (or **Ctrl + Break** on Windows) to exit.
180-
181-
### Step 5 | Connect to a Data Sink
182-
183-
#### Create connector configuration – `neo4jsink-temperature-connector.json`
137+
Create the connector configuration `neo4jsink-temperature-connector.json` and place the file in `ckn_broker/connectors/` (or your chosen directory).
184138

185139
```json
186140
{
@@ -205,53 +159,25 @@ Press **Ctrl +C** (or **Ctrl + Break** on Windows) to exit.
205159
}
206160
```
207161

208-
Place the file in `ckn_broker/connectors/` (or your chosen directory).
209-
210-
#### Register the connector – `setup_connector.sh`
162+
#### 4. Register the connector
211163

212164
```bash
213165
curl -X POST -H "Content-Type: application/json" \
214166
--data @/app/neo4jsink-temperature-connector.json \
215167
http://localhost:8083/connectors
216168
```
217169

218-
Restart CKN:
170+
Restart CKN and run the `temperature‑event` producer again.
219171

220172
```bash
221173
make down
222174
make up
223-
```
224175

225-
Run the temperature‑event producer again:
226-
227-
```bash
228176
python produce_temperature_events.py
229177
```
230178

231-
### Step 6 | Visualise Data
232-
233-
1. **Open the Neo4j browser:** [http://localhost:7474/browser/](http://localhost:7474/browser/)
234-
235-
2. **Log in** – username `neo4j`, password `PWD_HERE`.
236-
237-
3. **Query the graph:**
238-
239-
```cypher
240-
MATCH (s:Sensor)-[:REPORTED]->(r:TemperatureReading)
241-
RETURN s, r;
242-
```
243-
244-
4. **Explore** the graph using Neo4j visual tools.
245-
246-
---
247-
248-
## Next Steps
249-
250-
You have successfully set up a temperature‑monitoring use case with **CKN**, **Kafka**, and **Neo4j**. Consider:
251-
252-
- **Adding more sensors** to simulate a larger network.
253-
- Extending the cypher mapping to handle additional event attributes.
254-
- Integrating alerting or dashboarding tools for real‑time monitoring.
179+
Open [neo4j browser](http://localhost:7474/browser/) and log in with the credentials mentioned in the docker-compose file to view the streamed data.
180+
You have successfully set up a temperature‑monitoring plugin with CKN!
255181

256182
---
257183

@@ -261,4 +187,4 @@ The Cyberinfrastructure Knowledge Network (CKN) is copyrighted by the Indiana Un
261187

262188
## Acknowledgements
263189

264-
This research is funded in part by the National Science Foundation (award #2112606*AIInstitute for Intelligent CyberInfrastructure with Computational Learning in the Environment* \[ICICLE]) and by the *Data to Insight Center* (D2I) at Indiana University.
190+
This research is funded in part by the National Science Foundation (award #2112606*AI Institute for Intelligent CyberInfrastructure with Computational Learning in the Environment* \[ICICLE]) and by the *Data to Insight Center* (D2I) at Indiana University.

0 commit comments

Comments
 (0)