Skip to content

Commit a54cd54

Browse files
authored
Merge pull request #63 from delphi-hub/feature/updateReadme
Added information about configuration and setup to readme
2 parents 528e8cf + f8f14ae commit a54cd54

File tree

1 file changed

+49
-11
lines changed

1 file changed

+49
-11
lines changed

README.md

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@ 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*.
22-
To change the port of your http docker API to 9095, execute
23-
```
24-
edit /lib/systemd/system/docker.service
25-
ExecStart=/usr/bin/dockerd -H fd:// -H=tcp://0.0.0.0:9095
26-
systemctl daemon-reload
27-
sudo service docker restart
28-
```
29-
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/).
3022

31-
The following images must be registered at the docker registry:
23+
The Delphi registry requires a docker host to deploy containers to. The following images must be registered at the docker registry:
3224
* The Delphi Crawler ( ```delphi-crawler:1.0.0-SNAPSHOT``` )
3325
* The Delphi WebApi ( ```delphi-webapi:1.0.0-SNAPSHOT``` )
3426
* The Delphi WebApp ( ```delphi-webapp:1.0.0-SNAPSHOT``` )
@@ -39,7 +31,53 @@ To obtain these images, checkout the respective repositories ([here](https://git
3931
sbt docker:publishLocal
4032
```
4133
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*.
34+
The registry requires an initial instance of ElasticSearch to be running.
35+
36+
## Adapt the configuration file
37+
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.
38+
39+
|Attribute | Type | Default Value |Explanation |
40+
| :---: | :---: | :---: | :--- |
41+
|```bindHost``` | ```String``` | ```"0.0.0.0"``` | Host address that the registry server should be bound to |
42+
|```bindPort``` | ```Int``` | ```8087``` | Port that the registry server should be reachable at |
43+
|```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. |
44+
|```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. |
45+
|```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. |
46+
|```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.|
47+
|```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.|
48+
|```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.|
49+
|```defaultElasticSearchInstanceHost``` | ```String``` | ```"elasticsearch://172.17.0.1"``` | Host that the default ElasticSearch instance is located at.|
50+
|```defaultElasticSearchInstancePort``` | ```Int``` | ```9200``` | Port that the default ElasticSearch instance is reachable at.|
51+
|```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.|
52+
|```maxLabelLength``` | ```Int``` | ```50``` | Maximum number of characters for instance labels. Longer labels will be rejected.|
53+
|```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.|
54+
|```useInMemoryDB``` | ```Boolean``` | ```false``` | If set to true, all instance data will be kept in memory instead of using a MySQL database.|
55+
|```databaseHost``` | ```String``` | ```"jdbc:mysql://localhost/"``` | Host that the MySQL database is reachable at (only necessary if *useInMemoryDB* is false).|
56+
|```databaseName``` | ```String``` | ```""``` | Name of the MySQL database to use (only necessary if *useInMemoryDB* is false).|
57+
|```databaseDriver``` | ```String``` | ```"com.mysql.jdbc.Driver"``` | Driver to use for the MySQL connection (only necessary if *useInMemoryDB* is false).|
58+
|```databaseUsername``` | ```String``` | ```""``` | Username to use for the MySQL connection (only necessary if *useInMemoryDB* is false).|
59+
|```databasePassword``` | ```String``` | ```""``` | Password to use for the MySQL connection (only necessary if *useInMemoryDB* is false).|
60+
61+
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*.
62+
To change the port of your http docker API to 9095, execute
63+
```
64+
edit /lib/systemd/system/docker.service
65+
ExecStart=/usr/bin/dockerd -H fd:// -H=tcp://0.0.0.0:9095
66+
systemctl daemon-reload
67+
sudo service docker restart
68+
```
69+
70+
71+
72+
73+
74+
## Run the application
75+
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.
76+
### Run the registry directly
77+
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*.
78+
### Run the registry in Docker
79+
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.
80+
4381

4482
## Contributing
4583

0 commit comments

Comments
 (0)