<<

Che 7: New & Noteworthy

Florent Benoit

1 Introduction to 7

Eclipse Che

2 Development time spent on configuration and setup

Activities that require configuration and setup:

- Onboarding on a new project Config and Setup - Switching between different projects, technologies 24% - Fixing a maintenance branch of a dev team’s week is spent on - Reviewing a pull request building and maintaining developer environments - Upgrading tools, plugins, dependencies - Trying out a new technology

3 Anyone, anytime can contribute to a project without installing . The developer contribution journey

Scaffold Config and Setup Configure dependencies Code Dev Build Run Test Debug Integrate Feedback Optimize

Consistency, reproducibility, and ease of access is a velocity factor TRADITIONAL LAPTOP APPROACH

Shareable Project sources with all Dependencies Developer Tools: language servers, , testing tools, security tools, etc... Shareable Commands with some Build and packaging tools Terminal Hard to with Web server / application server anyone (All other runtime components)

A laptop makes it hard to share and secure everything a developer needs. 6 Defining a new kind of

> ……………………… …………………………………………… ………………………………....> ……………………… …………………………………………… ………………………………....{ Main void function() …………..

}

Source Code IDE Tools Runtime Env

Eclipse Che Workspace New Editor

8 NEW EDITOR

New editor:

Containerizing the IDE: zero install and automate configuration Extended Eclipse Theia, to provide a VSCode-like experience

Built-in: ⌁ Languages Server Protocol ⌁ Debug Adapter Protocol

Compatible with VSCode extensions

9 NEW EDITOR

Customize with VSCode extensions

extensions compatibility ● Extensions packaged with their dependencies ● Plug-in registry with predefined set of plug-ins

10 NEW EDITOR

Enriched Developer Experience

● Keyboard Navigation: Command Palette ● Rich Editor ○ Find/Replace instances ○ Peek Definition ○ Outline ● Improved Debug ● Simple Plugin ● Layout customization ● Theming ● Port detection Plugin

11 Swappable Editor

12 Che 7: swappable editor

13 Devfile

14 DEVFILE Devfile: Developer environment as code

Project Name Repo Branch The devfile provides easy-to-configure, highly reproducible IDE definitions of portable developer environments.

Tools It is a declarative abstraction of a replicable developer Runtime Env , which includes the runtime environments, the Build Env source code of the projects mapped to repositories and the Commands tools, plugins and commands needed to code, build, test, run Build Run Debug and debug a project.

Devfile Definition --- DEVFILE apiVersion: 1.0.0 : generateName: -web-vertx- 1 projects: - name: java-web-vertx source: Devfile Example type: git location: "https://github.com/che-samples/web-java-vertx" 2 components: 3 - type: chePlugin 1 Project information id: redhat/java/latest 4 - type: dockerimage 2 List of components of the workspace alias: maven image: quay.io/eclipse/che-java8-maven:nightly 3 Plugin component 5 env: - name: JAVA_OPTS 4 Runtime image value: "-Duser.home=/home/user" - name: MAVEN_OPTS

5 Env variables to configure the container value: $(JAVA_OPTS) memoryLimit: 512Mi 6 6 End-points definition endpoints: - name: '8080/tcp' port: 8080 mountSources: true 16 volumes: - name: m2 containerPath: /home/user/.m2 Devfile: Made for Team

Manage Consistency Easy to Integrate Simple to Share Extensible

First class support of K8S, Devfiles are easy to Devfile live with source Customize per task, with manage the complexity of integrate with any tools. code, are easy to modify, plug-in and developer developer environments Developer environments fork and share. preferences take out the pain. can be created from anywhere at anytime.

17 2019 TECH EXCHANGE CONFIDENTIAL INTERNAL USE

DEMO #1

18

Photo by Unsplash Stack and Plug-ins Registries

19 OPENSHIFT 4.2

Stack and Plug-ins Registries

Tools Registry Devfile Registry

In-house deployment Provide ready-to-use developer

stacks Define plug-ins

Manage stacks Define IDEs

20 Che 7: registries

Registries in Eclipse Che

plug-in registry devfile registry

workspace

21 Theia IDE and plug-ins

Manage all plugins including VS Code extensions

22 Develop VS Code extensions

Develop VS Code extensions

23 VS Code extensions How to start ?

Scaffolding: Yeoman generator yo code

Develop Intellisense from Eclipse Che IDE

Run Run inside Eclipse Che IDE

Debug Run inside Eclipse Che IDE

24 VS Code extensions hosted mode

Hosted / development mode

Browser Che / Theia Container

Theia IDE Serves Main Theia (plugin source) Server

Hosted Mode Serves Hosted Theia (running plugin) Server Two instances of Theia

● Main instance to write plug-ins

● A new instance to run plug-ins

25 2019 RED HAT TECH EXCHANGE CONFIDENTIAL INTERNAL USE

DEMO #2

Develop and debug VSCode extension

youtube

26

Photo by Unsplash Develop VS Code extensions

Publish VS Code extensions

on Eclipse Che registries

