16535: Merge branch 'master'
authorTom Clegg <tom@tomclegg.ca>
Tue, 18 Aug 2020 20:02:56 +0000 (16:02 -0400)
committerTom Clegg <tom@tomclegg.ca>
Tue, 18 Aug 2020 20:02:56 +0000 (16:02 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

1  2 
lib/config/config.default.yml
lib/config/generated_config.go
sdk/go/arvados/config.go
sdk/go/arvados/fs_project_test.go
sdk/go/arvados/fs_site_test.go

index e0c1d75765b5195a402d4b638ba089bd1dc13753,270d4045b5aaa395ee9b5c749763a601f35e1b6b..cc871087c31f0f13405430683553c7256e77e819
@@@ -139,9 -139,6 +139,6 @@@ Clusters
        Workbench2:
          InternalURLs: {}
          ExternalURL: ""
-       Nodemanager:
-         InternalURLs: {}
-         ExternalURL: "-"
        Health:
          InternalURLs: {}
          ExternalURL: "-"
        # Use of this feature is not recommended, if it can be avoided.
        ForwardSlashNameSubstitution: ""
  
 +      # Include "folder objects" in S3 ListObjects responses.
 +      S3FolderObjects: true
 +
        # Managed collection properties. At creation time, if the client didn't
        # provide the listed keys, they will be automatically populated following
        # one of the following behaviors:
  
            # (azure) Instance configuration.
            CloudEnvironment: AzurePublicCloud
-           ResourceGroup: ""
            Location: centralus
+           # (azure) The resource group where the VM and virtual NIC will be
+           # created.
+           ResourceGroup: ""
+           # (azure) The resource group of the Network to use for the virtual
+           # NIC (if different from ResourceGroup)
+           NetworkResourceGroup: ""
            Network: ""
            Subnet: ""
+           # (azure) Where to store the VM VHD blobs
            StorageAccount: ""
            BlobContainer: ""
+           # (azure) How long to wait before deleting VHD and NIC
+           # objects that are no longer being used.
            DeleteDanglingResourcesAfter: 20s
+           # Account (that already exists in the VM image) that will be
+           # set up with an ssh authorized key to allow the compute
+           # dispatcher to connect.
            AdminUsername: arvados
  
      InstanceTypes:
            ConnectTimeout: 1m
            ReadTimeout: 10m
            RaceWindow: 24h
+           # Use aws-s3-go (v2) instead of goamz
+           UseAWSS3v2Driver: false
  
            # For S3 driver, potentially unsafe tuning parameter,
            # intentionally excluded from main documentation.
index e02ed6a418a5aa2f1623f15e7d03664110b82c26,0241673aa550e5c783a04d875e92bd588eab091f..0374ff7c7b14dd9188b58ae149e98f8fdafb4d94
@@@ -145,9 -145,6 +145,6 @@@ Clusters
        Workbench2:
          InternalURLs: {}
          ExternalURL: ""
-       Nodemanager:
-         InternalURLs: {}
-         ExternalURL: "-"
        Health:
          InternalURLs: {}
          ExternalURL: "-"
        # Use of this feature is not recommended, if it can be avoided.
        ForwardSlashNameSubstitution: ""
  
 +      # Include "folder objects" in S3 ListObjects responses.
 +      S3FolderObjects: true
 +
        # Managed collection properties. At creation time, if the client didn't
        # provide the listed keys, they will be automatically populated following
        # one of the following behaviors:
  
            # (azure) Instance configuration.
            CloudEnvironment: AzurePublicCloud
-           ResourceGroup: ""
            Location: centralus
+           # (azure) The resource group where the VM and virtual NIC will be
+           # created.
+           ResourceGroup: ""
+           # (azure) The resource group of the Network to use for the virtual
+           # NIC (if different from ResourceGroup)
+           NetworkResourceGroup: ""
            Network: ""
            Subnet: ""
+           # (azure) Where to store the VM VHD blobs
            StorageAccount: ""
            BlobContainer: ""
+           # (azure) How long to wait before deleting VHD and NIC
+           # objects that are no longer being used.
            DeleteDanglingResourcesAfter: 20s
+           # Account (that already exists in the VM image) that will be
+           # set up with an ssh authorized key to allow the compute
+           # dispatcher to connect.
            AdminUsername: arvados
  
      InstanceTypes:
            ConnectTimeout: 1m
            ReadTimeout: 10m
            RaceWindow: 24h
+           # Use aws-s3-go (v2) instead of goamz
+           UseAWSS3v2Driver: false
  
            # For S3 driver, potentially unsafe tuning parameter,
            # intentionally excluded from main documentation.
diff --combined sdk/go/arvados/config.go
index da03fba7d9547589a80814264da93ae2be668911,c21addbba99284e5ad3e634e24e75e5deac9558e..41c20c8db2ee71cf4c4a024e7d1d73b72878a098
@@@ -121,7 -121,6 +121,7 @@@ type Cluster struct 
                TrashSweepInterval           Duration
                TrustAllContent              bool
                ForwardSlashNameSubstitution string
 +              S3FolderObjects              bool
  
                BlobMissingReport        string
                BalancePeriod            Duration
@@@ -278,6 -277,7 +278,7 @@@ type S3VolumeDriverParameters struct 
        Bucket             string
        LocationConstraint bool
        V2Signature        bool
+       UseAWSS3v2Driver   bool
        IndexPageSize      int
        ConnectTimeout     Duration
        ReadTimeout        Duration
@@@ -314,7 -314,6 +315,6 @@@ type Services struct 
        Keepbalance    Service
        Keepproxy      Service
        Keepstore      Service
-       Nodemanager    Service
        RailsAPI       Service
        SSO            Service
        WebDAVDownload Service
@@@ -553,7 -552,7 +553,7 @@@ func (ss *StringSet) UnmarshalJSON(dat
                return err
        }
        *ss = make(map[string]struct{}, len(hash))
-       for t, _ := range hash {
+       for t := range hash {
                (*ss)[t] = struct{}{}
        }
  
@@@ -567,7 -566,6 +567,6 @@@ const 
        ServiceNameController    ServiceName = "arvados-controller"
        ServiceNameDispatchCloud ServiceName = "arvados-dispatch-cloud"
        ServiceNameHealth        ServiceName = "arvados-health"
-       ServiceNameNodemanager   ServiceName = "arvados-node-manager"
        ServiceNameWorkbench1    ServiceName = "arvados-workbench1"
        ServiceNameWorkbench2    ServiceName = "arvados-workbench2"
        ServiceNameWebsocket     ServiceName = "arvados-ws"
@@@ -585,7 -583,6 +584,6 @@@ func (svcs Services) Map() map[ServiceN
                ServiceNameController:    svcs.Controller,
                ServiceNameDispatchCloud: svcs.DispatchCloud,
                ServiceNameHealth:        svcs.Health,
-               ServiceNameNodemanager:   svcs.Nodemanager,
                ServiceNameWorkbench1:    svcs.Workbench1,
                ServiceNameWorkbench2:    svcs.Workbench2,
                ServiceNameWebsocket:     svcs.Websocket,
index 1d091f5a8e014e87d47ad5abab680fa469169c5d,61d82c7fa9f4e442d6492ba8fc0f285df76bd5f2..cb2e54bda261ed590b39b59a90235f6b991787a3
@@@ -52,6 -52,7 +52,7 @@@ func (s *SiteFSSuite) testHomeProject(
        f, err := s.fs.Open(path)
        c.Assert(err, check.IsNil)
        fis, err := f.Readdir(-1)
+       c.Assert(err, check.IsNil)
        c.Check(len(fis), check.Not(check.Equals), 0)
  
        ok := false
@@@ -199,22 -200,6 +200,22 @@@ func (s *SiteFSSuite) TestProjectUpdate
        err = wf.Close()
        c.Check(err, check.IsNil)
  
 +      err = project.Sync()
 +      c.Check(err, check.IsNil)
 +      _, err = s.fs.Open("/home/A Project/oob/test.txt")
 +      c.Check(err, check.IsNil)
 +
 +      // Sync again to mark the project dir as stale, so the
 +      // collection gets reloaded from the controller on next
 +      // lookup.
 +      err = project.Sync()
 +      c.Check(err, check.IsNil)
 +
 +      // Ensure collection was flushed by Sync
 +      var latest Collection
 +      err = s.client.RequestAndDecode(&latest, "GET", "arvados/v1/collections/"+oob.UUID, nil, nil)
 +      c.Check(latest.ManifestText, check.Matches, `.*:test.txt.*\n`)
 +
        // Delete test.txt behind s.fs's back by updating the
        // collection record with an empty ManifestText.
        err = s.client.RequestAndDecode(nil, "PATCH", "arvados/v1/collections/"+oob.UUID, nil, map[string]interface{}{
        })
        c.Assert(err, check.IsNil)
  
 -      err = project.Sync()
 -      c.Check(err, check.IsNil)
        _, err = s.fs.Open("/home/A Project/oob/test.txt")
        c.Check(err, check.NotNil)
        _, err = s.fs.Open("/home/A Project/oob")
        c.Assert(err, check.IsNil)
  
        err = project.Sync()
 -      c.Check(err, check.IsNil)
 +      c.Check(err, check.NotNil) // can't update the deleted collection
        _, err = s.fs.Open("/home/A Project/oob")
 -      c.Check(err, check.NotNil)
 +      c.Check(err, check.IsNil) // parent dir still has old collection -- didn't reload, because Sync failed
 +}
 +
 +func (s *SiteFSSuite) TestProjectUnsupportedOperations(c *check.C) {
 +      s.fs.MountByID("by_id")
 +      s.fs.MountProject("home", "")
 +
 +      _, err := s.fs.OpenFile("/home/A Project/newfilename", os.O_CREATE|os.O_RDWR, 0)
 +      c.Check(err, check.ErrorMatches, "invalid argument")
 +
 +      err = s.fs.Mkdir("/home/A Project/newdirname", 0)
 +      c.Check(err, check.ErrorMatches, "invalid argument")
 +
 +      err = s.fs.Mkdir("/by_id/newdirname", 0)
 +      c.Check(err, check.ErrorMatches, "invalid argument")
 +
 +      err = s.fs.Mkdir("/by_id/"+fixtureAProjectUUID+"/newdirname", 0)
 +      c.Check(err, check.ErrorMatches, "invalid argument")
 +
 +      _, err = s.fs.OpenFile("/home/A Project", 0, 0)
 +      c.Check(err, check.IsNil)
  }
index d3111e1cb1adf1cd71bc49a0fa61ed2f78263a23,80cc03df37b88ad82ad246db6d4d7bce68dd68a2..778b12015a6f3964be7db301f30cd8ca5db1a971
@@@ -7,7 -7,6 +7,7 @@@ package arvado
  import (
        "net/http"
        "os"
 +      "time"
  
        check "gopkg.in/check.v1"
  )
@@@ -23,8 -22,6 +23,8 @@@ const 
        fixtureFooCollectionPDH        = "1f4b0bc7583c2a7f9102c395f4ffc5e3+45"
        fixtureFooCollection           = "zzzzz-4zz18-fy296fx3hot09f7"
        fixtureNonexistentCollection   = "zzzzz-4zz18-totallynotexist"
 +      fixtureBlobSigningKey          = "zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc"
 +      fixtureBlobSigningTTL          = 336 * time.Hour
  )
  
  var _ = check.Suite(&SiteFSSuite{})
@@@ -44,11 -41,7 +44,11 @@@ func (s *SiteFSSuite) SetUpTest(c *chec
        s.kc = &keepClientStub{
                blocks: map[string][]byte{
                        "3858f62230ac3c915f300c664312c63f": []byte("foobar"),
 -              }}
 +              },
 +              sigkey:    fixtureBlobSigningKey,
 +              sigttl:    fixtureBlobSigningTTL,
 +              authToken: fixtureActiveToken,
 +      }
        s.fs = s.client.SiteFileSystem(s.kc)
  }
  
@@@ -86,6 -79,7 +86,7 @@@ func (s *SiteFSSuite) TestByUUIDAndPDH(
                f, err = s.fs.Open("/by_id/" + path)
                c.Assert(err, check.IsNil)
                fis, err = f.Readdir(-1)
+               c.Assert(err, check.IsNil)
                var names []string
                for _, fi := range fis {
                        names = append(names, fi.Name())
@@@ -96,6 -90,7 +97,7 @@@
        f, err = s.fs.Open("/by_id/" + fixtureAProjectUUID + "/A Subproject/baz_file")
        c.Assert(err, check.IsNil)
        fis, err = f.Readdir(-1)
+       c.Assert(err, check.IsNil)
        var names []string
        for _, fi := range fis {
                names = append(names, fi.Name())
        c.Check(names, check.DeepEquals, []string{"baz"})
  
        _, err = s.fs.OpenFile("/by_id/"+fixtureNonexistentCollection, os.O_RDWR|os.O_CREATE, 0755)
 -      c.Check(err, check.Equals, ErrInvalidOperation)
 +      c.Check(err, check.Equals, ErrInvalidArgument)
        err = s.fs.Rename("/by_id/"+fixtureFooCollection, "/by_id/beep")
        c.Check(err, check.Equals, ErrInvalidArgument)
        err = s.fs.Rename("/by_id/"+fixtureFooCollection+"/foo", "/by_id/beep")