Skip to content

Commit

Permalink
Merge pull request #113 from SSU-NC/dev
Browse files Browse the repository at this point in the history
Merge dev as master for release.
  • Loading branch information
KumKeeHyun authored Nov 17, 2020
2 parents 893bfa2 + 837e2ec commit dcdcf22
Show file tree
Hide file tree
Showing 41 changed files with 2,982 additions and 610 deletions.
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## How to contribute to toiot

#### **Did you find a bug?**

* **Ensure the bug was not already reported** by searching on GitHub under [issues](https://github.com/ssu-nc/toiot/issues).

* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/ssu-nc/toiot/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.

#### **Did you write a patch that fixes a bug?**

* Open a new GitHub pull request with the patch.

* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

#### **Did you fix whitespace, format code, or make a purely cosmetic patch?**

Changes that are cosmetic in nature and do not add anything substantial to the stability, functionality, or testability of `toiot` will generally not be accepted.

#### **Do you intend to add a new feature or change an existing one?**

* Suggest your change in the [toiot issues](https://github.com/ssu-nc/toiot/issues) and start writing code.

* Do not open an issue on GitHub until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports and fixes.

#### **Do you want to contribute to the toiot documentation?**

* Please read and update [toiot document](https://github.com/ssu-nc/toiot/blob/master/README.md) or [toiot wiki](https://github.com/SSU-NC/toiot/wiki).

Thanks!

Yoonje Choi
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# Toiot
Internet of Things platform for device management, data collection, analytics and visualization and more. Toiot provides a powerful enterprise-class platform for those with little web skills, and provides drivers for sensors and hardware boards.

![ToIoT_image](https://user-images.githubusercontent.com/44857109/92562031-42f8f800-f2b0-11ea-8e5d-e6ddc3ae7e20.PNG)
<img width="1856" alt="toiot_arch" src="https://user-images.githubusercontent.com/38535571/98469939-d48bd400-2225-11eb-9dd7-ccbce2ebe750.png">


Table of contents
=================
Expand All @@ -25,7 +26,8 @@ Output
- Sink and Sensor Mangement
![sink_register](https://user-images.githubusercontent.com/38535571/92531650-ae6ba700-f269-11ea-8cd4-b9ba0e04c24f.png)<br>
![sensor_register](https://user-images.githubusercontent.com/38535571/92531663-b9263c00-f269-11ea-9896-25ba747deb55.png)<br>
![sensor_table](https://user-images.githubusercontent.com/38535571/92531768-e7a41700-f269-11ea-80b7-a0f8c37ccaf2.png)
![register_node_ex](https://user-images.githubusercontent.com/59961690/93308957-e8c2de80-f83d-11ea-8fb7-97688f9be285.png)<br>
![node_table_map](https://user-images.githubusercontent.com/44857109/99204296-8a43bd80-27f8-11eb-9643-dc74f02edfe7.png)
- Service
![service](https://user-images.githubusercontent.com/38535571/92531789-f5599c80-f269-11ea-963a-269f53424760.gif)

Expand All @@ -50,9 +52,22 @@ $ docker-compose up
$ docker-compose down
```

#### Port Forwarding
|Host|Container|Service|
|:---:|:---:|:---:|
|3307|3306|mysql|
|8081|8081|application|
|8082|8082|logic|
|8083|8083|health check|
|3000|3000|ui|
|2181|2181|zookeeper|
|9092|9092|kafka|
|9200|9200|elasticsearch|
|5601|5601|kibana|

Installation & Run
=======
This document describes how to personally set up and use this platform. You can launch applications on multiple servers, or you can set various options to make use of a lot of resources.
This document describes how to personally set up and use this platform. You can launch applications on multiple servers, or you can set various options to make use of a lot of computing resources.
* [User Interface](./ui/README.md)
* [Backend Server](./application/README.md)

Expand All @@ -68,7 +83,7 @@ yoonje.choi.dev@gmail.com
License
=======
```
Copyright 2020 Keehyun Kum, Haegyeong Im, Jungsu Kim, Sehee Jung, Yoonje Choi
Copyright 2020 Keehyun Kum, Haegyeong Im, Jungsu Kim, Sehee Jeong, Yoonje Choi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
49 changes: 20 additions & 29 deletions application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@

# Installation
```bash
$ go get github.com/KumKeeHyun/PDK
$ go get github.com/KumKeeHyun/toiot
```
or
```bash
// toiot/application
$ go get github.com/KumKeeHyun/PDK/application
$ go get github.com/KumKeeHyun/toiot/application

// toiot/logic-core
$ go get github.com/KumKeeHyun/PDK/logic-core
$ go get github.com/KumKeeHyun/toiot/logic-core

// toiot/health-check
$ go get github.com/KumKeeHyun/PDK/health-check
// toiot/health-check (will be implemented in later version)
$ go get github.com/KumKeeHyun/toiot/health-check
```

## docker
```bash
// latest tag is 0.3
// latest tag is 0.0.1

// toiot/application
$ docker pull kbzjung359/pdk-app
$ docker pull kbzjung359/toiot-app:0.0.1

// toiot/logic-core
$ docker pull kbzjung359/pdk-logic
$ docker pull kbzjung359/toiot-logic:0.0.1

// toiot/health-check
$ docker pull kbzjung359/pdk-health
// toiot/health-check (will be implemented in later version)
$ docker pull kbzjung359/toiot-health
```

or
Expand Down Expand Up @@ -59,20 +59,24 @@ The setting value of each microservice is set by reading environment variables.
### toiot/application (Registration)
|Key|Example|Explain|
|------|------|------|
|APP_SERVER|127.0.0.1:8081|Registration microservice address|
|LOGIC_SERVER|127.0.0.1:8082|Logic microservice address|
|APP_SERVER|0.0.0.0:8081|Registration microservice address|
|DB_DRIVER|mysql|DBMS type|
|DB_SERVER|localhost:3306|DBMS address|
|DB_USER|pdk|User name|
|DB_PASS|pdk1234|User password|
|DB_DATABASE|pdk-db|mysql database name|
|TOPIC_NAME|sensor-data|default kafka topic for registration info|
|TOPIC_PARTITIONS|1|topic's partitions|
|TOPIC_RePLICATIONS|1|topic's replications|

- Currently DBMS only supports mysql
- This service does not create Kafka topics to Kafka Automatically. Just register DB information for logic-service.

### toiot/logic-core (Logic)
### toiot/logic-core (Sensor Data Stream Processing)
|Key|Example|Explain|
|------|------|------|
|LOGIC_SERVER|127.0.0.1:8082|Logic microservice address|
|LOGIC_SERVER|0.0.0.0:8082|Logic microservice address|
|LOGIC_LISTEN|10.5.110.1:8082|Externally accessible address|
|APP_SERVER|127.0.0.1:8081|Registration microservice server address|
|KAFKA_BROKER|localhost:9092|Kafka Cluster address|
|KAFKA_GROUP|logic-core|Kafka consumer group id|
Expand All @@ -83,19 +87,6 @@ The setting value of each microservice is set by reading environment variables.
|ELASTIC_BUFSIZE|500|channel size of stream process in goroutines|
|ELASTIC_BATCHTICKER|5|Bulk Indexing interval second|
|ELASTIC_BATCHSIZE|400|Bulk Indexing documents size|
|MONGO_ADDR|127.0.0.1|MongoDB address for logic repository|
|MONGO_PORT|27017|MongoDB port|


### toiot/health-check (Health Check)
|Key|Example|Explain|
|------|------|------|
|HEALTH_SERVER|127.0.0.1:8083|Health microservice address|
|LOGIC_SERVER|127.0.0.1:8081|Logic microservice address|
|KAFKA_BROKER|localhost:9092|Kafka Cluster address|
|KAFKA_GROUP|health-check|Kafka consumer group id|
|KAFKA_TOPIC|health-data|Kafka topic to steam sensor data|
|KAFKA_BUFSIZE|100|channel size for stream process in goroutines|
|STATUS_COUNT|5|count to judge health state|
|STATUS_TICK|30| interval second to subtract|
|STATUS_DROP|12|drop metadata in repository interval hour when red state is maintained|
- Kafka topics must be prepared before running the service.
- Because LOGIC_LISTEN is used when calling from the application service to this service, external access must be possible.
15 changes: 15 additions & 0 deletions application/adapter/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,18 @@ func (p Page) IsBinded() bool {
func (p Page) GetOffset() int {
return (p.Page - 1) * p.Size
}

type SinkPage struct {
Sinks []model.Sink `json:"sinks"`
Pages int `json:"pages"`
}

type NodePage struct {
Nodes []model.Node `json:"nodes"`
Pages int `json:"pages"`
}

type SensorPage struct {
Sensors []model.Sensor `json:"sensors"`
Pages int `json:"pages"`
}
Loading

0 comments on commit dcdcf22

Please sign in to comment.