Merge pull request #2309 from pikasTech/fix/2304-opencode-session-sidebar
fix: use git-enabled OpenCode runtime image
This commit is contained in:
@@ -340,6 +340,7 @@ lanes:
|
|||||||
observability:
|
observability:
|
||||||
traceExplorerUrlTemplate: /v1/workbench/traces/{trace_id}/events
|
traceExplorerUrlTemplate: /v1/workbench/traces/{trace_id}/events
|
||||||
opencode:
|
opencode:
|
||||||
|
image: 127.0.0.1:5000/hwlab/opencode:1.17.7-git
|
||||||
providerProfile: dsflash-go
|
providerProfile: dsflash-go
|
||||||
providerId: dsflash-go
|
providerId: dsflash-go
|
||||||
displayName: AgentRun dsflash-go
|
displayName: AgentRun dsflash-go
|
||||||
|
|||||||
@@ -5652,6 +5652,7 @@ function opencodeRuntimeConfigForProfile(deploy, profile) {
|
|||||||
const providerProxyBasePath = configString(config.providerProxyBasePath) || "/v1";
|
const providerProxyBasePath = configString(config.providerProxyBasePath) || "/v1";
|
||||||
const providerProxyBaseURL = configString(config.providerProxyBaseURL) || `http://127.0.0.1:${providerProxyPort}${providerProxyBasePath}`;
|
const providerProxyBaseURL = configString(config.providerProxyBaseURL) || `http://127.0.0.1:${providerProxyPort}${providerProxyBasePath}`;
|
||||||
return {
|
return {
|
||||||
|
image: configString(config.image) || "ghcr.io/anomalyco/opencode:1.17.7",
|
||||||
providerProfile,
|
providerProfile,
|
||||||
providerId,
|
providerId,
|
||||||
displayName: configString(config.displayName) || `AgentRun ${providerProfile}`,
|
displayName: configString(config.displayName) || `AgentRun ${providerProfile}`,
|
||||||
@@ -5785,6 +5786,7 @@ function opencodeServerManifest({ profile = "v03", source, deploy = null, catalo
|
|||||||
"hwlab.pikastech.local/opencode-model": opencodeConfig.model,
|
"hwlab.pikastech.local/opencode-model": opencodeConfig.model,
|
||||||
"hwlab.pikastech.local/opencode-provider-base-url": opencodeConfig.baseURL,
|
"hwlab.pikastech.local/opencode-provider-base-url": opencodeConfig.baseURL,
|
||||||
"hwlab.pikastech.local/opencode-provider-upstream-base-url": opencodeConfig.upstreamBaseURL,
|
"hwlab.pikastech.local/opencode-provider-upstream-base-url": opencodeConfig.upstreamBaseURL,
|
||||||
|
"hwlab.pikastech.local/opencode-image": opencodeConfig.image,
|
||||||
"hwlab.pikastech.local/opencode-config-sha256": configSha256,
|
"hwlab.pikastech.local/opencode-config-sha256": configSha256,
|
||||||
"hwlab.pikastech.local/opencode-api-key-secret-ref": `${apiKeySecretRef.name}/${apiKeySecretRef.key}`,
|
"hwlab.pikastech.local/opencode-api-key-secret-ref": `${apiKeySecretRef.name}/${apiKeySecretRef.key}`,
|
||||||
"hwlab.pikastech.local/agentrun-provider-secret-ref": `${opencodeConfig.agentrunSecretNamespace}/${opencodeConfig.agentrunSecretName}`,
|
"hwlab.pikastech.local/agentrun-provider-secret-ref": `${opencodeConfig.agentrunSecretNamespace}/${opencodeConfig.agentrunSecretName}`,
|
||||||
@@ -5865,7 +5867,7 @@ function opencodeServerManifest({ profile = "v03", source, deploy = null, catalo
|
|||||||
}],
|
}],
|
||||||
containers: [{
|
containers: [{
|
||||||
name,
|
name,
|
||||||
image: "ghcr.io/anomalyco/opencode:1.17.7",
|
image: opencodeConfig.image,
|
||||||
imagePullPolicy: "IfNotPresent",
|
imagePullPolicy: "IfNotPresent",
|
||||||
command: ["/bin/sh", "-ec"],
|
command: ["/bin/sh", "-ec"],
|
||||||
args: ["exec opencode serve --hostname 0.0.0.0 --port 4096"],
|
args: ["exec opencode serve --hostname 0.0.0.0 --port 4096"],
|
||||||
|
|||||||
@@ -758,6 +758,7 @@ test("v03 render includes JD01 secret-plane smoke on JD01 gitops root", { timeou
|
|||||||
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/agentrun-provider-secret-ref"], "agentrun-v02/agentrun-v01-provider-dsflash-go");
|
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/agentrun-provider-secret-ref"], "agentrun-v02/agentrun-v01-provider-dsflash-go");
|
||||||
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/opencode-provider-base-url"], "http://127.0.0.1:4097/v1");
|
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/opencode-provider-base-url"], "http://127.0.0.1:4097/v1");
|
||||||
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/opencode-provider-upstream-base-url"], "https://opencode.ai/zen/go/v1");
|
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/opencode-provider-upstream-base-url"], "https://opencode.ai/zen/go/v1");
|
||||||
|
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/opencode-image"], "127.0.0.1:5000/hwlab/opencode:1.17.7-git");
|
||||||
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/opencode-provider-proxy-boot-sh"], "deploy/runtime/boot/opencode-provider-proxy.sh");
|
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/opencode-provider-proxy-boot-sh"], "deploy/runtime/boot/opencode-provider-proxy.sh");
|
||||||
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/values-printed"], "false");
|
assert.equal(opencodeDeployment.metadata?.annotations?.["hwlab.pikastech.local/values-printed"], "false");
|
||||||
assert.match(opencodeDeployment.spec?.template?.metadata?.annotations?.["hwlab.pikastech.local/opencode-config-sha256"] ?? "", /^[a-f0-9]{64}$/u);
|
assert.match(opencodeDeployment.spec?.template?.metadata?.annotations?.["hwlab.pikastech.local/opencode-config-sha256"] ?? "", /^[a-f0-9]{64}$/u);
|
||||||
@@ -767,6 +768,7 @@ test("v03 render includes JD01 secret-plane smoke on JD01 gitops root", { timeou
|
|||||||
assert.match(opencodeGitInit.args?.[0] ?? "", /git -C \/workspace init/u);
|
assert.match(opencodeGitInit.args?.[0] ?? "", /git -C \/workspace init/u);
|
||||||
assert.ok(opencodeGitInit.volumeMounts?.some((entry) => entry.name === "workspace" && entry.mountPath === "/workspace"));
|
assert.ok(opencodeGitInit.volumeMounts?.some((entry) => entry.name === "workspace" && entry.mountPath === "/workspace"));
|
||||||
const opencodeContainer = collectContainersFromItem(opencodeDeployment).find((container) => container.name === "opencode-server");
|
const opencodeContainer = collectContainersFromItem(opencodeDeployment).find((container) => container.name === "opencode-server");
|
||||||
|
assert.equal(opencodeContainer?.image, "127.0.0.1:5000/hwlab/opencode:1.17.7-git");
|
||||||
assert.deepEqual(opencodeContainer?.command, ["/bin/sh", "-ec"]);
|
assert.deepEqual(opencodeContainer?.command, ["/bin/sh", "-ec"]);
|
||||||
assert.equal(opencodeContainer?.args?.[0], "exec opencode serve --hostname 0.0.0.0 --port 4096");
|
assert.equal(opencodeContainer?.args?.[0], "exec opencode serve --hostname 0.0.0.0 --port 4096");
|
||||||
assert.doesNotMatch(opencodeContainer?.args?.[0] ?? "", /apk add|dl-cdn\.alpinelinux\.org/u, "opencode startup must not depend on runtime apk repository access");
|
assert.doesNotMatch(opencodeContainer?.args?.[0] ?? "", /apk add|dl-cdn\.alpinelinux\.org/u, "opencode startup must not depend on runtime apk repository access");
|
||||||
|
|||||||
Reference in New Issue
Block a user