[ARVADOS] updated: 2.1.0-219-gcf209afe7

Git user git at public.arvados.org
Mon Dec 21 17:13:20 UTC 2020


Summary of changes:
 lib/controller/handler_test.go  | 34 +++++++++++++++++++---------------
 lib/crunchrun/crunchrun.go      |  6 +++---
 lib/crunchrun/crunchrun_test.go |  2 +-
 sdk/go/arvados/container.go     | 14 +++++++-------
 4 files changed, 30 insertions(+), 26 deletions(-)

       via  cf209afe7018a987bd67a1b20e90b0f31eceba16 (commit)
      from  5a5737ba7565b985a20ce1256d09424860e70337 (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 cf209afe7018a987bd67a1b20e90b0f31eceba16
Author: Nico Cesar <nico at nicocesar.com>
Date:   Mon Dec 21 12:12:31 2020 -0500

    addressing https://dev.arvados.org/issues/17014#note-25
    
    Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico at curii.com>

diff --git a/lib/controller/handler_test.go b/lib/controller/handler_test.go
index d12e4fa33..15b929890 100644
--- a/lib/controller/handler_test.go
+++ b/lib/controller/handler_test.go
@@ -333,21 +333,25 @@ func (s *HandlerSuite) TestGetObjects(c *check.C) {
 	ksUUID := ksList.Items[0].UUID
 
 	testCases := map[string]map[string]bool{
-		"api_clients/" + arvadostest.TrustedWorkbenchAPIClientUUID:     nil,
-		"api_client_authorizations/" + arvadostest.AdminTokenUUID:      nil,
-		"authorized_keys/" + arvadostest.AdminAuthorizedKeysUUID:       nil,
-		"collections/" + arvadostest.CollectionWithUniqueWordsUUID:     {"href": true},
-		"containers/" + arvadostest.RunningContainerUUID:               nil,
-		"container_requests/" + arvadostest.QueuedContainerRequestUUID: nil,
-		"groups/" + arvadostest.AProjectUUID:                           nil,
-		"keep_services/" + ksUUID:                                      nil,
-		"links/" + arvadostest.ActiveUserCanReadAllUsersLinkUUID:       nil,
-		"logs/" + arvadostest.CrunchstatForRunningJobLogUUID:           nil,
-		"nodes/" + arvadostest.IdleNodeUUID:                            nil,
-		"repositories/" + arvadostest.ArvadosRepoUUID:                  nil,
-		"users/" + arvadostest.ActiveUserUUID:                          {"href": true},
-		"virtual_machines/" + arvadostest.TestVMUUID:                   nil,
-		"workflows/" + arvadostest.WorkflowWithDefinitionYAMLUUID:      nil,
+		"api_clients/" + arvadostest.TrustedWorkbenchAPIClientUUID: nil,
+		"api_client_authorizations/" + arvadostest.AdminTokenUUID:  nil,
+		"authorized_keys/" + arvadostest.AdminAuthorizedKeysUUID:   nil,
+		"collections/" + arvadostest.CollectionWithUniqueWordsUUID: {"href": true},
+		"containers/" + arvadostest.RunningContainerUUID:           nil,
+		"container_requests/" + arvadostest.QueuedContainerRequestUUID: {
+			"runtime_constraints":     true,
+			"scheduling_parameters":   true,
+			"modified_by_client_uuid": true,
+		}, // see https://dev.arvados.org/issues/17014#note-25
+		"groups/" + arvadostest.AProjectUUID:                      nil,
+		"keep_services/" + ksUUID:                                 nil,
+		"links/" + arvadostest.ActiveUserCanReadAllUsersLinkUUID:  nil,
+		"logs/" + arvadostest.CrunchstatForRunningJobLogUUID:      nil,
+		"nodes/" + arvadostest.IdleNodeUUID:                       nil,
+		"repositories/" + arvadostest.ArvadosRepoUUID:             nil,
+		"users/" + arvadostest.ActiveUserUUID:                     {"href": true},
+		"virtual_machines/" + arvadostest.TestVMUUID:              nil,
+		"workflows/" + arvadostest.WorkflowWithDefinitionYAMLUUID: nil,
 	}
 	for url, skippedFields := range testCases {
 		s.CheckObjectType(c, "/arvados/v1/"+url, arvadostest.AdminToken, skippedFields)
diff --git a/lib/crunchrun/crunchrun.go b/lib/crunchrun/crunchrun.go
index 341938354..ba6fba3ee 100644
--- a/lib/crunchrun/crunchrun.go
+++ b/lib/crunchrun/crunchrun.go
@@ -621,7 +621,7 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
 		return fmt.Errorf("output path does not correspond to a writable mount point")
 	}
 
-	if wantAPI := runner.Container.RuntimeConstraints.API; needCertMount && wantAPI != nil && *wantAPI {
+	if wantAPI := runner.Container.RuntimeConstraints.API; needCertMount && wantAPI {
 		for _, certfile := range arvadosclient.CertFiles {
 			_, err := os.Stat(certfile)
 			if err == nil {
@@ -1092,7 +1092,7 @@ func (runner *ContainerRunner) CreateContainer() error {
 		},
 	}
 
-	if wantAPI := runner.Container.RuntimeConstraints.API; wantAPI != nil && *wantAPI {
+	if wantAPI := runner.Container.RuntimeConstraints.API; wantAPI {
 		tok, err := runner.ContainerToken()
 		if err != nil {
 			return err
@@ -1269,7 +1269,7 @@ func (runner *ContainerRunner) updateLogs() {
 // CaptureOutput saves data from the container's output directory if
 // needed, and updates the container output accordingly.
 func (runner *ContainerRunner) CaptureOutput() error {
-	if wantAPI := runner.Container.RuntimeConstraints.API; wantAPI != nil && *wantAPI {
+	if wantAPI := runner.Container.RuntimeConstraints.API; wantAPI {
 		// Output may have been set directly by the container, so
 		// refresh the container record to check.
 		err := runner.DispatcherArvClient.Get("containers", runner.Container.UUID,
diff --git a/lib/crunchrun/crunchrun_test.go b/lib/crunchrun/crunchrun_test.go
index eb83bbd41..a1b33b33d 100644
--- a/lib/crunchrun/crunchrun_test.go
+++ b/lib/crunchrun/crunchrun_test.go
@@ -1293,7 +1293,7 @@ func (s *TestSuite) TestSetupMounts(c *C) {
 		cr.Container.OutputPath = "/tmp"
 
 		apiflag := true
-		cr.Container.RuntimeConstraints.API = &apiflag
+		cr.Container.RuntimeConstraints.API = apiflag
 
 		err := cr.SetupMounts()
 		c.Check(err, IsNil)
diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index d5f0b5bb1..3ff7c5205 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -89,18 +89,18 @@ type Mount struct {
 // RuntimeConstraints specify a container's compute resources (RAM,
 // CPU) and network connectivity.
 type RuntimeConstraints struct {
-	API          *bool `json:",omitempty"`
-	RAM          int64 `json:"ram,omitempty"`
-	VCPUs        int   `json:"vcpus,omitempty"`
-	KeepCacheRAM int64 `json:"keep_cache_ram,omitempty"`
+	API          bool  `json:"api"`
+	RAM          int64 `json:"ram"`
+	VCPUs        int   `json:"vcpus"`
+	KeepCacheRAM int64 `json:"keep_cache_ram"`
 }
 
 // SchedulingParameters specify a container's scheduling parameters
 // such as Partitions
 type SchedulingParameters struct {
-	Partitions  []string `json:"partitions,omitempty"`
-	Preemptible bool     `json:"preemptible,omitempty"`
-	MaxRunTime  int      `json:"max_run_time,omitempty"`
+	Partitions  []string `json:"partitions"`
+	Preemptible bool     `json:"preemptible"`
+	MaxRunTime  int      `json:"max_run_time"`
 }
 
 // ContainerList is an arvados#containerList resource.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list