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

Add Farms to config #1586

Merged
merged 2 commits into from
Aug 5, 2023
Merged

Add Farms to config #1586

merged 2 commits into from
Aug 5, 2023

Conversation

umohnani8
Copy link
Member

Add 2 new fields to EngineConfig Farms and DefaultFarm for the podman buildfarm feature work.
Also update the ssh connection code to be able to add a new connection to a new or existing farm when the --farm is set in podman system connection add.

PR containers/podman#19358 will vendor this in.

@umohnani8
Copy link
Member Author

@vrothberg @rhatdan PTAL

@vrothberg
Copy link
Member

vrothberg commented Jul 26, 2023

Carrying over my comment from the Podman PR:


I mean that it should not be part of the [engine] table but a new [buildfarm] table.

Ideally, it should not be part of containers.conf at all but a proper database or a dedicated predictable path for root and rootless. machine and conenction are (ab)using containers.conf already as a database but there is growing desire to change that, see #1566. containers.conf is a config file for users and we somehow abuse it as a database.

@rhatdan
Copy link
Member

rhatdan commented Jul 26, 2023

I agree this should at least be in a separate containers.conf file that can be updated on the fly. Moving everything to a dedicated connections.conf would be preferred to share both.

@vrothberg
Copy link
Member

I agree this should at least be in a separate containers.conf file that can be updated on the fly. Moving everything to a dedicated connections.conf would be preferred to share both.

I suggest to integrate buildfarm into the brainstorming in #1566. I think it's a bad idea to use a config file as a DB.

BUT adding buildfarm as done in this PR will not change the status quo since we're already using containers.conf as a DB. It would be nice to find a more elegant solution in the future but we shouldn't block buildfarm's progress on this issue.

@umohnani8 umohnani8 changed the title Farms Add Farms to config Jul 26, 2023
@umohnani8
Copy link
Member Author

I updated the PR to create a separate Farms TOML table so we are not cluttering EngineConfig.
I am not a big fan of the Farms.Farms name but I really couldn't think of a better way to name it, any suggestions would be appreciated.

@umohnani8 umohnani8 force-pushed the farms branch 2 times, most recently from 786ebcb to 5197889 Compare July 26, 2023 15:13
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Requires tests and we need to set defaults (i.e., create an empty map to avoid the nil checks).

@umohnani8 umohnani8 force-pushed the farms branch 8 times, most recently from 3463236 to bd68227 Compare August 1, 2023 17:16
@umohnani8
Copy link
Member Author

Tests are green!
@vrothberg @rhatdan PTAL

@rhatdan
Copy link
Member

rhatdan commented Aug 1, 2023

LGTM

@vrothberg
Copy link
Member

The Podman PR containers/podman#19358 doesn't pass CI yet. Let's wait to be sure this PR has everything containers/podman#19358 needs.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM
@rhatdan @Luap99 PTAL

@openshift-ci openshift-ci bot added the approved label Aug 3, 2023
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

This is missing documentation in the man page

pkg/config/containers.conf Outdated Show resolved Hide resolved
pkg/config/containers.conf Show resolved Hide resolved
Add two new fields Farms and DefaultFarm to the Config
to be used by the new podman buildfarm command.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
A new --farm flag is being added to podman system connection
add so that when a new connection is added it can be added to a new
or existing farm. Update the code here to be able to do that.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
@umohnani8
Copy link
Member Author

Added docs

@rhatdan
Copy link
Member

rhatdan commented Aug 5, 2023

/approve
/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan, umohnani8, vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit c32d5da into containers:main Aug 5, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants