Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
14 changes: 8 additions & 6 deletions build/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Dockerfile defines che-machine-exec production image eclipse/che-machine-exec-dev
#

FROM docker.io/golang:1.25.7-alpine as go_builder
FROM docker.io/golang:1.25.9-alpine AS go_builder

ENV USER=machine-exec
ENV UID=12345
Expand Down Expand Up @@ -44,19 +44,21 @@ COPY . .
ENV CGO_ENABLED=1
RUN GOOS=linux go build -mod=vendor -a -ldflags '-w -s' -a -installsuffix cgo -o /go/bin/che-machine-exec .

FROM docker.io/node:22-alpine as cloud_shell_builder
RUN corepack enable && corepack prepare yarn@4.0.0 --activate
COPY --from=go_builder /che-machine-exec/cloud-shell cloud-shell-src
WORKDIR cloud-shell-src
FROM docker.io/node:22-alpine AS cloud_shell_builder
RUN corepack enable && corepack prepare yarn@4.12.0 --activate
COPY --from=go_builder /che-machine-exec/cloud-shell /cloud-shell-src
WORKDIR /cloud-shell-src
RUN yarn install --immutable && \
yarn run build && \
mkdir /app && \
cp -rf index.html dist node_modules /app
cp -rf index.html dist /app

FROM scratch
COPY --from=go_builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=go_builder /etc/passwd /etc/passwd
COPY --from=go_builder /etc/group /etc/group
# Copy musl library for CGO binary (architecture-specific)
COPY --from=go_builder /lib/ld-musl-*.so.1 /lib/
USER machine-exec

COPY --from=go_builder /go/bin/che-machine-exec /go/bin/che-machine-exec
Expand Down
39 changes: 15 additions & 24 deletions cloud-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"description": "Che Cloud Shell Workspace",
"private": true,
"packageManager": "yarn@4.12.0",
"scripts": {
"build": "webpack --mode production",
"dev-build": "webpack --mode development"
Expand All @@ -11,33 +12,23 @@
"author": "Oleksandr Andriienko",
"license": "EPL-2.0",
"devDependencies": {
"css-loader": "^5.2.7",
"style-loader": "^2.0.0",
"ts-loader": "^8.4.0",
"typescript": "4.9.5",
"webpack": "^4.0.0",
"webpack-cli": "^3.2.1"
"css-loader": "^7.1.2",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "^5.7.2",
"webpack": "^5.97.1",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"reconnecting-websocket": "^4.2.0",
"vscode-uri": "^2.1.1",
"vscode-ws-jsonrpc": "^0.1.1",
"xterm": "^4.3.0",
"xterm-addon-fit": "^0.3.0"
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"reconnecting-websocket": "^4.4.0",
"vscode-jsonrpc": "~8.2.1",
"vscode-uri": "^3.0.8",
"vscode-ws-jsonrpc": "^3.3.2"
},
"resolutions": {
"cipher-base": "^1.0.6",
"sha.js": "^2.4.12",
"tar": "7.5.11",
"minimatch@^3.1.1": "^3.1.5",
"minimatch@^10.1.1": "^10.2.4",
"ajv": "6.14.0",
"brace-expansion@^1.1.7": "1.1.12",
"brace-expansion@^5.0.2": "5.0.6",
"postcss": "8.5.15",
"picomatch": "2.3.2",
"ip-address": "10.2.0",
"qs": "^6.15.2"
},
"packageManager": "yarn@4.12.0"
"sha.js": "^2.4.12"
}
}
7 changes: 3 additions & 4 deletions cloud-shell/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@

import { CloudShellTerminal, TerminalHandler } from "./terminal";
import { JsonRpcConnection } from "./json-rpc-connection";
import { GenericNotificationHandler } from "vscode-jsonrpc";
import { GenericNotificationHandler, NotificationType } from "vscode-jsonrpc";
import { MachineExec, EXIT_METHOD, ERROR_METHOD, ExecExitEvent, ExecErrorEvent } from "./terminal-protocol";
import { NotificationType } from 'vscode-ws-jsonrpc';
import { ANSIControlSequences as CS } from './const';

const terminalElem = document.getElementById('terminal-container');
Expand Down Expand Up @@ -75,12 +74,12 @@ rpcConnecton.create().then(connection => {
terminal.sendLine(CS.RED_COLOR + 'Unable to connect to json-rpc channel. Cause: ' + onRejected + CS.RESET_COLOR)
});
});
const exitNotification = new NotificationType<ExecExitEvent, void>(EXIT_METHOD);
const exitNotification = new NotificationType<ExecExitEvent>(EXIT_METHOD);
connection.onNotification(exitNotification, (event: ExecExitEvent) => {
terminal.sendLine(CS.GREEN_COLOR + "Process completed." + CS.RESET_COLOR)
});

const errorNotification = new NotificationType<ExecErrorEvent, void>(ERROR_METHOD);
const errorNotification = new NotificationType<ExecErrorEvent>(ERROR_METHOD);
connection.onNotification(errorNotification, (event: ExecErrorEvent) => {
terminal.sendLine(CS.RED_COLOR + 'Failed to create terminal. Error: ' + event.stack + CS.RESET_COLOR)
});
Expand Down
3 changes: 2 additions & 1 deletion cloud-shell/src/json-rpc-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*/

import ReconnectingWebSocket from "reconnecting-websocket";
import { IWebSocket, ConsoleLogger, createWebSocketConnection, Logger, MessageConnection } from 'vscode-ws-jsonrpc';
import { IWebSocket, ConsoleLogger, createWebSocketConnection } from 'vscode-ws-jsonrpc';
import { Logger, MessageConnection } from 'vscode-jsonrpc';

export class JsonRpcConnection {

Expand Down
6 changes: 3 additions & 3 deletions cloud-shell/src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* Red Hat, Inc. - initial API and implementation
*/

import { Terminal } from 'xterm'
import { FitAddon } from 'xterm-addon-fit';
import { Terminal } from '@xterm/xterm'
import { FitAddon } from '@xterm/addon-fit';
import '../styles.css';
import 'xterm/css/xterm.css';
import '@xterm/xterm/css/xterm.css';

export interface TerminalHandler {
onData(data: string): void;
Expand Down
3 changes: 0 additions & 3 deletions cloud-shell/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ const path = require('path');
module.exports = {
entry: ['./src/index.ts'],
devtool: 'inline-source-map',
node: {
net: 'empty',
},
module: {
rules: [
{
Expand Down
Loading
Loading