Merge lp:~lamont/maas/xenial-has-released into lp:~maas-committers/maas/trunk

Proposed by LaMont Jones
Status: Rejected
Rejected by: Mike Pontillo
Proposed branch: lp:~lamont/maas/xenial-has-released
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 114 lines (+25/-23)
2 files modified
src/provisioningserver/drivers/osystem/tests/test_ubuntu.py (+10/-11)
src/provisioningserver/drivers/osystem/ubuntu.py (+15/-12)
To merge this branch: bzr merge lp:~lamont/maas/xenial-has-released
Reviewer Review Type Date Requested Status
Lee Trager (community) Needs Information
Andres Rodriguez (community) Disapprove
Review via email: mp+320739@code.launchpad.net

Commit message

Xenial has released. Drop the old code from before it did.

Description of the change

Xenial has released. Drop the old code from before it did.

To post a comment you must log in.
Revision history for this message
Lee Trager (ltrager) wrote :

Thanks for cleaning that up!

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) wrote :

We are hardcoding this for a reason. This is to prevent that the next LTS release cause the same issues as it caused when Xenial was out.

review: Disapprove
Revision history for this message
LaMont Jones (lamont) wrote :

> We are hardcoding this for a reason. This is to prevent that the next LTS
> release cause the same issues as it caused when Xenial was out.

The code being removed literally says "if trusty is the current LTS, that's a lie, it's xenial" -- that situation will not reoccur for at least 26 years, and requires that we be silly enough to reuse both "trusty" and "xenial"....

If we want to keep the code, it should probably turn into something that says "use the current devel release if it's LTS" -- that would need a prod vs dev switch, but is very doable. (the new release gets added to distro-info shortly after it opens, and we'd just need to see that devel opened and that it's an LTS.)

Revision history for this message
LaMont Jones (lamont) wrote :

> > We are hardcoding this for a reason. This is to prevent that the next LTS
> > release cause the same issues as it caused when Xenial was out.
>
> The code being removed literally says "if trusty is the current LTS, that's a
> lie, it's xenial" -- that situation will not reoccur for at least 26 years,
> and requires that we be silly enough to reuse both "trusty" and "xenial"....
>
> If we want to keep the code, it should probably turn into something that says
> "use the current devel release if it's LTS" -- that would need a prod vs dev
> switch, but is very doable. (the new release gets added to distro-info shortly
> after it opens, and we'd just need to see that devel opened and that it's an
> LTS.)

Also, it's trivial for devs to override the LTS release name in the database. (Which I did for a while when I was using yakkety to test ipv6, because we had the packages there, but not in xenial yet.)

lp:~lamont/maas/xenial-has-released updated
5838. By LaMont Jones

Choose our LTS for commissioning based on a date which has an LTS we know we
support, since each LTS of Ubuntu has a potential for breaking MAAS (python
version changes, etc). (xenial release broke MAAS 1.x, and we expect that the
next LTS is likely to break MAAS 2.x.)

5839. By LaMont Jones

Do not support commissioning on a release if that release is no longer supported by Ubuntu.

Revision history for this message
Lee Trager (ltrager) wrote :

MAAS looks up what the latest LTS is using the DistroInfo library. This library contains a list of all released Ubuntu and Debian releases. For 2.0 we wanted to test Xenial as the default before it was released so I hard coded it in. This does not lock us to Xenial, it simply says if DistroInfo thinks the latest release is Trusty, use Xenial.

It looks like we're going to hardcode Xenial so even when 18.04 comes out Xenial will be used, I'm fine with that just two questions below.

review: Needs Information
Revision history for this message
LaMont Jones (lamont) wrote :

Ultimately, it's Andres' call, but I think it's a conscious decision on our part in the 18.04 cycle to say "yes, when it comes out, maas will support it", rather than blithely running our installed base into the crusher.

I think I do still need to rework it for that case, so that we can set maas_lts_date into the future, and have it not take effect until that date (that is, we look at the earlier date of "now" and "maas_lts_date".)

Andres?

Revision history for this message
Mike Pontillo (mpontillo) wrote :

I think the safest thing to do (and this is oversimplifying) is:

    return 'xenial';

Why? Because we have no way of knowing whether or not our commissioning scripts will work on any other LTS. They're only well-tested on Xenial. When the next LTS arrives, along with it will come a version of MAAS that has been tested with LTS-next. At which time we would re-test our commissioning scripts with LTS-next and change the hard-coded release.

When LTS-next arrives, current MAAS 2.2 users might break if we suddenly change commissioning to use LTS-next.

We should have a way to override this so that we can CI-test commissioning with development releases.

Unmerged revisions

5839. By LaMont Jones

Do not support commissioning on a release if that release is no longer supported by Ubuntu.

5838. By LaMont Jones

Choose our LTS for commissioning based on a date which has an LTS we know we
support, since each LTS of Ubuntu has a potential for breaking MAAS (python
version changes, etc). (xenial release broke MAAS 1.x, and we expect that the
next LTS is likely to break MAAS 2.x.)

5837. By LaMont Jones

