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

Ubuntu/eoan #397

Merged
merged 170 commits into from
May 28, 2020
Merged

Ubuntu/eoan #397

merged 170 commits into from
May 28, 2020

Conversation

blackboxsw
Copy link
Collaborator

One minor patch to apply prior to the new-upstream-snapshot to drop python3-nose and python3-unittest2

diff --git a/debian/changelog b/debian/changelog
index 75ead644..da6e7943 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 cloud-init (19.4-33-gbb4131a2-0ubuntu1~19.10.2) UNRELEASED; urgency=medium
 
   * d/control: drop pyflakes from Build-Depends
+  * d/control: drop python3-nose and python3-unittest2 from Build-Depends
+    - upstream uses pytest
   * d/control: add python3-pytest to Build-Depends
     - This fixes upstream daily builds.  python3-nose is not removed from
       Build-Depends because, currently, the Ubuntu package builds will still
diff --git a/debian/control b/debian/control
index 92d839bc..ec16a912 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,6 @@ Build-Depends: debhelper (>= 9.20160709),
                python3-jsonpatch,
                python3-jsonschema,
                python3-mock,
-               python3-nose,
                python3-oauthlib,
                python3-pep8,
                python3-pyflakes,
@@ -23,7 +22,6 @@ Build-Depends: debhelper (>= 9.20160709),
                python3-serial,
                python3-setuptools,
                python3-six,
-               python3-unittest2,
                python3-yaml
 XS-Python-Version: all
 Vcs-Browser: https://git.launchpad.net/cloud-init/?h=ubuntu/devel

To generate branch:

patch -p1 < eoan.patch
git commit -m 'd/control: drop python3-nose and python3-unittest2 from build-depends' debian/control
git commit -m 'update changelog to drop python3-nose and python3-unittest2' debian/changelog

new-upstream-snapshot 8377897b   # for release into ubuntu/eoan

sed -i -e "1s/UNRELEASED/eoan/" debian/changelog
git commit -m "releasing cloud-init version 20.2-38-g8377897b-0ubuntu1~19.10.1" debian/changelog
git tag ubuntu/20.2-38-g8377897b-0ubuntu1_19.10.1

To validate branch:

git diff # against blackboxsw/ubuntu/eoan  to see just author diffs in debian/changelog
make deb
build-package

raharper and others added 30 commits January 16, 2020 12:29
* Ensure util.get_architecture() runs only once

util.get_architecture() recently was wrapped using python3's lru_cache()
which will cache the result so we only invoke 'dpkg --print-architecture'
once.  In practice, cloud-init.log will show multiple invocations of the
command.  The source of this was that the debian Distro object implements
the get_primary_arch() with this command, but it was not calling it from
util, but issuing a util.subp() directly.  This branch also updates
cc_apt_configure methods to fetch the arch value from the distro class,
and then ensure that the methods apt_configure calls pass the arch value
around.

* utils: remove lsb_release and get_architecture wrappers

The original lsb_release wrapper was used to prevent polluting the
single value we cached, however lru_cache() already handles this
case by using args, kwargs values to cache different calls to the
method.

* rename_apt_list: use all positional parameters
This makes it clearer that we should only use this in code paths that
will definitely have dpkg available to them.

- Rename get_architecture -> get_dpkg_architecture
- Add docstring to get_dpkg_architecture
Co-Authored-By: Daniel Watkins <daniel@daniel-watkins.co.uk>
* url_helper: drop six

* url_helper: sort imports

* log: drop six

* log: sort imports

* handlers/__init__: drop six

* handlers/__init__: sort imports

* user_data: drop six

* user_data: sort imports

* sources/__init__: drop six

* sources/__init__: sort imports

* DataSourceOVF: drop six

* DataSourceOVF: sort imports

* sources/helpers/openstack: drop six

* sources/helpers/openstack: sort imports

* mergers/m_str: drop six

This also allowed simplification of the logic, as we will never
encounter a non-string text type.

* type_utils: drop six

* mergers/m_dict: drop six

* mergers/m_list: drop six

* cmd/query: drop six

* mergers/__init__: drop six

* net/cmdline: drop six

* reporting/handlers: drop six

