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

webui: mount point assignment support #4843

Merged
merged 4 commits into from
Jun 29, 2023

Conversation

KKoukiou
Copy link
Contributor

@KKoukiou KKoukiou commented Jun 19, 2023

Enhanced version of #4757

I made many changes that I felt maybe force pushing into the existing branch is bad idea. Let me know if you prefer.

@jelly kept your commit an d fixed the issue with the custom mountpoint option still showing plain disks.

Wanna take a look?

@KKoukiou KKoukiou force-pushed the custom-mount-point branch 2 times, most recently from 0f55651 to b911384 Compare June 20, 2023 08:49
@KKoukiou KKoukiou requested a review from rvykydal June 21, 2023 08:40
@jelly
Copy link
Contributor

jelly commented Jun 21, 2023

Some UI things I did not address, which can be a follow up:

Allows selection when you have no partitions

image

image

Allows selection, when you have a partition but no Filesystem

image

image

After going back and adding a new partition, the file system was not detected.

image

I think this is due to the re-use of the ManualPartitioning so when we click on Detect disks we should probably remove the old ManualPartitioning model.

Note that every time you change something with the partitions you need to go back and click Detect disks, adding a button everywhere to detect disks is a solution but not super nice if you ask me.

Error stays after switching back and forth.

When switching back and forth because I had a missing filesystem, then created one and clicked Detect disks I noticed the error is still shown:

image

Nice to have

Formatting a partition as ntfs and assigning it as / gives:

image

This could be an inline error, downside is that we'd have to hardcode a rule in the web ui.


