Skip to content

Commit

Permalink
Removing old code
Browse files Browse the repository at this point in the history
  • Loading branch information
IanWoodard committed Jan 6, 2025
1 parent 907fbd0 commit fd5b7a1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 518 deletions.
53 changes: 0 additions & 53 deletions devservices/utils/docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

from packaging import version

from devservices.configs.service_config import load_service_config_from_file
from devservices.constants import CONFIG_FILE_NAME
from devservices.constants import DEVSERVICES_DIR_NAME
from devservices.constants import DOCKER_COMPOSE_DOWNLOAD_URL
from devservices.constants import DOCKER_USER_PLUGIN_DIR
from devservices.constants import LOGGER_NAME
Expand All @@ -21,10 +18,8 @@
from devservices.exceptions import DockerComposeError
from devservices.exceptions import DockerComposeInstallationError
from devservices.utils.console import Console
from devservices.utils.dependencies import InstalledRemoteDependency
from devservices.utils.docker import check_docker_daemon_running
from devservices.utils.install_binary import install_binary
from devservices.utils.services import Service


class DockerComposeCommand(NamedTuple):
Expand Down Expand Up @@ -219,54 +214,6 @@ def create_docker_compose_command(
)


def get_docker_compose_commands_to_run(
service: Service,
remote_dependencies: list[InstalledRemoteDependency],
current_env: dict[str, str],
command: str,
options: list[str],
service_config_file_path: str,
mode_dependencies: list[str],
) -> list[DockerComposeCommand]:
docker_compose_commands = []
for dependency in remote_dependencies:
# TODO: Consider passing in service config in InstalledRemoteDependency instead of loading it here
dependency_service_config = load_service_config_from_file(dependency.repo_path)
dependency_config_path = os.path.join(
dependency.repo_path, DEVSERVICES_DIR_NAME, CONFIG_FILE_NAME
)
non_remote_services = get_non_remote_services(
dependency_config_path, current_env
)
services_to_use = non_remote_services.intersection(
set(dependency_service_config.modes[dependency.mode])
)
docker_compose_commands.append(
create_docker_compose_command(
dependency_service_config.service_name,
dependency_config_path,
services_to_use,
command,
options,
)
)

# Add docker compose command for the top level service
non_remote_services = get_non_remote_services(service_config_file_path, current_env)
services_to_use = non_remote_services.intersection(set(mode_dependencies))
if len(services_to_use) > 0:
docker_compose_commands.append(
create_docker_compose_command(
service.name,
service_config_file_path,
services_to_use,
command,
options,
)
)
return docker_compose_commands


def run_cmd(cmd: list[str], env: dict[str, str]) -> subprocess.CompletedProcess[str]:
logger = logging.getLogger(LOGGER_NAME)
try:
Expand Down
Loading

0 comments on commit fd5b7a1

Please sign in to comment.