* reporting/handlers: sort imports
…efault (canonical#180)

doc-requirements.txt: pin Sphinx at version used by RTD

Introduce a configuration file containing our existing web-based configuration.
This should ensure that all its dependencies are installed during doc
generation.

LP: #1860450
When creating a swap file on an xfs filesystem, fallocate cannot be used.
Doing so results in failure of swapon and a message like:
 swapon: swapfile has holes

The solution here is to maintain a list (currently containing only XFS)
of filesystems where fallocate cannot be used. The, on those fileystems
use the slower but functional 'dd' method.

Signed-off-by: Eduardo Otubo <otubo@redhat.com>
Co-authored-by: Adam Dobrawy <naczelnik@jawnosc.tk>
Co-authored-by:  Scott Moser <smoser@brickies.net>
Co-authored-by: Daniel Watkins <daniel@daniel-watkins.co.uk>

LP: #1781781
We only run on Python 3 now, so we can unambiguously expect
unittest.mock to exist.
Increasing the bits of security from 52 to 115.

LP: #1860795
* packages/brpm: switch to python3

No changes needed other than changing the shebang interpreter.

* pkg-deps.json: bump the redhat build dependencies to python36

CentOS 7 (our standard target for the COPR test builds) uses python3.6
as its default python3 interpreter, so let's bump the build dependencies
accordingly.
Drop support for specifying an Python interpreter different from python3
from tools/run-container.
Make sure network_config is created when self._network_config is unset.

Co-authored-by: Scott Moser <smoser@brickies.net>
* cloudinit: replace "import mock" with "from unittest import mock"

* test-requirements.txt: drop mock

Co-authored-by: Chad Smith <chad.smith@canonical.com>
It is proto 'none', not 'static' as was mistakenly implemented in
initramfs-tools/cloud-init in the past, yet was never the case in the
klibc ipconfig state file output.

LP: #1861412
…onical#162)

- Introduce the "flavor" configuration option for the sysconfig renderer
  this is necessary to account for differences in the handling of the
  BOOTPROTO setting between distributions (lp#1858808)
  + Thanks to Petr Pavlu for the idea
- Network config clean up for sysconfig renderer
  + The introduction of the "flavor" renderer configuration allows us
    to only write values that are pertinent for the given distro
- Set the DHCPv6 client mode on SUSE (lp#1800854)

Co-authored-by: Chad Smith <chad.smith@canonical.com>

LP: #1800854
fixes typo at doc/examples/cloud-config-disk-setup.txt; Cavaut => Caveat
The azurecloud platform did not always start instances
during collect runs.  This was a result of two issues. First
the image class _instance method did not invoke the start()
method which then allowed collect stage to attempt to run
scripts without an endpoint.  Second, azurecloud used the
image_id as both an instance handle (which is typically
vmName in azure api) as well as an image handle (for image
capture).  Resolve this by adding a .vm_name property to
the AzureCloudInstance and reference this property in
AzureCloudImage.

Also in this branch

- Fix error encoding user-data when value is None
- Add additional logging in AzureCloud platform
- Update logging format to print pathname,funcName and line number
  This greatly eases debugging.

LP: #1861921
As noticed by Seth Arnold, non-deterministic SystemRandom should be
used when creating security sensitive random strings.
OddBloke and others added 25 commits May 11, 2020 17:21
canonical#343)

And raise TypeError when subp called with no args, which more accurately mirrors normal behaviour:

>>> from cloudinit.util import subp
>>> subp()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: subp() missing 1 required positional argument: 'args'
Create a schema object for the `apt_configure` module and
validate this schema in the `handle`  function of the module.

There are some considerations regarding this PR:

* The `primary` and `security` keys have the exact same properties. I
  tried to eliminate this redundancy by moving their properties to a
  common place and then just referencing it for both security and
  primary. Similar to what is documented here:
    https://json-schema.org/understanding-json-schema/structuring.html
  under the `Reuse` paragraph.  However, this approach does not work,
  because the `#` pointer goes to the beginning of the file, which is
  a python module instead of a json file, not allowing the pointer to
  find the correct definition. What I did was to create a separate dict
  for the mirror config and reuse it for primary and security, but
  maybe there are better approaches to do that.
* There was no documentation for the config `debconf_selections`. I
  tried to infer what it supposed to do by looking at the code and the
  `debconf-set-selections`  manpage, but my description may not be
  accurate or complete.
* Add a _parse_description function to schema.py to render multi-line
  preformatted content instead of squashing all whitespace

LP: #1858884
This ensures that Travis will not kill our tests if fetching images is
taking a long time.

In implementation terms, this introduces a context manager which will
spin up a multiprocessing.Process in the background and print a dot to
stdout every 10 seconds.  The process is terminated when the context
manager exits.

This also drop the use of travis_wait, which was being used to work
around this issue.
We recently discovered that pylint is failing to report some errors when
invoked across our entire codebase (see
pylint-dev/pylint#3611).  I've run pylint across
every Python file under cloudinit/[0], and this commit fixes the issues
so-discovered.

[0] find cloudinit/ -name "*.py" | xargs -n 1 -t .tox/pylint/bin/python -m pylint
…#368)

We are longer using lxd.readthedocs.io

Signed-off-by: Thomas Parrott thomas.parrott@canonical.com
and slower.
and since we're making it slower, let's cache it, in case boottime gets
called more than once.
Specifically, ensure that given values are either strings, or arrays of strings.
This allows tests to be configured to permit some commands to be run via
util.subp, while still rejecting any unexpected calls.  See the
documentation for further details.
…cal#370)

And add an example of providing a list of assertions.
)

Hopefully this will save some ~pointless round trips on CLA PRs.
These config management things work on BSD, they also claim to work on all distros, so enabling them!

LP: #1880279
@raharper
Copy link
Collaborator

I think you forgot to push your last commit, so we don't have a clean diff

(crispyboi) cloud-init % git diff blackboxsw/ubuntu/eoan HEAD 
diff --git a/debian/changelog b/debian/changelog
index 87cae1d2..cd5cbcc0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 cloud-init (20.2-38-g8377897b-0ubuntu1~19.10.1) eoan; urgency=medium
 
   * d/control: drop pyflakes from Build-Depends
+  * d/control: drop python3-nose and python3-unittest2 from Build-Depends
+    - upstream uses pytest
   * d/control: add python3-pytest to Build-Depends
     - This fixes upstream daily builds.  python3-nose is not removed from
       Build-Depends because, currently, the Ubuntu package builds will still
@@ -194,7 +196,7 @@ cloud-init (20.2-38-g8377897b-0ubuntu1~19.10.1) eoan; urgency=medium
     - util: rename get_architecture to get_dpkg_architecture (#173)
     - Ensure util.get_architecture() runs only once (#172)
 
- -- Chad Smith <chad.smith@canonical.com>  Wed, 27 May 2020 17:47:16 -0600
+ -- Ryan Harper <ryan.harper@canonical.com>  Thu, 28 May 2020 15:21:15 -0500
 
 cloud-init (19.4-33-gbb4131a2-0ubuntu1~19.10.1) eoan; urgency=medium
 
diff --git a/debian/control b/debian/control
index 92d839bc..ec16a912 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,6 @@ Build-Depends: debhelper (>= 9.20160709),
                python3-jsonpatch,
                python3-jsonschema,
                python3-mock,
-               python3-nose,
                python3-oauthlib,
                python3-pep8,
                python3-pyflakes,
@@ -23,7 +22,6 @@ Build-Depends: debhelper (>= 9.20160709),
                python3-serial,
                python3-setuptools,
                python3-six,
-               python3-unittest2,
                python3-yaml
 XS-Python-Version: all
 Vcs-Browser: https://git.launchpad.net/cloud-init/?h=ubuntu/devel

@raharper
Copy link
Collaborator

OK, looks good now

(crispyboi) cloud-init % git fetch blackboxsw 
X11 forwarding request failed on channel 0
remote: Enumerating objects: 34, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 34 (delta 22), reused 34 (delta 22), pack-reused 0
Unpacking objects: 100% (34/34), 12.59 KiB | 238.00 KiB/s, done.
From github.com:blackboxsw/cloud-init
 + 115b2fd4...aada794e ubuntu/eoan  -> blackboxsw/ubuntu/eoan  (forced update)
 + 76efc72e...28af966c ubuntu/focal -> blackboxsw/ubuntu/focal  (forced update)
(crispyboi) cloud-init % git diff blackboxsw/ubuntu/eoan HEAD 
diff --git a/debian/changelog b/debian/changelog
index af5bc388..cd5cbcc0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -196,7 +196,7 @@ cloud-init (20.2-38-g8377897b-0ubuntu1~19.10.1) eoan; urgency=medium
     - util: rename get_architecture to get_dpkg_architecture (#173)
     - Ensure util.get_architecture() runs only once (#172)
 
- -- Chad Smith <chad.smith@canonical.com>  Wed, 27 May 2020 19:07:03 -0600
+ -- Ryan Harper <ryan.harper@canonical.com>  Thu, 28 May 2020 15:21:15 -0500
 
 cloud-init (19.4-33-gbb4131a2-0ubuntu1~19.10.1) eoan; urgency=medium

@blackboxsw blackboxsw merged commit aada794 into canonical:ubuntu/eoan May 28, 2020
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