Merge lp://staging/~boyang-niu/maas/enable_custom_images into lp://staging/~maas-committers/maas/trunk

Proposed by Boyang Niu
Status: Superseded
Proposed branch: lp://staging/~boyang-niu/maas/enable_custom_images
Merge into: lp://staging/~maas-committers/maas/trunk
Diff against target: 865 lines (+401/-48)
16 files modified
src/maasserver/forms.py (+84/-12)
src/maasserver/forms_settings.py (+13/-10)
src/maasserver/models/bootimage.py (+40/-5)
src/maasserver/models/config.py (+2/-3)
src/maasserver/models/node.py (+3/-4)
src/maasserver/templates/maasserver/boot_image_confirm_delete.html (+23/-0)
src/maasserver/templates/maasserver/bootimage.html (+26/-0)
src/maasserver/templates/maasserver/settings.html (+4/-0)
src/maasserver/templates/maasserver/settings_boot_images.html (+37/-0)
src/maasserver/tests/test_forms.py (+59/-0)
src/maasserver/urls.py (+7/-0)
src/maasserver/views/settings.py (+82/-0)
src/maasserver/views/settings_clusters.py (+1/-1)
src/provisioningserver/pxe/config.py (+9/-6)
src/provisioningserver/pxe/tests/test_config.py (+10/-6)
src/provisioningserver/tests/test_tftp.py (+1/-1)
To merge this branch: bzr merge lp://staging/~boyang-niu/maas/enable_custom_images
Reviewer Review Type Date Requested Status
Julian Edwards (community) Needs Resubmitting
Review via email: mp+169074@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2013-07-09.

Commit message

Enabled custom images during installation and commissioning.

Description of the change

Users are now able to put custom images into /var/lib/maas/tftp/[arch]/[subarch]/[purpose]/[release], where [release] holds their own kernel and initrd. gen_pxe_template_filenames in provisioningserver/config.py uses the release in attempting to find installable images. In addition, commissioning and install templates also have the option to use the release name appended to the end in order to add kernel options to custom images.

In maasserver/enum.py, DISTRO_SERIES is automated and searches through the tftp_root to look for any releases that are available. It then zips the folder name into the enum. Before, this was hardcoded as the three ubuntu release names and matched with the folder names in tftp_root.

To post a comment you must log in.
1523. By Raphaël Badin

[r=allenap][bug=1190536][author=rvb] Cope with 'Email' and 'E-mail' in error message.

1524. By Raphaël Badin

[r=allenap][bug=1190528][author=rvb] Add SECRET_KEY setting to test setting.

1525. By Raphaël Badin

[r=rvb][bug=][author=rvb] Fix lint. Reformat imports.

1526. By Raphaël Badin

[r=allenap][bug=1190591][author=rvb] SimpleUploadedFile does not accept a unicode object in Django 1.5.

1527. By Raphaël Badin

[r=allenap][bug=1064777][author=rvb] Display the list of IP addresses for a node in the UI.

1528. By Andres Rodriguez

[r=julian-edwards][bug=][author=andreserl] Drop list_commissioning_snippets() in setup.py in favor of using glob.

1529. By Raphaël Badin

[r=jtv][bug=1190534][author=rvb] Use XPath to test the widget's HTML code.

1530. By Raphaël Badin

[r=jtv][bug=1190962][author=rvb] Add helper to deal with the difference in how call_command() reports failure between Django 1.4 and Django 1.5.

1531. By Jeroen T. Vermeulen

[r=rvb][bug=1190530][author=jtv] Work around incompatibility in test client's put() between Django 1.4 and 1.5.

1532. By Raphaël Badin

[r=jtv][bug=1190958][author=rvb] Do not print newline if Django.VERSION >= (1.5).

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Hi there Boyang,

Thanks for your submission, this is the first community-submitted patch, congratulations!

Just a few quick pre-review comments:
 1. You have conflicts; the template stuff has changed recently so that it all moved to separate template files
 2. Your solution to auto-enumerate releases won't work in a development environment as it hard-codes the path. This is also bad because it assumes packaging knowledge of installation locations. Ultimately we want to get rid of this enum and possibly store the available distros in a new database table, which will be populated by using distro-info.
 3. All functionality needs tests and this branch has no new tests. We can help you out with that though.
 4. I'm not sure if you talked to anyone about how to approach this but ideally we'd make this driven through the UI a bit more. We need to be able to specify custom images on a per-node basis as well as this global solution. Also I think it would be better to configure additional custom image locations via the API/UI. It would also be nice to have a way of making sure the images are consistent across different clusters (but that's not strictly necessary up front).

So at the moment this can't land at least because of (1), (2) and (3). (4) is quite a lot of work so it's something that can be added later by anyone.

Also it looks like your branch is based off the 1.3 release and this MP is targeting trunk. You need to apply your revisions to a trunk-based branch instead, so I shall mark this as "resubmit" because of that.

review: Needs Resubmitting
1533. By Raphaël Badin

[r=jtv][bug=1190956][author=rvb] Use View.as_view() to transform the generic view class into a view method instead of calling dispatch() on the view class.

Revision history for this message
Boyang Niu (boyang-niu) wrote :

Julian,

Thanks for the feedback, I really appreciate the help I'm getting from
everyone!

As a possible solution to #2, could I take the TFTP root path from a config
file and use list_boot_images, as done in provisoningserver/boot_images.py
and provisioningserver/pxe/tftppath.py? This would keep the enum for the
moment but it's better than hardcoded paths (and it knows the same
information about available images as the region controller, so it enforces
certain standards).

