[arvados] created: 2.1.0-3164-g57205cfc2
git repository hosting
git at public.arvados.org
Thu Dec 8 19:20:49 UTC 2022
at 57205cfc2eb90c67bb448a2d9b0faa4de1a9d873 (commit)
commit 57205cfc2eb90c67bb448a2d9b0faa4de1a9d873
Author: Tom Clegg <tom at curii.com>
Date: Thu Dec 8 11:40:25 2022 -0500
19844: Get multiple pages of child CRs if necessary.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/costanalyzer/costanalyzer.go b/lib/costanalyzer/costanalyzer.go
index a3673c979..36c114b59 100644
--- a/lib/costanalyzer/costanalyzer.go
+++ b/lib/costanalyzer/costanalyzer.go
@@ -456,28 +456,46 @@ func generateCrInfo(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvad
csv += tmpCsv
cost[container.UUID] = total
- // Find all container requests that have the container we found above as requesting_container_uuid
- var childCrs arvados.ContainerRequestList
- filterset := []arvados.Filter{
- {
+ // Find all container requests that have the container we
+ // found above as requesting_container_uuid.
+ var allItems []arvados.ContainerRequest
+ var pagesize = 1000
+ for {
+ var resp arvados.ContainerRequestList
+ filters := []arvados.Filter{{
Attr: "requesting_container_uuid",
Operator: "=",
Operand: container.UUID,
}}
- err = ac.RequestAndDecode(&childCrs, "GET", "arvados/v1/container_requests", nil, map[string]interface{}{
- "filters": filterset,
- "limit": 10000,
- })
- if err != nil {
- return nil, fmt.Errorf("error querying container_requests: %s", err.Error())
+ if len(allItems) > 0 {
+ filters = append(filters, arvados.Filter{
+ Attr: "uuid",
+ Operator: ">",
+ Operand: allItems[len(allItems)-1].UUID,
+ })
+ }
+ err = ac.RequestAndDecode(&resp, "GET", "arvados/v1/container_requests", nil, arvados.ResourceListParams{
+ Filters: filters,
+ Limit: &pagesize,
+ Order: "uuid",
+ Count: "none",
+ })
+ if err != nil {
+ return nil, fmt.Errorf("error querying container_requests: %s", err.Error())
+ }
+ if len(resp.Items) == 0 {
+ // no more pages
+ break
+ }
+ allItems = append(allItems, resp.Items...)
}
- logger.Infof("Collecting child containers for container request %s (%s)", crUUID, container.FinishedAt)
+ logger.Infof("Looking up %d child containers for container %s (%s)", len(allItems), container.UUID, container.FinishedAt)
progressTicker := time.NewTicker(5 * time.Second)
defer progressTicker.Stop()
- for i, cr2 := range childCrs.Items {
+ for i, cr2 := range allItems {
select {
case <-progressTicker.C:
- logger.Infof("... %d of %d", i+1, len(childCrs.Items))
+ logger.Infof("... %d of %d", i+1, len(allItems))
default:
}
node, err := getNode(arv, ac, kc, cr2)
commit d316965bb0d8d0b134ce11c71c85827b723701fe
Author: Tom Clegg <tom at curii.com>
Date: Thu Dec 8 14:06:15 2022 -0500
19844: Use 127.0.0.1 instead of localhost for test servers.
Otherwise, depending on host config, nginx futilely tries ::1 first.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index 2bb20ca5d..33b9cdfdb 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -635,8 +635,8 @@ def run_nginx():
return
stop_nginx()
nginxconf = {}
- nginxconf['UPSTREAMHOST'] = 'localhost'
- nginxconf['LISTENHOST'] = 'localhost'
+ nginxconf['UPSTREAMHOST'] = '127.0.0.1'
+ nginxconf['LISTENHOST'] = '127.0.0.1'
nginxconf['CONTROLLERPORT'] = internal_port_from_config("Controller")
nginxconf['ARVADOS_API_HOST'] = "0.0.0.0:" + str(external_port_from_config("Controller"))
nginxconf['CONTROLLERSSLPORT'] = external_port_from_config("Controller")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list