[ARVADOS] updated: 65f13986f98a75f8da7cfe695ea5960ff741d402

Git user git at public.curoverse.com
Fri Aug 18 15:55:14 EDT 2017


Summary of changes:
 .../assets/javascripts/components/collections.js   |  19 +-
 .../app/assets/javascripts/models/loader.js        |  91 +++--
 .../app/assets/javascripts/models/session_db.js    |   1 -
 build/build.list                                   |   3 +-
 lib/crunchstat/crunchstat.go                       |  10 +-
 sdk/python/arvados/commands/ws.py                  |   8 +-
 services/api/Gemfile.lock                          |  22 +-
 services/ws/session_v0.go                          |  19 +
 services/ws/session_v0_test.go                     |  23 +-
 .../crunchstat_summary/command.py                  |  16 +-
 .../crunchstat_summary/reader.py                   |  12 +-
 .../crunchstat_summary/summarizer.py               | 454 ++++++++++++++-------
 ...r_9tee4-dz642-mjfb0i5hzojp16a-crunchstat.txt.gz | Bin 0 -> 622 bytes
 ...-dz642-mjfb0i5hzojp16a-crunchstat.txt.gz.report |  23 ++
 tools/crunchstat-summary/tests/test_examples.py    |  32 ++
 15 files changed, 501 insertions(+), 232 deletions(-)
 create mode 100644 tools/crunchstat-summary/tests/container_9tee4-dz642-mjfb0i5hzojp16a-crunchstat.txt.gz
 create mode 100644 tools/crunchstat-summary/tests/container_9tee4-dz642-mjfb0i5hzojp16a-crunchstat.txt.gz.report

       via  65f13986f98a75f8da7cfe695ea5960ff741d402 (commit)
       via  466e71eb74d1323dc79c8db68d74c5e31e789652 (commit)
       via  3bd6273f572ae49e1ed1b03f160d509b17335bdf (commit)
       via  cfde25f5e1ae64f2c56cf2376ea0beccc24d4e81 (commit)
       via  9fa94ac1f91b1f0c69045495227f0a1acbe46795 (commit)
       via  b32fabbac03030dba208d68750e06801fb2dfcec (commit)
       via  89359cee9d2b8cafbf3db166e48c1aeec59a10b2 (commit)
       via  2c542c9ee544e54b9e45b71c6ae8136f579d8c7b (commit)
       via  d5491668bc4bcb7d24d881430ee712126d6c7b4e (commit)
       via  c77cb0091a8488eae52341920e8e32beb8fc47dc (commit)
       via  6aa0477266f3250f7e1a5ad0915cee308b661b49 (commit)
       via  a68b0ba89ab00dddbc1e59872ed81c08a6113295 (commit)
       via  19aa02996b20c842e0ea0e522f851ba9f8a52717 (commit)
       via  9619cc733e47c058bbcf883db6f57f74ca5d9598 (commit)
       via  fdec93eb58899db80495ecb2dc161a727ae4b27c (commit)
       via  f04ff34e47cc5ff1e625e9a5c1b1b0cbeb810d8c (commit)
       via  6dd863d5fb9f9302fabec33e9e7080b1d9921cee (commit)
       via  dc140f2c277a7571669f5bdf492bac6448a0fba0 (commit)
       via  cd42a47667cb6876acf7a557d1cde96fc214bf47 (commit)
       via  68fee3aff2bc0e189827956720de58c3e8668bdc (commit)
       via  6699c983ac7c8506d17a60323ba71478ea2ac20d (commit)
       via  0a4e2d2940214cf91d9333f7a49b73159ee34d3a (commit)
       via  cf0656348eb1e4c5858ca944da6e9448cd22a894 (commit)
      from  2f9091d71a40dfad185232f3400a79377f5f305b (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 65f13986f98a75f8da7cfe695ea5960ff741d402
Merge: 3bd6273 466e71e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Fri Aug 18 15:54:20 2017 -0400

    Merge branch 'master' into 12033-multisite-search
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>


commit 3bd6273f572ae49e1ed1b03f160d509b17335bdf
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Aug 18 15:32:58 2017 -0400

    12033: Remove unused code.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/apps/workbench/app/assets/javascripts/models/session_db.js b/apps/workbench/app/assets/javascripts/models/session_db.js
index 1ebff83..1f5c02f 100644
--- a/apps/workbench/app/assets/javascripts/models/session_db.js
+++ b/apps/workbench/app/assets/javascripts/models/session_db.js
@@ -104,7 +104,6 @@ window.SessionDB = function() {
                     db.trash(key)
                 })
             })
