Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 492D0299943 for ; Fri, 12 Dec 2025 19:14:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765566882; cv=none; b=SeBHs8oOW0Sc7+KEf1h7h9YAwA/OyP11jEuuPxv24SzO7N8ZVmFleF/ur83Z3c+cdTWLMYzqX8zNLvXxEllbXIA4TZ0Guw6UD69Pc8Rm4SkKKWauMpFa8wF/NHNW4pYsxPWNp3sgAAudhf7bQd1C+CsZgkK4ssoKjc5R9SPA770= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765566882; c=relaxed/simple; bh=CsA3D0R2m7t1CRv0cKCgXNc0hcxc9AaPZIdBw7UYtGc=; h=MIME-Version:Date:From:To:Message-Id:In-Reply-To:References: Subject:Content-Type; b=L192yvOZpZSTHu1+8Xvl/iaa4EkNHZhLNyVwLgkcoWiKUJJwbT9vkVjdoaUCpNDB0+0Ty1yWb7jO7/lW3HU+o/g5YXEUuwULN/xM+v6soZOiTRPtd7+1zK988oJGuHcMbmSyKl9PFhGpGxfo2EmCjA343i3hOEuoRrjbaabDI+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tpqr6tqy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tpqr6tqy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C728C4CEF1 for ; Fri, 12 Dec 2025 19:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765566881; bh=CsA3D0R2m7t1CRv0cKCgXNc0hcxc9AaPZIdBw7UYtGc=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Tpqr6tqyErtPWRR5J6rt676qV0q8nOgRfjYJ/zFC3Zr589tfzvtDdiCDDkw+ZMNKQ trxElvqdVcHiqSeGKWltMpmU9Ib8UBbEaxquQJvAyKt6h31HrWlNPd3ZTQJ7AIqV8n LNyK5yBupMbcqM8bfYLP4yY0SBJ354layXO2f/B1RdFmqlQp7yFe9sixioBwK20OE5 LTdvY8PfOzFX+aKiAyol69S//ECEPwmC8edL7QvPdlaRZcR9MUxAXeeJlaG1eh6pzm lDwyeLJO0UCY5YYUAMjRAAjjK4667AjIDGkce/9gA6CysszaJiSbsimYhTbVJP9r9V 3NIotRiqEW7Ag== Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id B9A12F4006F; Fri, 12 Dec 2025 14:14:40 -0500 (EST) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-10.internal (MEProxy); Fri, 12 Dec 2025 14:14:40 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvkeellecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfvehhuhgtkhcu nfgvvhgvrhdfuceotggvlheskhgvrhhnvghlrdhorhhgqeenucggtffrrghtthgvrhhnpe ehheejleegffffiefhudduvedugefhheehfefhgfeuleeuudefteejudfhudekleenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegthhhutghklh gvvhgvrhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeifeegleelleeh ledqfedvleekgeegvdefqdgtvghlpeepkhgvrhhnvghlrdhorhhgsehfrghsthhmrghilh drtghomhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepmhgtghhrohhfsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegurgdrghhomhgvii eskhhruhgtvghsrdgtohhmpdhrtghpthhtohepkhguvghvohhpsheslhhishhtshdrlhhi nhhugidruggvvh X-ME-Proxy: Feedback-ID: ifa6e4810:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 97D26780054; Fri, 12 Dec 2025 14:14:40 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AI_2TKMfqrW3 Date: Fri, 12 Dec 2025 14:14:20 -0500 From: "Chuck Lever" To: "Luis Chamberlain" , "Daniel Gomez" , kdevops@lists.linux.dev Message-Id: In-Reply-To: References: <20251206165624.2640158-1-mcgrof@kernel.org> <20251206165624.2640158-2-mcgrof@kernel.org> Subject: Re: [PATCH 1/8] terraform: Use directory checksum in SSH key filenames Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, Dec 6, 2025, at 5:28 PM, Chuck Lever wrote: > On Sat, Dec 6, 2025, at 11:56 AM, Luis Chamberlain wrote: >> SSH keys now use directory-based checksums to support multiple kdevops >> installations coexisting without conflicts. The SSH key filename format >> is now ~/.ssh/kdevops_terraform_ where checksum is the first >> 8 characters of the SHA256 hash of the kdevops directory path. >> >> This was previously only applied to Lambda Labs provider but is now the >> default for all providers, as it solves the general problem of multiple >> installations sharing the same home directory. > >> Also fix OCI Kconfig generation scripts to use --quiet flag correctly >> to suppress progress output when generating dynamic Kconfig files. > > Instead of duplicating the same logic in all the terraform scripts, can > you add it just to scripts/generate_cloud_config.py ? If this isn't a good fit for generate_cloud_config.py, then another approach would be to add the .oci/config check in a helper in terraform/oci/scripts/oci_common.py and have the three menu generator scripts use that common helper. But I'm a little surprised because Claude /promised/ that these scripts fail gracefully when there's no authentication material ;-) > And can this fix go in a separate commit from the ssh change above? > > >> Generated-by: Claude AI >> Signed-off-by: Luis Chamberlain >> --- >> terraform/Kconfig.ssh | 7 +++++-- >> terraform/oci/scripts/gen_kconfig_image | 6 ++++++ >> terraform/oci/scripts/gen_kconfig_location | 6 ++++++ >> terraform/oci/scripts/gen_kconfig_shape | 6 ++++++ >> 4 files changed, 23 insertions(+), 2 deletions(-) >> >> diff --git a/terraform/Kconfig.ssh b/terraform/Kconfig.ssh >> index 4e239a35..b03f962f 100644 >> --- a/terraform/Kconfig.ssh >> +++ b/terraform/Kconfig.ssh >> @@ -21,14 +21,17 @@ config TERRAFORM_SSH_CONFIG_USER >> >> config TERRAFORM_SSH_CONFIG_PUBKEY_FILE >> string "File containing Ansible's ssh public key" >> - default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) | >> sha256sum | cut -c1-8).pub" if TERRAFORM_LAMBDALABS >> - default "~/.ssh/kdevops_terraform.pub" >> + default "~/.ssh/kdevops_terraform_$(shell, echo $(TOPDIR_PATH) | >> sha256sum | cut -c1-8).pub" >> help >> The filename of the file containing an ssh public key >> Ansible is to use to manage its target nodes. The >> matching private key should be located in a file using >> the same basename (without the ".pub"). >> >> + The filename includes an 8-character hash of the current >> + directory path, allowing multiple kdevops installations to >> + use separate SSH keys without conflicts. >> + >> config TERRAFORM_SSH_CONFIG_GENKEY >> bool "Should we create a new random key for you?" >> default y >> diff --git a/terraform/oci/scripts/gen_kconfig_image >> b/terraform/oci/scripts/gen_kconfig_image >> index 977446fd..55dfcf6c 100755 >> --- a/terraform/oci/scripts/gen_kconfig_image >> +++ b/terraform/oci/scripts/gen_kconfig_image >> @@ -718,6 +718,12 @@ def main(): >> """Main function to run the program.""" >> args = parse_arguments() >> >> + # Check for OCI config early - exit silently if not configured >> + if not os.path.exists(os.path.expanduser("~/.oci/config")): >> + if not args.quiet: >> + print("OCI not configured - skipping (optional)", >> file=sys.stderr) >> + sys.exit(0) >> + >> if args.publishers: >> # Show both known and discovered publishers >> compartment_ocid = get_default_compartment() >> diff --git a/terraform/oci/scripts/gen_kconfig_location >> b/terraform/oci/scripts/gen_kconfig_location >> index 17ec8266..b397f534 100755 >> --- a/terraform/oci/scripts/gen_kconfig_location >> +++ b/terraform/oci/scripts/gen_kconfig_location >> @@ -432,6 +432,12 @@ def main(): >> """Main function to run the program.""" >> args = parse_arguments() >> >> + # Check for OCI config early - exit silently if not configured >> + if not os.path.exists(os.path.expanduser("~/.oci/config")): >> + if not args.quiet: >> + print("OCI not configured - skipping (optional)", >> file=sys.stderr) >> + sys.exit(0) >> + >> if not args.quiet: >> print("Fetching list of OCI region subscriptions...", >> file=sys.stderr) >> regions = get_all_regions() >> diff --git a/terraform/oci/scripts/gen_kconfig_shape >> b/terraform/oci/scripts/gen_kconfig_shape >> index 09dd6d6f..d65ff37d 100755 >> --- a/terraform/oci/scripts/gen_kconfig_shape >> +++ b/terraform/oci/scripts/gen_kconfig_shape >> @@ -887,6 +887,12 @@ def main(): >> """Main function to run the program.""" >> args = parse_arguments() >> >> + # Check for OCI config early - exit silently if not configured >> + if not os.path.exists(os.path.expanduser("~/.oci/config")): >> + if not args.quiet: >> + print("OCI not configured - skipping (optional)", file=sys.stderr) >> + sys.exit(0) >> + >> compartment_ocid = get_default_compartment() >> if not compartment_ocid: >> print("Error: Could not determine compartment OCID", file=sys.stderr) >> -- >> 2.51.0 > > -- > Chuck Lever -- Chuck Lever