Skip to content
This repository was archived by the owner on Mar 16, 2023. It is now read-only.

Commit 9be1298

Browse files
authored
Merge pull request #3 from mindsphere/docker
chore: docker
2 parents 65e3909 + a366980 commit 9be1298

File tree

6 files changed

+84
-0
lines changed

6 files changed

+84
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
temp/*.json
2+
.git

.markdownlint.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"MD007": false,
3+
"MD033": false,
4+
"MD013": false,
5+
"MD041": false,
6+
"MD024": false,
7+
"MD025": false,
8+
"MD030": false
9+
}

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM jupyter/scipy-notebook
2+
USER root
3+
RUN apt-get update
4+
RUN apt-get install -y supervisor
5+
USER jovyan
6+
RUN mkdir /home/jovyan/work/temp
7+
COPY --chown=jovyan:users . /home/jovyan/work
8+
RUN mv /home/jovyan/work/service.conf /home/jovyan
9+
RUN jupyter trust work/*.ipynb
10+
RUN npm install -g @mindconnect/mindconnect-nodejs
11+
CMD ["supervisord","-c","/home/jovyan/service.conf"]

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- @format -->
2+
13
# MindSphere Analytics Examples
24

35
<!-- markdownlint-disable MD033 -->
@@ -12,6 +14,7 @@ Examples how to use the mindSphere analytics APIs.
1214

1315
## Jupyter Notebooks demonstrating the use of the MindSphere Analytics APIs
1416

17+
1518
### Trend Prediction API
1619

1720
The Trend Prediction API predicts future values for time series using linear and nonlinear regression models. It is a forecasting framework, that has many useful applications in the area of Process & Condition Monitoring.
@@ -30,6 +33,46 @@ Spectrum Analysis API allows users to perform time domain and frequency domain a
3033

3134
Example: [Spectrum Analysis API](spectrum-analysis.ipynb)
3235

36+
## Running the notebook
37+
38+
The easiest way to run the notebook is to use `mindspheredemos/analytics-examples` docker container.
39+
40+
You can either build the container locally
41+
42+
```bash
43+
docker build .
44+
```
45+
46+
or you can pull the container from docker hub.
47+
48+
```bash
49+
docker pull mindspheredemos/analytics-examples
50+
```
51+
52+
You can run the container using following command:
53+
54+
```bash
55+
docker run -it -p:8888:8888 -p:4994:4994 --name examples mindspheredemos/analytics-examples
56+
```
57+
58+
The container will offer two endpoints:
59+
60+
- MindSphere CLI [http://localhost:4994](http://localhost:4994)
61+
- Jupyter Lab [http://localhost:8888](http://localhost:8888)
62+
63+
Please configure the CLI with app credentials [as described here](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/setting-up-the-cli.html)
64+
65+
After that you can start using the jupyter lab with the notebooks. Just copy the token from the container output. The notebooks can be found in `work` folder.
66+
67+
![jupyter lab](images/notebook.png)
68+
69+
(If you have started the container in the background you can get the token by running `docker logs examples` command.)
70+
71+
## Docker Base Image
72+
73+
The docker image is based on [jupyter/scipy-notebook docker image](https://hub.docker.com/r/jupyter/scipy-notebook/).
74+
75+
3376
## Siemens API Notice
3477

3578
This project has been released under an [Open Source license](./LICENSE.md). The release may include and/or use APIs to Siemens’ or third parties’ products or services. In no event shall the project’s Open Source license grant any rights in or to these APIs, products or services that would alter, expand, be inconsistent with, or supersede any terms of separate license agreements applicable to those APIs. “API” means application programming interfaces and their specifications and implementing code that allows other software to communicate with or call on Siemens’ or third parties’ products or services and may be made available through Siemens’ or third parties’ products, documentations or otherwise.

images/notebook.png

83.3 KB
Loading

service.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[supervisord]
2+
nodaemon=true
3+
4+
[program:mc]
5+
command=mc sc
6+
autorestart=true
7+
stderr_logfile=/dev/stdout
8+
stderr_logfile_maxbytes = 0
9+
stdout_logfile=/dev/stdout
10+
stdout_logfile_maxbytes = 0
11+
12+
[program:jupyter]
13+
command=jupyter lab
14+
autostart=true
15+
autorestart=true
16+
stderr_logfile=/dev/stdout
17+
stderr_logfile_maxbytes = 0
18+
stdout_logfile=/dev/stdout
19+
stdout_logfile_maxbytes = 0

0 commit comments

Comments
 (0)