[grid] Dynamic K8s video always use the per-session subfolder; remove pod-wait + relocation - #17876
Conversation
…it + relocation For both inline recording and the external video sidecar the Node now sets SE_VIDEO_SESSION_SUBFOLDER=true + SE_VIDEO_FILE_NAME=auto, so the recorder writes each video straight to its final /videos/<sessionId>/ location on the shared assets volume. SE_NODE_CONTAINER_NAME (the Pod name via the downward API) is passed so the recorder can fall back to it when a session id is unavailable. Removes the relocation path entirely: KubernetesSession no longer waits for the Pod to terminate or moves jobName.mp4 into the session folder (waitForPodTerminated, relocateVideoFiles, waitForFileStable, the videoFileName field and the naming helpers are gone). Updated unit tests; removed the relocation-only KubernetesSessionTest. NOTE: needs a Bazel build to verify (fabric8 downward-API builder). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by QodoK8s Dynamic Grid: always record videos into per-session subfolders; drop relocation
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. SE_VIDEO_FILE_NAME forced to auto
|
🔗 Related Issues
Paired recorder change in docker-selenium (consumes the new
SE_NODE_CONTAINER_NAMEenv as the subfolder fallback): branchk8s-video-subfolder-container-name-fallback.💥 What does this PR do?
For the Kubernetes Dynamic Grid, both inline recording and the external video sidecar now always use the per-session subfolder approach. The Node sets
SE_VIDEO_SESSION_SUBFOLDER=true+SE_VIDEO_FILE_NAME=autoon the browser Job / video sidecar, so the recorder writes each video straight to its final/videos/<sessionId>/location on the shared assets volume.SE_NODE_CONTAINER_NAME(the Pod name via the downward APImetadata.name) is also passed so the recorder can fall back to it when a session id is unavailable.This removes the Node-side relocation path entirely.
KubernetesSessionno longer:waitForPodTerminated),jobName.mp4into<sessionId>/(relocateVideoFiles,waitForFileStable),videoFileNamefield.KubernetesSessionFactorydrops the now-dead naming helpers (resolveVideoFileName,getVideoFileName,getVideoFileNameTrimRegex,isVideoFileNameAuto,isVideoSessionSubfolder,isRecorderManagedFileName).🔧 Implementation Notes
Per-session grouping in K8s previously relied on the Node relocating the recorder's flat
jobName.mp4into<sessionId>/after waiting for the Pod to terminate. The recorder already supportsSE_VIDEO_SESSION_SUBFOLDERand writes<sessionId>/directly on the same/videosvolume as the assets path, so the relocation + pod-wait is redundant and only adds latency and complexity to session teardown. Using the subfolder approach for inline and external unifies the two modes and lets the recorder own the final path.The
SE_NODE_CONTAINER_NAMEfallback guarantees a unique folder per Pod, so a recording never lands flat and collides on the shared ReadWriteMany assets volume if a session id is ever missing.🤖 AI assistance
KubernetesSessionFactory/KubernetesSessionchanges and the unit-test updates💡 Additional Considerations
SE_NODE_CONTAINER_NAMEsubfolder fallback.SE_VIDEO_SESSION_SUBFOLDERsupport) would record flat instead of per-session, since there is no longer a relocation fallback. Recommend a browser/video image at least matching the Grid version.🔄 Types of changes