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

Create Pod Functionality #961

Merged
merged 1 commit into from
Oct 3, 2022
Merged

Conversation

strzinek
Copy link

@strzinek strzinek commented Apr 14, 2022


Ability to create new pod group

Podman now allows the creation of pods with an optional port or volume mapping.

image

create-pod

Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This was something we wanted to add for a while!

@garrett as we have limited set of integrations, do we still want to have a tabbed layout?

image

I've noticed that pods also supports volumes/mounts so should we add that as well?

onClick={() => this.setState({ showCreatePodModal: true })}>
{_("Create pod")}
</DropdownItem>
]} />
Copy link
Member

Choose a reason for hiding this comment

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

I've digged up our old designs for adding a pod creation to cockpit-podman and I think we don't want it in a new kebab menu but as a button

https://raw.githubusercontent.com/cockpit-project/cockpit-design/master/containers/podman-pod-groups.png

Copy link
Author

Choose a reason for hiding this comment

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

I am planning to implement other functions later which could go to kebab menu, and which are available through the API, e.g. Prune unused pods, Play a kube YAML, ... And I think two buttons together with filters would not look good on narrow layouts too. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think a create pod button takes up a lot of space, @garrett what do you think?

src/PodCreateModal.jsx Outdated Show resolved Hide resolved
src/PodCreateModal.jsx Outdated Show resolved Hide resolved
src/PodCreateModal.jsx Outdated Show resolved Hide resolved
src/PodCreateModal.jsx Outdated Show resolved Hide resolved
{ title: proc, props: { modifier: "nowrap" } },
{ title: mem, props: { modifier: "nowrap" } },
{ title: <Badge isRead className={containerStateClass}>{_(containerState)}</Badge> }, // States are defined in util.js
];
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea of hiding the owner column when pods are used, but the current layout seems a bit weird and it's not clear that the pod is a "system" pod.

image

Copy link
Author

Choose a reason for hiding this comment

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

Could some competent designer have a look at it? It would be better to show also other pod details, such as port mapping and mounts, and present layout is not prepared for this. I'd be glad to implement it. ;-)

Copy link
Member

Choose a reason for hiding this comment

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

Port mappings an mounts are at the pod level, right? I thought I had a design for this somewhere. (But perhaps I'm thinking of something else...?)

I'll look around, but it's end of the day today, so please ping me if I forget and take a while to get back to this.

Copy link
Member

Choose a reason for hiding this comment

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

I wasn't able to find what I was thinking of. Perhaps I have a pattern in mind that was in another mockup.

This means I'll need to mock up what I have in mind for Cockpit-Podman. 😉

Copy link
Author

Choose a reason for hiding this comment

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

I changed the pod title a little bit and added Owner label.

Copy link
Member

Choose a reason for hiding this comment

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

@garrett the pod details design is here #489 but that does not deal with the owner field. Maybe we can improve this in a follow up PR.

@garrett
Copy link
Member

garrett commented Apr 25, 2022

@garrett as we have limited set of integrations, do we still want to have a tabbed layout?

No, please drop the tabs from this modal dialog. Thanks!

@strzinek
Copy link
Author

strzinek commented May 2, 2022

Tabs removed.

I also added volumes section, but found out that mounts wont get created for pod because of bug in Podman: containers/podman#13548 . I am not able to verify it is fixed in 4.x version as I am on fedora 35 for now.

I would also add a new test for creating pod later on.

@strzinek strzinek requested review from garrett and jelly May 2, 2022 17:40
@strzinek
Copy link
Author

Now it is possible to choose if infra container is created. Also, infra containers are not hidden in pods listings anymore.

I also prepared two new tests, TestApplication.testCreatePodUser and TestApplication.testCreatePodSystem.

jelly
jelly previously requested changes May 18, 2022
@@ -463,9 +484,6 @@ class Containers extends React.Component {
);
}

// Remove infra containers
filtered = filtered.filter(id => !this.props.containers[id].IsInfra);
Copy link
Member

Choose a reason for hiding this comment

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

Why do you want to show infra containers, they aren't super interesting for users? Do you have a good reason to show it?

Copy link
Author

Choose a reason for hiding this comment

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

Infra container is a placeholder for shared resources of pod containers. The pod port mapping for example is defined on it. Without showing infra container, user of cockpit-podman does not know if pod has such shared resources and what ports pod exposes.

Copy link
Member

@jelly jelly May 23, 2022

Choose a reason for hiding this comment

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

For that we prefer the following design, it takes the info from the infra container. #489

image

