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

Chore/maas merge main #118

Merged
merged 50 commits into from
Feb 13, 2024

Conversation

gboutry
Copy link
Collaborator

@gboutry gboutry commented Feb 9, 2024

Merge main to feat maas

Manifest endpoints in microcluster have been set to AllowUntrusted (for the same reasons as the other endpoints, lack of ssl verification / authentication)

hemanthnakkina and others added 30 commits January 3, 2024 16:45
* Create a manifest table with fields id, applieddate
and manifest data. Applied date will be populated
by SQL when the record is inserted.
* Add APIs to list all manifests, get manifest by id,
delete manifest by id.
* Add aditional API to get latest inserted record when
manifest id is specied with keyword latest.
* TIMESTAMP type in database does not save the time in
nano second precision and saved only until seconds precision.
So retreiving latest inserted record should get all the
records with the latest timestamp and return the last one.
Add python helper functions to create/retreive/
delete manifest from cluster database.
Add manifest option to sunbeam bootstrap.
Add step to write the manifest to cluster db.
Add following options manifest and clear-manifest
to refresh command.
clear-manifest option updates cluster database
manifest table with empty manifest.
Add terraform to manifest file. terraform will be
a dictionary of terraform plan and local path of
the terraform plan.
Add revision/config to microk8s, microceph,
openstack-hypervisor terraform plans.
* Create default manifest
* Add terraform plan location to default manifest
* Define manifest part and tfvar/manifest map in plugins
* Remove configurable tfplan options
* Use latest manifest to populate terraform vars in openstack, configure plan
* Use latest manifest to populate terraform vars in plugins
* All the commands have logic to copy the teraform
plans to snap user common and creation of
terraform helper object. Move this logic as part
of Manifest class.
* All the plans more or less get terraform vars
from cluster db, update with generated tfvars based
on plan, update with tfvars from manifest, write
tfvars to the terraform plan and apply the plan.
Move this logic as part of Manifest class
Add unit tests to Manifest class
Rename few functions and arguments
Add bootstrap args from the manifest to the
juju bootstrap command. The bootstrap args
will be appended to the juju bootstrap command.

Manifest for juju bootstrap args looks like:
juju:
  bootstrap_args:
    - --agent-version=3.2.4
Fix typos in the dns plugin.
Create manifest after cluster is joined in
join command.
Add manifest override for juju bootstrap args
Add manifest list and manifest show commands.
* Add add_manifest_section to plugin interface so that
  plugins can add new manifest attributes.
* Add caas_config section to manifest as part of
  caas plugin
* Update caas plugin terraform plan to introduce
  variables that can be overriden by manifest
* Update plan for caas configure to read manifest
  caas_config section and use them as override_tfvars
terraform vars for the plan are created by merging
a. tfvars from cluster db b. From manifest along with
defaults c. override_tfvars from the plan step.

If any attribute in manifest is removed in subsequent
update of manifest, the merged tfvar map still contains
the value from cluster db (step a). To avoid this, remove
all the tfvar keys that can come from manifest in step a.
* Use manifest for refresh intra channel updates
* Refresh the apps in openstack and controller only
  when channel is specified in manifest (including
  default values) and no revision is specified.
  This will take care of app refresh for new revisions
  on the same channel.
  The logic to check if there is any latest revision
  on the channel is removed since the juju refresh
  should take care of the logic.
* Add Reapply terraform plan for Control plane.
* Add flag refresh to DeployMachineApplication so that
  the terraform plan can be reapplied when refresh is true.
  This covers terraform plans for microk8s, microceph.
  sunbeam-machine.
* Use ReapplyHypervisorTerraformPlan for
  openstack-hypervisor.
* Add all the above plans to the list of plans to execute
  on refresh
* For the plugins, do not apply any terraform plan if the
  plan is part of sunbeam-terraform as the control plane
  refresh should take care.
* Do not apply terraform plans if there is no change in
  current terraform vars and updated terraform vars.
[manifest] support for intra channel refresh
Use manifest for Upgrade releases.
For control plane, upgrade charms in following order - mysql charms,
openstack core charms, openstack plugins.
In each upgrade, only update the terraform variables corresponding
to charms and apply the terraform plan.
Followed similar approach for machine charms as well. Split machine
charms to individual ones as each machine charm may have pre and post
steps during upgrade.
Upgrade plugins using terraform plan openstack-plan as part of control
plane upgrade.
…-upgrade

[manifest] Support for upgrade-release
Add missing client argument to `get_all_external_repos`.
Add manifest option to enable group.
Plugins of type EnableDisablePlugin should read the user
provided manifest during enable of the plugin.
gboutry and others added 20 commits January 31, 2024 08:42
[manifest] Add option manifest to plugin enable
Expand terraform variables for observability
plugin to parameterise channel, revision, config.
Update manifest_default and corresponding tfvar
map in the plugin.
Update plugin to use manifest functions instead
of terraform helper functions.
…bility-plugin

Add manifest support to observability plugin
Validate the charms in the manifest file are valid
charms known by the sunbeam defaults. If not, raise
an error.
…ions

[manifest] Validate charms section in manifest file
Skip the step AddManifest that writes manifest to
cluster db if the content of provided manifest and
the latest one in cluster db is same.
…-writes

Skip writing manifest to db if there is no change
Add subcommand generate in sunbeam manifest.
Write the manifest to user provided file with
$HOME/.config/openstack/manifest.yaml as default.
Generate manifest with the current configuration
by default.
If the cluster is not bootstrapped, generate manifest
with default values.
Handle catching ManifestItemNotFound exception
in getting latest manfiest from cluster db and
return result as completed for AddManifest
is_skip.
Donot print default terraform sources in the generated
manifest.
Use single file for both manifest and preseed.
The file should have deployment as key for preseed
entries and software for software config entries.
Remove --preseed option from commands and pass the
preseed dict from manifest to the plans.
Since recent charm-microceph update, replicas size 1 is available under
limited conditions, get the number of OSDs configured on bootstrap and
resize to update the number of pool replicas for glance and cinder.
Compute number of OSDs to decide number of replicas
libdqlite-dev introduced dependency to libraft-canonical-dev which is
more advanced than libraft-dev.
@gboutry gboutry force-pushed the chore/maas-merge-main branch from 9bdbdab to 60d7875 Compare February 9, 2024 15:18
Copy link
Collaborator

@hemanthnakkina hemanthnakkina left a comment

Choose a reason for hiding this comment

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

LGTM

@hemanthnakkina hemanthnakkina merged commit 1aedbe6 into canonical:feat/maas Feb 13, 2024
7 checks passed
@gboutry gboutry deleted the chore/maas-merge-main branch February 13, 2024 07:14
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.

4 participants