Skip to content

Commit 7e7534b

Browse files
author
Johannes Duesing
committed
Updated Readme file with information about setup and configuration of the instance registry.
1 parent 528e8cf commit 7e7534b

File tree

1 file changed

+48
-11
lines changed

1 file changed

+48
-11
lines changed

README.md

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,46 @@ The Delphi registry is a server that provides access to all information and oper
1818
* Re-Assigning dependencies to instances (e.g. assigning a certain ElasticSearch instance to a Crawler)
1919

2020
## Requirements
21-
The Delphi registry requires a docker host to deploy containers to. By default, docker is expected to be reachable at *http://localhost:9095*, but you can override this setting by specifying the docker host URI in the environment variable *DOCKER_HOST*.
21+
In order to compile or execute the instance registry, you must have the latest version of the *Scala Build Tool* (SBT) installed. You can get it [here](https://www.scala-sbt.org/).
22+
The Delphi registry requires a docker host to deploy containers to. The following images must be registered at the docker registry:
23+
* The Delphi Crawler ( ```delphi-crawler:1.0.0-SNAPSHOT``` )
24+
* The Delphi WebApi ( ```delphi-webapi:1.0.0-SNAPSHOT``` )
25+
* The Delphi WebApp ( ```delphi-webapp:1.0.0-SNAPSHOT``` )
26+
27+
To obtain these images, checkout the respective repositories ([here](https://github.com/delphi-hub/delphi-crawler), [here](https://github.com/delphi-hub/delphi-webapi) and [here](https://github.com/delphi-hub/delphi-webapp)) and execute the command
28+
29+
```
30+
sbt docker:publishLocal
31+
```
32+
inside their root directory. This will build the docker images and register them directly at the local docker registry.
33+
The registry requires an initial instance of ElasticSearch to be running.
34+
35+
## Adapt the configuration file
36+
Before you can start the application, you have to make sure your configuration file contains valid data. The file can be found at *src/main/scala/de/upb/cs/swt/delphi/instanceregistry/Configuration.scala*, and most of its attributes are string or integer values. The following table describes the attributes in more detail.
37+
38+
|Attribute | Type | Default Value |Explanation |
39+
| :---: | :---: | :---: | :--- |
40+
|```bindHost``` | ```String``` | ```"0.0.0.0"``` | Host address that the registry server should be bound to |
41+
|```bindPort``` | ```Int``` | ```8087``` | Port that the registry server should be reachable at |
42+
|```defaultCrawlerPort``` | ```Int``` | ```8882``` | Port that Delphi Crawlers are reachable at. This may only be adapted if you manually changed the default port of crawlers before registering the respective image. |
43+
|```defaultWebApiPort``` | ```Int``` | ```8080``` | Port that Delphi WebAPIs are reachable at. This may only be adapted if you manually changed the default port of WebAPIs before registering the respective image. |
44+
|```defaultWebAppPort``` | ```Int``` | ```8085``` | Port that Delphi WebApps are reachable at. This may only be adapted if you manually changed the default port of WebApps before registering the respective image. |
45+
|```crawlerDockerImageName``` | ```String``` | ```"delphi-crawler:1.0.0-SNAPSHOT"``` | Name of the Docker image for Delphi Crawlers. May only be changed if you manually specified a different name when creating the image.|
46+
|```webApiDockerImageName``` | ```String``` | ```"delphi-webapi:1.0.0-SNAPSHOT"``` | Name of the Docker image for Delphi WebAPIs. May only be changed if you manually specified a different name when creating the image.|
47+
|```webAppDockerImageName``` | ```String``` | ```"delphi-webapp:1.0.0-SNAPSHOT"``` | Name of the Docker image for Delphi WebApps. May only be changed if you manually specified a different name when creating the image.|
48+
|```defaultElasticSearchInstanceHost``` | ```String``` | ```"elasticsearch://172.17.0.1"``` | Host that the default ElasticSearch instance is located at.|
49+
|```defaultElasticSearchInstancePort``` | ```Int``` | ```9200``` | Port that the default ElasticSearch instance is reachable at.|
50+
|```uriInLocalNetwork``` | ```String``` | ```"http://172.17.0.1:8087"``` | URI that the registry is reachable at for all docker containers. In most of the use-cases this is going to be the gateway of the default docker bridge.|
51+
|```maxLabelLength``` | ```Int``` | ```50``` | Maximum number of characters for instance labels. Longer labels will be rejected.|
52+
|```dockerOperationTimeout``` | ```Timeout``` | ```Timeout(20 seconds)``` | Default timeout for docker operations. If any of the async Docker operations (deploy, stop, pause, ..) takes longer than this, it will be aborted.|
53+
|```useInMemoryDB``` | ```Boolean``` | ```false``` | If set to true, all instance data will be kept in memory instead of using a MySQL database.|
54+
|```databaseHost``` | ```String``` | ```"jdbc:mysql://localhost/"``` | Host that the MySQL database is reachable at (only necessary if *useInMemoryDB* is false).|
55+
|```databaseName``` | ```String``` | ```""``` | Name of the MySQL database to use (only necessary if *useInMemoryDB* is false).|
56+
|```databaseDriver``` | ```String``` | ```"com.mysql.jdbc.Driver"``` | Driver to use for the MySQL connection (only necessary if *useInMemoryDB* is false).|
57+
|```databaseUsername``` | ```String``` | ```""``` | Username to use for the MySQL connection (only necessary if *useInMemoryDB* is false).|
58+
|```databasePassword``` | ```String``` | ```""``` | Password to use for the MySQL connection (only necessary if *useInMemoryDB* is false).|
59+
60+
By default, Docker is expected to be reachable at *http://localhost:9095*, but you can override this setting by specifying the docker host URI in the environment variable *DOCKER_HOST*.
2261
To change the port of your http docker API to 9095, execute
2362
```
2463
edit /lib/systemd/system/docker.service
@@ -28,18 +67,16 @@ sudo service docker restart
2867
```
2968

3069

31-
The following images must be registered at the docker registry:
32-
* The Delphi Crawler ( ```delphi-crawler:1.0.0-SNAPSHOT``` )
33-
* The Delphi WebApi ( ```delphi-webapi:1.0.0-SNAPSHOT``` )
34-
* The Delphi WebApp ( ```delphi-webapp:1.0.0-SNAPSHOT``` )
3570

36-
To obtain these images, checkout the respective repositories ([here](https://github.com/delphi-hub/delphi-crawler), [here](https://github.com/delphi-hub/delphi-webapi) and [here](https://github.com/delphi-hub/delphi-webapp)) and execute the command
3771

38-
```
39-
sbt docker:publishLocal
40-
```
41-
inside their root directory. This will build the docker images and register them directly at the local docker registry.
42-
The registry requires an initial instance of ElasticSearch to be running. The default location for this is *elasticsearch://172.17.0.1:9200*, however this can be changed in the *Configuration.scala* file at *src/main/scala/de/upb/cs/swt/delphi/instanceregistry*.
72+
73+
## Run the application
74+
There are two ways of running the registry application. You can either run the application directly, or build a docker image defined by the *build.sbt* file, and run a container based on this image. Either way, you have to set the correct configuration values before starting the application (see section **Adapt the configuration file** above for more information). We are currently working on a setup script that will prepare all images that need to be present on your docker host. Until its finished, you have to register the images manually, as described in the **Requirements** section.
75+
### Run the registry directly
76+
If you want to execute the registry directly on your local machine, simply go to the root folder of the repository and execute ```sbt run```. The application will stream all logging output to the terminal. You can terminate any time by pressing *RETURN*.
77+
### Run the registry in Docker
78+
For building a docker image containing the registry, go to the root folder of the repository and execute ```sbt docker:publishLocal```. This will build the application, create a docker image named ```delphi-registry:1.0.0-SNAPSHOT```, and register the image at your local docker registry.
79+
4380

4481
## Contributing
4582

0 commit comments

Comments
 (0)