Remove some dead code.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/provisioningserver/drivers/osystem/tests/test_ubuntu.py'
--- src/provisioningserver/drivers/osystem/tests/test_ubuntu.py 2016-07-06 05:37:58 +0000
+++ src/provisioningserver/drivers/osystem/tests/test_ubuntu.py 2017-03-23 17:21:39 +0000
@@ -13,18 +13,17 @@
13from maastesting.factory import factory13from maastesting.factory import factory
14from maastesting.testcase import MAASTestCase14from maastesting.testcase import MAASTestCase
15from provisioningserver.drivers.osystem import BOOT_IMAGE_PURPOSE15from provisioningserver.drivers.osystem import BOOT_IMAGE_PURPOSE
16from provisioningserver.drivers.osystem.ubuntu import UbuntuOS16from provisioningserver.drivers.osystem.ubuntu import (
17 maas_lts_date,
18 UbuntuOS,
19)
1720
1821
19class TestUbuntuOS(MAASTestCase):22class TestUbuntuOS(MAASTestCase):
2023
21 def get_lts_release(self):24 def get_lts_release(self):
22 # XXX ltrager 2016-04-06 - python3-distro-info won't set the latest lts25 # The LTS release is hardcoded for a version of maas by date.
23 # to Xenial until its been released. So we can start testing MAAS 2.026 return UbuntuDistroInfo().lts(maas_lts_date)
24 # with Xenial by default override it here. Once Xenial is released this
25 # can be removed
26 # return UbuntuDistroInfo().lts()
27 return "xenial"
2827
29 def get_release_title(self, release):28 def get_release_title(self, release):
30 info = UbuntuDistroInfo()29 info = UbuntuDistroInfo()
@@ -53,8 +52,8 @@
5352
54 def test_get_default_release(self):53 def test_get_default_release(self):
55 osystem = UbuntuOS()54 osystem = UbuntuOS()
56 expected = osystem.get_default_release()55 actual = osystem.get_default_release()
57 self.assertEqual(expected, self.get_lts_release())56 self.assertEqual(actual, self.get_lts_release())
5857
59 def test_get_supported_commissioning_releases(self):58 def test_get_supported_commissioning_releases(self):
60 self.patch_autospec(UbuntuDistroInfo, "is_lts").return_value = True59 self.patch_autospec(UbuntuDistroInfo, "is_lts").return_value = True
@@ -111,8 +110,8 @@
111110
112 def test_default_commissioning_release(self):111 def test_default_commissioning_release(self):
113 osystem = UbuntuOS()112 osystem = UbuntuOS()
114 expected = osystem.get_default_commissioning_release()113 actual = osystem.get_default_commissioning_release()
115 self.assertEqual(expected, self.get_lts_release())114 self.assertEqual(actual, self.get_lts_release())
116115
117 def test_get_release_title(self):116 def test_get_release_title(self):
118 osystem = UbuntuOS()117 osystem = UbuntuOS()
119118
=== modified file 'src/provisioningserver/drivers/osystem/ubuntu.py'
--- src/provisioningserver/drivers/osystem/ubuntu.py 2016-07-06 05:37:58 +0000
+++ src/provisioningserver/drivers/osystem/ubuntu.py 2017-03-23 17:21:39 +0000
@@ -4,11 +4,13 @@
4"""Ubuntu Operating System."""4"""Ubuntu Operating System."""
55
6__all__ = [6__all__ = [
7 "maas_lts_date",
7 "UbuntuOS",8 "UbuntuOS",
8 ]9 ]
910
10import os11import os
1112
13from datetime import date
12from distro_info import UbuntuDistroInfo14from distro_info import UbuntuDistroInfo
13from provisioningserver.config import ClusterConfiguration15from provisioningserver.config import ClusterConfiguration
14from provisioningserver.drivers.osystem import (16from provisioningserver.drivers.osystem import (
@@ -16,6 +18,9 @@
16 OperatingSystem,18 OperatingSystem,
17)19)
1820
21# The last LTS maas 2.x supports for commissioning is xenial.
22maas_lts_date = date(2016, 4, 30)
23
1924
20class UbuntuOS(OperatingSystem):25class UbuntuOS(OperatingSystem):
21 """Ubuntu operating system."""26 """Ubuntu operating system."""
@@ -42,15 +47,8 @@
4247
43 def get_lts_release(self):48 def get_lts_release(self):
44 """Return the latest Ubuntu LTS release."""49 """Return the latest Ubuntu LTS release."""
45 lts_release = self.ubuntu_distro_info.lts()50 lts_release = self.ubuntu_distro_info.lts(maas_lts_date)
46 # XXX ltrager 2016-04-06 - python3-distro-info won't set the latest lts51 return lts_release
47 # to Xenial until its been released. So we can start testing MAAS 2.0
48 # with Xenial by default override it here. Once Xenial is released this
49 # can be removed
50 if lts_release == "trusty":
51 return "xenial"
52 else:
53 return lts_release
5452
55 def get_default_release(self):53 def get_default_release(self):
56 """Gets the default release to use when a release is not54 """Gets the default release to use when a release is not
@@ -63,9 +61,14 @@
63 system that supports commissioning.61 system that supports commissioning.
64 """62 """
65 unsupported_releases = ['precise']63 unsupported_releases = ['precise']
66 return [name for name in self.ubuntu_distro_info.supported()64 # Return the list of still-supported lts releases that were supported
67 if name not in unsupported_releases65 # on maas_lts_date.
68 if self.ubuntu_distro_info.is_lts(name)]66 return [
67 name
68 for name in self.ubuntu_distro_info.supported(maas_lts_date)
69 if name not in unsupported_releases
70 if self.ubuntu_distro_info.is_lts(name)
71 if name in self.ubuntu_distro_info.supported()]
6972
70 def get_default_commissioning_release(self):73 def get_default_commissioning_release(self):
71 """Gets the default commissioning release for Ubuntu. This only exists74 """Gets the default commissioning release for Ubuntu. This only exists