Bug 2893 - [Hob] SSTATE_MIRROR box not populated
Summary: [Hob] SSTATE_MIRROR box not populated
Status: VERIFIED FIXED
Alias: None
Product: Hob
Classification: Build System, Metadata & Runtime
Component: image creator (show other bugs)
Version: 1.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3 M4
Assignee: Cristiana Voicu
QA Contact:
URL:
Whiteboard: patch review
Depends on:
Blocks:
 
Reported: 2012-08-05 01:39 UTC by Khem Raj
Modified: 2012-09-28 11:02 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
settings SSTATE_MIRRORS field (91.32 KB, image/png)
2012-09-07 06:34 UTC, Cristiana Voicu
no flags Details
shared-mirror-URL.pdf (75.12 KB, application/pdf)
2012-09-10 15:28 UTC, Belen Barros Pena
no flags Details
shared_state_tab.pdf (253.09 KB, application/pdf)
2012-09-12 16:50 UTC, Belen Barros Pena
no flags Details
shared_state_tab.pdf (259.76 KB, application/pdf)
2012-09-13 15:51 UTC, Belen Barros Pena
no flags Details
shared_state_tab.pdf (312.99 KB, application/pdf)
2012-09-14 15:31 UTC, Belen Barros Pena
no flags Details
setting shared state tab (54.53 KB, image/png)
2012-09-24 15:04 UTC, Cristiana Voicu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2012-08-05 01:39:56 UTC
I have existing local.conf where I have set SSTATE_MIRRORS variable
when I launch hob I see that download dir and sstate dir are populated with the values from my local.conf but

launch hob in a prebuild sandbox and then

settings->build environment tab

"Select SSTATE mirror:" is empty. It it expected to show my mirrors in there ?
if yes then its a bug

secondly there is a grammatical mistake it should be 'mirrors' and not 'mirror'
Comment 1 Cristiana Voicu 2012-09-07 06:34:47 UTC
Created attachment 767 [details]
settings SSTATE_MIRRORS field
Comment 2 Cristiana Voicu 2012-09-07 06:38:37 UTC
Yes it is a bug, it should apper as in the image I have attached. But we have also to change the interface because the variable SSTATE_MIRRORS isn't a path for a directory. It is a link, so the button to browse should be change in something else. Belen can you say us how should this be? Thanks.

After I will know how this should be, I will make a patch with all.
Comment 3 Belen Barros Pena 2012-09-10 15:28:01 UTC
Hi Cristiana,

You are right: it needs to be a valid URL. But it can be a URL pointing to a local or remote resource. The easiest way of inputting a local resource is using a file selection dialog, and that's why the interface is the way it is. I totally agree though that we need to be more clear about what inputs are valid for this field. To help with that, we should change the text that comes up when you click on the 'i' icon to: 

"A URL pointing to a pre-built mirror that will speed your build. The URL can point to a remote location (e.g. http://someserver.tld/sstate/) or to a local directory (e.g. file:///some/local/dir/sstate/)."

About the 'mirrors' typo, it will be fixed as part of bug 2162 (the label will be changed to "Shared mirror URL").

