Server Installation and Service » Historie » Verze 27
Eliška Mourycová, 2021-06-12 18:58
1 | 22 | Eliška Mourycová | h1. Server Installation |
---|---|---|---|
2 | 1 | Eliška Mourycová | |
3 | The server runs on Debian 10 VM at https://nuada.zcu.cz/ |
||
4 | 3 | Eliška Mourycová | The ip of the machine is 147.228.173.54 |
5 | 1 | Eliška Mourycová | |
6 | 13 | Eliška Mourycová | The application was tested on a machine with the following specs: |
7 | |||
8 | 3 | Eliška Mourycová | h2. Hardware requirements |
9 | 1 | Eliška Mourycová | |
10 | 15 | Eliška Mourycová | * *RAM size* |
11 | ** 768 MB |
||
12 | * *Disk size* |
||
13 | ** 4 GB |
||
14 | * *CPU architecture* |
||
15 | ** x86_64 |
||
16 | 1 | Eliška Mourycová | |
17 | |||
18 | 13 | Eliška Mourycová | h2. Software requirements |
19 | 3 | Eliška Mourycová | |
20 | 15 | Eliška Mourycová | * *OS, OS version* |
21 | ** OS: Debian GNU/Linux 10, version 10.9 |
||
22 | 14 | Eliška Mourycová | * -Mono, version 5.18.0.240- |
23 | 4 | Eliška Mourycová | |
24 | 17 | Eliška Mourycová | h2. Deploying the Server Application |
25 | 1 | Eliška Mourycová | |
26 | |||
27 | 7 | Roman Kalivoda | h3. Building the project |
28 | 1 | Eliška Mourycová | |
29 | At the moment, the easiest way to build the project is to build it locally in Windows with the following commands: |
||
30 | open windows command line (cmd.exe) in the directory where the solution file is located. Please make sure you can run `dotnet` command from the cmd. Make sure you have the right SDK on your system: |
||
31 | 11 | Eliška Mourycová | <pre> |
32 | dotnet --list-sdks |
||
33 | </pre> |
||
34 | |||
35 | 7 | Roman Kalivoda | Version 5.0 is needed to build the project. If you have this version, you can build the project: |
36 | 1 | Eliška Mourycová | |
37 | <pre> |
||
38 | dotnet publish --runtime=linux-x64 ServerApp.sln |
||
39 | </pre> |
||
40 | |||
41 | The built project files are in folder: |
||
42 | 27 | Eliška Mourycová | <pre> |
43 | 1 | Eliška Mourycová | .\ServerApp\bin\Debug\net5.0\linux-x64\publish |
44 | 27 | Eliška Mourycová | </pre> |
45 | 1 | Eliška Mourycová | |
46 | h3. Note |
||
47 | |||
48 | The project could probably be built on-site as well, but that would require .NET SDK to be installed and require larger disc space. |
||
49 | |||
50 | 18 | Eliška Mourycová | |
51 | h3. Uploading the project to the remote machine |
||
52 | |||
53 | Upload the whole folder built with the commands below: |
||
54 | |||
55 | <pre> |
||
56 | scp -r /pathToFolder/publish root@{machine_ip}:/<path>/ |
||
57 | </pre> |
||
58 | |||
59 | You can also upload the default configuration file: |
||
60 | |||
61 | <pre> |
||
62 | scp /path/server_config root@{machine_ip}:/<path>/ |
||
63 | </pre> |
||
64 | |||
65 | 1 | Eliška Mourycová | |
66 | 18 | Eliška Mourycová | h3. Server Configuration File |
67 | 27 | Eliška Mourycová | (See also [[Project architecture]]) |
68 | 19 | Eliška Mourycová | |
69 | The configuration file must contain the following lines: |
||
70 | |||
71 | * Site for OpenData (*site*) |
||
72 | * Data files naming convention (*naming_convention*) |
||
73 | * Root directory where data files are saved (*data_root_dir*) |
||
74 | * Port (*port*) |
||
75 | * Site for weather prediction (*weather_site*) |
||
76 | |||
77 | These lines must be followed by lines containing the desired values. |
||
78 | Default setting of the config file is as follows: |
||
79 | |||
80 | h5. Site for opendata |
||
81 | |||
82 | The site configuration specifies the website where the UWB open data can be downloaded. |
||
83 | It is by default set to *http://openstore.zcu.cz/* |
||
84 | |||
85 | h5. naming_convention |
||
86 | |||
87 | The naming convention specifies how the archives available for download are named. |
||
88 | It is by default set to *OD_ZCU_{type}_{month}_{year}_{format}.zip* |
||
89 | Variables in this string must keep their name, cannot be excluded and others cannot be added. They must be enclosed in {} brackets. |
||
90 | {} characters are treated as special characters and cannot be used as a part of the name. |
||
91 | |||
92 | |||
93 | h5. data_root_dir |
||
94 | |||
95 | The data root directory specifies where the downloaded data will be stored. In this root directory subdirectories are created for individual data types. |
||
96 | It is by default set to *.\data\auto* (relative to the config file's path) |
||
97 | |||
98 | h5. port |
||
99 | |||
100 | The port specifies the port number at which the part of the server listens for clients' connections. |
||
101 | It is by default set to *10000* |
||
102 | |||
103 | h5. site for weather prediction |
||
104 | |||
105 | Furthermore the configuration file can contain link to the site from which the weather prediction is downloaded. Used link must lead to a page with a json file in format that satisfies the format specified on page [[Data file structure]] |
||
106 | It is by default set to *http://wttr.in/Plzen,czechia?format=j1* |
||
107 | 18 | Eliška Mourycová | |
108 | 12 | Eliška Mourycová | |
109 | h3. Running the server |
||
110 | 18 | Eliška Mourycová | |
111 | 27 | Eliška Mourycová | * A .p12 certificate file named *cert.p12* must exist in the directory where the app is launched |
112 | 1 | Eliška Mourycová | ** We used this one: attachment:cert.p12 |
113 | |||
114 | Firstly you most grant permission to run the executable: |
||
115 | |||
116 | <pre> |
||
117 | 12 | Eliška Mourycová | chmod +x <path>/ServerApp |
118 | </pre> |
||
119 | |||
120 | Then you can run the server: |
||
121 | |||
122 | <pre> |
||
123 | <path>/ServerApp <args> |
||
124 | </pre> |
||
125 | 1 | Eliška Mourycová | |
126 | 8 | Eliška Mourycová | The path to the *server configuration file* must be passed as (the only) argument to the application. |
127 | 7 | Roman Kalivoda | |
128 | 27 | Eliška Mourycová | h3. Notes |
129 | 26 | Eliška Mourycová | |
130 | 27 | Eliška Mourycová | * *The shell from which the server application was started must remain open for as long as the server runs.* The server does not get forked into background in any way. |
131 | * The server app must be launched from a directory where all the needed binaries (located in the publish directory when built) are located. |
||
132 | 8 | Eliška Mourycová | |
133 | 23 | Eliška Mourycová | |
134 | h1. Admin Commands |
||
135 | 24 | Eliška Mourycová | |
136 | While the server is running, you can type commands into the console. The available commands are as follow: |
||
137 | * *data [OPTION] [DATE]...* |
||
138 | ** Description: Capable of showing saved data files and downloading new ones. |
||
139 | ** *-list*: Lists currently saved data files. This list does not have to match the files which any of the predictors is trained on! |
||
140 | *** Example: data -list |
||
141 | ** *-dl [startDate] [endDate]*: <notextile>Downloads jis, login and weather files from a specified time span. Both [startDate] and [endDate] are inclusive. Date format must be entered as [month]-[year].</notextile> |
||
142 | *** Example: data -dl 1-2019 12-2020 |
||
143 | |||
144 | |||
145 | * *model [OPTION]* |
||
146 | ** Description: Capable of retraining the prediction model, going back to the previous version and listing files on which the predictor was trained. |
||
147 | ** *-files*: Lists the data files on which the currently used model was trained. |
||
148 | *** Example: model -files |
||
149 | ** *-retrain*: Retrains the model using the files currently saved in the data directory. |
||
150 | *** Example: model -retrain |
||
151 | ** *-rollback*: Switches the model back to the previous version. |
||
152 | *** Example: model -rollback |
||
153 | |||
154 | |||
155 | * *help* |
||
156 | ** Description: Lists available commands and their description. |
||
157 | 25 | Eliška Mourycová | |
158 | |||
159 | h1. Logging |
||
160 | |||
161 | The server logs information about its activity to a file named ------ located in -------- |