Skip to content
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

Remove unused DockerRemote #6740

Merged
merged 1 commit into from
Jan 8, 2025
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
1 change: 0 additions & 1 deletion .cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"CURL_CLIENT": "*",
"CONFIGURATIONS": "*",
"ADDITIONAL_ARGS": "*",
"CONTAINER_NODES": "*",
},
},
"add_perf_test": {
Expand Down
10 changes: 1 addition & 9 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function(add_e2e_test)
cmake_parse_arguments(
PARSE_ARGV 0 PARSED_ARGS ""
"NAME;PYTHON_SCRIPT;LABEL;CURL_CLIENT;PERF_LABEL"
"CONSTITUTION;ADDITIONAL_ARGS;CONFIGURATIONS;CONTAINER_NODES"
"CONSTITUTION;ADDITIONAL_ARGS;CONFIGURATIONS"
)

if(NOT PARSED_ARGS_CONSTITUTION)
Expand Down Expand Up @@ -161,14 +161,6 @@ function(add_e2e_test)
PROPERTY ENVIRONMENT "CURL_CLIENT=ON"
)
endif()
if((${PARSED_ARGS_CONTAINER_NODES}) AND (LONG_TESTS))
# Containerised nodes are only enabled with long tests
set_property(
TEST ${PARSED_ARGS_NAME}
APPEND
PROPERTY ENVIRONMENT "CONTAINER_NODES=ON"
)
endif()

if(DEFINED DEFAULT_ENCLAVE_TYPE)
set_property(
Expand Down
222 changes: 0 additions & 222 deletions tests/infra/docker_remote.py

This file was deleted.

5 changes: 0 additions & 5 deletions tests/infra/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def __init__(
version=None,
service_load=None,
node_data_json_file=None,
nodes_in_container=False,
):
# Map of node id to dict of node arg to override value
# for example, to set the election timeout to 2s for node 3:
Expand Down Expand Up @@ -279,7 +278,6 @@ def __init__(
self.args = None
self.service_certificate_valid_from = None
self.service_certificate_validity_days = None
self.nodes_in_container = nodes_in_container

# Requires admin privileges
self.partitioner = (
Expand Down Expand Up @@ -324,7 +322,6 @@ def create_node(self, host, binary_dir=None, library_dir=None, **kwargs):
library_dir or self.library_dir,
debug,
perf,
nodes_in_container=self.nodes_in_container,
**kwargs,
)
self.nodes.append(node)
Expand Down Expand Up @@ -1703,7 +1700,6 @@ def network(
version=None,
service_load=None,
node_data_json_file=None,
nodes_in_container=False,
):
"""
Context manager for Network class.
Expand Down Expand Up @@ -1734,7 +1730,6 @@ def network(
version=version,
service_load=service_load,
node_data_json_file=node_data_json_file,
nodes_in_container=nodes_in_container,
)
try:
yield net
Expand Down
26 changes: 6 additions & 20 deletions tests/infra/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from enum import Enum, auto
import infra.crypto
import infra.remote
import infra.docker_remote
from datetime import datetime, timedelta, timezone
import infra.net
import infra.path
Expand Down Expand Up @@ -119,7 +118,6 @@ def __init__(
node_port=0,
version=None,
node_data_json_file=None,
nodes_in_container=False,
):
self.local_node_id = local_node_id
self.binary_dir = binary_dir
Expand Down Expand Up @@ -147,32 +145,20 @@ def __init__(
self.label = None
self.verify_ca_by_default = True

requires_docker_remote = nodes_in_container or os.getenv("CONTAINER_NODES")

if isinstance(self.host, str):
raise ValueError("Translate host to HostSpec before you get here")

for interface_name, rpc_interface in self.host.rpc_interfaces.items():
# Main RPC interface determines remote implementation
if interface_name == infra.interfaces.PRIMARY_RPC_INTERFACE:
if rpc_interface.protocol == "local":
self.remote_impl = (
infra.docker_remote.DockerRemote
if requires_docker_remote
else infra.remote.LocalRemote
)
# Node client address does not currently work with DockerRemote
if not requires_docker_remote:
if not self.major_version or self.major_version > 1:
self.node_client_host = str(
ipaddress.ip_address(BASE_NODE_CLIENT_HOST)
+ self.local_node_id
)
elif rpc_interface.protocol == "ssh":
if requires_docker_remote:
raise ValueError(
"Cannot use SSH remote with containerised nodes"
self.remote_impl = infra.remote.LocalRemote
if not self.major_version or self.major_version > 1:
self.node_client_host = str(
ipaddress.ip_address(BASE_NODE_CLIENT_HOST)
+ self.local_node_id
)
elif rpc_interface.protocol == "ssh":
self.remote_impl = infra.remote.SSHRemote
else:
assert (
Expand Down
14 changes: 2 additions & 12 deletions tests/lts_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,8 @@ def run_code_upgrade_from(

# Rollover JWKS so that new primary must read historical CA bundle table
# and retrieve new keys via auto refresh
if not os.getenv("CONTAINER_NODES"):
jwt_issuer.refresh_keys()
jwt_issuer.wait_for_refresh(network, args)
else:
# https://github.com/microsoft/CCF/issues/2608#issuecomment-924785744
LOG.warning("Skipping JWT refresh as running nodes in container")
jwt_issuer.refresh_keys()
jwt_issuer.wait_for_refresh(network, args)

test_new_service(
network,
Expand Down Expand Up @@ -663,12 +659,6 @@ def add(parser):
help='Absolute path to existing CCF release, e.g. "/opt/ccf"',
default=None,
)
parser.add_argument(
"--release-install-image",
type=str,
help="If --release-install-path is set, specify a docker image to run release in (only if CONTAINER_NODES envvar is set) ",
default=None,
)
parser.add_argument("--dry-run", action="store_true")

args = infra.e2e_args.cli_args(add)
Expand Down
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ docutils
python-iptables
py-spy
GitPython
docker
better_exceptions
pyasn1
Jinja2
Expand Down
Loading