[ARVADOS] updated: 2.1.0-379-gdfa749b3e

Git user git at public.arvados.org
Thu Feb 4 03:00:27 UTC 2021


Summary of changes:
 lib/costanalyzer/costanalyzer.go      | 7 ++-----
 lib/costanalyzer/costanalyzer_test.go | 4 +++-
 2 files changed, 5 insertions(+), 6 deletions(-)

  discards  1f82b6bdcb305681a169a98589af9ba5adf3292c (commit)
  discards  08c80b2ba6a8fc090d2e998dfcf2f280c8508019 (commit)
  discards  e60380ca96dab6348b9b6ca40e5d09867b94ab85 (commit)
  discards  c72e7388b50feaf79651719d6e3a7fbe8239c334 (commit)
       via  dfa749b3eacff1da33fe470a2a4af3e291defdcf (commit)
       via  7079cf10005d72b4866379250baa60840721ace5 (commit)
       via  f81aae076a78fec5dbafb30e410c596aa2b96b92 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (1f82b6bdcb305681a169a98589af9ba5adf3292c)
            \
             N -- N -- N (dfa749b3eacff1da33fe470a2a4af3e291defdcf)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 dfa749b3eacff1da33fe470a2a4af3e291defdcf
Author: Ward Vandewege <ward at curii.com>
Date:   Wed Feb 3 21:43:34 2021 -0500

    17249: make costanalyzer report preemptible status of the instance in
           the UUID report file.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/costanalyzer/costanalyzer.go b/lib/costanalyzer/costanalyzer.go
index e8dd18605..37e655e53 100644
--- a/lib/costanalyzer/costanalyzer.go
+++ b/lib/costanalyzer/costanalyzer.go
@@ -35,6 +35,7 @@ type nodeInfo struct {
 	// Modern
 	ProviderType string
 	Price        float64
+	Preemptible  bool
 }
 
 type arrayFlags []string
@@ -90,6 +91,12 @@ Usage:
 	was fulfilled. This program uses the cost data stored at the time of the
 	execution of the container, stored in the 'node.json' file in its log
 	collection.
+	- if a container was run on a preemptible ("spot") instance, the cost data
+	reported by this program may be wildly inaccurate, because it does not have
+	access to the spot pricing in effect for the node then the container ran. The
+	UUID report file that is generated when the '-output' option is specified has
+	a column that indicates the preemptible state of the instance that ran the
+	container.
 
 	In order to get the data for the uuids supplied, the ARVADOS_API_HOST and
 	ARVADOS_API_TOKEN environment variables must be set.
@@ -181,7 +188,7 @@ func addContainerLine(logger *logrus.Logger, node nodeInfo, cr arvados.Container
 		size = node.ProviderType
 	}
 	cost = delta.Seconds() / 3600 * price
-	csv += size + "," + strconv.FormatFloat(price, 'f', 8, 64) + "," + strconv.FormatFloat(cost, 'f', 8, 64) + "\n"
+	csv += size + "," + fmt.Sprintf("%+v", node.Preemptible) + "," + strconv.FormatFloat(price, 'f', 8, 64) + "," + strconv.FormatFloat(cost, 'f', 8, 64) + "\n"
 	return
 }
 
