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/devel #339

Merged
merged 109 commits into from May 13, 2020
Merged

Ubuntu/devel #339

merged 109 commits into from May 13, 2020

Conversation

blackboxsw
Copy link
Collaborator

@blackboxsw blackboxsw commented Apr 29, 2020

Release upstream 20.2 to Ubuntu devel release (Groovy Gorilla)

Steps to reproduce:

cd /tmp/
# Use uss-tableflip PR #48 (to auto-drop fix-cpick* files)
git clone git@github.com:blackboxsw/uss-tableflip.git -b tools/new-upstream-snapshot-also-drop-fix-cpick
git clone git@github.com:canonical/cloud-init.git
cd cloud-init
new-upstream-snapshot
sed -i -e "1s/UNRELEASED/groovy/" debian/changelog
git commit -m "releasing cloud-init version 20.2-20-gd10ce3ec-0ubuntu1" debian/changelog

OddBloke and others added 30 commits March 10, 2020 11:26
As the nose docs[0] themselves note, it has been in maintenance mode for the past several years. pytest is an actively developed, featureful and popular alternative that the nose docs themselves recommend. See [1] for more details about the thinking here.

(This PR also removes stale tox definitions, instead of modifying them.)

[0] https://nose.readthedocs.io/en/latest/
[1] https://lists.launchpad.net/cloud-init/msg00245.html
pyflakes versions older than 2.1.0 are incompatible with Python 3.8
(which is the Python version in the current Ubuntu development release).
See PyCQA/pyflakes#367 for details.

2.1.1 is the latest version ATM, so bump to that.
…onical#164)

Github api doesn't allow read-write access to labels or comments when
running from a pull_request fork during CI.

This restriction results in an API error
    message: "Resource not accessible by integration"

If we want to run this action per pull_request, we need to convert the
action to fail the PR status check and emit the required steps to sign the
CLA to the console on the PR's failed status tab.
Now that we can distinguish between CI xenial dependencies and
needed-to-run-on-dev-machine xenial depedencies, we can return to
testing with the correct jsonpatch version.
Instead of using the username that triggered the action (which, in the
case of a committer merging master into a PR branch will be the
committer), always use the username of the submitter of the pull
request.
Add support for the NetBSD Operating System.                                    
                                                                                
Features in this branch:                                                        
* Add BSD distro parent class from which NetBSD and FreeBSD can                 
  specialize                                                                    
* Add *bsd util functions to cloudinit.net and cloudinit.net.bsd_utils          
* subclass cloudinit.distro.freebsd.Distro from bsd.Distro                      
* Add new cloudinit.distro.netbsd and cloudinit.net.renderer for                
  netbsd                                                                        
* Add lru_cached util.is_NetBSD functions                                       
* Add NetBSD detection for ConfigDrive and NoCloud datasources                  
                                                                                
This branch has been tested with:                                               
                                                                                
- NoCloud and OpenStack (with and without config-drive)                         
- NetBSD 8.1. and 9.0                                                           
- FreeBSD 11.2 and 12.1                                                         
- Python 3.7 only, because of the dependency oncrypt.METHOD_BLOWFISH.           
  This version is available in NetBSD 7, 8 and 9 anyway
