Skip to content

Commit

Permalink
[grid] Moving grid docker package to a more logical location.
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Sep 10, 2021
1 parent 1477907 commit 319fd1a
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/cli/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* build a {@link org.openqa.selenium.grid.config.Config} instance, for
* which there are strongly-typed role-specific classes that use a
* {@code Config}, such as
* {@link org.openqa.selenium.grid.docker.DockerOptions}.
* {@link org.openqa.selenium.grid.node.docker.DockerOptions}.
*
* <p>Assuming your {@code CliCommand} extends
* {@link org.openqa.selenium.grid.TemplateGridCommand}, the process for
Expand Down
2 changes: 1 addition & 1 deletion java/src/org/openqa/selenium/docker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ java_library(
name = "docker",
srcs = glob(["**/*.java"]),
visibility = [
"//java/src/org/openqa/selenium/grid/docker:__pkg__",
"//java/src/org/openqa/selenium/grid/node/docker:__pkg__",
"//java/test/org/openqa/selenium/docker:__subpackages__",
],
deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.grid.docker;
package org.openqa.selenium.grid.node.docker;

import org.openqa.selenium.remote.SessionId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.grid.docker;
package org.openqa.selenium.grid.node.docker;

import static org.openqa.selenium.grid.config.StandardGridRoles.NODE_ROLE;
import static org.openqa.selenium.grid.docker.DockerOptions.DEFAULT_ASSETS_PATH;
import static org.openqa.selenium.grid.docker.DockerOptions.DEFAULT_DOCKER_URL;
import static org.openqa.selenium.grid.docker.DockerOptions.DEFAULT_VIDEO_IMAGE;
import static org.openqa.selenium.grid.docker.DockerOptions.DOCKER_SECTION;

import com.google.auto.service.AutoService;

Expand All @@ -44,21 +40,21 @@ public class DockerFlags implements HasRoles {
names = {"--docker-url"},
description = "URL for connecting to the docker daemon"
)
@ConfigValue(section = DOCKER_SECTION, name = "url", example = DEFAULT_DOCKER_URL)
@ConfigValue(section = DockerOptions.DOCKER_SECTION, name = "url", example = DockerOptions.DEFAULT_DOCKER_URL)
private String dockerUrl;

@Parameter(
names = {"--docker-host"},
description = "Host name where the docker daemon is running"
)
@ConfigValue(section = DOCKER_SECTION, name = "host", example = "\"localhost\"")
@ConfigValue(section = DockerOptions.DOCKER_SECTION, name = "host", example = "\"localhost\"")
private String dockerHost;

@Parameter(
names = {"--docker-port"},
description = "Port where the docker daemon is running"
)
@ConfigValue(section = DOCKER_SECTION, name = "port", example = "2375")
@ConfigValue(section = DockerOptions.DOCKER_SECTION, name = "port", example = "2375")
private Integer dockerPort;

@Parameter(
Expand All @@ -69,7 +65,7 @@ public class DockerFlags implements HasRoles {
variableArity = true,
splitter = NonSplittingSplitter.class)
@ConfigValue(
section = DOCKER_SECTION,
section = DockerOptions.DOCKER_SECTION,
name = "configs",
example = "[\"selenium/standalone-firefox:latest\", \"{\\\"browserName\\\": \\\"firefox\\\"}\"]")
private List<String> images2Capabilities;
Expand All @@ -78,14 +74,14 @@ public class DockerFlags implements HasRoles {
names = {"--docker-video-image"},
description = "Docker image to be used when video recording is enabled"
)
@ConfigValue(section = DOCKER_SECTION, name = "video-image", example = DEFAULT_VIDEO_IMAGE)
private String videoImage = DEFAULT_VIDEO_IMAGE;
@ConfigValue(section = DockerOptions.DOCKER_SECTION, name = "video-image", example = DockerOptions.DEFAULT_VIDEO_IMAGE)
private String videoImage = DockerOptions.DEFAULT_VIDEO_IMAGE;

@Parameter(
names = {"--docker-assets-path"},
description = "Absolute path where assets will be stored"
)
@ConfigValue(section = DOCKER_SECTION, name = "assets-path", example = DEFAULT_ASSETS_PATH)
@ConfigValue(section = DockerOptions.DOCKER_SECTION, name = "assets-path", example = DockerOptions.DEFAULT_ASSETS_PATH)
private String assetsPath;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.grid.docker;
package org.openqa.selenium.grid.node.docker;

import static org.openqa.selenium.Platform.WINDOWS;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMultimap;
Expand Down Expand Up @@ -49,8 +51,6 @@
import java.util.concurrent.ExecutionException;
import java.util.logging.Logger;

import static org.openqa.selenium.Platform.WINDOWS;

public class DockerOptions {

static final String DOCKER_SECTION = "docker";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.grid.docker;
package org.openqa.selenium.grid.node.docker;

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.docker.Container;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.grid.docker;
package org.openqa.selenium.grid.node.docker;

import static java.util.Optional.ofNullable;
import static org.openqa.selenium.docker.ContainerConfig.image;
Expand Down
4 changes: 2 additions & 2 deletions java/src/org/openqa/selenium/grid/node/local/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ java_library(
srcs = glob(["*.java"]),
visibility = [
"//java/src/org/openqa/selenium/grid/commands:__pkg__",
"//java/src/org/openqa/selenium/grid/docker:__pkg__",
"//java/src/org/openqa/selenium/grid/node/config:__pkg__",
"//java/src/org/openqa/selenium/grid/node/docker:__pkg__",
"//java/src/org/openqa/selenium/grid/node/httpd:__pkg__",
"//java/test/org/openqa/selenium/grid:__subpackages__",
],
Expand All @@ -19,11 +19,11 @@ java_library(
"//java/src/org/openqa/selenium/grid/component",
"//java/src/org/openqa/selenium/grid/config",
"//java/src/org/openqa/selenium/grid/data",
"//java/src/org/openqa/selenium/grid/docker",
"//java/src/org/openqa/selenium/grid/jmx",
"//java/src/org/openqa/selenium/grid/log",
"//java/src/org/openqa/selenium/grid/node",
"//java/src/org/openqa/selenium/grid/node/config",
"//java/src/org/openqa/selenium/grid/node/docker:docker",
"//java/src/org/openqa/selenium/grid/node/relay",
"//java/src/org/openqa/selenium/grid/security",
"//java/src/org/openqa/selenium/grid/server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import org.openqa.selenium.grid.data.SessionClosedEvent;
import org.openqa.selenium.grid.data.Slot;
import org.openqa.selenium.grid.data.SlotId;
import org.openqa.selenium.grid.docker.DockerSession;
import org.openqa.selenium.grid.jmx.JMXHelper;
import org.openqa.selenium.grid.jmx.ManagedAttribute;
import org.openqa.selenium.grid.jmx.ManagedService;
Expand All @@ -65,6 +64,7 @@
import org.openqa.selenium.grid.node.Node;
import org.openqa.selenium.grid.node.SessionFactory;
import org.openqa.selenium.grid.node.config.NodeOptions;
import org.openqa.selenium.grid.node.docker.DockerSession;
import org.openqa.selenium.grid.security.Secret;
import org.openqa.selenium.internal.Debug;
import org.openqa.selenium.internal.Either;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import org.openqa.selenium.grid.config.Config;
import org.openqa.selenium.grid.data.DefaultSlotMatcher;
import org.openqa.selenium.grid.data.SlotMatcher;
import org.openqa.selenium.grid.docker.DockerOptions;
import org.openqa.selenium.grid.log.LoggingOptions;
import org.openqa.selenium.grid.node.Node;
import org.openqa.selenium.grid.node.SessionFactory;
import org.openqa.selenium.grid.node.config.DriverServiceSessionFactory;
import org.openqa.selenium.grid.node.config.NodeOptions;
import org.openqa.selenium.grid.node.docker.DockerOptions;
import org.openqa.selenium.grid.node.relay.RelayOptions;
import org.openqa.selenium.grid.security.SecretOptions;
import org.openqa.selenium.grid.server.BaseServerOptions;
Expand Down

0 comments on commit 319fd1a

Please sign in to comment.