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

Update watchdog dependency #540

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ To be released at some future point in time

Description

- Update watchdog dependency
- Add option to build Torch backend without the Intel Math Kernel Library
- Fix ReadTheDocs build issue
- Promote device options to an Enum
Expand All @@ -37,6 +38,7 @@ Description

Detailed Notes

- Update watchdog dependency from 3.x to 4.x, fix new type issues (SmartSim-PR540_)
- Add an option to smart build "--torch_with_mkl"/"--no_torch_with_mkl" to
prevent Torch from trying to link in the Intel Math Kernel Library. This
is needed because on machines that have the Intel compilers installed, the
Expand Down Expand Up @@ -89,6 +91,7 @@ Detailed Notes
handler. SmartSim will now attempt to kill any launched jobs before calling
the previously registered signal handler. (SmartSim-PR535_)

.. _SmartSim-PR540: https://github.com/CrayLabs/SmartSim/pull/540
.. _SmartSim-PR538: https://github.com/CrayLabs/SmartSim/pull/538
.. _SmartSim-PR537: https://github.com/CrayLabs/SmartSim/pull/537
.. _SmartSim-PR498: https://github.com/CrayLabs/SmartSim/pull/498
Expand Down
30 changes: 18 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@

# check for compatible python versions
if not build_env.is_compatible_python(versions.PYTHON_MIN):
print("You are using Python {}. Python >={} is required.".format(build_env.python_version,
".".join((versions.PYTHON_MIN))))
print(
"You are using Python {}. Python >={} is required.".format(
build_env.python_version, ".".join((versions.PYTHON_MIN))
)
)
sys.exit(-1)

if build_env.is_windows():
Expand All @@ -121,9 +124,11 @@
# __version__ in smartsim/__init__.py
smartsim_version = versions.write_version(setup_path)


class BuildError(Exception):
pass


# Hacky workaround for solving CI build "purelib" issue
# see https://github.com/google/or-tools/issues/616
class InstallPlatlib(install):
Expand All @@ -132,15 +137,15 @@ def finalize_options(self):
if self.distribution.has_ext_modules():
self.install_lib = self.install_platlib


class SmartSimBuild(build_py):

def run(self):
database_builder = builder.DatabaseBuilder(build_env(),
build_env.MALLOC,
build_env.JOBS)
database_builder = builder.DatabaseBuilder(
build_env(), build_env.MALLOC, build_env.JOBS
)
if not database_builder.is_built:
database_builder.build_from_git(versions.REDIS_URL,
versions.REDIS)
database_builder.build_from_git(versions.REDIS_URL, versions.REDIS)

database_builder.cleanup()

Expand All @@ -152,9 +157,10 @@ def run(self):
class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform name

We use this because we want to pre-package Redis for certain
platforms to use.
We use this because we want to pre-package Redis for certain
platforms to use.
"""

def has_ext_modules(_placeholder):
return True

Expand All @@ -168,7 +174,7 @@ def has_ext_modules(_placeholder):
"tqdm>=4.50.2",
"filelock>=3.4.2",
"protobuf~=3.20",
"watchdog>=3.0.0,<4.0.0",
"watchdog>=4.0.0",
]

# Add SmartRedis at specific version
Expand All @@ -195,7 +201,7 @@ def has_ext_modules(_placeholder):
"typing_extensions>=4.1.0",
],
# see smartsim/_core/_install/buildenv.py for more details
**versions.ml_extras_required()
**versions.ml_extras_required(),
}


Expand All @@ -214,5 +220,5 @@ def has_ext_modules(_placeholder):
"console_scripts": [
"smart = smartsim._core._cli.__main__:main",
]
}
},
)
6 changes: 3 additions & 3 deletions smartsim/_core/utils/telemetry/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def on_modified(self, event: FileSystemEvent) -> None:

:param event: event representing file/directory modification.
:type event: FileSystemEvent"""
super().on_modified(event) # type: ignore
super().on_modified(event)
logger.debug(f"Processing manifest modified @ {event.src_path}")
self.process_manifest(event.src_path)

Expand All @@ -237,7 +237,7 @@ def on_created(self, event: FileSystemEvent) -> None:

:param event: event representing file/directory creation.
:type event: FileSystemEvent"""
super().on_created(event) # type: ignore
super().on_created(event)
logger.debug(f"processing manifest created @ {event.src_path}")
self.process_manifest(event.src_path)

Expand Down Expand Up @@ -544,7 +544,7 @@ async def run(self) -> int:
frequency_ms = int(self._args.frequency * 1000)

# Create event handlers to trigger when target files are changed
log_handler = LoggingEventHandler(logger) # type: ignore
log_handler = LoggingEventHandler(logger)
self._action_handler = ManifestEventHandler(
str(MANIFEST_FILENAME),
timeout_ms=frequency_ms,
Expand Down
Loading