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

Merge 2.9 #13607

Merged
merged 50 commits into from Jan 13, 2022
Merged

Merge 2.9 #13607

merged 50 commits into from Jan 13, 2022

Conversation

wallyworld
Copy link
Member

@wallyworld wallyworld commented Jan 12, 2022

Merge 2.9.
2.9 was updated to use juju-db 4.4 - here we change that to 5.0

#13587 JUJU-381 Fix test race in RaftLeaseRemoteSuite.TestSetAddress
#13588 JUJU-349 Remove stub sentence from add-machine helper
#13570 JUJU-256 MVP verify app health after controller/model upgrade
#13566 JUJU-338 Drop miscellaneous NewProviderAddress constructors in favour of a functional approach
#13589 Update to latest version of Pebble
#13591 JUJU-388 Ensure 'hostname -f' returns juju-assigned hostname on equinix metal
#13592 Remove the format2 test charm
#13593 The interactive version command doesn't need a controller
#13590 JUJU-403 Remove txn watcher wrench
#13594 JUJU-335 Expand functionality of ProviderAddress
#13601 JUJU-402 Unit machine test fixes for fire-walled env (s390x)
#13603 JUJU-412 Fix racy tests for the CAAS firewaller worker
#13604 JUJU-413 Test Raft queue immediate dispatch instead of 1 batch per operation
#13602 JUJU-106 Add support for mgo scram-sha256 auth; default to mongo 4.4 on bootstrap
#13599 JUJU-396 juju info/find/download run without a controller
#13606 [JUJU-418] Fix some intermittent unit test failures
#13600 [JUJU-380] Shutdown application worker properly

Conflicts were in snap version change, imports, and removed code.

# Conflicts:
#       agent/agent_test.go
#       api/charmhub/client_test.go
#       api/charmhub/data.go
#       caas/kubernetes/provider/bootstrap_test.go
#       cmd/juju/charmhub/data.go
#       cmd/juju/charmhub/download.go
#       cmd/juju/charmhub/download_test.go
#       cmd/juju/charmhub/find.go
#       cmd/juju/charmhub/find_test.go
#       cmd/juju/charmhub/info.go
#       cmd/juju/charmhub/info_test.go
#       cmd/juju/charmhub/mocks/api_mock.go
#       mongo/mongodfinder_test.go
#       provider/maas/interfaces.go
#       provider/maas/interfaces_test.go
#       service/snap/snap_test.go

QA steps

See PRs

jack-w-shaw and others added 30 commits December 13, 2021 11:44
Sometimes after a new release users can have issues with deployed
applications during an upgrade. Add some CI to verify that
existing applications remain healthy after a controller and model
upgrade
Instead use the cleaner NewMachineAddress().AsProviderAddress
Instead use the cleaner NewMachineAddress().AsProviderAddress
to avoid testing races in the raftlease client tests.
…race

juju#13587

Fixes a testing race in `github.com/juju/juju/api/raftlease.(*RaftLeaseRemoteSuite).TestSetAddress()`.

See: https://jenkins.juju.canonical.com/job/Unit-RunUnitTests-race-amd64/1050

The logic copies a reference under lock protection and uses it outside of the lock. To fix this we copy the value into a new reference that does not need lock protection.

## QA steps

Run `RaftLeaseRemoteSuite.TestSetAddress` in a loop with the `-race` flag.

## Documentation changes

None.

## Bug reference

N/A
…ne-helper

juju#13588

Correct mistake in help text for 'add-machine'

