[arvados] updated: 2.6.0-196-g8b1f87037

git repository hosting git at public.arvados.org
Fri May 26 14:37:05 UTC 2023


Summary of changes:
 .../install-compute-node.html.textile.liquid       |  4 +-
 lib/cloud/ec2/ec2.go                               | 67 ++++++++++++----------
 2 files changed, 38 insertions(+), 33 deletions(-)

       via  8b1f870373af47287e916bb0ec16a3bdf09b62cb (commit)
       via  9dd4c7e9149ec7c60edbc106dd208599cb2a75d9 (commit)
      from  aec8a66deeff226db672351cd3ab803bf01a186d (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 8b1f870373af47287e916bb0ec16a3bdf09b62cb
Author: Tom Clegg <tom at curii.com>
Date:   Fri May 26 10:25:36 2023 -0400

    20520: Fix broken link.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/doc/install/crunch2-cloud/install-compute-node.html.textile.liquid b/doc/install/crunch2-cloud/install-compute-node.html.textile.liquid
index fb69a0df3..c20e4855a 100644
--- a/doc/install/crunch2-cloud/install-compute-node.html.textile.liquid
+++ b/doc/install/crunch2-cloud/install-compute-node.html.textile.liquid
@@ -195,7 +195,7 @@ The @VPC@ and @Subnet@ should be configured for where you want the compute image
 
 h3(#aws-ebs-autoscaler). Autoscaling compute node scratch space
 
-Arvados supports "AWS EBS autoscaler":https://github.com/awslabs/amazon-ebs-autoscale .  This feature automatically expands the scratch space on the compute node on demand by 200 GB at a time, up to 5 TB.
+Arvados supports "AWS EBS autoscaler":https://github.com/awslabs/amazon-ebs-autoscale.  This feature automatically expands the scratch space on the compute node on demand by 200 GB at a time, up to 5 TB.
 
 If you want to add the daemon in your images, add the @--aws-ebs-autoscale@ flag to the "the build script":#building.
 
@@ -228,7 +228,7 @@ The AWS EBS autoscaler daemon will be installed with this configuration:
 
 Changing the ebs-autoscale configuration is left as an exercise for the reader.
 
-This feature also requires a few Arvados configuration changes, described in "EBS-Autoscale configuration"#aws-ebs-autoscaler .
+This feature also requires a few Arvados configuration changes, described in "EBS Autoscale configuration":install-dispatch-cloud.html#aws-ebs-autoscaler.
 
 h2(#azure). Build an Azure image
 

commit 9dd4c7e9149ec7c60edbc106dd208599cb2a75d9
Author: Tom Clegg <tom at curii.com>
Date:   Fri May 26 10:10:09 2023 -0400

    20520: Fix unreleased mutex on error importing SSH key.
    
    Any error listing or importing keys (which, luckily, only happens the
    first time a arvados-dispatch-cloud process creates a new instance)
    would cause Create() call to fail, and cause all subsequent Create()
    calls to hang forever until the service is restarted.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/cloud/ec2/ec2.go b/lib/cloud/ec2/ec2.go
index a74f12561..81e1f8b00 100644
--- a/lib/cloud/ec2/ec2.go
+++ b/lib/cloud/ec2/ec2.go
@@ -149,39 +149,10 @@ func (instanceSet *ec2InstanceSet) Create(
 	initCommand cloud.InitCommand,
 	publicKey ssh.PublicKey) (cloud.Instance, error) {
 
-	md5keyFingerprint, sha1keyFingerprint, err := awsKeyFingerprint(publicKey)
+	keyname, err := instanceSet.getKeyName(publicKey)
 	if err != nil {
-		return nil, fmt.Errorf("Could not make key fingerprint: %v", err)
-	}
-	instanceSet.keysMtx.Lock()
-	var keyname string
-	var ok bool
-	if keyname, ok = instanceSet.keys[md5keyFingerprint]; !ok {
-		keyout, err := instanceSet.client.DescribeKeyPairs(&ec2.DescribeKeyPairsInput{
-			Filters: []*ec2.Filter{{
-				Name:   aws.String("fingerprint"),
-				Values: []*string{&md5keyFingerprint, &sha1keyFingerprint},
-			}},
-		})
-		if err != nil {
-			return nil, fmt.Errorf("Could not search for keypair: %v", err)
-		}
-
-		if len(keyout.KeyPairs) > 0 {
-			keyname = *(keyout.KeyPairs[0].KeyName)
-		} else {
-			keyname = "arvados-dispatch-keypair-" + md5keyFingerprint
-			_, err := instanceSet.client.ImportKeyPair(&ec2.ImportKeyPairInput{
-				KeyName:           &keyname,
-				PublicKeyMaterial: ssh.MarshalAuthorizedKey(publicKey),
-			})
-			if err != nil {
-				return nil, fmt.Errorf("Could not import keypair: %v", err)
-			}
-		}
-		instanceSet.keys[md5keyFingerprint] = keyname
+		return nil, err
 	}
-	instanceSet.keysMtx.Unlock()
 
 	ec2tags := []*ec2.Tag{}
 	for k, v := range newTags {
@@ -257,6 +228,40 @@ func (instanceSet *ec2InstanceSet) Create(
 	}, nil
 }
 
+func (instanceSet *ec2InstanceSet) getKeyName(publicKey ssh.PublicKey) (string, error) {
+	instanceSet.keysMtx.Lock()
+	defer instanceSet.keysMtx.Unlock()
+	md5keyFingerprint, sha1keyFingerprint, err := awsKeyFingerprint(publicKey)
+	if err != nil {
+		return "", fmt.Errorf("Could not make key fingerprint: %v", err)
+	}
+	if keyname, ok := instanceSet.keys[md5keyFingerprint]; ok {
+		return keyname, nil
+	}
+	keyout, err := instanceSet.client.DescribeKeyPairs(&ec2.DescribeKeyPairsInput{
+		Filters: []*ec2.Filter{{
+			Name:   aws.String("fingerprint"),
+			Values: []*string{&md5keyFingerprint, &sha1keyFingerprint},
+		}},
+	})
+	if err != nil {
+		return "", fmt.Errorf("Could not search for keypair: %v", err)
+	}
+	if len(keyout.KeyPairs) > 0 {
+		return *(keyout.KeyPairs[0].KeyName), nil
+	}
+	keyname := "arvados-dispatch-keypair-" + md5keyFingerprint
+	_, err = instanceSet.client.ImportKeyPair(&ec2.ImportKeyPairInput{
+		KeyName:           &keyname,
+		PublicKeyMaterial: ssh.MarshalAuthorizedKey(publicKey),
+	})
+	if err != nil {
+		return "", fmt.Errorf("Could not import keypair: %v", err)
+	}
+	instanceSet.keys[md5keyFingerprint] = keyname
+	return keyname, nil
+}
+
 func (instanceSet *ec2InstanceSet) Instances(tags cloud.InstanceTags) (instances []cloud.Instance, err error) {
 	var filters []*ec2.Filter
 	for k, v := range tags {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list