27 Che 7: registries

Registries in Eclipse Che

plug-in registry devfile registry

workspace

28 Devfile

--- apiVersion: 1.0.0 metadata: name: my-che-workspace components: - type: chePlugin id: redhat/java11/latest

plug-in registry devfile

29 https://che-plugin-registry.openshift.io/v3/plugins/ Devfile and registries

--- apiVersion: 1.0.0 metadata: name: my-che-workspace components: - type: chePlugin che plug-in registry - reference: https://my-registry/plugins/florent/hello/0.1/meta.yaml

devfile

my registry 30 Create its own registry Build a custom registry based on existing one

● Add / update / remove plug-ins

● Rebuild image

31 Create its own registry on Or use a simple github project

32 2019 RED HAT TECH EXCHANGE CONFIDENTIAL INTERNAL USE

DEMO #3

VSCode extension with custom plugin registry

youtube33

Photo by Unsplash VS Code extensions and Eclipse Che

VS Code extensions and

Eclipse Che

34 BENEFITS ECLIPSE CHE

Eclipse Che Workspaces Multi-user / auth plug-ins per workspace OpenID Connect / LDAP / Keycloak

Plug-in Registry Cloud Ready Global / per instance Kubernetes / OpenShift

35 Custom namespace

@eclipse-che/plugin namespace

● Interact easily with Eclipse Che API https://github.com/eclipse/che-theia/blob/master/extensions/eclipse-che-theia-plugin/src/che-pr

oposed..ts

export namespace workspace { export function getCurrentWorkspace(): Promise; export function getAll(): Promise; export function getAllByNamespace(namespace: string): Promise; export function getById(workspaceId: string): Promise; export function create(config: cheApi.workspace.WorkspaceConfig, params: KeyValue): Promise; export function update(workspaceId: string, workspace: cheApi.workspace.Workspace): Promise; export function deleteWorkspace(workspaceId: string): Promise; export function start(workspaceId: string, environmentName: string): Promise; export function startTemporary(config: cheApi.workspace.WorkspaceConfig): Promise; export function stop(workspaceId: string): Promise; export function getSettings(): Promise; }

● Simple code to use

import * as che from '@eclipse-che/plugin';

36 ... await che.workspace.getCurrentWorkspace(); EXTERNAL PLUG-IN DEPENDENCIES

System Runtime dependencies / Java LSP needs Java, PHP requires PHP, etc

Tools dependencies $ apt-get install / yum install

Native libraries

37 PLUG-IN RUNTIME ECLIPSE CHE

Standalone VS Code Eclipse Che with containers

Java 11 Java 13 container container Plugin 1 Plugin 2 VS Code Che IDE Che IDE Endpoint Endpoint Plugin1 PluginN JSON RPC

Main IDE Container

Plugin 3 Java installed on your system

38 How sidecar endpoint is working ?

Che Remote Theia endpoint

FROM eclipse/che-theia-endpoint-runtime:next RUN apk --no-cache add openjdk11 -repository=http://dl-cdn.alpinelinux.org/alpine/edge/community ENV JAVA_HOME /usr/lib/jvm/default-jvm/

FROM eclipse/che-theia-endpoint-runtime:next RUN apk --no-cache add fortune

39 How sidecar endpoint is working ?

Che Remote Theia endpoint : some limitations

● 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)

40 How sidecar endpoint is working ?

Che Remote Theia endpoint : some limitations

● 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)

41 How sidecar endpoint is working ?

Upcoming Eclipse Che 7.4 : endpoint improvements

● 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

FROM docker.io/:14-alpine

● ⇒ no need to build images, use image name in plugin’s meta.yaml

42 Custom runtime

Use a custom runtime for a VS Code extension : meta.yaml

apiVersion: v2 publisher: redhat name: vscode- version: latest type: VS Code extension displayName: XML title: XML Language Support by Red Hat description: 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.svg repository: https://github.com/redhat-developer/vscode-xml category: Language firstPublicationDate: '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

43 2019 RED HAT TECH EXCHANGE CONFIDENTIAL INTERNAL USE

DEMO #4

VSCode extension with custom runtime

44youtube

Photo by Unsplash Develop VS Code extensions

Status

45 VS Code extensions https://che-incubator.github.io/vscode-theia-comparator/status.html

46 VS Code extensions

Theia-vscodecov checker

https://github.com/theia-ide/theia-vscodecov

$ cd my-vscode-extension $ npx theia-vscodecov

47 Conclusion

48 Getting started with Eclipse Che

Get started with Eclipse Che

Sources Dev List [email protected] github.com/eclipse/che

Mattermost Docs https://mattermost.eclipse.org http://eclipse.org/che/docs

Try it out : https://che.openshift.io

49 Thank you linkedin.com/company/red-hat

youtube.com/user/RedHatVideos Red Hat is the world’s leading provider of

enterprise open source software solutions. facebook.com/redhatinc Award-winning support, training, and consulting

services make twitter.com/RedHat Red Hat a trusted adviser to the Fortune 500.

50