## Checklist

 - ~[ ] Requires a [pylibjuju](https://github.com/juju/python-libjuju) change~
 - ~[ ] Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR~
 - ~[ ] Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed~
 - [x] Comments answer the question of why design decisions were made

## QA steps

```sh
make static-analysis
```

## Bug reference

https://bugs.launchpad.net/juju/+bug/1953746
juju#13570

Sometimes after a new release users can have issues with deployed
applications during an upgrade. Add some CI to verify that
existing applications remain healthy after a controller and model
upgrade

## Checklist

 - ~[ ] Requires a [pylibjuju](https://github.com/juju/python-libjuju) change~
 - [x] Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR
 - ~[ ] Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed~
 - [ ] Comments answer the question of why design decisions were made

## QA steps

Execute smoke.yml GitHub Action

## Documentation changes

No doc change required

## Bug reference

No bug reference
Instead use the cleaner NewMachineAddresses().AsProviderAddresses
…derAddressInSpace

juju#13566

There are many duplicate constructors for `ProviderAddress`'s for specific cases and inputs. This isn't great practice.

Unify all these cases under a single constructor, a method of `MachineAddress`. And replace every occurrence of these old constructors with the new pattern

Then do the same with the old NewProviderAddresses constructors

## Checklist

 - ~[ ] Requires a [pylibjuju](https://github.com/juju/python-libjuju) change~
 - [x] Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR
 - ~[ ] Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed~
 - [x] Comments answer the question of why design decisions were made

## QA steps

```sh
make static-analysis
go test ./...
```

## Documentation changes

*Please replace with any notes about how it affects current user workflow, CLI, or API.*

## Bug reference

No bug reference
This includes:

* Show process's last output in error msg when service exits quickly:
  canonical/pebble#69
* Fix subtle Service merging issues:
  canonical/pebble#98
* Fix bug with replan/start/restart not updating internal config:
  canonical/pebble#96
juju#13589

This includes:

* Show process's last output in error msg when service exits quickly:
 canonical/pebble#69
* Fix subtle Service merging issues:
 canonical/pebble#98
* Fix bug with replan/start/restart not updating internal config:
 canonical/pebble#96
…equinix-nodes

juju#13591

This PR ensures that running `hostname -f` on nodes that juju provisions on equinix metal always yields the juju-assigned hostname instead of localhost.

## QA steps

```sh
$ juju bootstrap equinix/da test-equinix-am --no-gui --bootstrap-constraints instance-type=c3.small.x86
$ juju switch controller
$ juju ssh 0

# Ensure that hostname and hostname -f always returns the juju-assigned hostname instead of localhost
$ hostname
juju-....
$ hostname -f
juju-...
```

## Bug reference
https://bugs.launchpad.net/juju/+bug/1956538
It is unused and has a broken symlink
juju#13593

When using juju interactively, the version command should not require a controller.

## QA steps

Start the repl by running "juju".
Then type "version".

## Bug reference

https://bugs.launchpad.net/juju/+bug/1951119
The following removes the txn watcher wrench. It calls too frequently in
production applications. This removes it completely, but I'm not adverse
to either creating a controller/model config for enabling wrenches
(calling wrench.SetEnable method), similar to the setup for logging
config. Alternatively, just throttling the existence of the wench every
minute or so.

Either way, we just need to back off calling this.
juju#13590

The following removes the txn watcher wrench. It calls too frequently in
production applications. This removes it completely, but I'm not averse
to either creating a controller/model config for enabling wrenches
(calling wrench.SetEnable method), similar to the setup for logging
config. Alternatively, just throttling the existence of the wench every
minute or so.

Either way, we just need to back off calling this.

@wallyworld thoughts?

## QA steps

Test pass.
The following patches the charmrevision Facade to prevent outbound API
requests to external services. This isn't ideal, as I don't really want
to patch a function call in a unit tests, but this is an integration
masking as a unit test.
…nal-outbound-services

juju#13601

The following patches the charmrevision Facade to prevent outbound API
requests to external services. This isn't ideal, as I don't really want
to patch a function call in a unit tests, but this is an integration
masking as a unit test.

## QA steps

```sh
$ go test -v ./cmd/jujud/agent -check.v -check.f=TestControllerModelWorkers
$ go test -v ./cmd/jujud/agent -check.v -check.f=TestHostedModelWorkers
```
And also add accompanying functional options

This is so these params can be included inside addresses, meaning
InterfaceInfos doesn't need to duplicate each nic for each address
…_ProviderAddress_constructors

juju#13594

This is to setup a later change described in JUJU-335. 

Add some more properties to `ProviderAddress`, particularly `ProviderID`, so they can later be dropped from `InterfaceInfo`

## Checklist

 - ~[ ] Requires a [pylibjuju](https://github.com/juju/python-libjuju) change~
 - [x] Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR
 - ~[ ] Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed~
 - [ ] Comments answer the question of why design decisions were made

## QA steps

```sh
make static-analysis
go test github.com/juju/juju/core/network
```

## Documentation changes

No documentations changes

## Bug reference

No bug reference
manadart and others added 8 commits January 11, 2022 12:05
batches of 1. We have observed that on slow systems, such as our arm64
test node, that there can be dequeued batches with more than one
operation.
juju#13603

The race test job runs quite slowly on arm64. It turns up race conditions in the CAAS firewaller worker tests.

Here we do some synchronising to ensure tests pass without races.

## QA steps

run the `WorkerSuite` tests in a loop with the `-race` flag.

## Documentation changes

None.

## Bug reference

N/A
juju#13604

On slow systems, such as our arm64 test node we can get multiple dispatch of Raft op queue results, despite synchronously enqueued operations.

Here we soften the test so that we ensure immediate dispatch of synchronously enqueued operations by checking for multiple batches.

## QA steps

Run the `OpQueueSuite` tests using `stress`

## Documentation changes

None.

## Bug reference

N/A
juju#13599

The commands to query CharmHub - info, find download - should be able to be run standalone without needing a running controller. Often, the user just wants to download a charm and inspect it, or find what charms are available etc without having to first bootstrap a controller. One reason for needing a controller was to deal with CharmHub API changes. Given the frequent Juju releases, if there happens to be any backwards incompatible CharmHub changes (which are not expected frequently if at all) , it's easy to release a new Juju client.

All 3 commands now use a consistent way of allowing a different CharmHub (eg beta) backend to be targetted. The commands support a charmhub-url parameter, or you can set the CHARMHUB_URL env var.

One feature not now available with this change is to default to any explicitly configured default series set on the in-scope model. The user is required to use the --series arg if they want to filter on series.

The implementation copies code to deal with parsing the CharmHub API structs from the apiserver package to the CLI package.
The controller client API is deleted and for Juju 3, the apiserver code will be deleted also. There was also other cleanup like deleting the filterFindResults() method which was unused except for a test.

## QA steps

juju info postgresql
juju download mattermost-k8s
juju find mariadb
etc

Check that the output matches what you'd get when running the 2.9 CLI against a controller.
juju#13602

Update to use a newer upstream juju/mgo/v2 which adds support for scram-sha256 authentication.
This enables auth against newer mongos.

When bootstrapping on focal or later, we now default to juju-db from the 4.4/stable channel. This gets rid of significant log spam due to apparmor issues and also uses a version of mongo that is still under support (4.0 reaches EOL April 2022).

A couple of small drive by cleanups as well.

## QA steps

juju bootstrap lxd --bootstrap-series=focal
juju bootstrap lxd --bootstrap-series=bionic
juju bootstrap microk8s
juju bootstrap lxd --bootstrap-series=focal --config juju-db-snap-channel=5.0/stable
juju bootstrap microk8s --config juju-db-snap-channel=5.0/stable

Once bootstrapped
juju enable-ha
juju deploy ubuntu

Bootstrap with juju 2.9.22 and upgrade to using this PR.
juju enable-ha
The installed mongo version should remain as 4.0.
juju#13606

Some unit tests we failing on slow hardware. One main root cause was advancing the test clock by exactly the interval used to trigger the next processing step. The test adds a small additional fraction of time to allow the step to always trigger.

In another case, a test clock was used instead of a wall clock to ensure a stable time.Now().

Also, in the firewaller tests, we were testing for something that could pass on slow hardware but fail in real life.

## QA steps

run the unit tests
@hpidcock
Copy link
Member

!!build!!

1 similar comment
@hpidcock
Copy link
Member

!!build!!

@wallyworld
Copy link
Member Author

!!build!!

jujubot and others added 2 commits January 12, 2022 17:59
juju#13600

The application worker should be removed from caasapplicationprovisioner runner when it peacefully exits or application is gone;

## Checklist

 - [ ] ~Requires a [pylibjuju](https://github.com/juju/python-libjuju) change~
 - [ ] ~Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR~
 - [ ] ~Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed~
 - [x] Comments answer the question of why design decisions were made

## QA steps


```console
$ juju add-model t1

$ juju deploy cs:kubeflow-volumes

$ juju remove-application kubeflow-volumes --force

$ juju deploy hello-kubecon

$ juju status --relations --color --storage -m k1:t1

```

## Documentation changes

No

## Bug reference

https://bugs.launchpad.net/juju/+bug/1938907
Copy link
Member

@hpidcock hpidcock left a comment

Choose a reason for hiding this comment

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

Approved assuming you put the mongo 4.4 -> 5.0 into its own commit or pr

@wallyworld
Copy link
Member Author

$$merge$$

1 similar comment
@wallyworld
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit 80dc2b5 into juju:develop Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants