Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Use same version of @theia dependencies in 'che-theia' and 'che-theia-endpoint-runtime' #406

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker_image_build.include
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ buildImages() {
bash $(pwd)/$image_dir/build.sh --build-args:${GITHUB_TOKEN_ARG},THEIA_VERSION=${THEIA_VERSION} --tag:${IMAGE_TAG} --branch:${THEIA_BRANCH} --git-ref:${THEIA_GIT_REFS}
elif [ "$image_dir" == "dockerfiles/theia-dev" ]; then
bash $(pwd)/$image_dir/build.sh --build-arg:${GITHUB_TOKEN_ARG} --tag:${IMAGE_TAG}
elif [ "$image_dir" == "dockerfiles/theia-endpoint-runtime" ]; then
bash $(pwd)/$image_dir/build.sh --build-arg:${GITHUB_TOKEN_ARG} --tag:${IMAGE_TAG} --branch:${THEIA_BRANCH}
else
bash $(pwd)/$image_dir/build.sh --build-arg:${GITHUB_TOKEN_ARG} --tag:${IMAGE_TAG}
fi
Expand Down
40 changes: 26 additions & 14 deletions dockerfiles/theia-endpoint-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ FROM ${BUILD_ORGANIZATION}/${BUILD_PREFIX}-theia-dev:${BUILD_TAG} as builder
# 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

# Check github limit
RUN if [ ! -z "${GITHUB_TOKEN-}" ]; then \
export GITHUB_TOKEN=$GITHUB_TOKEN; \
Expand All @@ -35,27 +37,37 @@ RUN if [ ! -z "${GITHUB_TOKEN-}" ]; then \
ADD https://${GITHUB_TOKEN}:x-oauth-basic@api.github.com/repos/theia-ide/theia/git/refs/head /tmp/branch_info.json
ADD https://${GITHUB_TOKEN}:x-oauth-basic@api.github.com/repos/eclipse/che-theia/git/refs/head /tmp/branch_info.json

# Clone theia
RUN git clone --branch ${GIT_BRANCH_NAME} --single-branch --depth 1 https://github.com/${THEIA_GITHUB_REPO} /home/workspace

# Grab dependencies
COPY /docker-build/theia-plugin-remote/package.json /home/workspace/packages/theia-remote/
RUN cd /home/workspace/packages/theia-remote/ && yarn install --ignore-scripts
COPY /docker-build/theia-plugin-remote/package.json /home/workspace/examples/assembly/
RUN cd /home/workspace/examples/assembly/ && yarn install --ignore-scripts

# Adding sources
COPY /docker-build/configs /home/workspace/che/configs
COPY /docker-build/configs/tsfmt.json /home/workspace/configs/tsfmt.json
COPY /docker-build/configs/tslint.json /home/workspace/configs/tslint.json
COPY /docker-build/theia-plugin-remote/*.json /home/workspace/examples/assembly/
COPY /docker-build/theia-plugin-remote/src /home/workspace/examples/assembly/src
COPY /docker-build/theia-plugin-ext /home/workspace/che/packages/theia-plugin-ext
COPY /docker-build/theia-plugin /home/workspace/che/packages/theia-plugin

RUN ln -s /home/workspace/che/packages/theia-plugin-ext /home/workspace/packages/theia-plugin-ext
RUN ln -s /home/workspace/che/packages/theia-plugin /home/workspace/packages/theia-plugin

# Compile
COPY /docker-build/configs /home/workspace/configs
COPY /docker-build/theia-plugin-remote/*.json /home/workspace/packages/theia-remote/
COPY /docker-build/theia-plugin-remote/src /home/workspace/packages/theia-remote/src
COPY /docker-build/theia-plugin-ext /home/workspace/packages/theia-plugin-ext
COPY /docker-build/theia-plugin /home/workspace/packages/theia-plugin
COPY /docker-build/theia-plugin-remote/tsconfig.json /home/workspace/packages/theia-plugin/tsconfig.json
# installing all dependencies
RUN cd /home/workspace/ && yarn

COPY /etc/package.json /home/workspace
RUN cd /home/workspace/ && yarn install
# Run into production mode
RUN cd /home/workspace/ && che:theia production

FROM node:10.16-alpine
ENV HOME=/home/theia
COPY --from=builder /home/workspace/node_modules /home/theia/node_modules
COPY --from=builder /home/workspace/production /home/theia/
RUN rm -rf /home/theia/node_modules/@eclipse-che/theia-plugin-ext /home/theia/node_modules/@eclipse-che/theia-remote
evidolob marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=builder /home/workspace/packages/theia-plugin-ext /home/theia/node_modules/@eclipse-che/theia-plugin-ext
COPY --from=builder /home/workspace/packages/theia-remote/lib /home/theia/lib
COPY --from=builder /home/workspace/che/packages/theia-plugin-ext /home/theia/node_modules/@eclipse-che/theia-plugin-ext
evidolob marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=builder /home/workspace/production/lib /home/theia/lib
RUN mkdir /projects \
# Store passwd/group as template files
&& cat /etc/passwd | sed s#root:x.*#root:x:\${USER_ID}:\${GROUP_ID}::\${HOME}:/bin/sh#g > ${HOME}/passwd.template \
Expand Down
2 changes: 1 addition & 1 deletion extensions/eclipse-che-theia-plugin-remote/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@eclipse-che/theia-remote",
"name": "@eclipse-che/theia-assembly",
"author": "Florent Benoit",
"version": "0.0.1",
"license": "EPL-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import * as theia from '@theia/plugin';
import { TerminalServiceExtImpl } from '@theia/plugin-ext/lib/plugin/terminal-ext';
import { DebugExtImpl } from '@theia/plugin-ext/lib/plugin/node/debug/debug';
import { TerminalOptionsExt } from '@theia/plugin-ext/lib/api/plugin-api';

/**
* Allow to override createTerminal to be container-aware and then create terminal to the sidecar container
Expand Down Expand Up @@ -54,9 +55,9 @@ export class TerminalContainerAware {

overrideTerminalCreationOptionForDebug(debugExt: DebugExtImpl) {
debugExt.doGetTerminalCreationOptions = (debugType: string) => {
const options: theia.TerminalOptions = {
const options: TerminalOptionsExt = {
attributes: {
'CHE_MACHINE_NAME': process.env.CHE_MACHINE_NAME
'CHE_MACHINE_NAME': process.env.CHE_MACHINE_NAME!
}
};

Expand Down