[ARVADOS] updated: d5f3f1c665fd78fd47094f86630e774408800234

git at public.curoverse.com git at public.curoverse.com
Sun Jan 24 21:08:00 EST 2016


Summary of changes:
 .../crunchstat_summary/command.py                  |  6 ++--
 .../crunchstat_summary/summarizer.py               | 38 ++++++++++++++++++----
 tools/crunchstat-summary/setup.py                  |  1 +
 3 files changed, 35 insertions(+), 10 deletions(-)

       via  d5f3f1c665fd78fd47094f86630e774408800234 (commit)
       via  8abd532c45353466a9b949951e71efb3baef7a35 (commit)
       via  72e1f8eebd7eb9ad5f6b4d0923f06cfc2b57b9d4 (commit)
      from  12b1501e8ee2edc932ceb908ab69189712a761b4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d5f3f1c665fd78fd47094f86630e774408800234
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Jan 24 21:07:42 2016 -0500

    8123: Change --include-child-jobs to --skip-child-jobs (default False).

diff --git a/tools/crunchstat-summary/crunchstat_summary/command.py b/tools/crunchstat-summary/crunchstat_summary/command.py
index a5339dd..a1e3eb2 100644
--- a/tools/crunchstat-summary/crunchstat_summary/command.py
+++ b/tools/crunchstat-summary/crunchstat_summary/command.py
@@ -21,8 +21,8 @@ class ArgumentParser(argparse.ArgumentParser):
             '--log-file', type=str,
             help='Read log data from a regular file')
         self.add_argument(
-            '--include-child-jobs', action='store_true',
-            help='Include stats from child jobs')
+            '--skip-child-jobs', action='store_true',
+            help='Do not include stats from child jobs')
         self.add_argument(
             '--format', type=str, choices=('html', 'text'), default='text',
             help='Report format')
@@ -44,7 +44,7 @@ class Command(object):
 
     def run(self):
         kwargs = {
-            'include_child_jobs': self.args.include_child_jobs,
+            'skip_child_jobs': self.args.skip_child_jobs,
         }
         if self.args.pipeline_instance:
             self.summer = summarizer.PipelineSummarizer(self.args.pipeline_instance, **kwargs)
diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
index 21676c3..3fc52ae 100644
--- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py
+++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
@@ -28,13 +28,13 @@ class Task(object):
 class Summarizer(object):
     existing_constraints = {}
 
-    def __init__(self, logdata, label=None, include_child_jobs=True):
+    def __init__(self, logdata, label=None, skip_child_jobs=False):
         self._logdata = logdata
 
         self.label = label
         self.starttime = None
         self.finishtime = None
-        self._include_child_jobs = include_child_jobs
+        self._skip_child_jobs = skip_child_jobs
 
         # stats_max: {category: {stat: val}}
         self.stats_max = collections.defaultdict(
@@ -72,8 +72,9 @@ class Summarizer(object):
             m = re.search(r'^\S+ \S+ \d+ (?P<seq>\d+) stderr Queued job (?P<uuid>\S+)$', line)
             if m:
                 uuid = m.group('uuid')
-                if not self._include_child_jobs:
-                    logger.warning('%s: omitting %s (try --include-child-job)',
+                if self._skip_child_jobs:
+                    logger.warning('%s: omitting stats from child job %s'
+                                   ' because --skip-child-jobs flag is on',
                                    self.label, uuid)
                     continue
                 logger.debug('%s: follow %s', self.label, uuid)

commit 8abd532c45353466a9b949951e71efb3baef7a35
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Jan 24 21:06:48 2016 -0500

    8123: Explain mysterious memory constraint logic.

diff --git a/tools/crunchstat-summary/crunchstat_summary/summarizer.py b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
index 93e018d..21676c3 100644
--- a/tools/crunchstat-summary/crunchstat_summary/summarizer.py
+++ b/tools/crunchstat-summary/crunchstat_summary/summarizer.py
@@ -269,16 +269,39 @@ class Summarizer(object):
             return
         used_ram = math.ceil(float(used_ram) / (1<<20))
         asked_ram = self.existing_constraints.get('min_ram_mb_per_node')
+
+        # Nodes that are advertised as "8 gibibytes" actually have
+        # what we might call "8 nearlygibs" of memory available for
+        # jobs.  Here, we calculate a whole number of nearlygibs that
+        # would have sufficed to run the job, then recommend
+        # requesting a node with that number of nearlygibs (expressed
+        # as mebibytes).
+        #
+        # Requesting a node with "nearly 8 gibibytes" is our best hope
+        # of getting a node that actually has nearly 8 gibibytes
+        # available. Either the scheduler will be smart enough to
+        # account for this discrepancy itself when choosing/creating a
+        # node, or -- failing that -- all smaller nodes will be so
+        # small that even their inflated advertised RAM will be too
+        # low to satisfy our request.
+        #
+        # For example, if we need 7500 MiB, we can ask for 7500 MiB,
+        # and we will generally get a node that is advertised as "8
+        # GiB" and has at least 7500 MiB available.  OTOH, asking for
+        # 8192 MiB would either result in an unnecessarily expensive
+        # 12 GiB node (if node manager knows about the discrepancy),
+        # or an 8 GiB node which crunch-dispatch considers too small
+        # to run our job.
+        nearlygibs = lambda mebibytes: mebibytes/AVAILABLE_RAM_RATIO/1024
         if asked_ram is None or (
-                math.ceil((used_ram/AVAILABLE_RAM_RATIO)/(1<<10)) <
-                (asked_ram/AVAILABLE_RAM_RATIO)/(1<<10)):
+                math.ceil(nearlygibs(used_ram)) < nearlygibs(asked_ram)):
             yield (
                 '#!! {} max RSS was {} MiB -- '
                 'try runtime_constraints "min_ram_mb_per_node":{}'
             ).format(
                 self.label,
                 int(used_ram),
-                int(math.ceil((used_ram/AVAILABLE_RAM_RATIO)/(1<<10))*(1<<10)*AVAILABLE_RAM_RATIO))
+                int(math.ceil(nearlygibs(used_ram))*AVAILABLE_RAM_RATIO*1024))
 
     def _format(self, val):
         """Return a string representation of a stat.

commit 72e1f8eebd7eb9ad5f6b4d0923f06cfc2b57b9d4
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Jan 24 21:05:28 2016 -0500

    8123: Update test dependencies.

diff --git a/tools/crunchstat-summary/setup.py b/tools/crunchstat-summary/setup.py
index ff0b1dd..f3c10bd 100755
--- a/tools/crunchstat-summary/setup.py
+++ b/tools/crunchstat-summary/setup.py
@@ -34,6 +34,7 @@ setup(name='crunchstat_summary',
           'arvados-python-client',
       ],
       test_suite='tests',
+      tests_require=['pbr<1.7.0', 'mock>=1.0'],
       zip_safe=False,
       cmdclass={'egg_info': tagger},
       )

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list