|
| 1 | +# Resources for the "theia-app-demo" Example docker image |
| 2 | + |
| 3 | +This folder contains the resources, needed to create a "demo" Docker image, based on one of the Theia app images. The demo image includes the necessary extras to easity perform a quick demo or immediately play with the trace viewer: the Eclipse Trace Compass Trace Server and a selection of Tutorial traces. |
| 4 | + |
| 5 | +## Build the demo images |
| 6 | + |
| 7 | +After connecting to either the tate or tave application using a browser, following the instructions below, the app should open with the trace server running and the workspace already selected, containing the tutorial traces, ready to use. |
| 8 | + |
| 9 | +Run the following commands from the parent folder (\<repo root\>/docker): |
| 10 | + |
| 11 | +```bash |
| 12 | +# e.g. make "tate" / "tave" demo image(s) |
| 13 | + |
| 14 | +# pre-requisite: the base image(s) need to be already built locally. |
| 15 | +# If not, or it they are not up-to-date, start by (re)building them: |
| 16 | +yarn build:docker:tate |
| 17 | +yarn build:docker:tave |
| 18 | + |
| 19 | +# make the demo image(s) that extend the base image(s) |
| 20 | +yarn build:docker:tate-demo |
| 21 | +yarn build:docker:tave-demo |
| 22 | +``` |
| 23 | + |
| 24 | +## Run the demo images |
| 25 | + |
| 26 | +### tate-demo (isolated docker network) |
| 27 | + |
| 28 | +note: since the isolated docker network is used, you may start several containers from the tate-demo image and each one will have its own, indepandant trace server. |
| 29 | + |
| 30 | +Run the following commands from the parent folder (\<repo root\>/docker): |
| 31 | + |
| 32 | +```bash |
| 33 | +# start the demo image |
| 34 | +yarn run:docker:tate-demo |
| 35 | + |
| 36 | +# using the start script above, the image is deployed isolated |
| 37 | +# find its IP address: |
| 38 | +docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' tv-tate-demo-1 |
| 39 | +100.109.0.1 |
| 40 | + |
| 41 | +# connect to it (replace with the ip address you obtained in the |
| 42 | +# previous step): |
| 43 | +firefox 100.109.0.1:4000 |
| 44 | +``` |
| 45 | + |
| 46 | +### tave-demo (host network) |
| 47 | + |
| 48 | +The trace viewer contained in the "tave" image uses vscode webviews. For security reasons, these webviews, by default, only work with SSL (HTTPS) and some extra network setup \[*\]. There is however an exception made for running the app on the localhost network, that's considered "safe" by default. It's beyond the scope of this guide to go into these details, so we will provide instructions to run that image using the host network, which should work OOTB locally and still be safe. |
| 49 | + |
| 50 | +\[*\]: for more info start here: |
| 51 | +https://github.com/eclipse-theia/theia/blob/86267992e133b3ee59508d4e2afbcfc6e384d61c/packages/plugin-ext/README.md |
| 52 | + |
| 53 | +Note: because the image's trace server uses the host's network, it might interfere or be interfered-with, by a trace server running locally on the host or in another container running the same image. To avoid issues, kill any trace server running locally on the host before starting this demo image and kill the container before starting a local trace server. |
| 54 | + |
| 55 | +Run the following commands from the parent folder (\<repo root\>/docker): |
| 56 | + |
| 57 | +```bash |
| 58 | +# start the demo image |
| 59 | +yarn run:docker:tave-demo |
| 60 | + |
| 61 | +# ***tave-demo***: |
| 62 | +# using the start script above, the image is deployed using the |
| 63 | +# docker host network. |
| 64 | +firefox localhost:4000 |
| 65 | +``` |
0 commit comments