ag-ai 0.1.2 → 0.1.4
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/k8s/common.d.ts +5 -0
- package/dist/k8s/common.js +23 -1
- package/dist/k8s/index.js +2 -1
- package/dist/k8s/opencode.js +4 -0
- package/dist/k8s/runner.js +1 -1
- package/package.json +1 -1
package/dist/k8s/common.d.ts
CHANGED
|
@@ -24,6 +24,11 @@ export interface SecretMount {
|
|
|
24
24
|
file: string;
|
|
25
25
|
}
|
|
26
26
|
export declare const secretMount: (name: string, reference: SecretReference) => SecretMount;
|
|
27
|
+
/**
|
|
28
|
+
* Mount one Secret key as one concrete file path, for tools that read a config
|
|
29
|
+
* file rather than an environment variable (for example OpenCode's auth.json).
|
|
30
|
+
*/
|
|
31
|
+
export declare const secretFileMount: (name: string, reference: SecretReference, file: string) => SecretMount;
|
|
27
32
|
export declare const env: (name: string, value: string) => V1EnvVar;
|
|
28
33
|
/** OpenCode health probe with basic auth, evaluated inside the container. */
|
|
29
34
|
export declare const openCodeHealthProbe: (port: number) => {
|
package/dist/k8s/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openCodeHealthProbe = exports.env = exports.secretMount = exports.stripClusterScopedNamespaces = exports.serviceUrl = exports.resourceName = exports.METAL_LB_KEY = exports.T3_SERVICE = exports.RUNNER_SERVICE = exports.OPENCODE_SERVICE = exports.T3_PORT = exports.GENERATION_PORT = exports.OPENCODE_PORT = exports.T3CODE_APP = exports.RUNNER_APP = exports.OPENCODE_APP = exports.NAMESPACE = void 0;
|
|
3
|
+
exports.openCodeHealthProbe = exports.env = exports.secretFileMount = exports.secretMount = exports.stripClusterScopedNamespaces = exports.serviceUrl = exports.resourceName = exports.METAL_LB_KEY = exports.T3_SERVICE = exports.RUNNER_SERVICE = exports.OPENCODE_SERVICE = exports.T3_PORT = exports.GENERATION_PORT = exports.OPENCODE_PORT = exports.T3CODE_APP = exports.RUNNER_APP = exports.OPENCODE_APP = exports.NAMESPACE = void 0;
|
|
4
4
|
const ag_rpi_mega_1 = require("ag-rpi-mega");
|
|
5
5
|
/** The plugin owns its identity; addresses, hosts, and secrets come from the host. */
|
|
6
6
|
exports.NAMESPACE = 'ag-ai';
|
|
@@ -39,6 +39,28 @@ const secretMount = (name, reference) => {
|
|
|
39
39
|
return { volume, mount, file: `${mountPath}/${reference.key}` };
|
|
40
40
|
};
|
|
41
41
|
exports.secretMount = secretMount;
|
|
42
|
+
/**
|
|
43
|
+
* Mount one Secret key as one concrete file path, for tools that read a config
|
|
44
|
+
* file rather than an environment variable (for example OpenCode's auth.json).
|
|
45
|
+
*/
|
|
46
|
+
const secretFileMount = (name, reference, file) => {
|
|
47
|
+
const volume = {
|
|
48
|
+
name: `${name}-file`,
|
|
49
|
+
secret: {
|
|
50
|
+
defaultMode: 0o400,
|
|
51
|
+
items: [{ key: reference.key, path: reference.key }],
|
|
52
|
+
secretName: reference.name,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const mount = {
|
|
56
|
+
mountPath: file,
|
|
57
|
+
name: volume.name,
|
|
58
|
+
readOnly: true,
|
|
59
|
+
subPath: reference.key,
|
|
60
|
+
};
|
|
61
|
+
return { volume, mount, file };
|
|
62
|
+
};
|
|
63
|
+
exports.secretFileMount = secretFileMount;
|
|
42
64
|
const env = (name, value) => ({ name, value });
|
|
43
65
|
exports.env = env;
|
|
44
66
|
/** OpenCode health probe with basic auth, evaluated inside the container. */
|
package/dist/k8s/index.js
CHANGED
|
@@ -20,9 +20,10 @@ exports.plugin = {
|
|
|
20
20
|
'generation-token',
|
|
21
21
|
'analytica-token',
|
|
22
22
|
'opencode-password',
|
|
23
|
+
'opencode-auth',
|
|
23
24
|
'image-api-key',
|
|
24
25
|
],
|
|
25
|
-
requiredImages: ['ag-ai-runner', 'ag-ai-opencode', 'ag-ai-t3code'],
|
|
26
|
+
requiredImages: ['ag-ai-runner', 'ag-ai-opencode', 'ag-ai-t3code', 'ag-ai-firewall'],
|
|
26
27
|
stacks: (context) => [
|
|
27
28
|
(0, opencode_1.opencodeStack)(context),
|
|
28
29
|
(0, runner_1.runnerStack)(context),
|
package/dist/k8s/opencode.js
CHANGED
|
@@ -21,6 +21,8 @@ const opencodeStack = (context) => {
|
|
|
21
21
|
(0, common_1.stripClusterScopedNamespaces)(stack);
|
|
22
22
|
const password = context.secret('opencode-password');
|
|
23
23
|
const credentials = (0, common_1.secretMount)('opencode-password', password);
|
|
24
|
+
// Provider credentials live in OpenCode's auth.json under XDG_DATA_HOME.
|
|
25
|
+
const auth = (0, common_1.secretFileMount)('opencode-auth', context.secret('opencode-auth'), '/data/opencode/data/opencode/auth.json');
|
|
24
26
|
const probe = (0, common_1.openCodeHealthProbe)(common_1.OPENCODE_PORT);
|
|
25
27
|
const container = {
|
|
26
28
|
name: 'opencode',
|
|
@@ -45,6 +47,7 @@ const opencodeStack = (context) => {
|
|
|
45
47
|
volumeMounts: [
|
|
46
48
|
...dataMounts,
|
|
47
49
|
credentials.mount,
|
|
50
|
+
auth.mount,
|
|
48
51
|
{ name: 'opencode', mountPath: OPENCODE_PREFIX, readOnly: true },
|
|
49
52
|
{ name: 'tmp', mountPath: '/tmp' },
|
|
50
53
|
],
|
|
@@ -73,6 +76,7 @@ const opencodeStack = (context) => {
|
|
|
73
76
|
volumes: [
|
|
74
77
|
dataVolume,
|
|
75
78
|
credentials.volume,
|
|
79
|
+
auth.volume,
|
|
76
80
|
{ name: 'opencode', emptyDir: { sizeLimit: '1Gi' } },
|
|
77
81
|
{ name: 'tmp', emptyDir: { sizeLimit: '1Gi' } },
|
|
78
82
|
],
|
package/dist/k8s/runner.js
CHANGED
|
@@ -147,7 +147,7 @@ const runnerStack = (context) => {
|
|
|
147
147
|
pod.initContainers = [
|
|
148
148
|
{
|
|
149
149
|
name: 'restrict-network',
|
|
150
|
-
image: facilities.image('
|
|
150
|
+
image: facilities.image('ag-ai-firewall'),
|
|
151
151
|
command: ['/bin/sh', '/etc/ag-ai/network-init.sh'],
|
|
152
152
|
volumeMounts: [{ name: scriptMount.name, mountPath: scriptMount.mountPath, readOnly: true }],
|
|
153
153
|
securityContext: {
|