run-spaceapp 0.1.6 → 0.1.7
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 +5 -2
- package/package.json +2 -2
- package/src/prerequisites.mjs +16 -5
package/README.md
CHANGED
|
@@ -28,8 +28,11 @@ images. Windows prefers Windows Package Manager's hash-pinned Docker Desktop
|
|
|
28
28
|
manifest and retains a signed direct-download fallback. Docker Desktop license
|
|
29
29
|
acceptance and Linux `docker` group membership require confirmation inside the
|
|
30
30
|
same command. On Windows, approve any UAC prompt required by WSL2 or Docker
|
|
31
|
-
Desktop.
|
|
32
|
-
|
|
31
|
+
Desktop. On Docker Desktop's first launch, select **Skip** in the top-right of
|
|
32
|
+
the **Welcome to Docker** window (or sign in), accept any remaining Docker
|
|
33
|
+
prompt, and keep the terminal open. SpaceApp waits for up to ten minutes and
|
|
34
|
+
continues automatically when Docker is ready. If Windows requests one restart,
|
|
35
|
+
rerun `spaceapp install` afterward and installation continues safely.
|
|
33
36
|
|
|
34
37
|
The launcher selects the `light` profile below 12 GiB RAM and the `standard`
|
|
35
38
|
profile otherwise; override this with `--profile light` or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run-spaceapp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Cross-platform Docker launcher for the SpaceApp self-hosted agent workspace",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public",
|
|
46
46
|
"provenance": true
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "3f5612291d2aea84f1a763c8b094ec0f42208fd1"
|
|
49
49
|
}
|
package/src/prerequisites.mjs
CHANGED
|
@@ -262,6 +262,15 @@ async function ensureWindowsDocker({
|
|
|
262
262
|
if (cliDirectory) {
|
|
263
263
|
prependPath(env, cliDirectory);
|
|
264
264
|
}
|
|
265
|
+
stdout.write(
|
|
266
|
+
"Opening Docker Desktop for its first-run setup.\n" +
|
|
267
|
+
"If Docker shows \"Welcome to Docker\", select \"Skip\" in the top-right (or sign in), and accept any remaining Docker prompt.\n" +
|
|
268
|
+
"Keep this terminal open; SpaceApp will continue automatically when Docker is ready (up to 10 minutes).\n"
|
|
269
|
+
);
|
|
270
|
+
await execute(
|
|
271
|
+
{ command: "docker", args: ["desktop", "start", "--detach"] },
|
|
272
|
+
{ stdin, stdout: null, stderr: null }
|
|
273
|
+
);
|
|
265
274
|
const launchCode = await launch({
|
|
266
275
|
operation: "start-docker-desktop",
|
|
267
276
|
env: {
|
|
@@ -272,12 +281,12 @@ async function ensureWindowsDocker({
|
|
|
272
281
|
stderr.write("Docker Desktop is installed, but SpaceApp could not start it.\n");
|
|
273
282
|
return { code: launchCode, reexecuted: false };
|
|
274
283
|
}
|
|
275
|
-
if (await waitForDocker({ execute, sleep })) {
|
|
284
|
+
if (await waitForDocker({ execute, sleep, attempts: 300 })) {
|
|
276
285
|
stdout.write("Docker Desktop is ready.\n");
|
|
277
286
|
return { code: 0, reexecuted: false };
|
|
278
287
|
}
|
|
279
288
|
stderr.write(
|
|
280
|
-
"Docker Desktop
|
|
289
|
+
"Docker Desktop did not become ready after 10 minutes. Open Docker Desktop and complete its first-run setup (select \"Skip\" on \"Welcome to Docker\" or sign in), restart Windows if requested, then run \"spaceapp install\" again.\n"
|
|
281
290
|
);
|
|
282
291
|
return { code: 1, reexecuted: false };
|
|
283
292
|
}
|
|
@@ -695,12 +704,14 @@ function shellQuote(value) {
|
|
|
695
704
|
return `'${String(value).replaceAll("'", "'\\''")}'`;
|
|
696
705
|
}
|
|
697
706
|
|
|
698
|
-
async function waitForDocker({ execute, sleep }) {
|
|
699
|
-
for (let attempt = 0; attempt
|
|
707
|
+
async function waitForDocker({ execute, sleep, attempts = 90 }) {
|
|
708
|
+
for (let attempt = 0; attempt <= attempts; attempt += 1) {
|
|
700
709
|
if (await dockerIsReady(execute)) {
|
|
701
710
|
return true;
|
|
702
711
|
}
|
|
703
|
-
|
|
712
|
+
if (attempt < attempts) {
|
|
713
|
+
await sleep(2_000);
|
|
714
|
+
}
|
|
704
715
|
}
|
|
705
716
|
return false;
|
|
706
717
|
}
|