From 32f9d24c544417a3b7b45cab01b63ecc78031ba0 Mon Sep 17 00:00:00 2001 From: Amanda Richardson Date: Wed, 18 Sep 2024 14:22:39 -0700 Subject: [PATCH] issues fixed --- pyproject.toml | 8 ++++---- smartsim/_core/control/job_manager.py | 2 +- smartsim/_core/control/preview_renderer.py | 4 ++-- smartsim/_core/launcher/dragon/dragon_backend.py | 4 ++-- smartsim/_core/launcher/dragon/dragon_connector.py | 6 ++++-- smartsim/_core/launcher/dragon/dragon_launcher.py | 2 +- smartsim/_core/launcher/launcher.py | 3 +-- smartsim/_core/launcher/step/dragon_step.py | 10 +++++----- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c62a849be..9d4e23c85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -158,13 +158,13 @@ module = [ "smartsim._core.launcher.sge.*", "smartsim._core.launcher.slurm.*", "smartsim._core.launcher.step.*", - "smartsim._core.launcher.stepInfo", - "smartsim._core.launcher.stepMapping", - "smartsim._core.launcher.taskManager", + "smartsim._core.launcher.step_info", + "smartsim._core.launcher.step_mapping", + "smartsim._core.launcher.task_manager", "smartsim._core.utils.serialize", "smartsim._core.utils.telemetry.*", "smartsim.database.*", - "smartsim.settings.sgeSettings", + "smartsim.settings.sge_settings", "smartsim._core.control.controller_utils", "smartsim.entity.dbnode", ] diff --git a/smartsim/_core/control/job_manager.py b/smartsim/_core/control/job_manager.py index 7fe3d558b..5d59ad50e 100644 --- a/smartsim/_core/control/job_manager.py +++ b/smartsim/_core/control/job_manager.py @@ -32,13 +32,13 @@ from threading import RLock, Thread from types import FrameType -from ..launcher.step import Step from ...database import FeatureStore from ...entity import EntitySequence, FSNode, SmartSimEntity from ...log import ContextThread, get_logger from ...status import TERMINAL_STATUSES, InvalidJobStatus, JobStatus from ..config import CONFIG from ..launcher import Launcher, LocalLauncher +from ..launcher.step import Step from ..utils.network import get_ip_from_host from .job import Job, JobEntity diff --git a/smartsim/_core/control/preview_renderer.py b/smartsim/_core/control/preview_renderer.py index 5d06a12a0..17d9ceac1 100644 --- a/smartsim/_core/control/preview_renderer.py +++ b/smartsim/_core/control/preview_renderer.py @@ -33,10 +33,10 @@ import jinja2.utils as u from jinja2 import pass_eval_context -from ..config import CONFIG -from . import Manifest from ...error.errors import PreviewFormatError from ...log import get_logger +from ..config import CONFIG +from . import Manifest from .job import Job logger = get_logger(__name__) diff --git a/smartsim/_core/launcher/dragon/dragon_backend.py b/smartsim/_core/launcher/dragon/dragon_backend.py index a0d6e71f2..7d77aaaac 100644 --- a/smartsim/_core/launcher/dragon/dragon_backend.py +++ b/smartsim/_core/launcher/dragon/dragon_backend.py @@ -45,6 +45,8 @@ # pylint: enable=import-error # isort: on +from ....log import get_logger +from ....status import TERMINAL_STATUSES, JobStatus from ...config import get_config from ...schemas import ( DragonHandshakeRequest, @@ -61,8 +63,6 @@ DragonUpdateStatusResponse, ) from ...utils.helpers import create_short_id_str -from ....log import get_logger -from ....status import TERMINAL_STATUSES, JobStatus logger = get_logger(__name__) diff --git a/smartsim/_core/launcher/dragon/dragon_connector.py b/smartsim/_core/launcher/dragon/dragon_connector.py index c493c7f89..7ff4cdc1c 100644 --- a/smartsim/_core/launcher/dragon/dragon_connector.py +++ b/smartsim/_core/launcher/dragon/dragon_connector.py @@ -42,7 +42,6 @@ import zmq import zmq.auth.thread -from . import dragon_sockets from ....error.errors import SmartSimError from ....log import get_logger from ...config import get_config @@ -56,6 +55,7 @@ DragonShutdownRequest, ) from ...utils.network import find_free_port, get_best_interface_and_address +from . import dragon_sockets if t.TYPE_CHECKING: from typing_extensions import Self @@ -224,7 +224,9 @@ def _start_connector_socket(self, socket_addr: str) -> zmq.Socket[t.Any]: connector_socket: t.Optional[zmq.Socket[t.Any]] = None self._reset_timeout(config.dragon_server_startup_timeout) self._get_new_authenticator(-1) - connector_socket = dragon_sockets.get_secure_socket(self._context, zmq.REP, True) + connector_socket = dragon_sockets.get_secure_socket( + self._context, zmq.REP, True + ) logger.debug(f"Binding connector to {socket_addr}") connector_socket.bind(socket_addr) if connector_socket is None: diff --git a/smartsim/_core/launcher/dragon/dragon_launcher.py b/smartsim/_core/launcher/dragon/dragon_launcher.py index 552c2f105..d540ce081 100644 --- a/smartsim/_core/launcher/dragon/dragon_launcher.py +++ b/smartsim/_core/launcher/dragon/dragon_launcher.py @@ -34,7 +34,6 @@ from smartsim.error import errors from smartsim.types import LaunchedJobID -from ..step_mapping import StepMap from ....error import LauncherError, SmartSimError from ....log import get_logger from ....settings import ( @@ -59,6 +58,7 @@ from ..slurm.slurm_launcher import SlurmLauncher from ..step import DragonBatchStep, DragonStep, LocalStep, Step from ..step_info import StepInfo +from ..step_mapping import StepMap from .dragon_connector import DragonConnector, _SchemaT if t.TYPE_CHECKING: diff --git a/smartsim/_core/launcher/launcher.py b/smartsim/_core/launcher/launcher.py index 722c64904..5b2894cf3 100644 --- a/smartsim/_core/launcher/launcher.py +++ b/smartsim/_core/launcher/launcher.py @@ -27,13 +27,12 @@ import abc import typing as t -from .step_mapping import StepMap from ...entity import SmartSimEntity from ...error import AllocationError, LauncherError, SSUnsupportedError from ...settings import SettingsBase from .step import Step from .step_info import StepInfo, UnmanagedStepInfo -from .step_mapping import StepMapping +from .step_mapping import StepMap, StepMapping from .task_manager import TaskManager diff --git a/smartsim/_core/launcher/step/dragon_step.py b/smartsim/_core/launcher/step/dragon_step.py index e90d892e7..26864e89f 100644 --- a/smartsim/_core/launcher/step/dragon_step.py +++ b/smartsim/_core/launcher/step/dragon_step.py @@ -30,11 +30,6 @@ import sys import typing as t -from ...schemas.dragon_requests import ( - DragonRunPolicy, - DragonRunRequest, - request_registry, -) from ....error.errors import SSUnsupportedError from ....log import get_logger from ....settings import ( @@ -43,6 +38,11 @@ SbatchSettings, Singularity, ) +from ...schemas.dragon_requests import ( + DragonRunPolicy, + DragonRunRequest, + request_registry, +) from .step import Step logger = get_logger(__name__)