diff --git a/test-tools/IoT-APP-Store-Demo/README.md b/test-tools/IoT-APP-Store-Demo/README.md index 06d17a65..266255c0 100644 --- a/test-tools/IoT-APP-Store-Demo/README.md +++ b/test-tools/IoT-APP-Store-Demo/README.md @@ -1,36 +1,50 @@ # IoT Application Store Wasm application management portal for WAMR -# Requirement -Install django with pip3 -``` -pip3 install django -``` +## Start the server -# Run -1. Start wasm server +### Using docker +1. install docker and docker-compose + ``` bash + sudo apt install docker.io docker-compose ``` + +2. start + ``` bash + docker-compose up + ``` +### Using commands +> Note: must use python3.5. If you don't have python3.5 on your machine, had better using docker +1. install the required package + ``` bash + pip3 install django + ``` + +2. Start device server + ``` bash cd wasm_django/server python3 wasm_server.py ``` -2. Start IoT application management web portal - ``` +3. Start IoT application management web portal + ``` bash cd wasm_django python3 manage.py runserver 0.0.0.0:80 ``` -3. Download WAMR runtime from [help](http://localhost/help/) page - > NOTE: You need to start web server according to *step 2* before accessing this link! +## Start the runtime +1. Download WAMR runtime from [help](http://localhost/help/) page + > NOTE: You need to start the server before accessing this link! -4. Start a WAMR runtime from localhost - ``` +2. Start a WAMR runtime from localhost + ``` bash + chmod +x simple ./simple ``` or from other computers - ``` + ``` bash ./simple -a [your.server.ip.address] ``` -# Online demo - http://39.106.110.7/ +## Online demo + http://82.156.57.236/ diff --git a/test-tools/IoT-APP-Store-Demo/docker-compose.yml b/test-tools/IoT-APP-Store-Demo/docker-compose.yml new file mode 100644 index 00000000..331d064c --- /dev/null +++ b/test-tools/IoT-APP-Store-Demo/docker-compose.yml @@ -0,0 +1,22 @@ +version: '2.0' + +services: + web_portal: + build: ./wasm_django + network_mode: "host" + depends_on: + - 'device_server' + restart: always + volumes: + - store:/app/static/upload/ + device_server: + build: + context: ./wasm_django + dockerfile: ./server/Dockerfile + network_mode: "host" + restart: always + volumes: + - store:/app/static/upload/ + +volumes: + store: \ No newline at end of file diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/Dockerfile b/test-tools/IoT-APP-Store-Demo/wasm_django/Dockerfile new file mode 100644 index 00000000..18ca41dc --- /dev/null +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.5 + +WORKDIR /app +ADD . /app + +RUN pip install django + +ENTRYPOINT ["python", "manage.py", "runserver", "0.0.0.0:80"] + diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html index b36279d4..9e9d63c9 100755 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html @@ -32,11 +32,11 @@ How to use?

- 1. Download a simple runtime (build for ubuntu 16.04 64 bits, other platforms please build + 1. Download a simple runtime (build for ubuntu 20.04 64 bits, other platforms please build from the source code)

- 2. In the terminal: cd ~/Download && ./simple -a 39.106.110.7 + 2. In the terminal: cd ~/Download && ./simple -a 82.156.57.236

@@ -51,7 +51,7 @@

For more details please refer to this guide

-

cd ~/Download && ./wasm_runtime_wgl -a 39.106.110.7

+

cd ~/Download && ./wasm_runtime_wgl -a 82.156.57.236

diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/server/Dockerfile b/test-tools/IoT-APP-Store-Demo/wasm_django/server/Dockerfile new file mode 100644 index 00000000..a60caad1 --- /dev/null +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/server/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.5 + +WORKDIR /app +ADD server/wasm_server.py /app/server/ + +ENTRYPOINT ["python", "server/wasm_server.py"] diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/connection.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/connection.wasm index ba4dab23..2a2e79dc 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/connection.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/connection.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_publisher.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_publisher.wasm index a48f4b0c..4cf91109 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_publisher.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_publisher.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_subscriber.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_subscriber.wasm index 820ad112..1766c256 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_subscriber.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/event_subscriber.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_handler.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_handler.wasm index 40507d1b..1da74dbe 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_handler.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_handler.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_sender.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_sender.wasm index 7f7c5b85..f7c9b994 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_sender.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/request_sender.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sensor.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sensor.wasm index d32c94c3..eb51ec8e 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sensor.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sensor.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/simple b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/simple index b7e86e25..da9c485e 100755 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/simple and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/simple differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/connection.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/connection.wasm index ba4dab23..2a2e79dc 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/connection.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/connection.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_publisher.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_publisher.wasm index a48f4b0c..4cf91109 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_publisher.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_publisher.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_subscriber.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_subscriber.wasm index 820ad112..1766c256 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_subscriber.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/event_subscriber.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_handler.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_handler.wasm index 40507d1b..1da74dbe 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_handler.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_handler.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_sender.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_sender.wasm index 7f7c5b85..f7c9b994 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_sender.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/request_sender.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/timer.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/timer.wasm index be209fd3..bcd4c8fa 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/timer.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/sys/timer.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/timer.wasm b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/timer.wasm index be209fd3..bcd4c8fa 100644 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/timer.wasm and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/timer.wasm differ diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/wasm_runtime_wgl b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/wasm_runtime_wgl index 01e34114..eb7b42b8 100755 Binary files a/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/wasm_runtime_wgl and b/test-tools/IoT-APP-Store-Demo/wasm_django/static/upload/wasm_runtime_wgl differ