mirror of
https://github.com/clearml/clearml-agent
synced 2025-03-03 10:42:05 +00:00
Add multiple packages support
This commit is contained in:
parent
259113c989
commit
a41ea52f87
@ -323,6 +323,7 @@ class Worker(ServiceCommandSection):
|
||||
PostRequirement,
|
||||
ExternalRequirements,
|
||||
partial(PackageCollectorRequirement, collect_package=['trains']),
|
||||
partial(PackageCollectorRequirement, collect_package=['clearml']),
|
||||
)
|
||||
|
||||
# poll queues every _polling_interval seconds
|
||||
|
@ -49,12 +49,12 @@ class PackageCollectorRequirement(SimpleSubstitution):
|
||||
|
||||
def __init__(self, session, collect_package):
|
||||
super(PackageCollectorRequirement, self).__init__(session)
|
||||
self._collect_packages = collect_package
|
||||
self._collect_packages = collect_package or tuple()
|
||||
self._last_req = None
|
||||
|
||||
def match(self, req):
|
||||
# match package names
|
||||
return req.name and (req.name.lower() in self.name or req.name.lower() in self._collect_packages)
|
||||
return req.name and req.name.lower() in self._collect_packages
|
||||
|
||||
def replace(self, req):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user