diff --git a/.github/workflows/docker-example.yml b/.github/workflows/docker-example.yml deleted file mode 100644 index 600d7bd3..00000000 --- a/.github/workflows/docker-example.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: docker-example - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - build-and-test: - name: Build and test docker-example - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - - strategy: - matrix: - os: [ubuntu-latest] - node-version: [18] - - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Build example-docker - uses: nick-invision/retry@v3 - with: - timeout_minutes: 10 - retry_wait_seconds: 15 - max_attempts: 3 - retry_on: error - command: | - cd examples/docker - docker build -t tte . - on_retry_command: cd ../.. - - - name: Run docker image - run: | - docker run --init -d -p 0.0.0.0:3000:4000 tte - - - name: Test trace viewer appliance - run: | - yarn --ignore-scripts - yarn test:browser-app diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6d17e49..533212d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,7 +112,6 @@ more may be necessary depending on the case. Here is an example used to uplift f * Some bumps may then be required also in the extension; consider applying them. 1. Uplift the version of each `@theia/` dependency in these `package.json` files, from `1.34.1` to `1.34.2` (replacing the former with the latter): * `./examples/browser/package.json` - * `./examples/docker/example-package.json` * `./examples/electron/package.json` * `./package.json` * `./theia-extensions/viewer-prototype/package.json` diff --git a/README.md b/README.md index 6e95f948..afbb97c0 100644 --- a/README.md +++ b/README.md @@ -112,14 +112,15 @@ You can also run two scripts to watch for changes and rebuild automatically: ## Try the trace extension -This repository contains an example trace-viewer application that includes the trace extension. It has three versions: +This repository contains an example trace-viewer application that includes the trace extension. It has two versions: * *browser*: a "browser" application, accessed with a web browser * *electron*: a native desktop application -* *docker*: a Docker-izable "browser" application, accessed with a web browser You can find those example applications under `examples/`. +Alternatively, you may find example applications in the [trace-viewer-examples] repository, including some "batteries included" Docker images that also contain the trace server and demo traces + ### Run the Trace Server In order to open traces, you need a trace server running on the same machine as the trace extension. You can download the [Eclipse Trace Compass server][tc-server] or let `yarn` download and run it: @@ -358,12 +359,10 @@ yarn test --coverage ### UI Tests -To run the UI test suite, first start the browser example application or optionally the Docker example application using external port 3000: +To run the UI test suite, first start the browser example application: ```bash yarn browser start -# or -docker run --init -d -p 0.0.0.0:3000:4000 tte ``` @@ -495,3 +494,4 @@ The code in this repository is licensed under `MIT` (see root `LICENSE`), except [tspc]: https://github.com/eclipse-cdt-cloud/tsp-typescript-client [tsp-gh-label]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/labels/trace%20server%20protocol [yarn-issue-2821]: https://github.com/yarnpkg/yarn/issues/2821 +[trace-viewer-examples]: https://github.com/eclipse-cdt-cloud/trace-viewer-examples diff --git a/examples/docker/Dockerfile b/examples/docker/Dockerfile deleted file mode 100644 index 99bbcba2..00000000 --- a/examples/docker/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -FROM node:18.19.1-bookworm-slim as build - -RUN apt-get update && apt-get install -y \ - git \ - python3 \ - make \ - pkg-config \ - libsecret-1-dev \ - g++ \ - libx11-dev \ - libxkbfile-dev - -# Build the browser theia-trace-extension application -COPY example-package.json /app/tte/package.json -COPY webpack.config.js /app/tte/webpack.config.js -WORKDIR /app/tte/ -RUN yarn && \ - npx theia build --app-target=\"browser\" --mode production && \ - yarn autoclean --init && \ - echo *.ts >> .yarnclean && \ - echo *.ts.map >> .yarnclean && \ - echo *.spec.* >> .yarnclean && \ - yarn --production && \ - yarn cache clean && \ - du -hs /app/tte - -FROM node:18.19.1-bookworm-slim - -COPY --from=build /app/tte /app/tte - -RUN apt-get update && apt-get install -y \ - libx11-6 \ - libxkbfile1 \ - libsecret-1-0 \ - && rm -rf /var/lib/apt/lists/* -ENV NODE_ENV production - -WORKDIR /app/tte -COPY docker-entrypoint.sh /usr/local/bin -EXPOSE 4000 -ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/examples/docker/README.md b/examples/docker/README.md deleted file mode 100644 index 6f5a1712..00000000 --- a/examples/docker/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Example docker image for theia-trace-extension - -This folder contains an example showing how to create a docker image -for theia-trace-extension front-end. - -Notes: - -- the image will contain exclusively the theia-trace-extension front-end. - If you want to run a complete application, you will need a service - running the trace-server (not included here); - -- the image will be built using a specific [npm package] of the - theia-trace-extension, and not the latest code in this repo; - -- the *example-package.json* file is not named *package.json* because - at the time this change was proposed building the theia-trace-extension - application from the source of this repo looked recursively to all - package.json in the project, and we wanted to avoid pollution of the - main project lockfile when building; - -## How to build and run - -Build the image and name it *tte*. Try adding `--network host` in case -of build failures related to debian packages retrieval: - -```bash -docker build -t tte . -``` - -Once the image has been built, start a container named *tte-1* from -the *tte* image: - -```bash -docker run --name tte-1 tte -``` - -Find the IP address of the *tte-1* container: - -```bash -docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' tte-1 -``` - -Connect to port `4000` of the IP identified earlier using your browser. -You should be able to see the theia-trace-extension UI. - -## Connect to a trace-server - -Let's say you have another container running the trace-server at -IP 172.17.0.2, port `8080`. You can launch the *tte-1* container and -connect it to the trace-server using the following command: - -```bash -docker run --name tte-1 --network="host" -e TRACE_SERVER_URL=172.17.0.2:8080/tsp/api tte -``` - -[npm package]: https://www.npmjs.com/package/theia-traceviewer diff --git a/examples/docker/docker-entrypoint.sh b/examples/docker/docker-entrypoint.sh deleted file mode 100755 index 1f470a3f..00000000 --- a/examples/docker/docker-entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -# @theia/cli not installed, so start the app directly -node ./src-gen/backend/main.js --hostname 0.0.0.0 --port 4000 \ No newline at end of file diff --git a/examples/docker/example-package.json b/examples/docker/example-package.json deleted file mode 100644 index a1d61928..00000000 --- a/examples/docker/example-package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "private": true, - "name": "docker-theia-trace-example", - "version": "0.1.0", - "theia": { - "target": "browser", - "frontend": { - "config": { - "applicationName": "Theia-Trace Example Application", - "preferences": { - "editor.autoSave": "on", - "trace-viewer.port": 8080 - } - } - } - }, - - "dependencies": { - "@emotion/react": "^11.10.5", - "@emotion/styled": "^11.10.5", - "@mui/material": "^5.10.14", - "@theia/core": "1.45.1", - "@theia/navigator": "1.45.1", - "@theia/preferences": "1.45.1", - "theia-traceviewer": "0.2.0-next.20240229144356.c22cb2c.0" - }, - "devDependencies": { - "@theia/cli": "1.45.1" - }, - "scripts": { - "start": "theia start", - "watch": "theia build --watch" - }, - "engines": { - "yarn": ">=1.7.0 <2", - "node": ">=16 <19" - }, - "resolutions": { - "msgpackr": "^1.10.1", - "inversify": "6.0.3" - } -} diff --git a/examples/docker/webpack.config.js b/examples/docker/webpack.config.js deleted file mode 100644 index 97c946d5..00000000 --- a/examples/docker/webpack.config.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This file can be edited to customize webpack configuration. - * To reset delete this file and rerun theia build again. - */ -// @ts-check -const config = require('./gen-webpack.config.js'); -const webpack = require("webpack"); - - -/** - * Expose bundled modules on window.theia.moduleName namespace, e.g. - * window['theia']['@theia/core/lib/common/uri']. - * Such syntax can be used by external code, for instance, for testing. -config.module.rules.push({ - test: /\.js$/, - loader: require.resolve('@theia/application-manager/lib/expose-loader') -}); */ - -config[0].plugins.push(new webpack.DefinePlugin({ - 'process.env': { - NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development') - } -})); - -module.exports = config; \ No newline at end of file diff --git a/theia-extensions/viewer-prototype/README.md b/theia-extensions/viewer-prototype/README.md index dc60b31a..ebd0e3b7 100644 --- a/theia-extensions/viewer-prototype/README.md +++ b/theia-extensions/viewer-prototype/README.md @@ -7,7 +7,7 @@ The Theia trace viewer extension is a Theia extension, that one can use to add t - [Theia Trace Viewer Extension git repository](https://github.com/eclipse-cdt-cloud/theia-trace-extension) - [Trace Server Protocol git repository](https://github.com/eclipse-cdt-cloud/trace-server-protocol) - [Reference Trace Server - Download (Eclipse Trace Compass)](https://download.eclipse.org/tracecompass.incubator/trace-server/rcp/) -- [Theia Trace Viewer Docker appliance example](https://github.com/eclipse-cdt-cloud/theia-trace-extension/blob/master/examples/docker/) +- [Theia Trace Viewer Docker appliance examples](https://github.com/eclipse-cdt-cloud/trace-viewer-examples/tree/master/docker) - [CDT Cloud Blueprint git repository (Contains the Theia Trace Viewer Extension)](https://github.com/eclipse-cdt-cloud/cdt-cloud-blueprint) ## Screenshots