-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[grid] Improve browser container labels and naming in Dynamic Grid #16599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Viet Nguyen Duc <[email protected]>
PR Compliance Guide 🔍(Compliance updated until commit f95d8f3)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit c701bc1
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
Signed-off-by: Viet Nguyen Duc <[email protected]>
User description
🔗 Related Issues
💥 What does this PR do?
Dynamic Grid Container Naming Implementation
browser-<browserName>-<timestamp>-<uuid> and recorder-<browserName>-<timestamp>-<uuid>browser-chrome-1731625200000-a3f2b8c9, recorder-chrome-1731625200000-a3f2b8c9Docker Compose Label Inheritance
com.docker.compose.*labels from parent node containerdocker-compose down*Before

After

🔧 Implementation Notes
Backward Compatibility
All changes are backward compatible
Container name is optional; existing code without names continues to work
Labels are optional; nodes not running in Docker Compose will have empty label maps
Related Issues
Improves debugging and monitoring of Docker-based Grid sessions
Addresses container lifecycle management in Docker Compose environments
Prevents naming conflicts in high-concurrency scenarios
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Implement container naming pattern for browser and recorder containers
Extract and apply Docker Compose labels to containers for lifecycle management
Add labels and name fields to ContainerConfig and ContainerInfo classes
Generate unique container identifiers using timestamp and UUID
Diagram Walkthrough
File Walkthrough
ContainerConfig.java
Add labels and name support to ContainerConfigjava/src/org/openqa/selenium/docker/ContainerConfig.java
labelsandnamefields to store container metadataparameters
getName(),labels(), andname()methods for fluent APImap(),env(),bind(), etc.) to preservelabels and name
toJson()to include labels in container creation request whennon-empty
ContainerInfo.java
Add labels field to ContainerInfojava/src/org/openqa/selenium/docker/ContainerInfo.java
labelsfield to store container labels from Docker inspectresponse
getLabels()getter method to retrieve container labelsCreateContainer.java
Support container naming in Docker API requestjava/src/org/openqa/selenium/docker/client/CreateContainer.java
namequeryparameter
ContainerConfig
InspectContainer.java
Extract labels from Docker inspect responsejava/src/org/openqa/selenium/docker/client/InspectContainer.java
response
DockerOptions.java
Extract and pass Docker Compose labelsjava/src/org/openqa/selenium/grid/node/docker/DockerOptions.java
getComposeLabels()method to filter Docker Compose labels fromparent node container
com.docker.compose.prefixDockerSessionFactory.java
Implement container naming and label applicationjava/src/org/openqa/selenium/grid/node/docker/DockerSessionFactory.java
composeLabelsfield to store Docker Compose labels from parentnode
UUID
browser---recorder---createBrowserContainer()andstartVideoContainer()methods toaccept and use sessionIdentifier