@theia/dev-container 1.46.0-next.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/lib/dev-container-server/dev-container-server.d.ts +2 -0
- package/lib/dev-container-server/dev-container-server.d.ts.map +1 -0
- package/lib/dev-container-server/dev-container-server.js +48 -0
- package/lib/dev-container-server/dev-container-server.js.map +1 -0
- package/lib/electron-browser/container-connection-contribution.d.ts +28 -0
- package/lib/electron-browser/container-connection-contribution.d.ts.map +1 -0
- package/lib/electron-browser/container-connection-contribution.js +147 -0
- package/lib/electron-browser/container-connection-contribution.js.map +1 -0
- package/lib/electron-browser/container-info-contribution.d.ts +11 -0
- package/lib/electron-browser/container-info-contribution.d.ts.map +1 -0
- package/lib/electron-browser/container-info-contribution.js +51 -0
- package/lib/electron-browser/container-info-contribution.js.map +1 -0
- package/lib/electron-browser/container-output-provider.d.ts +8 -0
- package/lib/electron-browser/container-output-provider.d.ts.map +1 -0
- package/lib/electron-browser/container-output-provider.js +41 -0
- package/lib/electron-browser/container-output-provider.js.map +1 -0
- package/lib/electron-browser/dev-container-frontend-module.d.ts +4 -0
- package/lib/electron-browser/dev-container-frontend-module.d.ts.map +1 -0
- package/lib/electron-browser/dev-container-frontend-module.js +39 -0
- package/lib/electron-browser/dev-container-frontend-module.js.map +1 -0
- package/lib/electron-common/container-output-provider.d.ts +4 -0
- package/lib/electron-common/container-output-provider.d.ts.map +1 -0
- package/lib/electron-common/container-output-provider.js +18 -0
- package/lib/electron-common/container-output-provider.js.map +1 -0
- package/lib/electron-common/dev-container-workspaces.d.ts +3 -0
- package/lib/electron-common/dev-container-workspaces.d.ts.map +1 -0
- package/lib/electron-common/dev-container-workspaces.js +21 -0
- package/lib/electron-common/dev-container-workspaces.js.map +1 -0
- package/lib/electron-common/remote-container-connection-provider.d.ts +30 -0
- package/lib/electron-common/remote-container-connection-provider.d.ts.map +1 -0
- package/lib/electron-common/remote-container-connection-provider.js +21 -0
- package/lib/electron-common/remote-container-connection-provider.js.map +1 -0
- package/lib/electron-node/dev-container-backend-module.d.ts +5 -0
- package/lib/electron-node/dev-container-backend-module.d.ts.map +1 -0
- package/lib/electron-node/dev-container-backend-module.js +58 -0
- package/lib/electron-node/dev-container-backend-module.js.map +1 -0
- package/lib/electron-node/dev-container-file-service.d.ts +10 -0
- package/lib/electron-node/dev-container-file-service.d.ts.map +1 -0
- package/lib/electron-node/dev-container-file-service.js +69 -0
- package/lib/electron-node/dev-container-file-service.js.map +1 -0
- package/lib/electron-node/dev-container-workspace-handler.d.ts +7 -0
- package/lib/electron-node/dev-container-workspace-handler.d.ts.map +1 -0
- package/lib/electron-node/dev-container-workspace-handler.js +21 -0
- package/lib/electron-node/dev-container-workspace-handler.js.map +1 -0
- package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.d.ts +17 -0
- package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.d.ts.map +1 -0
- package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.js +69 -0
- package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.js.map +1 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.d.ts +38 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.d.ts.map +1 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.js +192 -0
- package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.js.map +1 -0
- package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.d.ts +11 -0
- package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.d.ts.map +1 -0
- package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.js +37 -0
- package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.js.map +1 -0
- package/lib/electron-node/devcontainer-file.d.ts +350 -0
- package/lib/electron-node/devcontainer-file.d.ts.map +1 -0
- package/lib/electron-node/devcontainer-file.js +18 -0
- package/lib/electron-node/devcontainer-file.js.map +1 -0
- package/lib/electron-node/docker-container-service.d.ts +29 -0
- package/lib/electron-node/docker-container-service.d.ts.map +1 -0
- package/lib/electron-node/docker-container-service.js +106 -0
- package/lib/electron-node/docker-container-service.js.map +1 -0
- package/lib/electron-node/remote-container-connection-provider.d.ts +79 -0
- package/lib/electron-node/remote-container-connection-provider.d.ts.map +1 -0
- package/lib/electron-node/remote-container-connection-provider.js +260 -0
- package/lib/electron-node/remote-container-connection-provider.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +55 -0
- package/src/dev-container-server/dev-container-server.ts +53 -0
- package/src/electron-browser/container-connection-contribution.ts +151 -0
- package/src/electron-browser/container-info-contribution.ts +47 -0
- package/src/electron-browser/container-output-provider.ts +36 -0
- package/src/electron-browser/dev-container-frontend-module.ts +40 -0
- package/src/electron-common/container-output-provider.ts +19 -0
- package/src/electron-common/dev-container-workspaces.ts +18 -0
- package/src/electron-common/remote-container-connection-provider.ts +52 -0
- package/src/electron-node/dev-container-backend-module.ts +63 -0
- package/src/electron-node/dev-container-file-service.ts +67 -0
- package/src/electron-node/dev-container-workspace-handler.ts +33 -0
- package/src/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.ts +68 -0
- package/src/electron-node/devcontainer-contributions/main-container-creation-contributions.ts +196 -0
- package/src/electron-node/devcontainer-contributions/profile-file-modification-contribution.ts +35 -0
- package/src/electron-node/devcontainer-file.ts +411 -0
- package/src/electron-node/docker-container-service.ts +131 -0
- package/src/electron-node/remote-container-connection-provider.ts +315 -0
- package/src/package.spec.ts +28 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 Typefox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.RemoteDockerContainerConnection = exports.DevContainerConnectionProvider = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const remote_setup_service_1 = require("@theia/remote/lib/electron-node/setup/remote-setup-service");
|
|
21
|
+
const remote_connection_service_1 = require("@theia/remote/lib/electron-node/remote-connection-service");
|
|
22
|
+
const remote_proxy_server_provider_1 = require("@theia/remote/lib/electron-node/remote-proxy-server-provider");
|
|
23
|
+
const core_1 = require("@theia/core");
|
|
24
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
+
const Docker = require("dockerode");
|
|
26
|
+
const docker_container_service_1 = require("./docker-container-service");
|
|
27
|
+
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
28
|
+
const stream_1 = require("stream");
|
|
29
|
+
const child_process_1 = require("child_process");
|
|
30
|
+
const dev_container_file_service_1 = require("./dev-container-file-service");
|
|
31
|
+
let DevContainerConnectionProvider = class DevContainerConnectionProvider {
|
|
32
|
+
setClient(client) {
|
|
33
|
+
this.outputProvider = client;
|
|
34
|
+
}
|
|
35
|
+
async connectToContainer(options) {
|
|
36
|
+
const dockerConnection = new Docker();
|
|
37
|
+
const version = await dockerConnection.version().catch(() => undefined);
|
|
38
|
+
if (!version) {
|
|
39
|
+
this.messageService.error('Docker Daemon is not running');
|
|
40
|
+
throw new Error('Docker is not running');
|
|
41
|
+
}
|
|
42
|
+
// create container
|
|
43
|
+
const progress = await this.messageService.showProgress({
|
|
44
|
+
text: 'Creating container',
|
|
45
|
+
});
|
|
46
|
+
try {
|
|
47
|
+
const container = await this.containerService.getOrCreateContainer(dockerConnection, options, this.outputProvider);
|
|
48
|
+
const devContainerConfig = await this.devContainerFileService.getConfiguration(options.devcontainerFile);
|
|
49
|
+
// create actual connection
|
|
50
|
+
const report = message => progress.report({ message });
|
|
51
|
+
report('Connecting to remote system...');
|
|
52
|
+
const remote = await this.createContainerConnection(container, dockerConnection, devContainerConfig.name);
|
|
53
|
+
const result = await this.remoteSetup.setup({
|
|
54
|
+
connection: remote,
|
|
55
|
+
report,
|
|
56
|
+
nodeDownloadTemplate: options.nodeDownloadTemplate
|
|
57
|
+
});
|
|
58
|
+
remote.remoteSetupResult = result;
|
|
59
|
+
const registration = this.remoteConnectionService.register(remote);
|
|
60
|
+
const server = await this.serverProvider.getProxyServer(socket => {
|
|
61
|
+
remote.forwardOut(socket);
|
|
62
|
+
});
|
|
63
|
+
remote.onDidDisconnect(() => {
|
|
64
|
+
server.close();
|
|
65
|
+
registration.dispose();
|
|
66
|
+
});
|
|
67
|
+
const localPort = server.address().port;
|
|
68
|
+
remote.localPort = localPort;
|
|
69
|
+
await this.containerService.postConnect(options.devcontainerFile, remote, this.outputProvider);
|
|
70
|
+
return {
|
|
71
|
+
containerId: container.id,
|
|
72
|
+
workspacePath: (await container.inspect()).Mounts[0].Destination,
|
|
73
|
+
port: localPort.toString(),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
this.messageService.error(e.message);
|
|
78
|
+
console.error(e);
|
|
79
|
+
throw e;
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
progress.cancel();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
getDevContainerFiles(workspacePath) {
|
|
86
|
+
return this.devContainerFileService.getAvailableFiles(workspacePath);
|
|
87
|
+
}
|
|
88
|
+
async createContainerConnection(container, docker, name) {
|
|
89
|
+
return Promise.resolve(new RemoteDockerContainerConnection({
|
|
90
|
+
id: (0, core_1.generateUuid)(),
|
|
91
|
+
name: name !== null && name !== void 0 ? name : 'dev-container',
|
|
92
|
+
type: 'Dev Container',
|
|
93
|
+
docker,
|
|
94
|
+
container,
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
async getCurrentContainerInfo(port) {
|
|
98
|
+
const connection = this.remoteConnectionService.getConnectionFromPort(port);
|
|
99
|
+
if (!connection || !(connection instanceof RemoteDockerContainerConnection)) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
return connection.container.inspect();
|
|
103
|
+
}
|
|
104
|
+
dispose() {
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
exports.DevContainerConnectionProvider = DevContainerConnectionProvider;
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
(0, inversify_1.inject)(remote_connection_service_1.RemoteConnectionService),
|
|
110
|
+
tslib_1.__metadata("design:type", remote_connection_service_1.RemoteConnectionService)
|
|
111
|
+
], DevContainerConnectionProvider.prototype, "remoteConnectionService", void 0);
|
|
112
|
+
tslib_1.__decorate([
|
|
113
|
+
(0, inversify_1.inject)(remote_setup_service_1.RemoteSetupService),
|
|
114
|
+
tslib_1.__metadata("design:type", remote_setup_service_1.RemoteSetupService)
|
|
115
|
+
], DevContainerConnectionProvider.prototype, "remoteSetup", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, inversify_1.inject)(core_1.MessageService),
|
|
118
|
+
tslib_1.__metadata("design:type", core_1.MessageService)
|
|
119
|
+
], DevContainerConnectionProvider.prototype, "messageService", void 0);
|
|
120
|
+
tslib_1.__decorate([
|
|
121
|
+
(0, inversify_1.inject)(remote_proxy_server_provider_1.RemoteProxyServerProvider),
|
|
122
|
+
tslib_1.__metadata("design:type", remote_proxy_server_provider_1.RemoteProxyServerProvider)
|
|
123
|
+
], DevContainerConnectionProvider.prototype, "serverProvider", void 0);
|
|
124
|
+
tslib_1.__decorate([
|
|
125
|
+
(0, inversify_1.inject)(docker_container_service_1.DockerContainerService),
|
|
126
|
+
tslib_1.__metadata("design:type", docker_container_service_1.DockerContainerService)
|
|
127
|
+
], DevContainerConnectionProvider.prototype, "containerService", void 0);
|
|
128
|
+
tslib_1.__decorate([
|
|
129
|
+
(0, inversify_1.inject)(dev_container_file_service_1.DevContainerFileService),
|
|
130
|
+
tslib_1.__metadata("design:type", dev_container_file_service_1.DevContainerFileService)
|
|
131
|
+
], DevContainerConnectionProvider.prototype, "devContainerFileService", void 0);
|
|
132
|
+
tslib_1.__decorate([
|
|
133
|
+
(0, inversify_1.inject)(remote_connection_service_1.RemoteConnectionService),
|
|
134
|
+
tslib_1.__metadata("design:type", remote_connection_service_1.RemoteConnectionService)
|
|
135
|
+
], DevContainerConnectionProvider.prototype, "remoteService", void 0);
|
|
136
|
+
exports.DevContainerConnectionProvider = DevContainerConnectionProvider = tslib_1.__decorate([
|
|
137
|
+
(0, inversify_1.injectable)()
|
|
138
|
+
], DevContainerConnectionProvider);
|
|
139
|
+
class RemoteDockerContainerConnection {
|
|
140
|
+
constructor(options) {
|
|
141
|
+
this.onDidDisconnectEmitter = new core_1.Emitter();
|
|
142
|
+
this.onDidDisconnect = this.onDidDisconnectEmitter.event;
|
|
143
|
+
this.id = options.id;
|
|
144
|
+
this.type = options.type;
|
|
145
|
+
this.name = options.name;
|
|
146
|
+
this.docker = options.docker;
|
|
147
|
+
this.container = options.container;
|
|
148
|
+
this.docker.getEvents({ filters: { container: [this.container.id], event: ['stop'] } }).then(stream => {
|
|
149
|
+
stream.on('data', () => this.onDidDisconnectEmitter.fire());
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
async forwardOut(socket, port) {
|
|
153
|
+
const node = `${this.remoteSetupResult.nodeDirectory}/bin/node`;
|
|
154
|
+
const devContainerServer = `${this.remoteSetupResult.applicationDirectory}/backend/dev-container-server.js`;
|
|
155
|
+
try {
|
|
156
|
+
const ttySession = await this.container.exec({
|
|
157
|
+
Cmd: ['sh', '-c', `${node} ${devContainerServer} -target-port=${port !== null && port !== void 0 ? port : this.remotePort}`],
|
|
158
|
+
AttachStdin: true, AttachStdout: true, AttachStderr: true
|
|
159
|
+
});
|
|
160
|
+
const stream = await ttySession.start({ hijack: true, stdin: true });
|
|
161
|
+
socket.pipe(stream);
|
|
162
|
+
ttySession.modem.demuxStream(stream, socket, socket);
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
console.error(e);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async exec(cmd, args, options) {
|
|
169
|
+
var _a;
|
|
170
|
+
// return (await this.getOrCreateTerminalSession()).executeCommand(cmd, args);
|
|
171
|
+
const deferred = new promise_util_1.Deferred();
|
|
172
|
+
try {
|
|
173
|
+
// TODO add windows container support
|
|
174
|
+
const execution = await this.container.exec({ Cmd: ['sh', '-c', `${cmd} ${(_a = args === null || args === void 0 ? void 0 : args.join(' ')) !== null && _a !== void 0 ? _a : ''}`], AttachStdout: true, AttachStderr: true });
|
|
175
|
+
let stdoutBuffer = '';
|
|
176
|
+
let stderrBuffer = '';
|
|
177
|
+
const stream = await (execution === null || execution === void 0 ? void 0 : execution.start({}));
|
|
178
|
+
const stdout = new stream_1.PassThrough();
|
|
179
|
+
stdout.on('data', (chunk) => {
|
|
180
|
+
stdoutBuffer += chunk.toString();
|
|
181
|
+
});
|
|
182
|
+
const stderr = new stream_1.PassThrough();
|
|
183
|
+
stderr.on('data', (chunk) => {
|
|
184
|
+
stderrBuffer += chunk.toString();
|
|
185
|
+
});
|
|
186
|
+
execution.modem.demuxStream(stream, stdout, stderr);
|
|
187
|
+
stream === null || stream === void 0 ? void 0 : stream.addListener('close', () => deferred.resolve({ stdout: stdoutBuffer, stderr: stderrBuffer }));
|
|
188
|
+
}
|
|
189
|
+
catch (e) {
|
|
190
|
+
deferred.reject(e);
|
|
191
|
+
}
|
|
192
|
+
return deferred.promise;
|
|
193
|
+
}
|
|
194
|
+
async execPartial(cmd, tester, args, options) {
|
|
195
|
+
var _a;
|
|
196
|
+
const deferred = new promise_util_1.Deferred();
|
|
197
|
+
try {
|
|
198
|
+
// TODO add windows container support
|
|
199
|
+
const execution = await this.container.exec({ Cmd: ['sh', '-c', `${cmd} ${(_a = args === null || args === void 0 ? void 0 : args.join(' ')) !== null && _a !== void 0 ? _a : ''}`], AttachStdout: true, AttachStderr: true });
|
|
200
|
+
let stdoutBuffer = '';
|
|
201
|
+
let stderrBuffer = '';
|
|
202
|
+
const stream = await (execution === null || execution === void 0 ? void 0 : execution.start({}));
|
|
203
|
+
stream.on('close', () => {
|
|
204
|
+
if (deferred.state === 'unresolved') {
|
|
205
|
+
deferred.resolve({ stdout: stdoutBuffer, stderr: stderrBuffer });
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
const stdout = new stream_1.PassThrough();
|
|
209
|
+
stdout.on('data', (data) => {
|
|
210
|
+
if (deferred.state === 'unresolved') {
|
|
211
|
+
stdoutBuffer += data.toString();
|
|
212
|
+
if (tester(stdoutBuffer, stderrBuffer)) {
|
|
213
|
+
deferred.resolve({ stdout: stdoutBuffer, stderr: stderrBuffer });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
const stderr = new stream_1.PassThrough();
|
|
218
|
+
stderr.on('data', (data) => {
|
|
219
|
+
if (deferred.state === 'unresolved') {
|
|
220
|
+
stderrBuffer += data.toString();
|
|
221
|
+
if (tester(stdoutBuffer, stderrBuffer)) {
|
|
222
|
+
deferred.resolve({ stdout: stdoutBuffer, stderr: stderrBuffer });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
execution.modem.demuxStream(stream, stdout, stderr);
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
deferred.reject(e);
|
|
230
|
+
}
|
|
231
|
+
return deferred.promise;
|
|
232
|
+
}
|
|
233
|
+
async copy(localPath, remotePath) {
|
|
234
|
+
var _a;
|
|
235
|
+
const deferred = new promise_util_1.Deferred();
|
|
236
|
+
const process = (0, child_process_1.exec)(`docker cp -qa ${localPath.toString()} ${this.container.id}:${remotePath}`);
|
|
237
|
+
let stderr = '';
|
|
238
|
+
(_a = process.stderr) === null || _a === void 0 ? void 0 : _a.on('data', data => {
|
|
239
|
+
stderr += data.toString();
|
|
240
|
+
});
|
|
241
|
+
process.on('close', code => {
|
|
242
|
+
if (code === 0) {
|
|
243
|
+
deferred.resolve();
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
deferred.reject(stderr);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return deferred.promise;
|
|
250
|
+
}
|
|
251
|
+
disposeSync() {
|
|
252
|
+
// cant use dockerrode here since this needs to happen on one tick
|
|
253
|
+
(0, child_process_1.execSync)(`docker stop ${this.container.id}`);
|
|
254
|
+
}
|
|
255
|
+
async dispose() {
|
|
256
|
+
return this.container.stop();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
exports.RemoteDockerContainerConnection = RemoteDockerContainerConnection;
|
|
260
|
+
//# sourceMappingURL=remote-container-connection-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-container-connection-provider.js","sourceRoot":"","sources":["../../src/electron-node/remote-container-connection-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAQhF,qGAAmH;AACnH,yGAAoG;AACpG,+GAAyG;AACzG,sCAAsF;AAEtF,4DAAkE;AAClE,oCAAoC;AACpC,yEAAoE;AACpE,sEAA+D;AAE/D,mCAA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 -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=package.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.spec.d.ts","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
/* note: this bogus test file is required so that
|
|
17
|
+
we are able to run mocha unit tests on this
|
|
18
|
+
package, without having any actual unit tests in it.
|
|
19
|
+
This way a coverage report will be generated,
|
|
20
|
+
showing 0% coverage, instead of no report.
|
|
21
|
+
This file can be removed once we have real unit
|
|
22
|
+
tests in place. */
|
|
23
|
+
describe('dev-container package', () => {
|
|
24
|
+
it('support code coverage statistics', () => true);
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=package.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAEhF;;;;;;qBAMqB;AAErB,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAEnC,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@theia/dev-container",
|
|
3
|
+
"version": "1.46.0-next.241+4295c1a8c",
|
|
4
|
+
"description": "Theia - Editor Preview Extension",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@theia/core": "1.46.0-next.241+4295c1a8c",
|
|
7
|
+
"@theia/output": "1.46.0-next.241+4295c1a8c",
|
|
8
|
+
"@theia/remote": "1.46.0-next.241+4295c1a8c",
|
|
9
|
+
"@theia/workspace": "1.46.0-next.241+4295c1a8c",
|
|
10
|
+
"dockerode": "^4.0.2",
|
|
11
|
+
"jsonc-parser": "^2.2.0",
|
|
12
|
+
"uuid": "^8.0.0"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"theiaExtensions": [
|
|
18
|
+
{
|
|
19
|
+
"frontendElectron": "lib/electron-browser/dev-container-frontend-module",
|
|
20
|
+
"backendElectron": "lib/electron-node/dev-container-backend-module"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"theia-extension"
|
|
25
|
+
],
|
|
26
|
+
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/eclipse-theia/theia.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/eclipse-theia/theia/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/eclipse-theia/theia",
|
|
35
|
+
"files": [
|
|
36
|
+
"lib",
|
|
37
|
+
"src"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "theiaext build",
|
|
41
|
+
"clean": "theiaext clean",
|
|
42
|
+
"compile": "theiaext compile",
|
|
43
|
+
"lint": "theiaext lint",
|
|
44
|
+
"test": "theiaext test",
|
|
45
|
+
"watch": "theiaext watch"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@theia/ext-scripts": "1.56.0",
|
|
49
|
+
"@types/dockerode": "^3.3.23"
|
|
50
|
+
},
|
|
51
|
+
"nyc": {
|
|
52
|
+
"extends": "../../configs/nyc.json"
|
|
53
|
+
},
|
|
54
|
+
"gitHead": "4295c1a8c8b5d23471f274265c798bac9e6baecc"
|
|
55
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 Typefox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { createConnection } from 'net';
|
|
18
|
+
import { stdin, argv, stdout } from 'process';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* this node.js Program is supposed to be executed by an docker exec session inside a docker container.
|
|
22
|
+
* It uses a tty session to listen on stdin and send on stdout all communication with the theia backend running inside the container.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
let backendPort: number | undefined = undefined;
|
|
26
|
+
argv.slice(2).forEach(arg => {
|
|
27
|
+
if (arg.startsWith('-target-port')) {
|
|
28
|
+
backendPort = parseInt(arg.split('=')[1]);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (!backendPort) {
|
|
33
|
+
throw new Error('please start with -target-port={port number}');
|
|
34
|
+
}
|
|
35
|
+
if (stdin.isTTY) {
|
|
36
|
+
stdin.setRawMode(true);
|
|
37
|
+
}
|
|
38
|
+
const connection = createConnection(backendPort, '0.0.0.0');
|
|
39
|
+
|
|
40
|
+
connection.pipe(stdout);
|
|
41
|
+
stdin.pipe(connection);
|
|
42
|
+
|
|
43
|
+
connection.on('error', error => {
|
|
44
|
+
console.error('connection error', error);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
connection.on('close', () => {
|
|
48
|
+
console.log('connection closed');
|
|
49
|
+
process.exit(0);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// keep the process running
|
|
53
|
+
setInterval(() => { }, 1 << 30);
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 Typefox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { AbstractRemoteRegistryContribution, RemoteRegistry } from '@theia/remote/lib/electron-browser/remote-registry-contribution';
|
|
19
|
+
import { DevContainerFile, LastContainerInfo, RemoteContainerConnectionProvider } from '../electron-common/remote-container-connection-provider';
|
|
20
|
+
import { RemotePreferences } from '@theia/remote/lib/electron-browser/remote-preferences';
|
|
21
|
+
import { WorkspaceStorageService } from '@theia/workspace/lib/browser/workspace-storage-service';
|
|
22
|
+
import { Command, MaybePromise, QuickInputService, URI } from '@theia/core';
|
|
23
|
+
import { WorkspaceInput, WorkspaceOpenHandlerContribution, WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
24
|
+
import { ContainerOutputProvider } from './container-output-provider';
|
|
25
|
+
import { WorkspaceServer } from '@theia/workspace/lib/common';
|
|
26
|
+
import { DEV_CONTAINER_PATH_QUERY, DEV_CONTAINER_WORKSPACE_SCHEME } from '../electron-common/dev-container-workspaces';
|
|
27
|
+
|
|
28
|
+
export namespace RemoteContainerCommands {
|
|
29
|
+
export const REOPEN_IN_CONTAINER = Command.toLocalizedCommand({
|
|
30
|
+
id: 'dev-container:reopen-in-container',
|
|
31
|
+
label: 'Reopen in Container',
|
|
32
|
+
category: 'Dev Container'
|
|
33
|
+
}, 'theia/dev-container/connect');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const LAST_USED_CONTAINER = 'lastUsedContainer';
|
|
37
|
+
@injectable()
|
|
38
|
+
export class ContainerConnectionContribution extends AbstractRemoteRegistryContribution implements WorkspaceOpenHandlerContribution {
|
|
39
|
+
|
|
40
|
+
@inject(RemoteContainerConnectionProvider)
|
|
41
|
+
protected readonly connectionProvider: RemoteContainerConnectionProvider;
|
|
42
|
+
|
|
43
|
+
@inject(RemotePreferences)
|
|
44
|
+
protected readonly remotePreferences: RemotePreferences;
|
|
45
|
+
|
|
46
|
+
@inject(WorkspaceStorageService)
|
|
47
|
+
protected readonly workspaceStorageService: WorkspaceStorageService;
|
|
48
|
+
|
|
49
|
+
@inject(WorkspaceService)
|
|
50
|
+
protected readonly workspaceService: WorkspaceService;
|
|
51
|
+
|
|
52
|
+
@inject(WorkspaceServer)
|
|
53
|
+
protected readonly workspaceServer: WorkspaceServer;
|
|
54
|
+
|
|
55
|
+
@inject(QuickInputService)
|
|
56
|
+
protected readonly quickInputService: QuickInputService;
|
|
57
|
+
|
|
58
|
+
@inject(ContainerOutputProvider)
|
|
59
|
+
protected readonly containerOutputProvider: ContainerOutputProvider;
|
|
60
|
+
|
|
61
|
+
registerRemoteCommands(registry: RemoteRegistry): void {
|
|
62
|
+
registry.registerCommand(RemoteContainerCommands.REOPEN_IN_CONTAINER, {
|
|
63
|
+
execute: () => this.openInContainer()
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
canHandle(uri: URI): MaybePromise<boolean> {
|
|
68
|
+
return uri.scheme === DEV_CONTAINER_WORKSPACE_SCHEME;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async openWorkspace(uri: URI, options?: WorkspaceInput | undefined): Promise<void> {
|
|
72
|
+
const filePath = new URLSearchParams(uri.query).get(DEV_CONTAINER_PATH_QUERY);
|
|
73
|
+
|
|
74
|
+
if (!filePath) {
|
|
75
|
+
throw new Error('No devcontainer file specified for workspace');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const devcontainerFiles = await this.connectionProvider.getDevContainerFiles(uri.path.toString());
|
|
79
|
+
const devcontainerFile = devcontainerFiles.find(file => file.path === filePath);
|
|
80
|
+
|
|
81
|
+
if (!devcontainerFile) {
|
|
82
|
+
throw new Error(`Devcontainer file at ${filePath} not found in workspace`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return this.doOpenInContainer(devcontainerFile, uri.toString());
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async getWorkspaceLabel(uri: URI): Promise<string | undefined> {
|
|
89
|
+
const containerFilePath = new URLSearchParams(uri.query).get(DEV_CONTAINER_PATH_QUERY);
|
|
90
|
+
if (!containerFilePath) {
|
|
91
|
+
return;
|
|
92
|
+
};
|
|
93
|
+
const files = await this.connectionProvider.getDevContainerFiles(uri.path.toString());
|
|
94
|
+
const devcontainerFile = files.find(file => file.path === containerFilePath);
|
|
95
|
+
return `${uri.path.base} [Dev Container: ${devcontainerFile?.name}]`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async openInContainer(): Promise<void> {
|
|
99
|
+
const devcontainerFile = await this.getOrSelectDevcontainerFile();
|
|
100
|
+
if (!devcontainerFile) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.doOpenInContainer(devcontainerFile);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async doOpenInContainer(devcontainerFile: DevContainerFile, workspaceUri?: string): Promise<void> {
|
|
107
|
+
const lastContainerInfoKey = `${LAST_USED_CONTAINER}:${devcontainerFile.path}`;
|
|
108
|
+
const lastContainerInfo = await this.workspaceStorageService.getData<LastContainerInfo | undefined>(lastContainerInfoKey);
|
|
109
|
+
|
|
110
|
+
this.containerOutputProvider.openChannel();
|
|
111
|
+
|
|
112
|
+
const connectionResult = await this.connectionProvider.connectToContainer({
|
|
113
|
+
nodeDownloadTemplate: this.remotePreferences['remote.nodeDownloadTemplate'],
|
|
114
|
+
lastContainerInfo,
|
|
115
|
+
devcontainerFile: devcontainerFile.path,
|
|
116
|
+
workspaceUri
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
this.workspaceStorageService.setData<LastContainerInfo>(lastContainerInfoKey, {
|
|
120
|
+
id: connectionResult.containerId,
|
|
121
|
+
lastUsed: Date.now()
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
this.workspaceServer.setMostRecentlyUsedWorkspace(
|
|
125
|
+
`${DEV_CONTAINER_WORKSPACE_SCHEME}:${this.workspaceService.workspace?.resource.path}?${DEV_CONTAINER_PATH_QUERY}=${devcontainerFile.path}`);
|
|
126
|
+
|
|
127
|
+
this.openRemote(connectionResult.port, false, connectionResult.workspacePath);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async getOrSelectDevcontainerFile(): Promise<DevContainerFile | undefined> {
|
|
131
|
+
const workspace = this.workspaceService.workspace;
|
|
132
|
+
if (!workspace) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const devcontainerFiles = await this.connectionProvider.getDevContainerFiles(workspace.resource.path.toString());
|
|
136
|
+
|
|
137
|
+
if (devcontainerFiles.length === 1) {
|
|
138
|
+
return devcontainerFiles[0];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return (await this.quickInputService.pick(devcontainerFiles.map(file => ({
|
|
142
|
+
type: 'item',
|
|
143
|
+
label: file.name,
|
|
144
|
+
description: file.path,
|
|
145
|
+
file: file,
|
|
146
|
+
})), {
|
|
147
|
+
title: 'Select a devcontainer.json file'
|
|
148
|
+
}))?.file;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 Typefox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
19
|
+
import type { ContainerInspectInfo } from 'dockerode';
|
|
20
|
+
import { RemoteContainerConnectionProvider } from '../electron-common/remote-container-connection-provider';
|
|
21
|
+
import { PortForwardingService } from '@theia/remote/lib/electron-browser/port-forwarding/port-forwarding-service';
|
|
22
|
+
import { getCurrentPort } from '@theia/core/lib/electron-browser/messaging/electron-local-ws-connection-source';
|
|
23
|
+
|
|
24
|
+
@injectable()
|
|
25
|
+
export class ContainerInfoContribution implements FrontendApplicationContribution {
|
|
26
|
+
|
|
27
|
+
@inject(RemoteContainerConnectionProvider)
|
|
28
|
+
protected readonly connectionProvider: RemoteContainerConnectionProvider;
|
|
29
|
+
|
|
30
|
+
@inject(PortForwardingService)
|
|
31
|
+
protected readonly portForwardingService: PortForwardingService;
|
|
32
|
+
|
|
33
|
+
containerInfo: ContainerInspectInfo | undefined;
|
|
34
|
+
|
|
35
|
+
async onStart(): Promise<void> {
|
|
36
|
+
this.containerInfo = await this.connectionProvider.getCurrentContainerInfo(parseInt(getCurrentPort() ?? '0'));
|
|
37
|
+
|
|
38
|
+
this.portForwardingService.forwardedPorts = Object.entries(this.containerInfo?.NetworkSettings.Ports ?? {}).flatMap(([_, ports]) => (
|
|
39
|
+
ports.map(port => ({
|
|
40
|
+
editing: false,
|
|
41
|
+
address: port.HostIp ?? '',
|
|
42
|
+
localPort: parseInt(port.HostPort ?? '0'),
|
|
43
|
+
origin: 'container'
|
|
44
|
+
}))));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 Typefox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { OutputChannel, OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
19
|
+
|
|
20
|
+
@injectable()
|
|
21
|
+
export class ContainerOutputProvider implements ContainerOutputProvider {
|
|
22
|
+
|
|
23
|
+
@inject(OutputChannelManager)
|
|
24
|
+
protected readonly outputChannelManager: OutputChannelManager;
|
|
25
|
+
|
|
26
|
+
protected currentChannel?: OutputChannel;
|
|
27
|
+
|
|
28
|
+
openChannel(): void {
|
|
29
|
+
this.currentChannel = this.outputChannelManager.getChannel('Container');
|
|
30
|
+
this.currentChannel.show();
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
onRemoteOutput(output: string): void {
|
|
34
|
+
this.currentChannel?.appendLine(output);
|
|
35
|
+
}
|
|
36
|
+
}
|