Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Node-Builder support #668

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rico132
Copy link

@rico132 rico132 commented Jan 23, 2025

buildx/cli_wrapper: add the --append flag to the create command
buildx/cli_wrapper: update platforms() and status() properties, add nodes() property
models.py: add class BuilderNode
models.py: rewrite from_str method so it also parses BuilderNodes

buildx/cli_wrapper: update platforms() and status() properties, add nodes() property
models.py: add class BuilderNode
models.py: rewrite from_str method so it also parses BuilderNodes
@gabrieldemarmiesse
Copy link
Owner

I fixed the formatting with uv run --with pre-commit pre-commit run --all-files

if platforms:
node.platforms = platforms.split(", ")
result_dict["nodes"].append(node)
node = BuilderNode()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than doing all this parsing, I believe we should leverage docker buildx ls --format "{{json . }}", I will look into it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but you mentioned that docker buildx ls --format "{{json . }}" loses the information of what builder is being used, so I parsed it from docker buildx inspect

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can grab the builder name from docker buildx inspect, and then run docker buildx ls --format "{{json . }}" , we loop over the results and take the entry corresponding to our builder. Then parsing the json is easy peasy and can be loaded into a pydantic model

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to do this in the _fetch_and_parse_inspect_result function? Or do you want to create another function to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants