Merge branch '19240-check-redirect'
authorTom Clegg <tom@curii.com>
Mon, 7 Nov 2022 15:40:17 +0000 (10:40 -0500)
committerTom Clegg <tom@curii.com>
Mon, 7 Nov 2022 15:40:17 +0000 (10:40 -0500)
fixes #19240

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

doc/install/configure-s3-object-storage.html.textile.liquid
services/keepstore/s3_volume.go
services/keepstore/s3aws_volume.go
tools/arvbox/lib/arvbox/docker/common.sh

index e9866d510344da4e9a58ba7c8a5deee268540da1..746c1d40231bc5ad26b60da5736c564059a0e984 100644 (file)
@@ -46,8 +46,9 @@ Volumes are configured in the @Volumes@ section of the cluster configuration fil
           AccessKeyID: <span class="userinput">""</span>
           SecretAccessKey: <span class="userinput">""</span>
 
-          # Storage provider region. For Google Cloud Storage, use ""
-          # or omit.
+          # Storage provider region. If Endpoint is specified, the
+          # region determines the request signing method, and defaults
+          # to "us-east-1".
           Region: <span class="userinput">us-east-1</span>
 
           # Storage provider endpoint. For Amazon S3, use "" or
index ee89b156f796b49395fc6ec151de6ab12127e176..78737640045db53691f03f27742ffc4f495debd0 100644 (file)
@@ -56,15 +56,12 @@ func (v *S3Volume) check() error {
                return errors.New("DriverParameters: RaceWindow must not be negative")
        }
 
-       var ok bool
-       v.region, ok = aws.Regions[v.Region]
        if v.Endpoint == "" {
+               r, ok := aws.Regions[v.Region]
                if !ok {
                        return fmt.Errorf("unrecognized region %+q; try specifying endpoint instead", v.Region)
                }
-       } else if ok {
-               return fmt.Errorf("refusing to use AWS region name %+q with endpoint %+q; "+
-                       "specify empty endpoint or use a different region name", v.Region, v.Endpoint)
+               v.region = r
        } else {
                v.region = aws.Region{
                        Name:                 v.Region,
index f7cff6d33ea4d7c764ba74f06e49c8815f021fa9..d068dde074ea254ef814aea38eefa6f63102d7e3 100644 (file)
@@ -184,19 +184,25 @@ func (v *S3AWSVolume) check(ec2metadataHostname string) error {
                        if v.Endpoint != "" && service == "s3" {
                                return aws.Endpoint{
                                        URL:           v.Endpoint,
-                                       SigningRegion: v.Region,
+                                       SigningRegion: region,
                                }, nil
                        } else if service == "ec2metadata" && ec2metadataHostname != "" {
                                return aws.Endpoint{
                                        URL: ec2metadataHostname,
                                }, nil
+                       } else {
+                               return defaultResolver.ResolveEndpoint(service, region)
                        }
-
-                       return defaultResolver.ResolveEndpoint(service, region)
                }
                cfg.EndpointResolver = aws.EndpointResolverFunc(myCustomResolver)
        }
-
+       if v.Region == "" {
+               // Endpoint is already specified (otherwise we would
+               // have errored out above), but Region is also
+               // required by the aws sdk, in order to determine
+               // SignatureVersions.
+               v.Region = "us-east-1"
+       }
        cfg.Region = v.Region
 
        // Zero timeouts mean "wait forever", which is a bad
index 4e95bdedfc465ac0c3c25065e2dd778f0b949775..ba81426f0bfc35a7b916496970edf0cbb9648300 100644 (file)
@@ -74,6 +74,11 @@ run_bundler() {
        # If present, use the one associated with rails workbench or API
        BUNDLER=$PWD/bin/bundle
     fi
+
+    if test -z "$(flock $GEMLOCK /var/lib/arvados/bin/gem list | grep 'arvados[[:blank:]].*[0-9.]*dev')" ; then
+        (cd /usr/src/arvados/sdk/ruby && \
+        /var/lib/arvados/bin/gem build arvados.gemspec && flock $GEMLOCK /var/lib/arvados/bin/gem install $(ls -1 *.gem | sort -r | head -n1))
+    fi
     if ! flock $GEMLOCK $BUNDLER install --verbose --local --no-deployment $frozen "$@" ; then
         flock $GEMLOCK $BUNDLER install --verbose --no-deployment $frozen "$@"
     fi