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

Charmhub deploy charm #483

Merged
merged 18 commits into from
May 26, 2021
Merged

Conversation

SimonRichardson
Copy link
Member

@SimonRichardson SimonRichardson commented Mar 31, 2021

This PR allows the deploying of charmhub charms and bundles.

There are a few gaps in this PR and those will be filled in future PRs.

  1. resources (oci-images, local, etc)
  2. refresh/upgrade-charm
  3. k8s testing

The replicates as much as the juju go CLI. Although there are gaps in how
we deal with series as we currently don't have as much information as the go
CLI, but that is coming.

Q&A Steps

Run the examples for bundles and try and deploy a charmhub charm.

@SimonRichardson SimonRichardson force-pushed the charmhub-deploy-charm branch from fc52e70 to c0f50d6 Compare May 13, 2021 09:22
@SimonRichardson SimonRichardson marked this pull request as ready for review May 13, 2021 11:21
@SimonRichardson SimonRichardson force-pushed the charmhub-deploy-charm branch 5 times, most recently from 58f9f98 to b2b7554 Compare May 13, 2021 14:51
@SimonRichardson
Copy link
Member Author

!!build!!

Makefile Outdated Show resolved Hide resolved
examples/deploy_bundle.py Outdated Show resolved Hide resolved
juju/bundle.py Outdated Show resolved Hide resolved
juju/bundle.py Outdated Show resolved Hide resolved
juju/model.py Outdated Show resolved Hide resolved
The following adds the ability to add a charm based on the charm facade.
The client facade is deprecated and shouldn't be used if the charms
facade is located.
The v2 charm URL scheme should support both architecture and series.
Allowing us to deploy different architectures correctly.
There was some issue with adding a charm, but that was easily resolved.
This is still a work in progress, but essentially charms without
resources are able to be deployed and bundle machines are. There is an
issue with a missing charm revision for charmhub charms, I'm unsure
where to resolve that currently.
The following changes ensures that if we talk to older controllers we
can correctly deploy bundles as well.
Using an older controller that doesn't have the facade available causes
all sorts of issues, this cleans up the issues around that.
The original charm we used for the integration tests have gone, let's
pick one that we can control.
The integration tests do work when run as a file, but fail when
attempting to run the whole thing as one. In order to get some tests
starting to pass green I think the best way would be to run each on and
see if that helps.
The integration tests will be better served if they're run individually
so we can try and get the signal to noise ratio lower.
The following updates the bundle unit tests changes fixes. These should
ensure that we're at least compatible with what was previously written.
When supporting older facades we need to get and use the charm Id from
the entity get.

As a driveby I've sorted out the lint issues
The following removes an indention when checking for a facade. This
makes it a lot easier to read.

Additionally cleaned up the deploy_bundle example.
The following implements deployment types so that it's easier to reason
about the logic of a deployment strategy (charmhub, charmstore and local
charms/bundles).

This is a quite a simple change, but does have a dramatic effect or
readability of the deploy method in model.
The readability of some of the if statements was slightly hard to
comprehend because of the if, elif statements.
Just make xdist work better with the libraries.
@SimonRichardson SimonRichardson force-pushed the charmhub-deploy-charm branch from 63823eb to 98bef78 Compare May 19, 2021 09:42
Copy link
Contributor

@pengale pengale left a comment

Choose a reason for hiding this comment

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

LGTM :-)

@SimonRichardson
Copy link
Member Author

$$merge$$

@SimonRichardson
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit ef05ad8 into juju:2.9 May 26, 2021
@SimonRichardson SimonRichardson deleted the charmhub-deploy-charm branch May 26, 2021 17:46
SimonRichardson added a commit to SimonRichardson/python-libjuju that referenced this pull request Oct 12, 2021
2.9.4
^^^^^

Tuesday October 12 2021

* Charmhub deploy charm by @SimonRichardson in juju#483
* add wait_for_status instead of wait_for_active by @sed-i in juju#517
* Adds resource support for charmhub deployments by @tlm in juju#516
* Fix bug juju#519 and juju#522: Add local resources for bundles by @davigar15 in juju#520
* Patching some missing kwargs by @cderici in juju#527
* Implementing `backup` functionality by @cderici in juju#536
* Fix issue 532: Set the default_series properly by @davigar15 in juju#533
* A random small bug fix by @cderici in juju#541
* Allow ApplicationFacade set_config with non-string values by @cderici in juju#540
* Skip macaroon tests issue 534 by @cderici in juju#542
* Fix issue 530: Check the controller for unsynched models by @cderici in juju#539
* Upgrade setup-python action. by @juanmanuel-tirado in juju#543
* Fix integration tests by @cderici in juju#544
* Bring juju/juju.py into life by @cderici in juju#546
* Extract resources info from apps in locally deployed bundle by cderici in juju#552
* Fix for simple bug in bundle deployment code self.charm -> self['charm'] by @jnsgruk in ttps://github.com/juju/pull/558
* Fix integration tests continued by @cderici in ttps://github.com/juju/pull/547
* Get the config dir resolve logic into one place by @cderici in ttps://github.com/juju/pull/555
* Complete the backups functionality by @cderici in ttps://github.com/juju/pull/556
jujubot added a commit that referenced this pull request Oct 12, 2021
#561

2.9.4
^^^^^

Tuesday October 12 2021

* Charmhub deploy charm by @SimonRichardson in #483
* add wait_for_status instead of wait_for_active by @sed-i in #517
* Adds resource support for charmhub deployments by @tlm in #516
* Fix bug #519 and #522: Add local resources for bundles by @davigar15 in #520
* Patching some missing kwargs by @cderici in #527
* Implementing `backup` functionality by @cderici in #536
* Fix issue 532: Set the default_series properly by @davigar15 in #533
* A random small bug fix by @cderici in #541
* Allow ApplicationFacade set_config with non-string values by @cderici in #540
* Skip macaroon tests issue 534 by @cderici in #542
* Fix issue 530: Check the controller for unsynched models by @cderici in #539
* Upgrade setup-python action. by @juanmanuel-tirado in #543
* Fix integration tests by @cderici in #544
* Bring juju/juju.py into life by @cderici in #546
* Extract resources info from apps in locally deployed bundle by cderici in #552
* Fix for simple bug in bundle deployment code self.charm -> self['charm'] by @jnsgruk in ttps://github.com//pull/558
* Fix integration tests continued by @cderici in ttps://github.com//pull/547
* Get the config dir resolve logic into one place by @cderici in ttps://github.com//pull/555
* Complete the backups functionality by @cderici in ttps://github.com//pull/556
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.

3 participants