added model documentation
This commit is contained in:
parent
206169e135
commit
cd4e2aa77b
@ -15,6 +15,7 @@ import {ModelTemplatesComponent} from './model-templates/model-templates.compone
|
|||||||
import {DocumentationArchitectureComponent} from './documentation/documentation-architecture/documentation-architecture.component';
|
import {DocumentationArchitectureComponent} from './documentation/documentation-architecture/documentation-architecture.component';
|
||||||
import {MaterialsComponent} from './materials/materials.component';
|
import {MaterialsComponent} from './materials/materials.component';
|
||||||
import {MaterialComponent} from './material/material.component';
|
import {MaterialComponent} from './material/material.component';
|
||||||
|
import {DocumentationModelsComponent} from './documentation/documentation-models/documentation-models.component';
|
||||||
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
@ -34,6 +35,7 @@ const routes: Routes = [
|
|||||||
{path: 'documentation', component: DocumentationComponent},
|
{path: 'documentation', component: DocumentationComponent},
|
||||||
{path: 'documentation/architecture', component: DocumentationArchitectureComponent},
|
{path: 'documentation/architecture', component: DocumentationArchitectureComponent},
|
||||||
{path: 'documentation/database', component: DocumentationDatabaseComponent},
|
{path: 'documentation/database', component: DocumentationDatabaseComponent},
|
||||||
|
{path: 'documentation/models', component: DocumentationModelsComponent},
|
||||||
|
|
||||||
// if not authenticated
|
// if not authenticated
|
||||||
{ path: '**', redirectTo: '' }
|
{ path: '**', redirectTo: '' }
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
<a routerLink="/documentation" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">General</a>
|
<a routerLink="/documentation" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">General</a>
|
||||||
<a routerLink="/documentation/architecture" routerLinkActive="active">Architecture</a>
|
<a routerLink="/documentation/architecture" routerLinkActive="active">Architecture</a>
|
||||||
<a routerLink="/documentation/database" routerLinkActive="active">Database</a>
|
<a routerLink="/documentation/database" routerLinkActive="active">Database</a>
|
||||||
|
<a routerLink="/documentation/models" routerLinkActive="active">Models</a>
|
||||||
</nav>
|
</nav>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -1 +1,56 @@
|
|||||||
<p>documentation-models works!</p>
|
<h4>Model file upload</h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Model files have to be saved as a .pkl file in 80_Modelle_BIC. <br>
|
||||||
|
For upload the upload script has to be opened (can be in every environment). The name of the model file has to be
|
||||||
|
entered wih the .pkl ending in the first command and without .pkl in the second.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h4 class="space-above">Adding new model scripts</h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Open Spyder in the base environment and open the model.py within.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Enter model file name without .pkl in fetchData</li>
|
||||||
|
<li>Add new prediction function below others</li>
|
||||||
|
<li>duplicate another @app.route and rename according to desired route name and prediction function name</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h4 class="space-above">Testing locally</h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
To test the model Python script locally, you need to execute it in the base environment, in which all necessary
|
||||||
|
packages have to be installed. Note that Spyder also has to be opened in the base environment.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Open a separate Anaconda Prompt and cd into the definma-UI folder</li>
|
||||||
|
<li>Adapt the model-mock.json at definma-UI/assets/ and enter the new model URL and name</li>
|
||||||
|
<li>Execute "python -m http.server" in the Anaconda Prompt</li>
|
||||||
|
<li>Execute the model.py script in Spyder</li>
|
||||||
|
<li>Navigate to <a href="http://localhost:8000">http://localhost:8000</a> in the browser</li>
|
||||||
|
<li>If there are problems with cached data, open the Browser developer console (Ctrl+Shift+I) and tick
|
||||||
|
"Disable cache" in the Network tab. The console then has to stay open.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h4 class="space-above">Model script upload</h4>
|
||||||
|
|
||||||
|
In the Windows Powershell:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>cf login (only at the first time)</li>
|
||||||
|
<li>API endpoint: https://api.sys.de1.bosch-iot-cloud.com</li>
|
||||||
|
<li>Enter email with .de.bosch.com</li>
|
||||||
|
<li>Enter BIC password</li>
|
||||||
|
<li>Select space to upload to (currently 3 - development)</li>
|
||||||
|
<li>cd into the folder containing the manifest.yaml (here is also model.py)</li>
|
||||||
|
<li>cf push</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
After upload the new model details have to be entered in the UI.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user