Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ type CheClusterDevEnvironments struct {
// Typical uses cases include injecting organization tools/configs, initializing persistent home, etc.
// +optional
InitContainers []corev1.Container `json:"initContainers,omitempty"`

// CLI Activity Tracker configuration for preventing workspace idling during active CLI processes.
// +optional
CliActivityTracker *CliActivityTrackerConfig `json:"cliActivityTracker,omitempty"`
}

// Che components configuration.
Expand Down Expand Up @@ -690,6 +694,56 @@ type WorkspaceSecurityConfig struct {
ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`
}

// CliActivityTrackerConfig defines CLI Activity Tracker configuration for preventing workspace idling
// during active CLI processes. These settings are propagated as environment variables
// to workspace containers. When omitted, the CLI Activity Tracker calculates defaults
// dynamically based on the workspace idle timeout.
type CliActivityTrackerConfig struct {
// Enables CLI Activity Tracker to monitor running CLI processes and prevent workspace idling.
// When omitted, the CLI Activity Tracker determines the default behavior.
// +optional
Enabled *bool `json:"enabled,omitempty"`

// How often (in seconds) to scan for active CLI processes.
// When omitted, the CLI Activity Tracker calculates a default
// based on the workspace idle timeout (e.g. 60s for a 1800s idle timeout).
// +optional
Comment thread
vrubezhny marked this conversation as resolved.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:ExclusiveMinimum=true
SecondsOfCheckPeriod *int32 `json:"secondsOfCheckPeriod,omitempty"`

// How long (in seconds) to wait for input from interactive processes
// before considering them idle.
// When omitted, the CLI Activity Tracker calculates a default
// based on the workspace idle timeout (e.g. 1500s for a 1800s idle timeout).
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:ExclusiveMinimum=true
SecondsOfActivityWindow *int32 `json:"secondsOfActivityWindow,omitempty"`

// All processes unconditionally prevent idling when younger than this (in seconds).
// When omitted, the CLI Activity Tracker calculates a default
// based on the workspace idle timeout (e.g. 300s for a 1800s idle timeout).
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:ExclusiveMinimum=true
SecondsOfGracePeriod *int32 `json:"secondsOfGracePeriod,omitempty"`

// Safety limit (in seconds). Processes older than this stop preventing idling.
// When omitted, the CLI Activity Tracker uses its built-in default (e.g. 6h).
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:ExclusiveMinimum=true
SecondsOfMaxProcessAge *int32 `json:"secondsOfMaxProcessAge,omitempty"`

// Enables verbose logging of CLI Activity Tracker activity-detection details
// (which process was detected, why it does or doesn't prevent idling), promoting
// them from Debug to Info level without requiring debug logging for the whole
// container. When omitted, the CLI Activity Tracker determines the default behavior.
// +optional
Verbose *bool `json:"verbose,omitempty"`
}

// Authentication settings.
type Auth struct {
// Public URL of the Identity Provider server.
Expand Down
50 changes: 50 additions & 0 deletions api/v2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/scripts/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ init() {
build() {
printf "%bBuilding image %b${IMAGE_NAME}${NC}..." "${BOLD}" "${BLUE}"
if ${CONTAINER_ENGINE} build -t ${IMAGE_NAME} > docker-build-log 2>&1 -<<EOF
FROM docker.io/golang:1.25-bookworm
FROM docker.io/golang:1.26-bookworm
RUN apt update && apt install python3-pip skopeo jq rsync unzip -y && \
pip install --break-system-packages yq && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ metadata:
categories: Developer Tools
certified: "false"
containerImage: quay.io/eclipse/che-operator:next
createdAt: "2026-08-17T09:52:27Z"
createdAt: "2026-08-19T17:44:00Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces.
features.operators.openshift.io/cnf: "false"
Expand All @@ -108,7 +108,7 @@ metadata:
operatorframework.io/arch.amd64: supported
operatorframework.io/arch.arm64: supported
operatorframework.io/os.linux: supported
name: eclipse-che.v7.122.0-1057.next
name: eclipse-che.v7.122.0-1058.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1173,7 +1173,7 @@ spec:
name: openvsx
- image: quay.io/sclorg/postgresql-16-c9s:20260319
name: openvsx-postgres
version: 7.122.0-1057.next
version: 7.122.0-1058.next
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19920,6 +19920,59 @@ spec:
type: string
type: array
type: object
cliActivityTracker:
description: CLI Activity Tracker configuration for preventing
workspace idling during active CLI processes.
properties:
enabled:
description: |-
Enables CLI Activity Tracker to monitor running CLI processes and prevent workspace idling.
When omitted, the CLI Activity Tracker determines the default behavior.
type: boolean
secondsOfActivityWindow:
description: |-
How long (in seconds) to wait for input from interactive processes
before considering them idle.
When omitted, the CLI Activity Tracker calculates a default
based on the workspace idle timeout (e.g. 1500s for a 1800s idle timeout).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
secondsOfCheckPeriod:
description: |-
How often (in seconds) to scan for active CLI processes.
When omitted, the CLI Activity Tracker calculates a default
based on the workspace idle timeout (e.g. 60s for a 1800s idle timeout).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
secondsOfGracePeriod:
description: |-
All processes unconditionally prevent idling when younger than this (in seconds).
When omitted, the CLI Activity Tracker calculates a default
based on the workspace idle timeout (e.g. 300s for a 1800s idle timeout).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
secondsOfMaxProcessAge:
description: |-
Safety limit (in seconds). Processes older than this stop preventing idling.
When omitted, the CLI Activity Tracker uses its built-in default (e.g. 6h).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
verbose:
description: |-
Enables verbose logging of CLI Activity Tracker activity-detection details
(which process was detected, why it does or doesn't prevent idling), promoting
them from Debug to Info level without requiring debug logging for the whole
container. When omitted, the CLI Activity Tracker determines the default behavior.
type: boolean
type: object
containerBuildConfiguration:
description: Container build configuration.
properties:
Expand Down
53 changes: 53 additions & 0 deletions config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19815,6 +19815,59 @@ spec:
type: string
type: array
type: object
cliActivityTracker:
description: CLI Activity Tracker configuration for preventing
workspace idling during active CLI processes.
properties:
enabled:
description: |-
Enables CLI Activity Tracker to monitor running CLI processes and prevent workspace idling.
When omitted, the CLI Activity Tracker determines the default behavior.
type: boolean
secondsOfActivityWindow:
description: |-
How long (in seconds) to wait for input from interactive processes
before considering them idle.
When omitted, the CLI Activity Tracker calculates a default
based on the workspace idle timeout (e.g. 1500s for a 1800s idle timeout).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
secondsOfCheckPeriod:
description: |-
How often (in seconds) to scan for active CLI processes.
When omitted, the CLI Activity Tracker calculates a default
based on the workspace idle timeout (e.g. 60s for a 1800s idle timeout).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
secondsOfGracePeriod:
description: |-
All processes unconditionally prevent idling when younger than this (in seconds).
When omitted, the CLI Activity Tracker calculates a default
based on the workspace idle timeout (e.g. 300s for a 1800s idle timeout).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
secondsOfMaxProcessAge:
description: |-
Safety limit (in seconds). Processes older than this stop preventing idling.
When omitted, the CLI Activity Tracker uses its built-in default (e.g. 6h).
exclusiveMinimum: true
format: int32
minimum: 0
type: integer
verbose:
description: |-
Enables verbose logging of CLI Activity Tracker activity-detection details
(which process was detected, why it does or doesn't prevent idling), promoting
them from Debug to Info level without requiring debug logging for the whole
container. When omitted, the CLI Activity Tracker determines the default behavior.
type: boolean
type: object
containerBuildConfiguration:
description: Container build configuration.
properties:
Expand Down
28 changes: 28 additions & 0 deletions controllers/usernamespace/usernamespace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,34 @@ func (r *CheUserNamespaceReconciler) reconcileUserSettings(
data["SECONDS_OF_DW_RUN_BEFORE_IDLING"] = strconv.FormatInt(int64(*checluster.Spec.DevEnvironments.SecondsOfRunBeforeIdling), 10)
}

// CLI Activity Tracker configuration
if checluster.Spec.DevEnvironments.CliActivityTracker != nil {
cw := checluster.Spec.DevEnvironments.CliActivityTracker
if cw.Enabled != nil && *cw.Enabled {
data["CLI_ACTIVITY_TRACKER_ENABLED"] = "true"

if cw.SecondsOfCheckPeriod != nil {
data["CLI_ACTIVITY_TRACKER_CHECK_PERIOD"] = strconv.FormatInt(int64(*cw.SecondsOfCheckPeriod), 10)
}

if cw.SecondsOfActivityWindow != nil {
data["CLI_ACTIVITY_TRACKER_ACTIVITY_WINDOW"] = strconv.FormatInt(int64(*cw.SecondsOfActivityWindow), 10)
}

if cw.SecondsOfGracePeriod != nil {
data["CLI_ACTIVITY_TRACKER_GRACE_PERIOD"] = strconv.FormatInt(int64(*cw.SecondsOfGracePeriod), 10)
}

if cw.SecondsOfMaxProcessAge != nil {
data["CLI_ACTIVITY_TRACKER_MAX_PROCESS_AGE"] = strconv.FormatInt(int64(*cw.SecondsOfMaxProcessAge), 10)
}

if cw.Verbose != nil {
data["CLI_ACTIVITY_TRACKER_VERBOSE"] = strconv.FormatBool(*cw.Verbose)
}
}
}

// proxy settings
if proxyConfig, err := che.GetProxyConfiguration(deployContext); err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ func setupCheCluster(t *testing.T, ctx context.Context, cl client.Client, cheNam
},
SecondsOfInactivityBeforeIdling: ptr.To(int32(1800)),
SecondsOfRunBeforeIdling: ptr.To(int32(-1)),
CliActivityTracker: &chev2.CliActivityTrackerConfig{
Enabled: ptr.To(true),
SecondsOfCheckPeriod: ptr.To(int32(30)),
SecondsOfActivityWindow: ptr.To(int32(900)),
SecondsOfGracePeriod: ptr.To(int32(300)),
// SecondsOfMaxProcessAge intentionally omitted (nil) to test that no env var is created
Verbose: ptr.To(true),
},
EditorsDownloadUrls: []chev2.EditorDownloadUrl{
{
Editor: "che-incubator/che-idea/latest",
Expand Down
Loading
Loading