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 2A88A273D7B for ; Thu, 28 Aug 2025 20:16:35 +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=1756412195; cv=none; b=Idxu7VEOHEP5q8WObQHJikaIvjk//ZSt4mwx4W+dKZVklQRsg+DUXWXtP8pRI9Vtr9y3posC4HETVQzU40PhkccZuMEfyqGWS93wInkUvCKFO8iDwi9wwQ9U3D4Sl8mlmRjGHetZyLa93adhE1yl4/ZXkWcKBuII1b0M13H5gf0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756412195; c=relaxed/simple; bh=ImlyjucXI6PxHr+hCuDCcHuZY/1AGHLPexwaLofc4R4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U3WM/vbqB3OkecLwnvC2WekqD4/mlMeZrm3hWDJ/Fyz+6tZRxK1P8lU01GNx9RMYxFfP1ce7AHs6PnClgh7+TujjdkhkieUfsMNgKnDr+4qSfz9Y7lKBFrtjXOYVh4Gz/JqhzAPEbkbGD18dEwAEg0osS821ZGHXRmnSHxVo9aQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IsmOrmPC; 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="IsmOrmPC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E121AC4CEEB; Thu, 28 Aug 2025 20:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756412195; bh=ImlyjucXI6PxHr+hCuDCcHuZY/1AGHLPexwaLofc4R4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IsmOrmPC1xGB0SmY0VCeNzNoGIniP8JjhyDRZSYPloMvV5ntDBqQsqDh/oyfiPVoK EZDwWo5DOVyFq4jfzMcnoK1rwsuCfrnVkP7hxrSRiKpP6NFxJgr/BHoz7rixCxUu6G j7y5zXLw2cG90fz0Pdo06Ux05TUaDoMLCpH4q3mntfH+xycyE91TFRSqkKG6yeeEBT 7+oragiG7BA3zeGMvwtZVoAYkf5EaT0wlXNdl9uBabL5cOg7iQogn7Ezag70uLbC3f GvrKaDdJgIZSj2LeIdxgvQ/WjtBzEVQHVDWVDcJYpZBtZ9XNGrltvUdMsy6X7N2nlL eYVrJ5Rh3YWwA== Date: Thu, 28 Aug 2025 13:16:33 -0700 From: Luis Chamberlain To: Chuck Lever Cc: Daniel Gomez , kdevops@lists.linux.dev Subject: Re: [PATCH v2 02/10] scripts: add Lambda Labs Python API library Message-ID: References: <20250827212902.4021990-1-mcgrof@kernel.org> <20250827212902.4021990-3-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Aug 28, 2025 at 04:13:12PM -0400, Chuck Lever wrote: > On 8/28/25 4:03 PM, Luis Chamberlain wrote: > > On Thu, Aug 28, 2025 at 04:00:09PM -0400, Chuck Lever wrote: > >> On 8/28/25 3:33 PM, Luis Chamberlain wrote: > >>> On Thu, Aug 28, 2025 at 02:59:18PM -0400, Chuck Lever wrote: > >>>> On 8/27/25 5:28 PM, Luis Chamberlain wrote: > >>>>> Add a Python library for interacting with the Lambda Labs cloud API. > >>>>> This provides core functionality to query instance types, regions, > >>>>> availability, and manage cloud resources programmatically. > >>>>> > >>>>> The API library handles: > >>>>> - Instance type enumeration and capacity checking > >>>>> - Region availability queries > >>>>> - SSH key management operations > >>>>> - Error handling and retries for API calls > >>>>> - Parsing and normalizing API responses > >>>>> > >>>>> This forms the foundation for dynamic Kconfig generation and terraform > >>>>> integration, but doesn't enable any features yet. > >>>> > >>>> Thanks for splitting this up. Much much easier for humble humans to > >>>> understand now. There are some really interesting ideas in the series; > >>>> kudos to you and Claude. > >>>> > >>>> The other cloud providers have their own house-brewed command line > >>>> utilities that are typically packaged by distributions (eg, oci, aws, > >>>> and so on), as well as their own Ansible collections. > >>>> > >>>> I assume that Lambda does not have those (yet). > >>> > >>> Right. It sad to not see such a thing, which meant it was actually > >>> harder to do this inference work, and yet it shows its possible. Which > >>> also means, technically in theory, it might even be possible to do the > >>> same with other cloud providers without a CLI tool. > >>> > >>>> Can the patch > >>>> description mention that? > >>> > >>> Sure. > >>> > >>>> Basically that's the whole purpose for this > >>>> patch and the two following, IIUC. > >>>> > >>>> I would actually encourage this script to be restructured and renamed so > >>>> that it works like the tooling available from other cloud providers. > >>> > >>> So you mean we write Lambda's CLI tool? Sure we can try that, but who do > >>> we follow? And do we need to do that now? Or can I do that later? > >>> > >>>> Separate the API calls and retrieval of information (which is rather > >>>> general purpose) from the translation of that information to Kconfig > >>>> menus (which is specific to kdevops). > >>> > >>> You mean, to re-use all the knowledge we used for Kconfig dynamic > >>> kconfig to a create a specific tool, which can then be itself leveraged > >>> for both the dynamic kconfig and also a user tool? > >> > >> I think so: Write a command line tool that makes API queries and spits > >> out JSON. Write a second tool that takes the JSON and turns it into > >> Kconfig menus. Re-use the first tool for other tasks. That is how I > >> was thinking of building dynamic menus for the other providers; their > >> existing command line tools are tool #1 above. > > > > Yeah I think this is really *it*! > > > >> But, we can do it later. I won't hold you up with crazy ideas. > > > > Its not crazy at all, proper architecture trumps all. But if we didn't > > start evaluating this patch series with this inference cloud thing for > > dynamic kconfig thing we wouldn't have ended up here. And so I think we > > have a solid path. > > > > I'd like to extend your suggestion further: I am not sure if we need a > > different CLI tool per cloud provider. Wouldn't it be nice if we had > > unified way to query such things and output json for each cloud > > provider? > > Basically I'm re-using the tools each provider gives us because, well, > I'm a lazy sod. It gives some immediate traction. > > But I can see that doing it that way means we have a distinct JSON to > Kconfig translation for each provider. > > If handling the API queries is as easy as the Python script here looks, > then the only hard part to building a single tool will be turning the > provider-specific JSON into something common (and YAML output might be > easier for Ansible and Python to deal with than JSON, IMO). I see the challenges ahead, yeah screw it. Let's for now diverge and later we can evaluate. I don't think we *need* a common tool other than a utopian dream of sharing dynamic kconfig generation scripts. That can wait until we have each cloud provider set up. Luis