@@ -369,7 +376,7 @@ func generateCrCsv(logger *logrus.Logger, uuid string, arv *arvadosclient.Arvado
 
 	cost = make(map[string]float64)
 
-	csv := "CR UUID,CR name,Container UUID,State,Started At,Finished At,Duration in seconds,Compute node type,Hourly node cost,Total cost\n"
+	csv := "CR UUID,CR name,Container UUID,State,Started At,Finished At,Duration in seconds,Compute node type,Preemptible,Hourly node cost,Total cost\n"
 	var tmpCsv string
 	var tmpTotalCost float64
 	var totalCost float64
diff --git a/lib/costanalyzer/costanalyzer_test.go b/lib/costanalyzer/costanalyzer_test.go
index b1ddf97a3..f4d8d1073 100644
--- a/lib/costanalyzer/costanalyzer_test.go
+++ b/lib/costanalyzer/costanalyzer_test.go
@@ -53,7 +53,7 @@ func (s *Suite) SetUpSuite(c *check.C) {
     "IncludedScratch": 64000000000,
     "AddedScratch": 0,
     "Price": 0.292,
-    "Preemptible": false
+    "Preemptible": true
 }`
 	standardD32sV3JSON := `{
     "Name": "Standard_D32s_v3",
@@ -168,6 +168,8 @@ func (*Suite) TestContainerRequestUUID(c *check.C) {
 
 	uuidReport, err := ioutil.ReadFile(resultsDir + "/" + arvadostest.CompletedContainerRequestUUID + ".csv")
 	c.Assert(err, check.IsNil)
+	// Make sure the 'preemptible' flag was picked up
+	c.Check(string(uuidReport), check.Matches, "(?ms).*,Standard_E4s_v3,true,.*")
 	c.Check(string(uuidReport), check.Matches, "(?ms).*TOTAL,,,,,,,,,7.01302889")
 	re := regexp.MustCompile(`(?ms).*supplied uuids in (.*?)\n`)
 	matches := re.FindStringSubmatch(stderr.String()) // matches[1] contains a string like 'results/2020-11-02-18-57-45-aggregate-costaccounting.csv'

commit 7079cf10005d72b4866379250baa60840721ace5
Author: Nico Cesar <nico at nicocesar.com>
Date:   Fri Jan 29 13:38:02 2021 -0500

    fixed test for 17299
    
    Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>

diff --git a/services/api/test/unit/container_test.rb b/services/api/test/unit/container_test.rb
index 4d8538524..773a9a876 100644
--- a/services/api/test/unit/container_test.rb
+++ b/services/api/test/unit/container_test.rb
@@ -23,7 +23,7 @@ class ContainerTest < ActiveSupport::TestCase
     command: ["echo", "hello"],
     output_path: "test",
     runtime_constraints: {
-      "api" => false,
+      "API" => false,
       "keep_cache_ram" => 0,
       "ram" => 12000000000,
       "vcpus" => 4,
@@ -229,7 +229,7 @@ class ContainerTest < ActiveSupport::TestCase
     set_user_from_auth :active
     env = {"C" => "3", "B" => "2", "A" => "1"}
     m = {"F" => {"kind" => "3"}, "E" => {"kind" => "2"}, "D" => {"kind" => "1"}}
-    rc = {"vcpus" => 1, "ram" => 1, "keep_cache_ram" => 1, "api" => true}
+    rc = {"vcpus" => 1, "ram" => 1, "keep_cache_ram" => 1, "API" => true}
     c, _ = minimal_new(environment: env, mounts: m, runtime_constraints: rc)
     c.reload
     assert_equal Container.deep_sort_hash(env).to_json, c.environment.to_json

commit f81aae076a78fec5dbafb30e410c596aa2b96b92
Author: Nico Cesar <nico at nicocesar.com>
Date:   Fri Jan 29 13:09:41 2021 -0500

    Changed 'api' -> 'API in runtime_constraints
    
    Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>

diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index 3ff7c5205..8d65bb400 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -89,7 +89,7 @@ type Mount struct {
 // RuntimeConstraints specify a container's compute resources (RAM,
 // CPU) and network connectivity.
 type RuntimeConstraints struct {
-	API          bool  `json:"api"`
+	API          bool  `json:"API"`
 	RAM          int64 `json:"ram"`
 	VCPUs        int   `json:"vcpus"`
 	KeepCacheRAM int64 `json:"keep_cache_ram"`
diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 7d5bea8fa..f2bae3a4b 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -877,7 +877,7 @@ class ArvadosModel < ApplicationRecord
   # request.
   def fill_container_defaults
     self.runtime_constraints = {
-      'api' => false,
+      'API' => false,
       'keep_cache_ram' => 0,
       'ram' => 0,
       'vcpus' => 0,

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list