useEffect(() => {
if (requests === null) {
findPartitioning({ method: "MANUAL" }).then(([partitioning]) => {
Copy link
Contributor

@jelly jelly Jun 21, 2023

Choose a reason for hiding this comment

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

TLDR:

When scanning for new devices we correctly call ResetPartitioning but this does not pick up filesystem changes, only new partitions. (As GatherRequests which is called here does the right thing)

@poncovka I assume this is not expected behaviour but a bug?

Creating a new Partitining does pick up the filesystem changes on disk:

[anaconda root@localhost ~]# busctl --verbose --address=$(cat /run/anaconda/bus.address) call org.fedoraproject.Anaconda.Modules.Storage  /org/fedoraproject/Anaconda/Modules/Storage org.fedoraproject.Anaconda.Modules.Storage CreatePartitioning s "MANUAL"

[anaconda root@localhost ~]# busctl --verbose --address=$(cat /run/anaconda/bus.address) call org.fedoraproject.Anaconda.Modules.Storage /org/fedoraproject/Anaconda/Modules/Storage/Partitioning/3 org.fedoraproject.Anaconda.Modules.Storage.Partitioning.Manual GatherRequests | grep ext4
                                        STRING "ext4";
                                        STRING "ext4";

Old partitioning model:

[anaconda root@localhost ~]# busctl --verbose --address=$(cat /run/anaconda/bus.address) call org.fedoraproject.Anaconda.Modules.Storage /org/fedoraproject/Anaconda/Modules/Storage/Partitioning/2 org.fedoraproject.Anaconda.Modules.Storage.Partitioning.Manual GatherRequests | grep ext4
[anaconda root@localhost ~]#

@KKoukiou so this is where we find the "existing" ManualPartitioning. If I recall correctly you can't deleted CreatedPartitioning models so findPartitioning just finds the last one. So this is a bit of an issue, it can be fixed in two ways I think.

Either invalidate the PartioningModel's Requests property so it fetches the new information from the DeviceTree. I thought ResetPartitioning should do that But it does not seem so.

Keep some global state somewhere, so create a ManualPartitioning object when you select Custom Mount point and if you click Rescan devices. This is however a rather suboptimal solution I'd say.

Listing Partitionings:

[anaconda root@localhost ~]# busctl --verbose --address=$(cat /run/anaconda/bus.address) get-property org.fedoraproject.Anaconda.Modules.Storage  /org/fedoraproject/Anaconda/Modules/Storage org.fedoraproject.Anaconda.Modules.Storage CreatedPartitioning
ARRAY "o" {
        OBJECT_PATH "/org/fedoraproject/Anaconda/Modules/Storage/Partitioning/1";
        OBJECT_PATH "/org/fedoraproject/Anaconda/Modules/Storage/Partitioning/2";
};

Getting the GatherRequests (Turns should turn into a Requests property).

busctl --verbose --address=$(cat /run/anaconda/bus.address) call org.fedoraproject.Anaconda.Modules.Storage /org/fedoraproject/Anaconda/Modules/Storage/Partitioning/2 org.fedoraproject.Anaconda.Modules.Storage.Partitioning.Manual GatherRequests

We should be able to call ResetPartitioning to Reset the Partitioning model.

busctl --verbose --address=$(cat /run/anaconda/bus.address) call org.fedoraproject.Anaconda.Modules.Storage  /org/fedoraproject/Anaconda/Modules/Storage org.fedoraproject.Anaconda.Modules.Storage ResetPartitioning

And then call GatherRequests again, but this does not seem to discover new filesystems.

@M4rtinK
Copy link
Contributor

M4rtinK commented Jun 21, 2023

Would it perhaps make sense to split the PR into more commits ? Say one commit for the JS API code calling DBus, one for the review screen & similar ?

@KKoukiou
Copy link
Contributor Author

Would it perhaps make sense to split the PR into more commits ? Say one commit for the JS API code calling DBus, one for the review screen & similar ?

But we need the front end to make the JS APIs call for dbus testable.

@M4rtinK
Copy link
Contributor

M4rtinK commented Jun 26, 2023

/boot-iso --webui

@M4rtinK
Copy link
Contributor

M4rtinK commented Jun 27, 2023

/boot-iso --webui

@KKoukiou KKoukiou force-pushed the custom-mount-point branch 2 times, most recently from 0766591 to 651ad21 Compare June 27, 2023 13:54
@KKoukiou KKoukiou force-pushed the custom-mount-point branch 3 times, most recently from 2b2b038 to 39bb620 Compare June 27, 2023 16:07
@M4rtinK
Copy link
Contributor

M4rtinK commented Jun 28, 2023

/boot-iso --webui

This get's reprinted on each re-render of the component polluting the
browser console and therefore the test run outputs.
@KKoukiou KKoukiou mentioned this pull request Jun 28, 2023
5 tasks
@KKoukiou
Copy link
Contributor Author

KKoukiou commented Jun 28, 2023

@jelly i need some support on this. Checked your review comments from above:

  • no custom mountpoint section is disabled if no partitions on the device
  • when no f ilesystem on the partition I still show it - and we get then the error when clicking next as you suggest. Mind if we fi this in followup?
  • errors don't get discared currently when switching between pages indeed. Since a change in this approach is affecting the whole app, not just this feature let's please check this as well seperately
  • Parsing the errors to make this inline can be considered - but let's keep it as well for enhancement.

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Looks good to me - quite the piece of work @KKoukiou & @jelly! :)

Just a couple minor remarks. :)

ui/webui/src/apis/storage.js Outdated Show resolved Hide resolved
ui/webui/src/apis/storage.js Show resolved Hide resolved

const MountPointSelect = ({ partition, requests, mountpoint, handleOnSelect, isDisabled }) => {
// TODO: extend?
const defaultOptions = [
Copy link
Contributor

Choose a reason for hiding this comment

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

No really relevant for this review, but I'm thinking this might eventually end up in the config file, as various distro variants might have very different ideas of what the suggested partitions should be (eq. swap, separate /var, /boot not on separate partition, etc.) & might want to set it up in a custom manner.

<TextContent>
<Text component={TextVariants.p}>
{_("This option requires you to first partition and format your disk and " +
"then assign custom mount points in the next step.")}
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest also mentioning (possibly in another paragraph) that if the layout already exists (from an existing installation or already created by the user beforehand) that the user can proceed right away to assign the mount points.

ui/webui/src/components/storage/StorageConfiguration.jsx Outdated Show resolved Hide resolved
Support a new storage configuration method where a user first has to
manually partition and create file systems using the tools on the
installation image.
When selecting the custom mount point option the user can now select
which partition to map to mount point either from a well known list of
Mount points or a manually created one.

Co-authored-by: Katerina Koukiou <kkoukiou@redhat.com>
…scan button

Previously we were replacing the wizard content with a loading empty
state but that causes a flicker when rescanning disks.
@KKoukiou KKoukiou removed the request for review from rvykydal June 29, 2023 11:22
@KKoukiou
Copy link
Contributor Author

/kickstart-test --waive webui only

@KKoukiou KKoukiou merged commit 56fcaf7 into rhinstaller:master Jun 29, 2023
14 checks passed
@KKoukiou KKoukiou deleted the custom-mount-point branch June 29, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants