Skip to content

Commit 73e67ed

Browse files
kylos101ona-agent
andcommitted
Update installer and preview to support new agent-smith config
Co-authored-by: Ona <[email protected]>
1 parent df34a5b commit 73e67ed

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

components/ee/agent-smith/example-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
"enabled": true,
5858
"scanInterval": "5m",
5959
"maxFileSize": 1024,
60-
"workingArea": "/var/gitpod/workspaces"
60+
"workingArea": "/mnt/workingarea-mk2"
6161
}
6262
}

dev/preview/workflow/preview/deploy-gitpod.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,14 @@ yq w -i "${INSTALLER_CONFIG_PATH}" experimental.workspace.networkLimits.bucketSi
464464
#
465465
yq w -i "${INSTALLER_CONFIG_PATH}" experimental.webapp.server.gcpProfilerEnabled "true"
466466

467+
#
468+
# Enable agent-smith filesystem scanning
469+
# (uncomment if needed, we don't use agent-smith by default in previews)
470+
# yq w -i "${INSTALLER_CONFIG_PATH}" experimental.agentsmith.filesystemScanning.enabled "true"
471+
# yq w -i "${INSTALLER_CONFIG_PATH}" experimental.agentsmith.filesystemScanning.scanInterval "5m"
472+
# yq w -i "${INSTALLER_CONFIG_PATH}" experimental.agentsmith.filesystemScanning.maxFileSize "1024"
473+
# yq w -i "${INSTALLER_CONFIG_PATH}" experimental.agentsmith.filesystemScanning.workingArea "/mnt/workingarea-mk2"
474+
467475
log_success "Generated config at $INSTALLER_CONFIG_PATH"
468476

469477
# ========

install/installer/pkg/components/agent-smith/configmap.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package agentsmith
66

77
import (
88
"fmt"
9+
"time"
910

1011
"github.com/gitpod-io/gitpod/agent-smith/pkg/config"
1112
"github.com/gitpod-io/gitpod/common-go/baseserver"
@@ -42,6 +43,13 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
4243
if ctx.Config.Components != nil && ctx.Config.Components.AgentSmith != nil {
4344
ascfg.Config = *ctx.Config.Components.AgentSmith
4445
ascfg.Config.KubernetesNamespace = ctx.Namespace
46+
47+
// Set working area path if filesystem scanning is enabled
48+
if ascfg.Config.FilesystemScanning != nil && ascfg.Config.FilesystemScanning.Enabled {
49+
ascfg.Config.FilesystemScanning.Enabled = true
50+
ascfg.Config.FilesystemScanning.WorkingArea = ContainerWorkingAreaMk2
51+
ascfg.Config.FilesystemScanning.ScanInterval = config.Duration{Duration: 5 * time.Minute}
52+
}
4553
}
4654

4755
fc, err := common.ToJSONString(ascfg)

install/installer/pkg/components/agent-smith/constants.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ package agentsmith
66

77
const (
88
Component = "agent-smith"
9+
10+
// Working area paths - must match ws-daemon constants
11+
HostWorkingAreaMk2 = "/var/gitpod/workspaces-mk2"
12+
ContainerWorkingAreaMk2 = "/mnt/workingarea-mk2"
913
)

install/installer/pkg/components/agent-smith/daemonset.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
7474
MountPath: "/wsman-certs",
7575
ReadOnly: true,
7676
},
77+
{
78+
Name: "working-area",
79+
MountPath: ContainerWorkingAreaMk2,
80+
ReadOnly: true,
81+
},
7782
common.CAVolumeMount(),
7883
},
7984
Env: common.CustomizeEnvvar(ctx, Component, common.MergeEnv(
@@ -103,6 +108,15 @@ func daemonset(ctx *common.RenderContext) ([]runtime.Object, error) {
103108
},
104109
},
105110
},
111+
{
112+
Name: "working-area",
113+
VolumeSource: corev1.VolumeSource{
114+
HostPath: &corev1.HostPathVolumeSource{
115+
Path: HostWorkingAreaMk2,
116+
Type: func() *corev1.HostPathType { t := corev1.HostPathDirectory; return &t }(),
117+
},
118+
},
119+
},
106120
common.CAVolume(),
107121
},
108122
Tolerations: []corev1.Toleration{

0 commit comments

Comments
 (0)