From: Chuck Lever <cel@kernel.org>
To: Luis Chamberlain <mcgrof@kernel.org>,
Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Subject: Re: [PATCH v4 3/8] aws: add optimized Kconfig generator using Chuck's scripts
Date: Tue, 16 Sep 2025 20:58:01 -0700 [thread overview]
Message-ID: <9899f6c3-6418-476b-98e3-5ee7825ebbe3@kernel.org> (raw)
In-Reply-To: <20250917003451.2318229-4-mcgrof@kernel.org>
On 9/16/25 5:34 PM, Luis Chamberlain wrote:
> Create a wrapper script that orchestrates Chuck's existing AWS scripts
> (ec2_instance_info.py, aws_regions_info.py, aws_ami_info.py) to generate
> Kconfig files with JSON caching and parallel processing.
>
> This approach leverages Chuck's already working scripts while adding:
> - JSON caching with 24-hour TTL in ~/.cache/kdevops/aws/
> - Parallel fetching of instance data (10 concurrent workers)
> - Parallel file writing (20 concurrent workers)
> - Proper data structure handling for families list
>
> Performance improvements:
> - First run: ~21 seconds to fetch all data from AWS
> - Cached runs: ~0.04 seconds (525x faster)
> - Generates 75 Kconfig files for 72 instance families
>
> The script properly uses Chuck's existing AWS API implementations
> rather than reimplementing them, maintaining code reuse and consistency.
>
> Generated-by: Claude AI
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
I've got a slightly different approach in mind, but same goal: make
these scripts fast. Great minds think alike!
After working with my scripts a bit, it seems like we really don't need
the JSON intermediate step. It made sense when getting output from the
CLI, but the response from the boto3 client is truly enough to assemble
the Kconfig menus directly.
Building the instance types is what seems to take the longest because
the script repeatedly does a describe_instance_types and the response
to that is HUGE. But we can do that once at the top of the script, and
simply use the same response as often as needed.
The use case seems to be "build the Kconfig menus" and then use them
for a while. So we have the 21 second first run, but I'm not yet seeing
a benefit to caching -- why rebuild the menus again if your input data
is going to remain exactly the same for 24 hours? Let me know if I've
misunderstood.
And, I now agree it makes sense to get rid of the menu subdirectories.
Sourcing the little files doesn't seem to add any value. My new scripts
construct one large locations menu and one large compute menu.
--
Chuck Lever
next prev parent reply other threads:[~2025-09-17 3:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 0:34 [PATCH v4 0/8] aws: add dynamic kconfig support Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 1/8] aws: prevent SSH key conflicts across multiple kdevops directories Luis Chamberlain
2025-09-17 3:36 ` Chuck Lever
2025-09-17 0:34 ` [PATCH v4 2/8] terraform/aws: Add scripts to gather provider resource information Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 3/8] aws: add optimized Kconfig generator using Chuck's scripts Luis Chamberlain
2025-09-17 3:58 ` Chuck Lever [this message]
2025-09-17 0:34 ` [PATCH v4 4/8] aws: integrate dynamic Kconfig generation with make targets Luis Chamberlain
2025-09-17 3:40 ` Chuck Lever
2025-09-17 7:05 ` Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 5/8] aws: add cloud billing support with make cloud-bill Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 6/8] aws: replace static Kconfig files with dynamically generated ones Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 7/8] aws: add GPU instance defconfigs for AI/ML workloads Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 8/8] docs: add documentation for dynamic cloud configuration Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9899f6c3-6418-476b-98e3-5ee7825ebbe3@kernel.org \
--to=cel@kernel.org \
--cc=da.gomez@kruces.com \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox