Skip to content

Commit

Permalink
Merge pull request #19 from PizzaFactory/pro-pre-add-vstepngtcore
Browse files Browse the repository at this point in the history
Add VSTeP/NGT Core supports
  • Loading branch information
monaka authored Jun 29, 2019
2 parents 1a6b435 + b3b31a5 commit a24d340
Show file tree
Hide file tree
Showing 42 changed files with 353 additions and 59 deletions.
72 changes: 71 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,68 @@
# che-theia
<br/>
<div id="che-theia-logo" align="center" style="vertical-align: middle">

<img src="https://raw.githubusercontent.com/eclipse/che-theia/master/extensions/eclipse-che-theia-about/src/browser/style/che-logo-light.svg?sanitize=true" alt="Che Logo" width="200" />

<img src="https://raw.githubusercontent.com/theia-ide/theia/master/logo/theia-logo.svg?sanitize=true" alt="Theia Logo" width="150"/>

# Che Theia


</div>

<div id="badges" align="center">

[![Build Status](https://ci.codenvycorp.com/buildStatus/icon?job=che-theia-master-ci)](https://ci.codenvycorp.com/job/che-theia-master-ci)
[![mattermost](https://img.shields.io/badge/chat-on%20mattermost-blue.svg)](https://mattermost.eclipse.org/eclipse/channels/eclipse-che-ide2-team)
[![Open questions](https://img.shields.io/badge/Open-questions-blue.svg?style=flat-curved)](https://github.com/eclipse/che-theia/labels/kind%2Fquestion)
[![Open bugs](https://img.shields.io/badge/Open-bugs-red.svg?style=flat-curved)](https://github.com/eclipse/che-theia/labels/kind%2Fbug)

</div>

<div style='margin:0 auto;width:80%;'>

![Che-Theia](https://raw.githubusercontent.com/eclipse/che-theia/master/che-theia-screenshot.png)

</div>

## What is Che-theia ?
[Eclipse Che](https://eclipse.org/che/) provides a default web IDE for the workspaces which is based on the [Theia](https://github.com/theia-ide/theia) project. It’s a subtle different version than a plain Theia(https://github.com/theia-ide/theia) as there are functionalities that have been added based on the nature of the Eclipse Che workspaces. We are calling this version of Eclipse Theia for Che: Che-Theia.

So, Che-Theia is the default `Che editor` provided with developer workspaces created in [Eclipse Che 7](https://eclipse.org/che/)([Github](https://github.com/eclipse/che)).

Che-Theia contains additional extensions and plugins which have been added based on the nature of Eclipse Che workspaces and to provide the best IDE experience of Theia within Che.
- A VSCode-like IDE experience. Che-Theia is based on the monaco
editor and includes features like the command pallete.
- VSCode extension compatibility. Che-Theia supports VSCode
extensions. In Che-theia, these extensions could come with a side-car
containers with all the dependencies required by the extension.
No need to install the JDK or Maven when you install our VSCode Java plugin.
- Nice views to interact with your user containers or production runtime containers.
(Terminal access, execute Che-commands in specific containers, etc...)

## Che-Theia capabilities
In Che-Theia, you’ll find the following capabilities:


| Plug-in | Description |
|-----------------------|-------------|
| Che Extended Tasks | Handles the Che commands and provides the ability to start those into a specific container of the workspace. |
| Che Extended Terminal | Allows to provide terminal for any of the containers of the workspace. |
| Che Factory | Handles the Eclipse Che Factories [TODO: LINK] |
| Che Container | Provides a container view that shows all the containers that are running in the workspace and allows to interact with them. |
| Che Dashboard | Allows to integrate the IDE with Che Dashboard and facilitate the navigation. |
| Che Welcome Page | Display a welcome page with handy links when opening the IDE. |
| Che Ports | Allows to detect when services are running inside of the workspace and expose them. |
| Che APIs | Extends the IDE APIs, to allow interacting with the Che specific components (workspaces, preferences, etc.). |


## Join the community

The Eclipse Che community is globally reachable through public chat rooms, mailing list and weekly calls.
See https://www.eclipse.org/che/docs/che-7/introduction-to-eclipse-che.html#joining-the-community

Che-Theia is mainly maintained by the Che IDE2 team a.k.a Selene.
You are very welcome to join our community chat [here](https://mattermost.eclipse.org/eclipse/channels/eclipse-che-ide2-team) to discuss about improvements, bug fixes and anything else.

## Project structure

Expand All @@ -7,6 +71,7 @@
- [extensions](./extensions) contains Theia Extensions
- [plugins](./plugins) contains Theia Plugins

# Contributing
## How to build

Run `yarn` to build Theia extensions and plugins.
Expand Down Expand Up @@ -39,3 +104,8 @@ Then in `dockerfiles/theia` run:
Where `${GITHUB_TOKEN_ARG}` is your GitHub API token, it's used for fetching some vscode library that placed on GitHub releases, without that token build may fail.

That script will clone Theia from master branch and all Che related extensions from theirs master branches.


## License

- [Eclipse Public License 2.0](LICENSE)
Binary file added che-theia-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docker_image_build.include
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dockerfiles/remote-plugin-kubernetes-tooling-0.1.17
dockerfiles/remote-plugin-kubernetes-tooling-1.0.0
dockerfiles/remote-plugin-openshift-connector-0.0.17
dockerfiles/remote-plugin-openshift-connector-0.0.21
dockerfiles/remote-plugin-dependency-analytics-0.0.12
)

IMAGES_LIST=(
Expand All @@ -54,6 +55,7 @@ eclipse/che-remote-plugin-kubernetes-tooling-0.1.17
eclipse/che-remote-plugin-kubernetes-tooling-1.0.0
eclipse/che-remote-plugin-openshift-connector-0.0.17
eclipse/che-remote-plugin-openshift-connector-0.0.21
eclipse/che-remote-plugin-dependency-analytics-0.0.12
)

buildImages() {
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/build.include
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ init() {

ORGANIZATION="eclipse"
PREFIX="che"
TAG="nightly"
TAG="next"
SKIP_TESTS=false
NAME="che"
ARGS=""
Expand Down
24 changes: 24 additions & 0 deletions dockerfiles/remote-plugin-dependency-analytics-0.0.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2019 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia-endpoint-runtime:${BUILD_TAG}
RUN apk --update --no-cache add openjdk8 procps nss maven
ENV JAVA_HOME /usr/lib/jvm/default-jvm/

ENV MAVEN_VERSION 3.5.4
ENV MAVEN_HOME /usr/lib/mvn
ENV PATH $MAVEN_HOME/bin:$PATH

RUN wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
tar -zxvf apache-maven-$MAVEN_VERSION-bin.tar.gz && \
rm apache-maven-$MAVEN_VERSION-bin.tar.gz && \
mv apache-maven-$MAVEN_VERSION /usr/lib/mvn

WORKDIR /projects
15 changes: 15 additions & 0 deletions dockerfiles/remote-plugin-dependency-analytics-0.0.12/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
#
# Copyright (c) 2019 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#

base_dir=$(cd "$(dirname "$0")"; pwd)
. "${base_dir}"/../build.include

init --name:remote-plugin-dependency-analytics "$@"
build
2 changes: 1 addition & 1 deletion dockerfiles/remote-plugin-dotnet-2.2.105/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Red Hat, Inc. - initial API and implementation

FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia-endpoint-runtime:${BUILD_TAG} as endpoint
FROM node:10.15-stretch-slim
FROM node:10.16-stretch-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
Expand Down
3 changes: 2 additions & 1 deletion dockerfiles/remote-plugin-go-1.10.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RUN set -eux; \
go version && \
apk add gcc g++ git

ENV GOPATH /projects:/go
ENV GOPATH /go
ENV GOCACHE /.cache
ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
Empty file modified dockerfiles/remote-plugin-kubernetes-tooling-0.1.17/build.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Red Hat, Inc. - initial API and implementation

FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia-endpoint-runtime:${BUILD_TAG} as endpoint
FROM quay.io/buildah/upstream:v1.8.2
FROM quay.io/buildah/stable:v1.9.0

ENV KUBECTL_VERSION v1.14.1
ENV HELM_VERSION v2.13.1
Expand All @@ -31,4 +31,6 @@ COPY --from=endpoint /etc/passwd /etc/passwd
COPY --from=endpoint /etc/group /etc/group
COPY --from=endpoint /entrypoint.sh /entrypoint.sh

RUN chmod g+w /home/theia

ENTRYPOINT ["/entrypoint.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia-endpoint-runtime:${BUILD_TAG}

ENV GLIBC_VERSION 2.29-r0
ENV ODO_VERSION v0.0.19
ENV OC_VERSION v3.11.0
ENV OC_TAG 0cbc58b

Expand All @@ -20,7 +21,7 @@ RUN wget -O glibc-${GLIBC_VERSION}.apk https://github.com/andyshinn/alpine-pkg-g
apk --update --allow-untrusted add glibc-${GLIBC_VERSION}.apk && \
rm -f glibc-${GLIBC_VERSION}.apk && \
# install ODO
wget -O /usr/local/bin/odo https://github.com/redhat-developer/odo/releases/download/v0.0.19/odo-linux-amd64 && \
wget -O /usr/local/bin/odo https://github.com/openshift/odo/releases/download/${ODO_VERSION}/odo-linux-amd64 && \
chmod +x /usr/local/bin/odo && \
# install OC
wget -O- https://github.com/openshift/origin/releases/download/${OC_VERSION}/openshift-origin-client-tools-${OC_VERSION}-${OC_TAG}-linux-64bit.tar.gz | tar xvz -C /usr/local/bin --strip 1
Empty file modified dockerfiles/remote-plugin-openshift-connector-0.0.17/build.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN apk add --no-cache bash && \
apk --update --allow-untrusted add glibc-${GLIBC_VERSION}.apk && \
rm -f glibc-${GLIBC_VERSION}.apk && \
# install odo
wget -O /usr/local/bin/odo https://github.com/redhat-developer/odo/releases/download/${ODO_VERSION}/odo-linux-amd64 && \
wget -O /usr/local/bin/odo https://github.com/openshift/odo/releases/download/${ODO_VERSION}/odo-linux-amd64 && \
chmod +x /usr/local/bin/odo && \
# install oc
wget -O- https://github.com/openshift/origin/releases/download/${OC_VERSION}/openshift-origin-client-tools-${OC_VERSION}-${OC_TAG}-linux-64bit.tar.gz | tar xvz -C /usr/local/bin --strip 1
2 changes: 1 addition & 1 deletion dockerfiles/theia-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
###
# Builder Image
#
FROM node:10.15-alpine
FROM node:10.16-alpine

RUN apk add --update --no-cache \
# Download some files
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/theia-endpoint-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ COPY /docker-build/theia-plugin-remote/tsconfig.json /home/workspace/packages/th
COPY /etc/package.json /home/workspace
RUN cd /home/workspace/ && yarn install

FROM node:10.15-alpine
FROM node:10.16-alpine
ENV HOME=/home/theia
COPY --from=builder /home/workspace/node_modules /home/theia/node_modules
RUN rm -rf /home/theia/node_modules/@eclipse-che/theia-plugin-ext /home/theia/node_modules/@eclipse-che/theia-remote
Expand Down
15 changes: 10 additions & 5 deletions dockerfiles/theia/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ WORKDIR ${HOME}
# else check if github rate limit is enough, else will abort requiring to set GITHUB_TOKEN value
ARG GITHUB_TOKEN

ARG THEIA_GITHUB_REPO=theia-ide/theia

# Define upstream version of theia to use
ARG THEIA_VERSION=master

Expand All @@ -40,10 +42,10 @@ RUN if [ ! -z "${GITHUB_TOKEN-}" ]; then \
fi

#invalidate cache
ADD https://${GITHUB_TOKEN}:x-oauth-basic@api.github.com/repos/theia-ide/theia/git/${GIT_REF} /tmp/branch_info.json
ADD https://${GITHUB_TOKEN}:x-oauth-basic@api.github.com/repos/${THEIA_GITHUB_REPO}/git/${GIT_REF} /tmp/branch_info.json

# Clone theia
RUN git clone --branch ${GIT_BRANCH_NAME} --single-branch --depth 1 https://github.com/theia-ide/theia ${HOME}/theia-source-code
RUN git clone --branch ${GIT_BRANCH_NAME} --single-branch --depth 1 https://github.com/${THEIA_GITHUB_REPO} ${HOME}/theia-source-code

# Add patches
ADD src/patches ${HOME}/patches
Expand All @@ -62,8 +64,6 @@ ARG CDN_PREFIX=""
ARG MONACO_CDN_PREFIX=""
WORKDIR ${HOME}/theia-source-code

RUN yarn add -W @opentestmodeling/vstep-ngt-core-dsl @opentestmodeling/vstep-ngt-core-sprotty

COPY che-theia/che-theia-init-sources.yml ${HOME}/che-theia-init-sources.yml

#invalidate cache for che-theia extensions
Expand All @@ -76,6 +76,11 @@ RUN che:theia cdn --theia="${CDN_PREFIX}" --monaco="${MONACO_CDN_PREFIX}"
# Compile Theia
RUN yarn

# Add more extensions
RUN cd examples/assembly && \
yarn add @opentestmodeling/vstep-ngt-core-dsl@0.8.0-next.2 \
@opentestmodeling/vstep-ngt-core-sprotty@0.8.0-next.2

# Run into production mode
RUN che:theia production

Expand All @@ -93,7 +98,7 @@ RUN find production -exec sh -c "chgrp 0 {}; chmod g+rwX {}" \; 2>log.txt
# Runtime Image
#
# Use node image
FROM node:10.15-alpine as runtime
FROM node:10.16-alpine as runtime
ENV USE_LOCAL_GIT=true \
HOME=/home/theia \
THEIA_DEFAULT_PLUGINS=local-dir:///default-theia-plugins \
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/theia/e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV NOCDN=true

RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y libx11-dev libxkbfile-dev
apt-get install -y libx11-dev libxkbfile-dev sudo iproute2
CMD /root/docker-run.sh
RUN yarn global add typescript@2.9.2 node-gyp

Expand Down
23 changes: 21 additions & 2 deletions dockerfiles/theia/e2e/src/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@
#
# SPDX-License-Identifier: EPL-2.0

# (5 + 2 * 30 = 65 seconds) is the default timeout.
: "${WAIT_COUNT:=30}"

echo "Starting Theia..."
rm -rf /root/logs/*
HOME=/home/theia /entrypoint.sh > /root/logs/theia.log 2>/root/logs/theia-error.log&
sleep 10s

echo "Cleaning videos folder..."
# Cleanup previous videos
rm -rf /root/cypress/videos
rm -rf /root/cypress/videos/*

# Find TCP 0.0.0.0:3100 that will be opened by Theia.
sleep 5s
while [ $WAIT_COUNT -gt 0 ]; do
# Check the listening port
ss -nlt | grep -Fq ':3100' && break
# not found
WAIT_COUNT=$((WAIT_COUNT-1));
echo "Waiting for booting up Theia..."
sleep 2s
done

if [ $WAIT_COUNT -eq 0 ]; then
echo "Timeout. Theia is dead?"
exit 1
fi

# Run tests
echo "Run the tests"
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/theia/extract-for-cdn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ help() {

image="$1"
destination="$2"
if [ "${image}" == "" -o "${destination}" == "" ]; then
if [ -z "${image}" -o -z "${destination}" ]; then
help
exit 1
fi
Expand Down
1 change: 1 addition & 0 deletions extensions/eclipse-che-theia-activity-tracker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build": "concurrently -n \"format,lint,compile\" -c \"red,green,blue\" \"yarn format\" \"yarn lint\" \"yarn compile\"",
"watch": "tsc -w"
},
"license": "EPL-2.0",
"theiaExtensions": [
{
"frontend": "lib/browser/che-theia-activity-tracker-frontend-module",
Expand Down
1 change: 1 addition & 0 deletions extensions/eclipse-che-theia-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"build": "concurrently -n \"format,lint,compile\" -c \"red,green,blue\" \"yarn format\" \"yarn lint\" \"yarn compile\"",
"watch": "tsc -w"
},
"license": "EPL-2.0",
"theiaExtensions": [
{
"frontend": "lib/browser/che-theia-dashboard-module"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { CheVariablesMainImpl } from './che-variables-main';
import { CheTaskMainImpl } from './che-task-main';
import { CheSshMainImpl } from './che-ssh-main';
import { CheDevfileMainImpl } from './che-devfile-main';
import { CheUserMainImpl } from './che-user-main';

@injectable()
export class CheApiProvider implements MainPluginApiProvider {
Expand All @@ -29,6 +30,7 @@ export class CheApiProvider implements MainPluginApiProvider {
rpc.set(PLUGIN_RPC_CONTEXT.CHE_VARIABLES_MAIN, new CheVariablesMainImpl(container, rpc));
rpc.set(PLUGIN_RPC_CONTEXT.CHE_TASK_MAIN, new CheTaskMainImpl(container, rpc));
rpc.set(PLUGIN_RPC_CONTEXT.CHE_SSH_MAIN, new CheSshMainImpl(container));
rpc.set(PLUGIN_RPC_CONTEXT.CHE_USER_MAIN, new CheUserMainImpl(container));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export default new ContainerModule(bind => {
bindViewContribution(bind, ChePluginViewContribution);

bind(ChePluginMenu).toSelf().inSingletonScope();
bind(ChePluginWidget).toSelf().inSingletonScope();

bind(ChePluginWidget).toSelf();
bind(WidgetFactory).toDynamicValue(ctx => ({
id: ChePluginViewContribution.PLUGINS_WIDGET_ID,
createWidget: () => ctx.container.get(ChePluginWidget)
Expand Down
Loading

0 comments on commit a24d340

Please sign in to comment.