aglio-worker 0.6.0 → 0.9.2

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.
Files changed (2) hide show
  1. package/agent.js +10 -2
  2. package/package.json +2 -2
package/agent.js CHANGED
@@ -28148,6 +28148,10 @@ var cardLabelInputSchema = external_exports.object({
28148
28148
  color: cardLabelColorSchema.default(DEFAULT_CARD_LABEL_COLOR)
28149
28149
  });
28150
28150
 
28151
+ // ../../packages/shared/src/workspace.ts
28152
+ var INVITE_TTL_DAYS = 7;
28153
+ var INVITE_TTL_MS = INVITE_TTL_DAYS * 24 * 60 * 60 * 1e3;
28154
+
28151
28155
  // ../../packages/shared/src/workspace-theme.ts
28152
28156
  var WORKSPACE_THEME_ACCENT_IDS = ["default", "violet", "emerald", "amber", "rose"];
28153
28157
  var WORKSPACE_THEME_SCALES = ["compact", "default", "large"];
@@ -28242,6 +28246,10 @@ import { existsSync } from "node:fs";
28242
28246
  import { PassThrough } from "node:stream";
28243
28247
  import { join, posix, relative, resolve } from "node:path";
28244
28248
  import Dockerode from "dockerode";
28249
+ async function runnerCpuCount(client) {
28250
+ const info = await client.info().catch(() => null);
28251
+ return Math.max(1, Math.min(2, Math.floor(info?.NCPU ?? 1)));
28252
+ }
28245
28253
  var CONTAINER_WORKSPACE = "/workspace";
28246
28254
  function isRunningInContainer() {
28247
28255
  return existsSync("/.dockerenv") || existsSync("/run/.containerenv");
@@ -28324,7 +28332,7 @@ async function createDockerJobExecutor(input2) {
28324
28332
  Binds: [`${hostPath}:${CONTAINER_WORKSPACE}`],
28325
28333
  NetworkMode: networkMode,
28326
28334
  Memory: 4 * 1024 * 1024 * 1024,
28327
- NanoCpus: 2e9,
28335
+ NanoCpus: await runnerCpuCount(client) * 1e9,
28328
28336
  PidsLimit: 1024,
28329
28337
  AutoRemove: false,
28330
28338
  Init: true,
@@ -28450,7 +28458,7 @@ async function createDockerLoginContainer(input2) {
28450
28458
  NetworkMode: "bridge",
28451
28459
  ExtraHosts: input2.extraHosts ?? [],
28452
28460
  Memory: 2 * 1024 * 1024 * 1024,
28453
- NanoCpus: 2e9,
28461
+ NanoCpus: await runnerCpuCount(client) * 1e9,
28454
28462
  PidsLimit: 512,
28455
28463
  AutoRemove: false,
28456
28464
  Init: true,
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "aglio-worker",
3
- "version": "0.6.0",
3
+ "version": "0.9.2",
4
4
  "description": "Host machine agent for Aglio: claims jobs over the API and starts aglio-runner containers.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "aglio-worker": "./agent.js"
7
+ "aglio-worker": "agent.js"
8
8
  },
9
9
  "files": [
10
10
  "agent.js"