@oya-ai/cli 1.0.163 → 1.0.167
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/dist/index.js +18 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -509,6 +509,7 @@ var Status = {
|
|
|
509
509
|
/** The key may not use this endpoint. */
|
|
510
510
|
FORBIDDEN: 403
|
|
511
511
|
};
|
|
512
|
+
var NATIVE_LINUX_DIRECTORY = process.env.OYA_NATIVE_LINUX_DIRECTORY || "";
|
|
512
513
|
|
|
513
514
|
// src/install/shell.ts
|
|
514
515
|
function settle(cmd, args, resolve, reject) {
|
|
@@ -1231,15 +1232,31 @@ async function provisionK8sFleet(root, a) {
|
|
|
1231
1232
|
|
|
1232
1233
|
// src/install/docker.ts
|
|
1233
1234
|
async function provisionGoverned(root) {
|
|
1235
|
+
const context = nativeContext();
|
|
1234
1236
|
const exists = await capture("docker", ["network", "inspect", "oya-browsers"]);
|
|
1235
1237
|
if (!exists)
|
|
1236
1238
|
await run("docker", ["network", "create", "--internal", "--driver", "bridge", "oya-browsers"], { cwd: root });
|
|
1239
|
+
await buildGoverned(root, context);
|
|
1240
|
+
governedInstructions();
|
|
1241
|
+
}
|
|
1242
|
+
async function buildGoverned(root, context) {
|
|
1237
1243
|
console.log(" building the governed browser image\u2026");
|
|
1238
|
-
await run(
|
|
1244
|
+
await run(
|
|
1245
|
+
"docker",
|
|
1246
|
+
["build", "--platform", "linux/amd64", "--build-context", context, "-t", "oya-browser:local", "browser"],
|
|
1247
|
+
{ cwd: root }
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
function governedInstructions() {
|
|
1239
1251
|
console.log("\n Governed browsers need Docker daemon access from the server container.");
|
|
1240
1252
|
console.log(" Add this to the server service in docker-compose.yml, then re-run `docker compose up -d`:");
|
|
1241
1253
|
console.log(" volumes:\n - /var/run/docker.sock:/var/run/docker.sock");
|
|
1242
1254
|
}
|
|
1255
|
+
function nativeContext() {
|
|
1256
|
+
if (!NATIVE_LINUX_DIRECTORY)
|
|
1257
|
+
throw new Error("Set OYA_NATIVE_LINUX_DIRECTORY to the verified Linux x64 Oya distribution.");
|
|
1258
|
+
return `native-engine=${NATIVE_LINUX_DIRECTORY}`;
|
|
1259
|
+
}
|
|
1243
1260
|
async function provisionDocker(root, a) {
|
|
1244
1261
|
if (a.fleet === "oya-selfhosted") await provisionGoverned(root);
|
|
1245
1262
|
const scale = a.fleet === "docker-workers" ? ["--scale", `browser=${a.workers}`] : ["--scale", "browser=0"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oya-ai/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.167",
|
|
4
4
|
"description": "Command line for the Oya browser control plane.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://oyabrowser.com",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@oya-ai/browser": "1.0.
|
|
53
|
+
"@oya-ai/browser": "1.0.167",
|
|
54
54
|
"@types/node": "^20.19.43",
|
|
55
55
|
"tsup": "^8.5.1",
|
|
56
56
|
"typescript": "^6.0.3"
|