About the value displayed inside the text field, I see in your screenshot that the mirror URL is preceded by "file://.*". We should take that out and display only the URL (in your screenshot ftp://10.237.112.100/sstate-cache). Also, if you use the file selection dialog to select a local directory, we should add "file://" to the beginning of the path automatically, so that users don't need to type it by hand. 

I hope this makes sense. I have attached a pdf document explaining the above (shared-mirror-URL.pdf), just in case it helps.

If you have any questions, please let me know.

Belen



(In reply to comment #2)
> Yes it is a bug, it should apper as in the image I have attached. But we
> have also to change the interface because the variable SSTATE_MIRRORS isn't
> a path for a directory. It is a link, so the button to browse should be
> change in something else. Belen can you say us how should this be? Thanks.
> 
> After I will know how this should be, I will make a patch with all.
Comment 4 Belen Barros Pena 2012-09-10 15:28:32 UTC
Created attachment 779 [details]
shared-mirror-URL.pdf
Comment 5 Belen Barros Pena 2012-09-10 15:32:41 UTC
Hi Scott, 

I am assigning this bug to you so that you can review the content of the information bubble and make sure you are happy with it. To give you some context, we need to provide a bit more detail about what constitutes a valid SSTATE_MIRROR value. To do so, I am suggesting we change the label to:

"Shared mirror URL"

And the information bubble should say something like: 

"A URL pointing to a pre-built mirror that will speed your build. The URL can point to a remote location (e.g. http://someserver.tld/sstate/) or to a local directory (e.g. file:///some/local/dir/sstate/)."

The screenshots show the Hob screens involved.

Any changes you'd like to make in the text?

Thanks!

Belen
Comment 6 Scott Rifenbark 2012-09-10 16:48:43 UTC
Belen, 

The bubble looks fine.  No changes recommended. Do I mark this resolved?

Scott
Comment 7 Bogdan Marinescu 2012-09-11 14:34:16 UTC
Hi Belen,

(In reply to comment #3)
> Hi Cristiana,
> 
> You are right: it needs to be a valid URL. But it can be a URL pointing to a
> local or remote resource. The easiest way of inputting a local resource is
> using a file selection dialog, and that's why the interface is the way it
> is.

I understand your comments, but unfortunately I don't think this is enough. The main problem is that SSTATE_MIRRORS can have more than one entry (and with the last changes it apparently _needs_ to have more than one entry, one for native packages and one for everything else). For example, my SSTATE_MIRRORS looks like this now:

SSTATE_MIRRORS ?= "\
file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1 \n \
file://(.*) ftp://10.237.112.100/sstate-cache/\1 \n \
"
(the first line is needed for native packages, the second one for everything else).

With this in mind, the file selection dialog is no longer an option IMO. The easy way to fix this is to let the user enter the content of SSTATE_MIRROS manually, without any dialogs. If we want to get more user-friendly, SSTATE_MIRRORS should probably get its own dialog that would have a list with the current SSTATE_MIRRORS entries and buttons for "Add new URL", "Add new local dir", "Remove entry". But note that the user-friendly part is further complicated by the contents of SSTATE_MIRRORS. Take for example the first part of SSTATE_MIRRORS above:

file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1

Note that this is actually a regexp (the '\1' at the end takes its value from the '(.*)' after the file:// URL). This is a very flexible mechanism and unfortunately quite hard to capture in a GUI. 
In conclusion, I'd make SSTATE_MIRRORS a simple text entry widget, without any associated file selection dialog and let the user have full control over it. Validating its contents might be yet another challenge, due to the issue explained above.
There are some good news too: the fix for the original bug (SSTATE_MIRRORS not reflected in the GUI) should be quite easy :)
Comment 8 Belen Barros Pena 2012-09-11 15:27:16 UTC
Thanks Scott. I'll assign the bug back to Cristiana.

Cheers

Belen

(In reply to comment #6)
> Belen, 
> 
> The bubble looks fine.  No changes recommended. Do I mark this resolved?
> 
> Scott
Comment 9 Belen Barros Pena 2012-09-11 15:59:44 UTC
Hi Bogdan,

Thanks for the information. I am a bit confused now: just had a brief chat with Paul E about this, and he believes that you don't need two entries. You just need to add 'PATH' to the SSTATE_MIRRORS URL and that will append the appropriate distro-specific path for native recipes. 

If the above is correct, we should probably add 'PATH' to the URL entered in the SSTATE_MIRROR field behind the scenes. We would then use the info icon to explain that mirrors must have the correct directory structure, and point users to the section of the manual where they can find more information about this. 

Before I run away to redesign the Settings dialogue, maybe we should confirm Paul's comments. What do you think?

Cheers

Belen



(In reply to comment #7)
> Hi Belen,
> 
> (In reply to comment #3)
> > Hi Cristiana,
> > 
> > You are right: it needs to be a valid URL. But it can be a URL pointing to a
> > local or remote resource. The easiest way of inputting a local resource is
> > using a file selection dialog, and that's why the interface is the way it
> > is.
> 
> I understand your comments, but unfortunately I don't think this is enough.
> The main problem is that SSTATE_MIRRORS can have more than one entry (and
> with the last changes it apparently _needs_ to have more than one entry, one
> for native packages and one for everything else). For example, my
> SSTATE_MIRRORS looks like this now:
> 
> SSTATE_MIRRORS ?= "\
> file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1
> \n \
> file://(.*) ftp://10.237.112.100/sstate-cache/\1 \n \
> "
> (the first line is needed for native packages, the second one for everything
> else).
> 
> With this in mind, the file selection dialog is no longer an option IMO. The
> easy way to fix this is to let the user enter the content of SSTATE_MIRROS
> manually, without any dialogs. If we want to get more user-friendly,
> SSTATE_MIRRORS should probably get its own dialog that would have a list
> with the current SSTATE_MIRRORS entries and buttons for "Add new URL", "Add
> new local dir", "Remove entry". But note that the user-friendly part is
> further complicated by the contents of SSTATE_MIRRORS. Take for example the
> first part of SSTATE_MIRRORS above:
> 
> file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1
> 
> Note that this is actually a regexp (the '\1' at the end takes its value
> from the '(.*)' after the file:// URL). This is a very flexible mechanism
> and unfortunately quite hard to capture in a GUI. 
> In conclusion, I'd make SSTATE_MIRRORS a simple text entry widget, without
> any associated file selection dialog and let the user have full control over
> it. Validating its contents might be yet another challenge, due to the issue
> explained above.
> There are some good news too: the fix for the original bug (SSTATE_MIRRORS
> not reflected in the GUI) should be quite easy :)
Comment 10 Bogdan Marinescu 2012-09-12 09:01:42 UTC
Hi Belen,

I talked to Paul and apparently adding PATH doesn't really work. However, I made a few more tests and it turns out that it is actually possible to use SSTATE_MIRRORS with a single line like the one below:

SSTATE_MIRRORS ?= "file://(.*) ftp://10.237.112.100/sstate-cache/\1"

So we're back to where we started. Personally though, I agree with Cristiana's comments. It seems a bit weird to use a "browse files" GUI button for a text entry element that can hold arbitrary URLs. I'd still leave the text entry element as-is, without any additional button and let the user edit it manually, with some old-fashioned typing :)

Thanks,
Bogdan

(In reply to comment #9)
> Hi Bogdan,
> 
> Thanks for the information. I am a bit confused now: just had a brief chat
> with Paul E about this, and he believes that you don't need two entries. You
> just need to add 'PATH' to the SSTATE_MIRRORS URL and that will append the
> appropriate distro-specific path for native recipes. 
> 
> If the above is correct, we should probably add 'PATH' to the URL entered in
> the SSTATE_MIRROR field behind the scenes. We would then use the info icon
> to explain that mirrors must have the correct directory structure, and point
> users to the section of the manual where they can find more information
> about this. 
> 
> Before I run away to redesign the Settings dialogue, maybe we should confirm
> Paul's comments. What do you think?
> 
> Cheers
> 
> Belen
> 
> 
> 
> (In reply to comment #7)
> > Hi Belen,
> > 
> > (In reply to comment #3)
> > > Hi Cristiana,
> > > 
> > > You are right: it needs to be a valid URL. But it can be a URL pointing to a
> > > local or remote resource. The easiest way of inputting a local resource is
> > > using a file selection dialog, and that's why the interface is the way it
> > > is.
> > 
> > I understand your comments, but unfortunately I don't think this is enough.
> > The main problem is that SSTATE_MIRRORS can have more than one entry (and
> > with the last changes it apparently _needs_ to have more than one entry, one
> > for native packages and one for everything else). For example, my
> > SSTATE_MIRRORS looks like this now:
> > 
> > SSTATE_MIRRORS ?= "\
> > file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1
> > \n \
> > file://(.*) ftp://10.237.112.100/sstate-cache/\1 \n \
> > "
> > (the first line is needed for native packages, the second one for everything
> > else).
> > 
> > With this in mind, the file selection dialog is no longer an option IMO. The
> > easy way to fix this is to let the user enter the content of SSTATE_MIRROS
> > manually, without any dialogs. If we want to get more user-friendly,
> > SSTATE_MIRRORS should probably get its own dialog that would have a list
> > with the current SSTATE_MIRRORS entries and buttons for "Add new URL", "Add
> > new local dir", "Remove entry". But note that the user-friendly part is
> > further complicated by the contents of SSTATE_MIRRORS. Take for example the
> > first part of SSTATE_MIRRORS above:
> > 
> > file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1
> > 
> > Note that this is actually a regexp (the '\1' at the end takes its value
> > from the '(.*)' after the file:// URL). This is a very flexible mechanism
> > and unfortunately quite hard to capture in a GUI. 
> > In conclusion, I'd make SSTATE_MIRRORS a simple text entry widget, without
> > any associated file selection dialog and let the user have full control over
> > it. Validating its contents might be yet another challenge, due to the issue
> > explained above.
> > There are some good news too: the fix for the original bug (SSTATE_MIRRORS
> > not reflected in the GUI) should be quite easy :)
Comment 11 Belen Barros Pena 2012-09-12 12:06:52 UTC
Ah, the proverbial circle ;) Don't worry: we go around all the time. 

Apparently, PATH does work for the same reason your single line solution works. But I'll let you discuss that with Paul. 

I'd like to find a way of presenting the mirrors that helps users enter the right input in the right format. This might require something a bit more sophisticated than a simple text input field (we can always fall back to that). 

It might take a little longer than I thought, but I'll try to send you some mockups today and we can then discuss if they would work. 

In the meantime, I've changed the status of the bug to NEEDINFO.

Belen

(In reply to comment #10)
> Hi Belen,
> 
> I talked to Paul and apparently adding PATH doesn't really work. However, I
> made a few more tests and it turns out that it is actually possible to use
> SSTATE_MIRRORS with a single line like the one below:
> 
> SSTATE_MIRRORS ?= "file://(.*) ftp://10.237.112.100/sstate-cache/\1"
> 
> So we're back to where we started. Personally though, I agree with
> Cristiana's comments. It seems a bit weird to use a "browse files" GUI
> button for a text entry element that can hold arbitrary URLs. I'd still
> leave the text entry element as-is, without any additional button and let
> the user edit it manually, with some old-fashioned typing :)
> 
> Thanks,
> Bogdan
> 
> (In reply to comment #9)
> > Hi Bogdan,
> > 
> > Thanks for the information. I am a bit confused now: just had a brief chat
> > with Paul E about this, and he believes that you don't need two entries. You
> > just need to add 'PATH' to the SSTATE_MIRRORS URL and that will append the
> > appropriate distro-specific path for native recipes. 
> > 
> > If the above is correct, we should probably add 'PATH' to the URL entered in
> > the SSTATE_MIRROR field behind the scenes. We would then use the info icon
> > to explain that mirrors must have the correct directory structure, and point
> > users to the section of the manual where they can find more information
> > about this. 
> > 
> > Before I run away to redesign the Settings dialogue, maybe we should confirm
> > Paul's comments. What do you think?
> > 
> > Cheers
> > 
> > Belen
> > 
> > 
> > 
> > (In reply to comment #7)
> > > Hi Belen,
> > > 
> > > (In reply to comment #3)
> > > > Hi Cristiana,
> > > > 
> > > > You are right: it needs to be a valid URL. But it can be a URL pointing to a
> > > > local or remote resource. The easiest way of inputting a local resource is
> > > > using a file selection dialog, and that's why the interface is the way it
> > > > is.
> > > 
> > > I understand your comments, but unfortunately I don't think this is enough.
> > > The main problem is that SSTATE_MIRRORS can have more than one entry (and
> > > with the last changes it apparently _needs_ to have more than one entry, one
> > > for native packages and one for everything else). For example, my
> > > SSTATE_MIRRORS looks like this now:
> > > 
> > > SSTATE_MIRRORS ?= "\
> > > file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1
> > > \n \
> > > file://(.*) ftp://10.237.112.100/sstate-cache/\1 \n \
> > > "
> > > (the first line is needed for native packages, the second one for everything
> > > else).
> > > 
> > > With this in mind, the file selection dialog is no longer an option IMO. The
> > > easy way to fix this is to let the user enter the content of SSTATE_MIRROS
> > > manually, without any dialogs. If we want to get more user-friendly,
> > > SSTATE_MIRRORS should probably get its own dialog that would have a list
> > > with the current SSTATE_MIRRORS entries and buttons for "Add new URL", "Add
> > > new local dir", "Remove entry". But note that the user-friendly part is
> > > further complicated by the contents of SSTATE_MIRRORS. Take for example the
> > > first part of SSTATE_MIRRORS above:
> > > 
> > > file://Ubuntu-12.04/(.*) ftp://10.237.112.100/sstate-cache/Ubuntu-12.04/\1
> > > 
> > > Note that this is actually a regexp (the '\1' at the end takes its value
> > > from the '(.*)' after the file:// URL). This is a very flexible mechanism
> > > and unfortunately quite hard to capture in a GUI. 
> > > In conclusion, I'd make SSTATE_MIRRORS a simple text entry widget, without
> > > any associated file selection dialog and let the user have full control over
> > > it. Validating its contents might be yet another challenge, due to the issue
> > > explained above.
> > > There are some good news too: the fix for the original bug (SSTATE_MIRRORS
> > > not reflected in the GUI) should be quite easy :)
Comment 12 Belen Barros Pena 2012-09-12 16:50:39 UTC
Created attachment 789 [details]
shared_state_tab.pdf

Have a look to the 'shared_state_tab.pdf' document I've attached, although it might make no sense or be too much effort. 

In any case, let me know what you think.

Belen
Comment 13 Cristiana Voicu 2012-09-13 07:34:25 UTC
Hello Belen,

The tab looks ok, but I think we don't need "Test" button. I will start to implement it.

Cristiana

(In reply to comment #12)
> Created attachment 789 [details]
> shared_state_tab.pdf
> 
> Have a look to the 'shared_state_tab.pdf' document I've attached, although
> it might make no sense or be too much effort. 
> 
> In any case, let me know what you think.
> 
> Belen
Comment 14 Belen Barros Pena 2012-09-13 15:51:42 UTC
Created attachment 803 [details]
shared_state_tab.pdf

Thanks, Cristiana. I am fine with not implementing the 'test' functionality. Paul wasn't very happy with how the 'Delete' and 'Add another mirror' buttons were handled, so I've updated the design to use inactive states instead (see shared_state_tab.pdf).

If you have any questions during the implementation, let me know.

Cheers

Belen
Comment 15 Belen Barros Pena 2012-09-14 15:31:24 UTC
Created attachment 811 [details]
shared_state_tab.pdf

Hi Cristiana,

I've updated the design document. No major changes: just the reset button for the shared state directory and the content of the information bubble. 

If there is anything missing or have any questions, let me know.

Belen
Comment 16 Cristiana Voicu 2012-09-17 11:14:19 UTC
I've tried to make a commit, but I received many conflicts. Waiting the patch for bug 3117 to be merged, and then to make the changes.
Comment 17 Belen Barros Pena 2012-09-18 08:59:57 UTC
Hi Cristiana,

In the meantime, do you think I could have a look at the fix in your branch? Could you point me to it?

Thanks!!

Belen

(In reply to comment #16)
> I've tried to make a commit, but I received many conflicts. Waiting the
> patch for bug 3117 to be merged, and then to make the changes.
Comment 18 Cristiana Voicu 2012-09-18 09:16:06 UTC
Hi Belen,

After I have made a git pull, I found that I have a lot of conflicts. I kept only a git diff result to know what I have to add/modifiy. I don't have it in another branch, but after settings button will works, I will fix this fast. I'm sorry.

Cristiana


(In reply to comment #17)
> Hi Cristiana,
> 
> In the meantime, do you think I could have a look at the fix in your branch?
> Could you point me to it?
> 
> Thanks!!
> 
> Belen
> 
> (In reply to comment #16)
> > I've tried to make a commit, but I received many conflicts. Waiting the
> > patch for bug 3117 to be merged, and then to make the changes.
Comment 19 Cristiana Voicu 2012-09-24 15:04:36 UTC
Created attachment 836 [details]
setting shared state tab

This is an image with Shared state tab. I thought it will be better to make "add mirror" button like the others from "Others" tab. Belen what do you think?
Comment 20 Cristiana Voicu 2012-09-28 07:37:49 UTC
patch merged to master
Comment 21 Belen Barros Pena 2012-09-28 11:02:03 UTC
verified