-            // m.request(session.baseURL + 'discovery/v1/apis/arvados/v1/rest').then(function(dd) {})
         },
         request: function(session, path, opts) {
             opts = opts || {}

commit cfde25f5e1ae64f2c56cf2376ea0beccc24d4e81
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Aug 18 15:32:21 2017 -0400

    12033: Improve confusing comment.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/apps/workbench/app/assets/javascripts/models/loader.js b/apps/workbench/app/assets/javascripts/models/loader.js
index f9b82ce..0b29de6 100644
--- a/apps/workbench/app/assets/javascripts/models/loader.js
+++ b/apps/workbench/app/assets/javascripts/models/loader.js
@@ -97,8 +97,18 @@ window.MergingLoader = function(config) {
             })
         },
         mergeItems: function() {
-            // cutoff is the topmost (recent) of {bottom (oldest) entry of
-            // any child that still has more pages left to fetch}
+            // We want to avoid moving items around on the screen once
+            // they're displayed.
+            //
+            // To this end, here we find the last safely displayable
+            // item ("cutoff") by getting the last item from each
+            // unfinished child, and taking the topmost (most recent)
+            // one of those.
+            //
+            // (If we were to display an item below that cutoff, the
+            // next page of results from an unfinished child could
+            // include items that get inserted above the cutoff,
+            // causing the cutoff item to move down.)
             var cutoff
             var cutoffUnknown = false
             loader.children.forEach(function(child) {
@@ -121,9 +131,8 @@ window.MergingLoader = function(config) {
                 child.itemsDisplayed = 0
                 child.items().every(function(item) {
                     if (cutoff && item.modified_at < cutoff)
-                        // Some other children haven't caught up to this
-                        // point, so don't display this item or anything
-                        // after it.
+                        // Don't display this item or anything after
+                        // it (see "cutoff" comment above).
                         return false
                     combined.push(item)
                     child.itemsDisplayed++

commit 9fa94ac1f91b1f0c69045495227f0a1acbe46795
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Aug 18 15:28:29 2017 -0400

    12033: Simplify loader interface.
    
    items() is ready immediately, and returns [] until the first results
    arrive.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/apps/workbench/app/assets/javascripts/components/collections.js b/apps/workbench/app/assets/javascripts/components/collections.js
index 097fda2..a2054c1 100644
--- a/apps/workbench/app/assets/javascripts/components/collections.js
+++ b/apps/workbench/app/assets/javascripts/components/collections.js
@@ -45,7 +45,7 @@ window.CollectionsTable = {
                 m('th', 'last modified'),
             ])),
             m('tbody', [
-                loader.items() && loader.items().map(function(item) {
+                loader.items().map(function(item) {
                     return m('tr', [
                         m('td', m('a.btn.btn-xs.btn-default', {href: item.session.baseURL.replace('://', '://workbench.')+'collections/'+item.uuid}, 'Show')),
                         m('td.arvados-uuid', item.uuid),
@@ -145,7 +145,7 @@ window.CollectionsSearch = {
                             ? m('span.label.label-xs.label-danger', 'none')
                             : vnode.state.loader.children.map(function(child) {
                                 return [m('span.label.label-xs', {
-                                    className: child.items() ? 'label-success' : 'label-warning',
+                                    className: child.state == child.LOADING ? 'label-warning' : 'label-success',
                                 }, child.sessionKey), ' ']
                             }),
                         ' ',
diff --git a/apps/workbench/app/assets/javascripts/models/loader.js b/apps/workbench/app/assets/javascripts/models/loader.js
index c1205bc..f9b82ce 100644
--- a/apps/workbench/app/assets/javascripts/models/loader.js
+++ b/apps/workbench/app/assets/javascripts/models/loader.js
@@ -26,7 +26,7 @@ window.MultipageLoader = function(config) {
         LOADING: 'loading',
         READY: 'ready',
 
-        items: m.stream(),
+        items: m.stream([]),
         thresholdItem: null,
         loadMore: function() {
             if (loader.state == loader.DONE || loader.state == loader.LOADING)
@@ -37,7 +37,7 @@ window.MultipageLoader = function(config) {
             ] : []
             loader.state = loader.LOADING
             loader.loadFunc(filters).then(function(resp) {
-                var items = loader.items() || []
+                var items = loader.items()
                 Array.prototype.push.apply(items, resp.items)
                 if (resp.items.length == 0) {
                     loader.state = loader.DONE
@@ -65,7 +65,7 @@ window.MergingLoader = function(config) {
     var loader = this
     Object.assign(loader, config, {
         // Sorted items ready to display, merged from all children.
-        items: m.stream(),
+        items: m.stream([]),
         state: 'ready',
         DONE: 'done',
         LOADING: 'loading',
@@ -100,14 +100,22 @@ window.MergingLoader = function(config) {
             // cutoff is the topmost (recent) of {bottom (oldest) entry of
             // any child that still has more pages left to fetch}
             var cutoff
+            var cutoffUnknown = false
             loader.children.forEach(function(child) {
+                if (child.state == child.DONE)
+                    return
                 var items = child.items()
-                if (items.length == 0 || child.state == child.DONE)
+                if (items.length == 0) {
+                    // No idea what's coming in the next page.
+                    cutoffUnknown = true
                     return
+                }
                 var last = items[items.length-1].modified_at
                 if (!cutoff || cutoff < last)
                     cutoff = last
             })
+            if (cutoffUnknown)
+                return
             var combined = []
             loader.children.forEach(function(child) {
                 child.itemsDisplayed = 0

commit b32fabbac03030dba208d68750e06801fb2dfcec
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Aug 18 14:30:19 2017 -0400

    12033: Combine loading/done flags into a ready/loading/done state.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/apps/workbench/app/assets/javascripts/components/collections.js b/apps/workbench/app/assets/javascripts/components/collections.js
index 9f7c804..097fda2 100644
--- a/apps/workbench/app/assets/javascripts/components/collections.js
+++ b/apps/workbench/app/assets/javascripts/components/collections.js
@@ -5,7 +5,7 @@
 window.CollectionsTable = {
     maybeLoadMore: function(dom) {
         var loader = this.loader
-        if (loader.done || loader.loading)
+        if (loader.state != loader.READY)
             // Can't start getting more items anyway: no point in
             // checking anything else.
             return
@@ -36,6 +36,7 @@ window.CollectionsTable = {
         window.removeEventListener('resize', vnode.state.maybeLoadMore)
     },
     view: function(vnode) {
+        var loader = vnode.attrs.loader
         return m('table.table.table-condensed', [
             m('thead', m('tr', [
                 m('th'),
@@ -44,7 +45,7 @@ window.CollectionsTable = {
                 m('th', 'last modified'),
             ])),
             m('tbody', [
-                vnode.attrs.loader.items() && vnode.attrs.loader.items().map(function(item) {
+                loader.items() && loader.items().map(function(item) {
                     return m('tr', [
                         m('td', m('a.btn.btn-xs.btn-default', {href: item.session.baseURL.replace('://', '://workbench.')+'collections/'+item.uuid}, 'Show')),
                         m('td.arvados-uuid', item.uuid),
@@ -53,21 +54,21 @@ window.CollectionsTable = {
                     ])
                 }),
             ]),
-            m('tfoot', m('tr', [
-                vnode.attrs.loader.done ? null : m('th[colspan=4]', m('button.btn.btn-xs', {
-                    className: vnode.attrs.loader.loading ? 'btn-default' : 'btn-primary',
+            loader.state == loader.DONE ? null : m('tfoot', m('tr', [
+                m('th[colspan=4]', m('button.btn.btn-xs', {
+                    className: loader.state == loader.LOADING ? 'btn-default' : 'btn-primary',
                     style: {
                         display: 'block',
                         width: '12em',
                         marginLeft: 'auto',
                         marginRight: 'auto',
                     },
-                    disabled: vnode.attrs.loader.loading,
+                    disabled: loader.state == loader.LOADING,
                     onclick: function() {
-                        vnode.attrs.loader.loadMore()
+                        loader.loadMore()
                         return false
                     },
-                }, vnode.attrs.loader.loading ? '(loading)' : 'Load more')),
+                }, loader.state == loader.LOADING ? '(loading)' : 'Load more')),
             ])),
         ])
     },
diff --git a/apps/workbench/app/assets/javascripts/models/loader.js b/apps/workbench/app/assets/javascripts/models/loader.js
index 1b44670..c1205bc 100644
--- a/apps/workbench/app/assets/javascripts/models/loader.js
+++ b/apps/workbench/app/assets/javascripts/models/loader.js
@@ -10,9 +10,10 @@
 // response. loadFunc() must retrieve results in "modified_at desc"
 // order.
 //
-// done is true if there are no more pages to load.
-//
-// loading is true if a network request is in progress.
+// state is:
+// * 'loading' if a network request is in progress;
+// * 'done' if there are no more items to load;
+// * 'ready' otherwise.
 //
 // items is a stream that resolves to an array of all items retrieved so far.
 //
@@ -20,30 +21,34 @@
 window.MultipageLoader = function(config) {
     var loader = this
     Object.assign(loader, config, {
-        done: false,
-        loading: false,
+        state: 'ready',
+        DONE: 'done',
+        LOADING: 'loading',
+        READY: 'ready',
+
         items: m.stream(),
         thresholdItem: null,
         loadMore: function() {
-            if (loader.done || loader.loading)
+            if (loader.state == loader.DONE || loader.state == loader.LOADING)
                 return
             var filters = loader.thresholdItem ? [
                 ["modified_at", "<=", loader.thresholdItem.modified_at],
                 ["uuid", "!=", loader.thresholdItem.uuid],
             ] : []
-            loader.loading = true
+            loader.state = loader.LOADING
             loader.loadFunc(filters).then(function(resp) {
                 var items = loader.items() || []
                 Array.prototype.push.apply(items, resp.items)
-                if (resp.items.length == 0)
-                    loader.done = true
-                else
+                if (resp.items.length == 0) {
+                    loader.state = loader.DONE
+                } else {
                     loader.thresholdItem = resp.items[resp.items.length-1]
-                loader.loading = false
+                    loader.state = loader.READY
+                }
                 loader.items(items)
             }).catch(function(err) {
                 loader.err = err
-                loader.loading = false
+                loader.state = loader.READY
             })
         },
     })
@@ -61,21 +66,24 @@ window.MergingLoader = function(config) {
     Object.assign(loader, config, {
         // Sorted items ready to display, merged from all children.
         items: m.stream(),
-        done: false,
-        loading: false,
+        state: 'ready',
+        DONE: 'done',
+        LOADING: 'loading',
+        READY: 'ready',
         loadable: function() {
             // Return an array of children that we could call
-            // loadMore() on. Update loader.done and loader.loading.
-            loader.done = true
-            loader.loading = false
+            // loadMore() on. Update loader.state.
+            loader.state = loader.DONE
             return loader.children.filter(function(child) {
-                if (child.done)
+                if (child.state == child.DONE)
                     return false
-                loader.done = false
-                if (!child.loading)
-                    return true
-                loader.loading = true
-                return false
+                if (child.state == child.LOADING) {
+                    loader.state = loader.LOADING
+                    return false
+                }
+                if (loader.state == loader.DONE)
+                    loader.state = loader.READY
+                return true
             })
         },
         loadMore: function() {
@@ -83,7 +91,7 @@ window.MergingLoader = function(config) {
             // lowWaterMark.
             loader.loadable().map(function(child) {
                 if (child.items().length - child.itemsDisplayed < loader.lowWaterMark) {
-                    loader.loading = true
+                    loader.state = loader.LOADING
                     child.loadMore()
                 }
             })
@@ -94,7 +102,7 @@ window.MergingLoader = function(config) {
             var cutoff
             loader.children.forEach(function(child) {
                 var items = child.items()
-                if (items.length == 0 || child.done)
+                if (items.length == 0 || child.state == child.DONE)
                     return
                 var last = items[items.length-1].modified_at
                 if (!cutoff || cutoff < last)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list