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

microcloud charm v0.1 #149

Closed

Conversation

gabrielmougard
Copy link
Contributor

@gabrielmougard gabrielmougard commented Sep 8, 2023

This is the initial work for the Microcloud MAAS charm.

As of now the charm achieves the following:

  • Support for microceph and microovn.
  • A cluster is bootstraped with the microcloud --auto flag.
  • Three nodes and four nodes cluster initialization (I didn't test for bigger configurations because of hardware limitations but I don't see any systemic code issues that wouldn't allow it)
  • One unit at a time scale-up: 3 to 4 scale-up tested successfully

Roadmap items to achieve for 0.2:

Roadmap items to achieve for 1.0:

@gabrielmougard gabrielmougard marked this pull request as draft September 8, 2023 09:56
Copy link
Member

@simondeziel simondeziel left a comment

Choose a reason for hiding this comment

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

Overall, LGTM! I quite like the nginx cache trick you pulled to make testing faster, love it!

microcloud/charms/README.md Show resolved Hide resolved
microcloud/charms/LICENSE Show resolved Hide resolved
microcloud/charms/config.yaml Show resolved Hide resolved
microcloud/charms/config.yaml Show resolved Hide resolved
microcloud/charms/config.yaml Show resolved Hide resolved
microcloud/charms/src/charm.py Show resolved Hide resolved
check=True,
timeout=600,
)
self.unit_maintenance("core core20 core22 installed successfully...")
Copy link
Member

Choose a reason for hiding this comment

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

Please don't deploy any of the core. The needed ones are pulled automatically as snapd handles dependencies.

config_changed = self.config_changed()
logger.info(f"Validating config: {config_changed}")

# TODO: For now, we don't have any config to validate
Copy link
Member

Choose a reason for hiding this comment

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

Enabling/disabling microovn/microceph on an already deployed app should probably be rejected.

self.microcloud_remove(os.uname().nodename)
logger.info("Microcloud node successfully removed")
except RuntimeError:
logger.error("Failed to remove a Microcloud node, retrying later")
Copy link
Member

Choose a reason for hiding this comment

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

I think I'd do it the other way around. Instead of the removed unit trying to self remove, why not ask the leader to remove the departing unit from the cluster?

I'm suggesting that as rel-broken fires very late and you often don't have access to data bags.

if not self.unit.is_leader():
time.sleep(30) # Make sure that the leader has time to initialize the cluster

return
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure delaying the return achieves anything, or does it? Isn't the leader supposed to bootstrap the cluster and then only add nodes?

@tomponline
Copy link
Member

@gabrielmougard we will not be merging this PR into this repo, but will instead create a new repo called charm-microcloud. I am currently waiting for confirmation on what license to use and will let you know when the new repo is setup.

In the meantime it'd be worth addressing @simondeziel comments here so that your branch is ready to be sent to the new repo once its created.

@tomponline
Copy link
Member

@gabrielmougard new repo is created here https://github.com/canonical/charm-microcloud

@tomponline tomponline closed this Sep 13, 2023
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