Skip to content

Commit

Permalink
Add npm script to download trace server and sample traces
Browse files Browse the repository at this point in the history
The trace server download will work when the update
in the Trace Compass CI matches.

Gitpod config switched to produce the electron version
of the example trace viewer application. The browser
version does not currently work when the frontend and
backend of the app are on different machines.

To access the example application on Gitpod, wait for
it to build, and when done open port 6080 from the
right side of the status bar. This will open a new
browser tab or window that will access the vnc server
that runs in your container. This way of doing things
introduces significant lag vs the broser version. That's
unavoidable. Even if not ideal, one can test a PR in 3
mins instead of 15 this way.

Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
  • Loading branch information
marcdumais-work committed Jun 19, 2020
1 parent 2e4fe21 commit 61efe89
Show file tree
Hide file tree
Showing 9 changed files with 389 additions and 359 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ node_modules
.browser_modules
lib
*.log
sample-traces
trace-compass-server
trace-compass-server.tar.gz
tracecompass-test-traces
*-app/*
!*-app/package.json
!*-app/electron-builder.yml
Expand Down
16 changes: 12 additions & 4 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ ports:
onOpen: ignore
- port: 9339 # Node.js debug port
onOpen: ignore
- port: 6080
- port: 6080 # VNC server
onOpen: ignore
- port: 5900
onOpen: ignore
- port: 8080 # Trace Compass server
onOpen: ignore
tasks:
- init: yarn
- init: >
yarn download:server
command: >
yarn start:server
- init: >
yarn download:sample-traces &&
yarn
command: >
yarn start:browser ../ --hostname=0.0.0.0
yarn start:electron ../sample-traces/ --hostname=0.0.0.0
github:
prebuilds:
pullRequestsFromForks: true
pullRequestsFromForks: true
20 changes: 12 additions & 8 deletions LICENSE.gitpod.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
The Gitpod config files have been copied from the main eclipse-theia repo:

[.gitpod.yml](https://github.com/eclipse-theia/theia/blob/c1af83e93712e07049a4cfcf46735b039de24ab8/.gitpod.yml)

[.gitpod.dockerfile](https://github.com/eclipse-theia/theia/blob/c1af83e93712e07049a4cfcf46735b039de24ab8/.gitpod.dockerfile)
# License of Gitpod configuration files



License:
The Gitpod config files have been copied from the main eclipse-theia repo, which is licensed like so:

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0, or GNU General Public License, version 2
with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.

Original files:

[.gitpod.yml](https://github.com/eclipse-theia/theia/blob/c1af83e93712e07049a4cfcf46735b039de24ab8/.gitpod.yml)

[.gitpod.dockerfile](https://github.com/eclipse-theia/theia/blob/c1af83e93712e07049a4cfcf46735b039de24ab8/.gitpod.dockerfile)

Note: The two above copied files are only useful for CI/tests and are not contributing to the Theia extension or example application contained in this repo. The presence of these differently licensed files in the repo would have no impact on the licensing of the Trace extension or the example application, that can both remain licensed under MIT.

(The MIT license permits re-licensing - that right remains available for anyone to exercise)
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We plan to distribute this extension on npm.

Availability: TBD

## Build the extension
## Build the extension and example application

Here is the step in order to build the trace viewer

Expand All @@ -22,11 +22,11 @@ Here is the step in order to build the trace viewer

**Note for some debian-based machines**: On some distros, there are 2 yarn commands. If you get an error message saying **ERROR: There are no scenarios; must have at least one.**, you are using the wrong yarn. See [https://github.com/yarnpkg/yarn/issues/2821](https://github.com/yarnpkg/yarn/issues/2821).

## Trying the trace extension
## Try the trace extension

This repo contains an example theia-trace application that includes the trace extension. It has two versions:
This repository contains an example trace-viewer application that includes the trace extension. It has two versions:

- _browser_: a "cloud" application, accessed with a web browser
- _browser_: a "browser" application, accessed with a web browser
- _electron_: a native desktop application

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](https://download.eclipse.org/tracecompass.incubator/trace-server/rcp/?d) or build it yourself using Trace Compass and the Incubator, take a look at the [instruction here](https://www.eclipse.org/tracecompass/download.html).
Expand All @@ -35,7 +35,7 @@ In order to open traces you need a trace server running on the same machine as t
2. From the repo root: `yarn start:browser` or `yarn start:electron`
3. Go to http://localhost:3000 or use the Electron application

## Packaging the Example Theia Trace Viewer Application
## Package the Example Theia Trace Viewer Application

It's possible to package the repo's example application with `electron-builder`. After running `yarn` in the repo root, do:

Expand Down
7 changes: 2 additions & 5 deletions browser-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
"editor.autoSave": "on"
}
}
},
"generator": {
"config": {
"preloadTemplate": "./preload.html"
}
}
},
"dependencies": {
Expand All @@ -33,6 +28,8 @@
"@theia/messages": "next",
"@theia/cpp-debug": "next",
"@theia/vsx-registry": "next",
"@theia/keymaps": "next",
"@theia/getting-started": "next",
"trace-viewer": "0.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion electron-app/electron-builder.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
electronDist: node_modules/electron/dist
productName: Theia Trace Example Aopplication
productName: Theia Trace Example Application
appId: theia-trace-example

asar: false
Expand Down
2 changes: 2 additions & 0 deletions electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"@theia/monaco": "next",
"@theia/messages": "next",
"@theia/vsx-registry": "next",
"@theia/keymaps": "next",
"@theia/getting-started": "next",
"@theia/electron": "next",
"trace-viewer": "0.0.0"
},
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"rebuild:browser": "theia rebuild:browser",
"rebuild:electron": "theia rebuild:electron",
"start:browser": "yarn rebuild:browser ; yarn --cwd browser-app start",
"start:electron": "yarn rebuild:electron ; yarn --cwd electron-app start"
"start:electron": "yarn rebuild:electron ; yarn --cwd electron-app start",
"download:sample-traces": "git clone https://github.com/tracecompass/tracecompass-test-traces.git; ln -s tracecompass-test-traces/ctf/src/main/resources sample-traces",
"download:server": "curl -o trace-compass-server.tar.gz https://download.eclipse.org/tracecompass.incubator/trace-server/rcp/trace-compass-server-latest-linux.gtk.x86_64.tar.gz",
"start:server": "./trace-compass-server/tracecompass-server",
"start-all:browser": "yarn start:server & yarn start:browser",
"start-all:electron": "yarn start:server & yarn start:electron"
},
"devDependencies": {
"lerna": "2.4.0"
Expand Down
Loading

0 comments on commit 61efe89

Please sign in to comment.