onClick={() => this.setState({ showCreatePodModal: true })}>
{_("Create pod")}
</DropdownItem>
]} />
Copy link
Member

Choose a reason for hiding this comment

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

I don't think a create pod button takes up a lot of space, @garrett what do you think?

src/ImageRunModal.jsx Outdated Show resolved Hide resolved
src/PodCreateModal.jsx Outdated Show resolved Hide resolved
{ title: proc, props: { modifier: "nowrap" } },
{ title: mem, props: { modifier: "nowrap" } },
{ title: <Badge isRead className={containerStateClass}>{_(containerState)}</Badge> }, // States are defined in util.js
];
Copy link
Member

Choose a reason for hiding this comment

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

@garrett the pod details design is here #489 but that does not deal with the owner field. Maybe we can improve this in a follow up PR.

@jelly
Copy link
Member

jelly commented May 18, 2022

I think this is a good PR to look at landing next after the rename PR.

@jelly
Copy link
Member

jelly commented Aug 8, 2022

The rename PR landed, can you please rebase this PR?

@jelly jelly force-pushed the create_pod branch 2 times, most recently from 1050367 to 8540cbe Compare August 19, 2022 08:22
@jelly
Copy link
Member

jelly commented Aug 19, 2022

I've rebased the PR, resolved the conflicts and dropped some of the things which can be a follow up PR.

@marusak
Copy link
Member

marusak commented Aug 22, 2022

This breaks pixel tests: https://cockpit-logs.us-east-1.linodeobjects.com/pull-961-20220819-084819-8540cbeb-fedora-35/TestApplication-testRunImageSystem-integration-pixels.png

It causes regression, I did this change a few weeks ago - wrong checkout?

Also needs some new tests

@jelly
Copy link
Member

jelly commented Aug 22, 2022

This breaks pixel tests: https://cockpit-logs.us-east-1.linodeobjects.com/pull-961-20220819-084819-8540cbeb-fedora-35/TestApplication-testRunImageSystem-integration-pixels.png

It causes regression, I did this change a few weeks ago - wrong checkout?

Also needs some new tests

Hmm the code was moved around so maybe it doesn't pick up some css changes?

@jelly jelly force-pushed the create_pod branch 2 times, most recently from a34867f to bfe5b80 Compare September 2, 2022 15:31
@jelly jelly changed the title Better pod management Create Pod Functionality Sep 5, 2022
@jelly
Copy link
Member

jelly commented Sep 19, 2022

Failing tests on ubuntu-2204 are due to podman not support user mounts on 3.4.4 and requires 4.0.0 so our gui should hide it containers/podman#10379

@jelly
Copy link
Member

jelly commented Sep 27, 2022

Issue summary:

@jelly jelly force-pushed the create_pod branch 3 times, most recently from e244962 to b267776 Compare September 27, 2022 18:17
@jelly jelly self-requested a review September 27, 2022 20:56
@marusak
Copy link
Member

marusak commented Sep 29, 2022

Why Owner label is not on the same row?
Screenshot from 2022-09-29 13-52-30

Like here for example?
Screenshot from 2022-09-29 13-52-18

Also found it a bit confusing, that when you create pod and give it ports and volumes, you don't see them in the UI unless you add there container and start it.

@jelly
Copy link
Member

jelly commented Sep 29, 2022

Also found it a bit confusing, that when you create pod and give it ports and volumes, you don't see them in the UI unless you add there container and start it.

Agreed, however.... the Ports can be found in infraContainer but for the mounts we need infraContainerDetails and that is only available when the pod is started. We should ask the podman guys to expose the mounts in the containers information to make this work nicely.

This implements the ability to create a podman pod for the user and
admin session. A pod can have a volume and port mapping, note that
volumes are only supported from podman 4.0.
Copy link
Member

@marusak marusak left a comment

Choose a reason for hiding this comment

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

Superb, thank you!

@marusak
Copy link
Member

marusak commented Oct 3, 2022

Can you please write proper release note with screenshot as well?

@marusak marusak dismissed jelly’s stale review October 3, 2022 08:50

Has been fixed

@marusak marusak merged commit 5d98049 into cockpit-project:main Oct 3, 2022
@strzinek
Copy link
Author

strzinek commented Oct 3, 2022

Thanks everyone for pushing things through, I haven't had any time to pursue this myself.

@jelly
Copy link
Member

jelly commented Oct 4, 2022

Thanks everyone for pushing things through, I haven't had any time to pursue this myself.

No problem, thanks for the initial PR!

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.

None yet

4 participants