Skip to content

Commit 4005235

Browse files
authored
Update README.md
1 parent 14756f5 commit 4005235

1 file changed

Lines changed: 0 additions & 130 deletions

File tree

fri/README.md

Lines changed: 0 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -29,133 +29,3 @@ $ cd ..
2929
$ python3 test.py
3030
````
3131

32-
# Building FRI Container
33-
34-
Now, we elaborate on building FRI as a container, together with the Kong API Gateway.
35-
36-
Connect to the Server VM, assuming x.x.x.x to be the IP address of your server.
37-
````
38-
$ ssh -i "controlcore.pem" ubuntu@x.x.x.x
39-
````
40-
Perform Git clone if this is the first time you are configuring the Server
41-
````
42-
$ git clone git@github.com/ControlCore-Project/concore.git
43-
````
44-
45-
First build the Docker Container of the FRI.
46-
````
47-
$ git pull
48-
49-
$ sudo docker build -t fri .
50-
````
51-
52-
# Running Control-Core FRI with Kong as containers
53-
54-
If you are already running FRI, make sure to stop and clear existing FRI container as it is likely conflict with the port. If there is Kong gateway running in default ports, stop and clear it too.
55-
````
56-
$ docker stop fri
57-
$ docker rm fri
58-
$ docker stop kong
59-
$ docker rm kong
60-
````
61-
62-
Start and configure Cassandra container for Kong API.
63-
````
64-
$ docker run -d --name kong-database \
65-
-p 9042:9042 \
66-
cassandra:3
67-
68-
69-
$ docker run --rm \
70-
--link kong-database:kong-database \
71-
-e "KONG_DATABASE=cassandra" \
72-
-e "KONG_PG_HOST=kong-database" \
73-
-e "KONG_PG_USER=kong" \
74-
-e "KONG_PG_PASSWORD=kong" \
75-
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
76-
kong kong migrations bootstrap
77-
````
78-
79-
Start Kong
80-
````
81-
$ docker run -d --name kong \
82-
--link kong-database:kong-database \
83-
-e "KONG_DATABASE=cassandra" \
84-
-e "KONG_PG_HOST=kong-database" \
85-
-e "KONG_PG_PASSWORD=kong" \
86-
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
87-
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
88-
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
89-
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
90-
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
91-
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
92-
-p 80:8000 \
93-
-p 8443:8443 \
94-
-p 8001:8001 \
95-
-p 8444:8444 \
96-
kong
97-
````
98-
99-
Start FRI container
100-
````
101-
$ nohup sudo docker run --name fri -p 8090:8081 fri > controlcore.out &
102-
````
103-
104-
Delete if there is a previously configured Kong service. If not, skip this step. First you need to find the ID-VALUE for the route with a GET command before deleting the route and service.
105-
````
106-
$ curl -X GET "http://localhost:8001/services/fri/routes"
107-
````
108-
Use the ID output from above to issue the delete command as below (issue this only if you have a previous conflicting service definiton in kong. Otherwise, skip this step):
109-
````
110-
$ curl -X DELETE "http://localhost:8001/services/fri/routes/ID-VALUE"
111-
112-
$ curl -X DELETE "http://localhost:8001/services/fri/"
113-
````
114-
115-
Define Kong Service and Route.
116-
117-
First Configure a Kong service, replacing the variable "private-ip" with the private IP address of your server below.
118-
````
119-
$ curl -i -X POST --url http://localhost:8001/services/ --data 'name=fri' --data 'url=http://private-ip:8090'
120-
````
121-
Then configure route to the service
122-
````
123-
$ curl -i -X POST --url http://localhost:8001/services/fri/routes --data 'paths=/'
124-
````
125-
126-
Now, controlcore.org is routed through the Kong APIs.
127-
128-
129-
# Troubleshooting the FRI
130-
131-
Connect to the Server VM
132-
````
133-
$ ssh -i "controlcore.pem" ubuntu@x.x.x.x
134-
````
135-
Check the Server logs.
136-
````
137-
$ tail -f controlcore.out
138-
````
139-
or
140-
````
141-
$ sudo docker logs fri -f
142-
````
143-
Find the FRI docker container
144-
````
145-
$ sudo docker ps
146-
````
147-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
148-
dfdd3b3d3308 fri "python main.py" 38 minutes ago Up 38 minutes 0.0.0.0:80->80/tcp fri
149-
150-
Access the container
151-
````
152-
$ sudo docker exec -it dfdd /bin/bash
153-
````
154-
155-
156-
157-
# Citing the CONTROL-CORE FRI
158-
159-
If you use the CONTROL-CORE FRI in your research, please cite the below paper:
160-
161-
* Kathiravelu, P., Arnold, M., Fleischer, J., Yao, Y., Awasthi, S., Goel, A. K., Branen, A., Sarikhani, P., Kumar, G., Kothare, M. V., and Mahmoudi, B. **CONTROL-CORE: A Framework for Simulation and Design of Closed-Loop Peripheral Neuromodulation Control Systems**. In IEEE Access. March 2022. https://doi.org/10.1109/ACCESS.2022.3161471

0 commit comments

Comments
 (0)