Skip to content

Commit 600320f

Browse files
authored
Switch ateom gVisor state path (agent-substrate#190)
## Summary Switch the shared atelet/ateom gVisor state directory from `/run/ateom-gvisor` to `/var/lib/ateom- gvisor`. ## Why This path is not just a transient socket location. It is the shared host/container state root for downloaded `runsc` binaries, per-ateom sockets, OCI bundles, runsc state, pidfiles, checkpoint state, and restore state. `/run` is normally volatile runtime storage and may be tmpfs-backed, which makes it a poor fit for large or service-owned local state. Moving this under `/var/lib` better matches Linux filesystem conventions and avoids treating gVisor runtime/checkpoint artifacts as ephemeral runtime-only files. Additionally I was running into many permissions issues with apps trying to use various folders mounted under `/root` before this change. ## Changes - Update `ateompath.BasePath` to `/var/lib/ateom-gvisor`. - Update the WorkerPool controller to use `ateompath.BasePath` instead of hard-coding the mount path. - Update the atelet install manifest to mount the new hostPath. ## Impact This keeps `atelet`, `ateom-gvisor`, and dynamically created WorkerPool Deployments aligned on the same shared state path. Without that alignment, the system can fail to find sockets, bundles, runsc state, or checkpoint/restore files.
1 parent 65beb7b commit 600320f

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

internal/ateompath/ateompath.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
const (
2323
// The base path. This is both the path of the root shared folder on the
2424
// host filesystem, and when it is mounted into ateom and atelet containers.
25-
BasePath = "/run/ateom-gvisor"
25+
BasePath = "/var/lib/ateom-gvisor"
2626
)
2727

2828
var (

internal/controllers/workerpool_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"sigs.k8s.io/controller-runtime/pkg/client"
3232
"sigs.k8s.io/controller-runtime/pkg/log"
3333

34+
"github.com/agent-substrate/substrate/internal/ateompath"
3435
atev1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1"
3536
)
3637

@@ -155,14 +156,14 @@ func buildDeploymentApplyConfig(wp *atev1alpha1.WorkerPool) *appsv1ac.Deployment
155156
).
156157
WithVolumeMounts(corev1ac.VolumeMount().
157158
WithName("run-ateom").
158-
WithMountPath("/run/ateom-gvisor"))).
159+
WithMountPath(ateompath.BasePath))).
159160
WithSecurityContext(corev1ac.PodSecurityContext().
160161
WithRunAsUser(0).
161162
WithRunAsGroup(0)).
162163
WithVolumes(corev1ac.Volume().
163164
WithName("run-ateom").
164165
WithHostPath(corev1ac.HostPathVolumeSource().
165-
WithPath("/run/ateom-gvisor").
166+
WithPath(ateompath.BasePath).
166167
WithType(corev1.HostPathDirectoryOrCreate))))))
167168
}
168169

manifests/ate-install/atelet.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ spec:
104104
protocol: TCP
105105
volumeMounts:
106106
- name: run-ateom
107-
mountPath: /run/ateom-gvisor
107+
mountPath: /var/lib/ateom-gvisor
108108
volumes:
109109
- name: run-ateom
110110
hostPath:
111-
path: /run/ateom-gvisor
112-
type: DirectoryOrCreate
111+
path: /var/lib/ateom-gvisor
112+
type: DirectoryOrCreate

0 commit comments

Comments
 (0)