The auto-enumerate was added in order to support per-node custom images
from the UI, since before it was impossible to select any distro other than
the hardcoded enum releases. I can implement the importing of a local file
for the custom image through UI and get it showing up on the UI menu; I'll
start working on that next.

Keep in touch!
Boyang

On Sun, Jun 16, 2013 at 10:47 PM, Julian Edwards <
<email address hidden>> wrote:

> Review: Resubmit
>
> Hi there Boyang,
>
> Thanks for your submission, this is the first community-submitted patch,
> congratulations!
>
> Just a few quick pre-review comments:
> 1. You have conflicts; the template stuff has changed recently so that it
> all moved to separate template files
> 2. Your solution to auto-enumerate releases won't work in a development
> environment as it hard-codes the path. This is also bad because it assumes
> packaging knowledge of installation locations. Ultimately we want to get
> rid of this enum and possibly store the available distros in a new database
> table, which will be populated by using distro-info.
> 3. All functionality needs tests and this branch has no new tests. We
> can help you out with that though.
> 4. I'm not sure if you talked to anyone about how to approach this but
> ideally we'd make this driven through the UI a bit more. We need to be
> able to specify custom images on a per-node basis as well as this global
> solution. Also I think it would be better to configure additional custom
> image locations via the API/UI. It would also be nice to have a way of
> making sure the images are consistent across different clusters (but that's
> not strictly necessary up front).
>
> So at the moment this can't land at least because of (1), (2) and (3).
> (4) is quite a lot of work so it's something that can be added later by
> anyone.
>
> Also it looks like your branch is based off the 1.3 release and this MP is
> targeting trunk. You need to apply your revisions to a trunk-based branch
> instead, so I shall mark this as "resubmit" because of that.
> --
>
> https://code.launchpad.net/~boyang-niu/maas/enable_custom_images/+merge/169074
> You are the owner of lp:~boyang-niu/maas/enable_custom_images.
>

1534. By Andres Rodriguez

[r=andreserl,allenap][bug=][author=andreserl] Change the way how maas_ipmi_autodetect_py is being rendered into the enlistment preseed to add indentation and not cause issues with yaml loading when being processed by cloud-init. Thanks Gaving for suggesting this.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On 18/06/13 03:58, Boyang Niu wrote:
> Julian,
>
> Thanks for the feedback, I really appreciate the help I'm getting from
> everyone!

Very welcome.

> As a possible solution to #2, could I take the TFTP root path from a config
> file and use list_boot_images, as done in provisoningserver/boot_images.py
> and provisioningserver/pxe/tftppath.py? This would keep the enum for the
> moment but it's better than hardcoded paths (and it knows the same
> information about available images as the region controller, so it enforces
> certain standards).

We had a chat about it and there's a couple of reasons why this approach
is fundamentally bad:

1. Are the files always present on the same system that needs to scan them?

2. Executing shell commands directly from the module is bad practice.
Even lint checkers will import that module, and I don't like the idea of
even "ls" running as a side effect. You can't even patch it out in a test.

> The auto-enumerate was added in order to support per-node custom images
> from the UI, since before it was impossible to select any distro other than
> the hardcoded enum releases. I can implement the importing of a local file
> for the custom image through UI and get it showing up on the UI menu; I'll
> start working on that next.

I think this is the best approach. We want to store the distro-info in
the database so that all parts of the system can access that data. The
enum should die in favour of a DB query.

Please, if you need any more help, just drop another email to the list.
 There are quite a few people who can offer advice (TZ-dependent if on
IRC) and help with UI design.

Hope that helps!

1535. By Raphaël Badin

[r=julian-edwards][bug=1054518][author=rvb] Remove duplicated distro_series field, set max_lenght to 20.

1536. By Jeroen T. Vermeulen

[r=rvb][bug=1084807][author=jtv] Warn users not to customize their MAAS-managed DHCP configuration by editing dhcpd.conf.

1537. By Gavin Panella

[r=allenap][bug=][author=allenap] Document MAAS's development philosophy.

1538. By Boyang Niu

replaced hardcoding of releases enum

1539. By Boyang Niu

merged conflicts with 1.3

1540. By Boyang Niu

Added boot image UI and file-writing support

1541. By Boyang Niu

merged from trunk

1542. By Boyang Niu

added boot image creation/deletion forms, testing for custom images, and removed usage of distro_series enum

1543. By Boyang Niu

style changes in order to make maas linter happy

1544. By Boyang Niu

changed the display name for images in form selection to be more detailed

Unmerged revisions

1544. By Boyang Niu

changed the display name for images in form selection to be more detailed

1543. By Boyang Niu

style changes in order to make maas linter happy

1542. By Boyang Niu

added boot image creation/deletion forms, testing for custom images, and removed usage of distro_series enum

1541. By Boyang Niu

merged from trunk

1540. By Boyang Niu

Added boot image UI and file-writing support

1539. By Boyang Niu

merged conflicts with 1.3

1538. By Boyang Niu

replaced hardcoding of releases enum

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.