Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements...
Transcript of Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements...
![Page 1: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/1.jpg)
1
Move your VS Code extension into Eclipse Che
Florent Benoit
![Page 2: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/2.jpg)
2
Eclipse Che 7
Eclipse Che 7
![Page 3: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/3.jpg)
Devfile to share workspacesDevfile
apiVersion: 1.0.0metadata: generateName: python-projects: - name: python-hello-world source: type: git location: "https://github.com/che-samples/python-hello-world.git"components: - type: chePlugin id: ms-python/python/latest memoryLimit: 512Mi - type: dockerimage alias: python image: quay.io/eclipse/che-python-3.7:nightly memoryLimit: 512Mi mountSources: truecommands: - name: run actions: - type: exec component: python command: "python hello-world.py" workdir: ${CHE_PROJECTS_ROOT}/python-hello-world
Build Env
Runtime Env
Commands
IDE
Tools Plug-ins Dep
Project
Name Repo Branch
Test Env
Build Run Debug
![Page 4: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/4.jpg)
Che 7: swappable editor
4
![Page 5: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/5.jpg)
Che 7: registries
5
Registries in Eclipse Che
plug-in registry devfile registry
workspace
![Page 6: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/6.jpg)
Theia IDE and plug-ins
Manage all plugins including VS
Code extensions6
![Page 7: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/7.jpg)
This afternoon: 5PMSeminarraum 5
More about che 7
Eclipse Che 7: The new, the noteworthy and the future plans!
7
![Page 8: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/8.jpg)
8
Develop VS Code extensions
Develop VS Code extensions
![Page 9: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/9.jpg)
DebugRun inside Eclipse Che IDE
RunRun inside Eclipse Che IDE
VS Code extensions
9
Scaffolding: Yeoman generatoryo code
DevelopIntellisense from Eclipse Che IDE
How to start ?
![Page 10: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/10.jpg)
VS Code extensions hosted mode
Hosted / development mode
10
Two instances of Theia
● Main instance to write plug-ins
● A new instance to run plug-ins
Browser Che / Theia Container
Main Theia Server
Hosted Theia Server
Theia IDE(plugin source)
Hosted Mode(running plugin)
Serves
Serves
![Page 12: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/12.jpg)
12
Develop VS Code extensions
Publish VS Code extensions
on Eclipse Che registries
![Page 13: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/13.jpg)
Che 7: registries
13
Registries in Eclipse Che
plug-in registry devfile registry
workspace
![Page 14: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/14.jpg)
Devfile
---apiVersion: 1.0.0metadata: name: my-che-workspacecomponents: - type: chePlugin id: redhat/java11/latest
plug-in registrydevfile
14 https://che-plugin-registry.openshift.io/v3/plugins/
![Page 15: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/15.jpg)
Devfile and registries
---apiVersion: 1.0.0metadata: name: my-che-workspacecomponents: - type: chePlugin - reference: https://my-registry/plugins/florent/hello/0.1/meta.yaml
che plug-in registry
devfile
my registry15
![Page 16: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/16.jpg)
Create its own registry
16
Build a custom registry based on existing one
● Add / update / remove plug-ins
● Rebuild docker image
![Page 17: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/17.jpg)
Create its own registry on github
17
Or use a simple github project
![Page 19: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/19.jpg)
19
VS Code extensions and Eclipse Che
VS Code extensions and
Eclipse Che
![Page 20: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/20.jpg)
Eclipse Che Workspacesplug-ins per workspace
BENEFITS
Cloud ReadyKubernetes / OpenShift
Plug-in RegistryGlobal / per instance
20
Multi-user / authOpenID Connect / LDAP / Keycloak
ECLIPSE CHE
![Page 21: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/21.jpg)
Custom namespace
21
@eclipse-che/plugin namespace
● Interact easily with Eclipse Che APIhttps://github.com/eclipse/che-theia/blob/master/extensions/eclipse-che-theia-plugin/src/che-proposed.d.ts
export namespace workspace {
export function getCurrentWorkspace(): Promise<cheApi.workspace.Workspace>;
export function getAll(): Promise<cheApi.workspace.Workspace[]>;
export function getAllByNamespace(namespace: string): Promise<cheApi.workspace.Workspace[]>;
export function getById(workspaceId: string): Promise<cheApi.workspace.Workspace>;
export function create(config: cheApi.workspace.WorkspaceConfig, params: KeyValue): Promise<any>;
export function update(workspaceId: string, workspace: cheApi.workspace.Workspace): Promise<any>;
export function deleteWorkspace(workspaceId: string): Promise<any>;
export function start(workspaceId: string, environmentName: string): Promise<any>;
export function startTemporary(config: cheApi.workspace.WorkspaceConfig): Promise<any>;
export function stop(workspaceId: string): Promise<any>;
export function getSettings(): Promise<KeyValue>;
}
● Simple code to useimport * as che from '@eclipse-che/plugin';
...await che.workspace.getCurrentWorkspace();
![Page 22: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/22.jpg)
EXTERNAL PLUG-IN DEPENDENCIES
22
System Runtime dependencies / Language server protocol Java LSP needs Java, PHP requires PHP, etc
Native libraries
Tools dependencies$ apt-get install / yum install
![Page 23: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/23.jpg)
VS Code
Plugin1 PluginN
Standalone VS Code
Java 11container
Plugin 1
Main IDE Container
Plugin 3
JSON RPC
Java 13container
Plugin 2
Eclipse Che with containers
Che IDEEndpoint
Che IDEEndpoint
PLUG-IN RUNTIME
23
ECLIPSE CHE
Java installed on your system
![Page 24: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/24.jpg)
Che Remote Theia endpoint
How sidecar endpoint is working ?
FROM eclipse/che-theia-endpoint-runtime:nextRUN apk --no-cache add openjdk11 -repository=http://dl-cdn.alpinelinux.org/alpine/edge/communityENV JAVA_HOME /usr/lib/jvm/default-jvm/
FROM eclipse/che-theia-endpoint-runtime:nextRUN apk --no-cache add fortune
24
![Page 25: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/25.jpg)
Che Remote Theia endpoint : some limitations
How sidecar endpoint is working ?
25
● Needs to inherit from a dedicated Docker image
● Workaround with multi-staged builds
● Strong link between Theia image and sidecar images
○ (better to use same version of theia on main theia
and sidecars)
![Page 26: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/26.jpg)
Che Remote Theia endpoint : some limitations
How sidecar endpoint is working ?
26
● Needs to inherit from a dedicated Docker image
● Workaround with multi-staged builds
● Strong link between Theia image and sidecar images
○ (better to use same version of theia on main theia
and sidecars)
![Page 27: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/27.jpg)
Upcoming Eclipse Che 7.4 : endpoint improvements
How sidecar endpoint is working ?
27
● Create a single all-in-one binary for this endpoint
○ Using nexe tool on Eclipse Che Theia remote package
● Copy this binary and run it
● Allow to use existing dockers image from docker registries
● ⇒ no need to build images, use image name in plugin’s meta.yaml
FROM docker.io/openjdk:14-alpine
![Page 28: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/28.jpg)
Custom runtime
28
apiVersion: v2publisher: redhatname: vscode-xmlversion: latesttype: VS Code extensiondisplayName: XMLtitle: XML Language Support by Red Hatdescription: This VS Code extension provides support for creating and editing XML documents, based on the LSP4XML language server, running with Java.icon: https://www.eclipse.org/che/images/logo-eclipseche.svgrepository: https://github.com/redhat-developer/vscode-xmlcategory: LanguagefirstPublicationDate: '2019-04-19'spec:
containers: - image: "docker.io/eclipse/che-remote-plugin-runner-java11:next" name: vscode-xml memoryLimit: "768Mi" extensions: - https://github.com/redhat-developer/vscode-xml/releases/download/0.7.0/vscode-xml-0.7.0-3205.vsix
Use a custom runtime for a VS Code extension : meta.yaml
![Page 30: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/30.jpg)
30
Develop VS Code extensions
Status
![Page 31: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/31.jpg)
31
VS Code extensions
https://che-incubator.github.io/vscode-theia-comparator/status.html
![Page 32: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/32.jpg)
32
VS Code extensions
Theia-vscodecov checkerhttps://github.com/theia-ide/theia-vscodecov
$ cd my-vscode-extension$ npx theia-vscodecov
![Page 33: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/33.jpg)
33
Develop VS Code extensions
Conclusion
![Page 34: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/34.jpg)
34
FUTURE
● Improve VS Code API compliance
● Alternate VS Code extension marketplace
![Page 35: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/35.jpg)
35
Getting started with Eclipse Che
Sources github.com/eclipse/che
Dev List [email protected]
Docs http://eclipse.org/che/docs
Mattermost https://mattermost.eclipse.org
Try it out : https://che.openshift.io
Get started with Eclipse Che
![Page 36: Move your VS Code extension into Eclipse Che · Upcoming Eclipse Che 7.4 : endpoint improvements How sidecar endpoint is working ? 27 Create a single all-in-one binary for this endpoint](https://reader035.fdocuments.in/reader035/viewer/2022062605/5fdcacc85ed3555c9002466e/html5/thumbnails/36.jpg)
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat
Red Hat is the world’s leading provider of
enterprise open source software solutions.
Award-winning support, training, and consulting
services make
Red Hat a trusted adviser to the Fortune 500.
Thank you
36