Since 94838de, CloudInit supports NetBSD
too.
…rsions (canonical#251)

This is a follow-up to canonical#144 which fixed the rendering behaviour.

While writing the tests, CI failed due to dict iteration differences across Python versions, so this also sorts output so that we will produce the same output across Python versions.
This workflow will label pull requests with "stale-pr" if they haven't
seen activity for 14 days.  It will then close them out after a further
7 days of inactivity.
Drop remaining python six usage
Quote the Ubuntu version numbers in releases.yaml to make sure they're
treated as strings and not as floats.
…ical#256)

The 'merged_cfg' key introduced in 71af48d was incorrectly referenced
to as 'ci_cfg' in the json validation test for ec2.
…nical#114)

Add support for rendering secondary static IPv4/IPv6 addresses on
any NIC attached to the machine. In order to see secondary IP
addresses in Ec2 IMDS network config, cloud-init now reads metadata
version 2018-09-24. Metadata services which do not support the Ec2
API version will not get secondary IP addresses configured.

In order to discover secondary IP address config, cloud-init now
relies on metadata API Parse local-ipv4s, ipv6s,
subnet-ipv4-cidr-block and subnet-ipv6-cidr-block metadata keys to
determine additional IPs and appropriate subnet prefix to set for a
nic.

Also add the datasource config option apply_full_imds_netork_config
which defaults to true to allow cloud-init to automatically configure
secondary IP addresses. Setting this option to false will tell
cloud-init to avoid setting up secondary IP addresses.

Also in this branch:
 - Shift Ec2 datasource to emit network config v2 instead of v1.

LP: #1866930
Co-authored-by: Chad Smith <chad.smith@canonical.com>
These classes don't use `self.logs` anywhere in their body, so we can
remove the `with_logs = True` setting from them.

These instances were found using astpath[0], with the following
invocation:

  astpath "//Name[@id='with_logs' and not(ancestor::ClassDef//Attribute[@attr='logs'])]"

[0] https://github.com/hchasestevens/astpath
Bring it into line with the current state of the code (by dropping the
now-untrue caveat).
* test_oracle: sort imports

* DataSourceOracle: sort imports
On NetBSD and OpenBSD, the libc soname and location are different. There
is no reason to be to specific. Python is able to propely open the share
library by itself.
…onical#271)

These two implementations had drifted away from one another very
slightly.  Reconcile them and then remove the one in cc_apt_configure.
Addresses "Runtime Error: dictionary keys changed during iteration".

Co-authored-by: Noah Meyerhans <noahm@debian.org>

LP: #1868327
* tools: use python3

Switch tools/ to use python3 instead of python.  At minimum this
fixes building deb on python3 only releases like Focal. Applied
via shell commands:

 $ grep 'usr/bin/.*python' tools/* 2>/dev/null | \
     grep -v python3 | awk -F':' '{print $1}' | \
     xargs -i sed -i -e '0,/python/s/python/python3/' {}

* Use /usr/bin/env python3 to be virtualenv friendly
Currently, `cc_package_update_upgrade_install.py` fails because
`package_command()` does not know how to do an update on FreeBSD.

```
2020-03-23 20:01:53,995 - util.py[DEBUG]: Package update failed
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/cloud_init-20.1-py3.7.egg/cloudinit/config/cc_package_update_upgrade_install.py", line 85, in handle
    cloud.distro.update_package_sources()
  File "/usr/local/lib/python3.7/site-packages/cloud_init-20.1-py3.7.egg/cloudinit/distros/freebsd.py", line 158, in update_package_sources
    ["update"], freq=PER_INSTANCE)
  File "/usr/local/lib/python3.7/site-packages/cloud_init-20.1-py3.7.egg/cloudinit/helpers.py", line 185, in run
    results = functor(*args)
  File "/usr/local/lib/python3.7/site-packages/cloud_init-20.1-py3.7.egg/cloudinit/distros/bsd.py", line 102, in package_command
    cmd.extend(pkglist)
UnboundLocalError: local variable 'cmd' referenced before assignment
```

This commit defines a new `pkg_cmd_update_prefix` key. If it's empty, we
don't do any update, otherwise we use the value to update the package
manager.
Co-authored-by: Joshua Powers <josh.powers@canonical.com>
paride and others added 4 commits May 1, 2020 18:57
Since upstream cloud-init has dropped python2 support,
adapt remaining package build scripts and tools to python3 only

Changes:

* Do not template debian/rules as python3 is the only supported version
* Drop six from requirements.txt
* Makefile: drop everything related to Python 2
* run-container: install the CI deps only on ubuntu|debian
* read-version: update the shebang to use Python 3
* brpm: read_dependencies(): drop unused argument
* read-dependencies: switch to Py3 and drop the --python-version option
* pkg-deps.json: drop the Python version field and update the redhat deps
* pkg-deps.json: drop the unittest2 and contextlib2 renames
* Update RPM the spec file to use Python 3 when building the RPM
* bddeb: drop support for Python 2
Implement the upgrade support:

- FreeBSD: using `pkg upgrade`
- NetBSD: with `pkgin`
Copy link
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

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

One typo, and one concern about the continuing presence of a patch.

debian/changelog Outdated
@@ -1,3 +1,116 @@
cloud-init (20.2-0ubuntu1) gorilla; urgency=medium
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cloud-init (20.2-0ubuntu1) gorilla; urgency=medium
cloud-init (20.2-0ubuntu1) groovy; urgency=medium

debian/changelog Outdated
+ cpick-9d7b35ce-cc_mounts-fix-incorrect-format-specifiers-316
+ cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths
* refresh patches:
+ debian/patches/fix-cpick-4fb6fd8a-net-ubuntu-focal-prioritize-netplan-over-eni.patch
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this patch should be dropped instead of refreshed, as its header says:

Support for netbsd and openbsd is on in upstream until new-upstream-snapshot.

And we are now new-upstream-snapshot'ing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, this should be dropped, and that drop bevior is included in canonical/uss-tableflip#45
Maybe we work to land canonical/uss-tableflip#45 first so we don't have to manually fix this. and I can then open a new PR that is a full new-upstream-snapshot.

OddBloke and others added 4 commits May 6, 2020 13:17
Amazon Linux 2 is configured with a log format different to the one
shipped by upstream, which means analyze fails to parse any of the log
lines.  This updates the code to know how to parse such lines.

LP: #1876323
Add a unit test to validate if the examples provided in the config
modules are conforming to the concatenated schema of all config
modules. The rationale behind that is not only to verify if the
examples are correctly written but to assert that no config schema
is interfering with each other.

Failures in validate_cloudconfig_schema raise the
SchemaValidationError by using strict=True, so I have
only called the function passing the right schema examples to
validate.

This branch also fixes an invalid schema example in cc_snap.

LP: #1876412
Move from 127.0.0.1 to 127.0.1.1 for localhost IP addr for opensuse and sles
Copy link
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

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

A couple of inline notes, but it boils down to these differences from what I would expect to see:

--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-cloud-init (20.2-13-gb24b376f-0ubuntu1) focal; urgency=medium
+cloud-init (20.2-13-gb24b376f-0ubuntu1) groovy; urgency=medium
 
   * drop the following cherry-picks now included:
     + cpick-6600c642-ec2-render-network-on-all-NICs-and-add-secondary-IPs-as
@@ -13,6 +13,7 @@ cloud-init (20.2-13-gb24b376f-0ubuntu1) focal; urgency=medium
     + cpick-09fea85f-net-ignore-renderer-key-in-netplan-config-306
     + cpick-9d7b35ce-cc_mounts-fix-incorrect-format-specifiers-316
     + cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths
+    + fix-cpick-4fb6fd8a-net-ubuntu-focal-prioritize-netplan-over-eni.patch
   * New upstream snapshot.
     - make suse and sles support 127.0.1.1 (#336) [chengcheng-chcheng]
     - Create tests to validate schema examples (#348)

debian/changelog Outdated
@@ -1,3 +1,130 @@
cloud-init (20.2-13-gb24b376f-0ubuntu1) focal; urgency=medium
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
cloud-init (20.2-13-gb24b376f-0ubuntu1) focal; urgency=medium
cloud-init (20.2-13-gb24b376f-0ubuntu1) groovy; urgency=medium

@@ -1,40 +0,0 @@
Description: Drop netbsd and openbsd from cherry pick tests
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file was removed without documentation of that fact in d/changelog.

@blackboxsw
Copy link
Collaborator Author

Thanks @OddBloke pushed changes reflecting that.

@blackboxsw blackboxsw requested a review from OddBloke May 8, 2020 20:56
TheRealFalcon and others added 12 commits May 8, 2020 17:38
…cal#355)

Also update all examples to include the cloud-config header if they don't have it

LP: #1876414
…canonical#352)

As we only look at these logs when there's an error, and lintian
failures don't cause the package build to error out, we never examine
this lintian output.  Let's save ourselves some CI time by skipping it.

(We aren't lintian clean, otherwise a better change here would be to
make lintian warnings cause the package build to fail.)
Specifically:

* include warning against general use of mock assert methods (and suggestions on how to replace them)
* add guidelines on test decorator/param ordering
* add test guideline for module-level mock variables
…l#349)

This (a) gives people an easy way of getting a commit into the codebase,
and (b) saves us from having to explain this process (or do it
ourselves) for every new contributor.
drop the following cherry picks:
  cpick-6600c642-ec2-render-network-on-all-NICs-and-add-secondary-IPs-as
  cpick-986f37b0-cloudinit-move-to-pytest-for-running-tests-211
  cpick-4fb6fd8a-net-ubuntu-focal-prioritize-netplan-over-eni-even-if
  cpick-04771d75-cc_disk_setup-fix-RuntimeError-270
  cpick-c5e949c0-distros-tests-test_init-add-tests-for
  cpick-2566fdbe-net-introduce-is_ip_address-function-288
  cpick-4f825b3e-cloudinit-refactor-util.is_ipv4-to-net.is_ipv4_address
  cpick-c478d0bf-distros-replace-invalid-characters-in-mirror-URLs-with
  cpick-1bbc4908-distros-drop-leading-trailing-hyphens-from-mirror-URL
  cpick-09fea85f-net-ignore-renderer-key-in-netplan-config-306
  fix-cpick-4fb6fd8a-net-ubuntu-focal-prioritize-netplan-over-eni.patch
  cpick-9d7b35ce-cc_mounts-fix-incorrect-format-specifiers-316
  cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths
Copy link
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

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

🙏

$ git d blackboxsw/ubuntu/devel | cat
diff --git a/debian/changelog b/debian/changelog
index 8835e4283..62ae4c7c8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -133,7 +133,7 @@ cloud-init (20.2-20-gd10ce3ec-0ubuntu1) groovy; urgency=medium
     - tox.ini: bump pyflakes version to 2.1.1 (#239)
     - cloudinit: move to pytest for running tests (#211)
 
- -- Chad Smith <chad.smith@canonical.com>  Mon, 11 May 2020 20:17:06 -0600
+ -- Daniel Watkins <oddbloke@ubuntu.com>  Wed, 13 May 2020 12:47:46 -0400
 
 cloud-init (20.1-10-g71af48df-0ubuntu5) focal; urgency=medium

Thank you for your persistence on this, Chad!

@blackboxsw blackboxsw merged commit 4ced4b6 into canonical:ubuntu/devel May 13, 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