Skip to content

Commit cf57955

Browse files
authored
Added configuration documentation. (#239)
1 parent 9121ed9 commit cf57955

File tree

5 files changed

+147
-32
lines changed

5 files changed

+147
-32
lines changed

src/main/resources/application.properties

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ ei.backend.instances.list.json.content=
2424
#ei.backend.instances.list.json.content=[{ "contextPath": "", "port": "8090", "name": "EI-Backend-1", "host": "localhost", "https": false, "defaultBackend": true}]
2525

2626
###### EI Documentation Link Url ##########
27-
ei.eiffel.documentation.urls={ "EI Frontend GitHub": "https://github.com/eiffel-community/eiffel-intelligence-frontend",\
28-
"EI Backend GitHub": "https://github.com/eiffel-community/eiffel-intelligence",\
27+
ei.eiffel.documentation.urls={ "EI front-end documentation": "https://eiffel-community.github.io/eiffel-intelligence-frontend",\
28+
"EI front-end GitHub": "https://github.com/eiffel-community/eiffel-intelligence-frontend",\
29+
"EI back-end documentation": "https://eiffel-community.github.io/eiffel-intelligence",\
30+
"EI back-end GitHub": "https://github.com/eiffel-community/eiffel-intelligence",\
2931
"Eiffel Github main page": "https://github.com/eiffel-community/eiffel",\
30-
"Test Rules User Guide": "https://github.com/eiffel-community/eiffel-intelligence-frontend/blob/master/wiki/markdown/test-rules.md" }
32+
"User guide for test rules page": "https://github.com/eiffel-community/eiffel-intelligence-frontend/blob/master/wiki/markdown/test-rules.md" }
3133

3234
#### LOGGING #########
3335
logging.level.root: INFO

wiki/markdown/configuration.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Configuration
2+
3+
To be able to execute and use Eiffel-Intelligence front-end, some configuration need to provided.
4+
All configurations is made via application.properties file. These properties can also be provided as Java properties arguments as well.
5+
6+
## Eiffel-Intelligence back-end
7+
8+
Eiffel-Intelligence front-end is dependent that at least one EI back-end instance is up and running.
9+
It is possible to configure several EI Backend instances.
10+
11+
EI back-end instances is configured by setting **ei.backend.instances.list.json.content** property, example:
12+
13+
ei.backend.instances.list.json.content=[{ "contextPath": "", "port": "8090", "name": "EI-Backend-1", "host": "ei-backend-host-1", "https": false, "defaultBackend": true},\
14+
{ "contextPath": "", "port": "8090", "name": "EI-Backend-2", "host": "ei-backend-host-2", "https": false, "defaultBackend": false},\
15+
{ "contextPath": "", "port": "8090", "name": "EI-Backend-3", "host": "ei-backend-host-3", "https": false, "defaultBackend": false},\
16+
{ "contextPath": "", "port": "8090", "name": "EI-Backend-4", "host": "ei-backend-host-4", "https": false, "defaultBackend": false}]
17+
18+
You can set as many EI back-end instances as you intend to use.
19+
20+
## Eiffel-Intelligence front-end server settings
21+
22+
Which port EIffel-Intelligence front-end web-server should be started with is set by the property **server.port**:
23+
24+
server.port=8080
25+
26+
**ei.frontend.service.host** property is the hostname on the host where EI front-end application is started on.
27+
28+
**ei.frontend.service.port** property is the port number on the host where EI front-end application is started on.
29+
30+
**ei.frontend.context.path** property is used when EI front-end application is started with a context path in web-server.
31+
32+
If running locally with "mvn spring-boot:run" no context-path is added which means you can leave the **ei.frontend.context.path** property empty.
33+
34+
ei.frontend.service.host=localhost
35+
ei.frontend.service.port=${server.port}
36+
ei.frontend.context.path=
37+
38+
## HTTPS security
39+
40+
If Eiffel-Intelligence front-end need to be executed with secure HTTPS connections, then these properties need to be set:
41+
42+
ei.use.secure.http.frontend=false
43+
server.ssl.key-store: <keystore.p12>
44+
server.ssl.key-store-password: <mypassword>
45+
server.ssl.key-store-type: <PKCS12>
46+
server.ssl.key-alias: <tomcat>
47+
48+
Read more in Spring documentation about how to enable HTTPS security in Spring applications.
49+
50+
## Customize documentation links
51+
52+
It is possible to add and change Documentation url links that is seen in the Eiffel-Intelligence front-end Web-UI.
53+
Documentaiton url links is configured by property **ei.eiffel.documentation.urls**, example:
54+
55+
ei.eiffel.documentation.urls={ "EI front-end documentation": "https://eiffel-community.github.io/eiffel-intelligence-frontend",\
56+
"EI front-end GitHub": "https://github.com/eiffel-community/eiffel-intelligence-frontend",\
57+
"EI back-end documentation": "https://eiffel-community.github.io/eiffel-intelligence",\
58+
"EI back-end GitHub": "https://github.com/eiffel-community/eiffel-intelligence",\
59+
"Eiffel Github main page": "https://github.com/eiffel-community/eiffel",\
60+
"User guide for test rules page": "https://github.com/eiffel-community/eiffel-intelligence-frontend/blob/master/wiki/markdown/test-rules.md" }
61+
62+
## Other properties
63+
64+
All Eiffel-Intelligence front-end properties can be found in [application.properties](https://github.com/Ericsson/eiffel-intelligence-frontend/blob/master/src/main/resources/application.properties) example file.

wiki/markdown/docker.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,23 @@ With the Docker image user can try-out the Eiffel-Intelligence front-end on a Do
1818

1919
## Follow these step to build the Docker image.
2020

21-
1. Build the Eiffel-Intelligence front-end war file:
22-
23-
`mvn package -DskipTests`
21+
**1** Build the Eiffel-Intelligence front-end war file:
22+
23+
mvn package -DskipTests
2424

2525

2626
This will produce a war file in the "target" folder.
2727

28-
2. Build the Docker image with the war file that was produced from previous step:
29-
30-
`docker build -t eiffel-intelligence-frontend:0.0.19 --build-arg URL=./target/eiffel-intelligence-frontend-0.0.19.war -f src/main/docker/Dockerfile .`
28+
**2** Build the Docker image with the war file that was produced from previous step:
29+
30+
docker build -t eiffel-intelligence-frontend:0.0.19 --build-arg URL=./target/eiffel-intelligence-frontend-0.0.19.war -f src/main/docker/Dockerfile .
3131

3232
Now docker image has build with tag "eiffel-intelligence-frontend:0.0.19"
3333

3434
## Run Docker image on local Docker Host
3535
To run the produced docker image on the local Docker host, execute this command:
36-
37-
38-
`docker run -p 8071:8080 --expose 8080 -e server.port=8080 -e logging.level.log.level.root=DEBUG -e logging.level.org.springframework.web=DEBUG -e logging.level.com.ericsson.ei=DEBUG eiffel-intelligence-frontend:0.0.19`
36+
37+
docker run -p 8071:8080 --expose 8080 -e server.port=8080 -e logging.level.log.level.root=DEBUG -e logging.level.org.springframework.web=DEBUG -e logging.level.com.ericsson.ei=DEBUG eiffel-intelligence-frontend:0.0.19
3938

4039
# Some info of all flags to this command
4140

@@ -73,17 +72,19 @@ In web-browser use url with docker host ip number: "\<docker host ip\>:8071/"
7372
Switch-back-end functionality do not work when "localhost" address is used.
7473

7574
Another option to configure Eiffel Intelligence front-end is to provide the application properties file into the container, which can be made in two ways:
76-
1. Put application.properties file in Tomcat Catalina config folder in container and run Eiffel Intelligence front-end:
77-
78-
`docker run -p 8070:8080 --expose 8080 --volume /path/to/application.properties:/usr/local/tomcat/config/application.properties eiffel-intelligence-frontend:0.0.19`
7975

80-
2. Put application.properties file in a different folder in container and tell EI where the application.properties is located in the container:
76+
**1** Put application.properties file in Tomcat Catalina config folder in container and run Eiffel Intelligence front-end:
77+
78+
docker run -p 8070:8080 --expose 8080 --volume /path/to/application.properties:/usr/local/tomcat/config/application.properties eiffel-intelligence-frontend:0.0.19
8179

82-
`docker run -p 8070:8080 --expose 8080 --volume /path/to/application.properties:/tmp/application.properties -e spring.config.location=/tmp/application.properties eiffel-intelligence-frontend:0.0.19`
80+
**2** Put application.properties file in a different folder in container and tell EI where the application.properties is located in the container:
81+
82+
docker run -p 8070:8080 --expose 8080 --volume /path/to/application.properties:/tmp/application.properties -e spring.config.location=/tmp/application.properties eiffel-intelligence-frontend:0.0.19
8383

8484

8585
# Run Docker image with provided docker-compose file
8686
This docker-compose file includes these components, [docker-compose.yml](https://github.com/Ericsson/eiffel-intelligence-frontend/blob/master/src/main/docker/docker-compose.yml):
87+
8788
- MongoDB
8889
- RabbitMq
8990
- ER (Event Repository)
@@ -111,8 +112,11 @@ To run docker-compose commands, the environment variables needs to be set:
111112
Two variables need to be set before we can start up all services with docker-compose tool.
112113
Set Docker host IP to the HOST variable. This is done automatically when sourcing [env.bash](https://github.com/Ericsson/eiffel-intelligence-frontend/blob/master/src/main/docker/env.bash).
113114
But it is also possible to do it manually. If on Linux:
114-
`export HOST=$(hostname -I | tr " " "\n"| head -1)`
115-
If on Windows, get Docker Host IP with command: `dockermachine ip`
115+
116+
export HOST=$(hostname -I | tr " " "\n"| head -1)
117+
If on Windows, get Docker Host IP with command:
118+
119+
dockermachine ip
116120
Set that Docker host IP to HOST environment variable.
117121

118122
Currently we need to provide EI back-end instances list outside of docker-compose.yml file.
@@ -127,25 +131,23 @@ It will take some minutes until all components has started. When all components
127131
http://\<docker host ip\>:8081/
128132

129133
Curl command can be used to make request via EI front-end bridge to EI back-end REST API, example for getting all subscriptions:
130-
131-
132-
`curl -X GET http://localhost:8081/subscriptions`
134+
135+
curl -X GET http://localhost:8081/subscriptions
133136

134137
It is also possible to access these Rest-Api addresses in web-browser and get result presented in a Json view in web-browser.
135138

136139
Following command can be used to get the logs from the EI front-end container/service:
137-
138-
`docker-compose -f src/main/docker/docker-compose.yml logs ei_frontend`
140+
141+
docker-compose -f src/main/docker/docker-compose.yml logs ei_frontend
139142

140143
All service names can be retrieved with following command:
141-
142-
`docker-compose -f src/main/docker/docker-compose.yml config --services`
144+
145+
docker-compose -f src/main/docker/docker-compose.yml config --services
143146

144147
It is also possible to retrieve the logs by only using "docker logs <container_id or container_name>" command:
145-
146-
`docker logs <container_id or container_name>`
147-
`docker logs <container_id or container_name>`
148+
149+
docker logs <container_id or container_name>
148150

149151
Container id can be retrieved with docker command:
150-
151-
`docker ps`
152+
153+
docker ps
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Running Eiffel Intelligence front-end
2+
3+
## _Prerequisites_
4+
5+
Eiffel intelligence front-end is a Spring microservice distributed in a war file.
6+
7+
To start the service, download the war file from
8+
[jitpack.io](https://jitpack.io/#eiffel-community/eiffel-intelligence-frontend) and look for the
9+
latest version. Now replace the latest version in the link below:
10+
11+
https://jitpack.io/com/github/eiffel-community/eiffel-intelligence-frontend/<version>/eiffel-intelligence-<version>.war
12+
13+
If you want to test the latest code in GitHub clone the project and compile it
14+
with:
15+
16+
mvn clean install
17+
18+
append **_-DskipTests_** if you want to skip the tests since the latest on
19+
master always has passed the tests. The war file should now be found under
20+
target folder in your cloned project.
21+
22+
If you run from source code, you can run Eiffel-Intelligence front-end with maven command:
23+
24+
mvn spring-boot:run
25+
26+
Or you can run the executable war file (located in target folder, if running from source code):
27+
28+
java -jar eiffel-intelligence-frontend-<version>.war
29+
30+
if you want to run with default configuration.
31+
32+
Own configuration can be provided with
33+
34+
java -jar eiffel-intelligence-frontend-<version>.war --spring.config.location=file:<path to own application.properties>
35+
36+
remember to keep the name of the properties file if you are a beginner to
37+
Spring. More advanced Spring user can look [here](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html)
38+
for more information about using external configuration.
39+
40+
If only few properties need to be overriden then use Java opts, for example
41+
42+
java -jar eiffel-intelligence-frontend-<version>.war -Dspring.data.mongodb.port=27019
43+
44+
All available Eiffel-Intelligence front-end properties can be found in [application.properties](https://github.com/Ericsson/eiffel-intelligence-frontend/blob/master/src/main/resources/application.properties) example file.

wiki/site.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939

4040
<menu name="Overview">
4141
<item name="Home" href="index.html" />
42-
<item name="Run in Docker" href="docker.html" />
42+
<item collapse="true" name="Running Eiffel Intelligence front-end" href="running-eiffel-intelligence-frontend.html">
43+
<item name="Configuration" href="configuration.html" />
44+
<item name="Run in Docker" href="docker.html" />
45+
</item>
4346
<item name="GUI overview" href="GUI-overview.html" />
4447
<item collapse="true" name="Subscription handling" href="subscription-handling.html">
4548
<item name="Add Subscription" href="add-subscription.html" />

0 commit comments

Comments
 (0)