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

My Provision Vision #28

Open
jonpugh opened this issue Feb 2, 2018 · 3 comments
Open

My Provision Vision #28

jonpugh opened this issue Feb 2, 2018 · 3 comments

Comments

@jonpugh
Copy link
Member

jonpugh commented Feb 2, 2018

User Experience

  • The user should not be expected to have any sysadmin knowledge.

  • The CLI will walk the user through every step of the way, explaining how things work when needed, being careful to not overwhelm the user with information.
    screenshot from 2018-02-02 10-38-08

  • Tasks should display a clean, clear summary of what is happening, but show no output by default, unless asked for with --verbose.
    feb 2 2018 11_49 am - edited

  • The voice of Provision should friendly and helpful, always anticipating the users needs and communicating things as clearly as possible.

Self Setup

  • Provision should be able to install everything by itself.

  • The tool will detect what is already running on the system and offer to integrate with it. (Started this in d4596f9). Provision now checks to see if it's configuration is active in apache.
    screenshot from 2018-02-02 10-36-51

  • The tool will know how to install additional services if they do not yet exist.

Redefine "Platform".

In Aegir, "Platforms" were treated as primary entities, separate from sites, but required to install a site.

One problem with this is that some of the most important information for a site, like it's root path, and what web server it should be running on were associated with the platform, not the site itself.

In Provision 4, I propose we make Platforms optional. Platforms are like site templates. They allow for automating the site creation by storing default information like path and code-base. Let's treat Platforms less like a primary entity and more like a way to create a site template.

We must redesign the system so that the ServerContext sets itself up, and all you have to do to get a site is add a site.

Here's how we can remove the requirement of creating the platform first:

  1. Move "publish_path", makefile, and git repo to SiteContext.
  2. Move "platform_verify" tasks to "site_verify" tasks.
  3. Remove ContextSubscriber and ContextProvider, and just have ServerContext and SiteContext.
  4. Move 'http' service to SiteContext.
  5. Change PlatformContext to not have a relationship to services at all.
  6. Allow PlatformContext code to add a property to a site, indicating that the site is using
  7. Change the UI to show Servers, Sites, and platforms separately.
  8. Allow a new platform to be created from an existing site. Allow new sites to be created on existing platforms.

Developer Experience

  • Users should be able to use composer global require (or cgr) to add additional Service plugins.
  • Service Classes should be as simple and clear as possible:
    • ExampleServiceClass::verify_site()
    • ExampleServiceClass::verify_platform()
    • ExampleServiceClass::verify_server()
  • Should leverage all of the latest PHP techniques: Interfaces, Traits, Annotations
  • Should leverage existing libraries like https://thephpleague.com/
  • Should provide easy ways to run commands and write templates.
  • Should be pluggable to allow provision to kick off to other config management like Ansible or Puppet.

More to come...

@helmo
Copy link
Member

helmo commented Feb 5, 2018

When you chip away the essential properties of a platform, I see an issue coming up later add additional sites. For a third site do you get publish_path from site 1 or 2? Or will there be a 'primary' site that holds such information?

In OO fashion why not let the site class extend the platform class/interface? Then the platform level remains responsible, and the site has the info.

@jonpugh
Copy link
Member Author

jonpugh commented Feb 5, 2018

In OO fashion why not let the site class extend the platform class/interface? Then the platform level remains responsible, and the site has the info.

That's a decent idea, since the site would need all of the platform properties.

I'm not saying a site will represent a platform, I'm saying if we have a site with a publish path, makefile/gitrepo we can use those bits of info to create a platform.

@jonpugh
Copy link
Member Author

jonpugh commented Feb 5, 2018

Thanks for the tip, @helmo !

Inheriting PlatformContext was the key to making this a quick change. See PR at #32 and #30.

SiteContext has all platform properties now. If a --platform is specified on provision save, it will populate the options from the platform as if you passed them from the command line (like --root).

Works great!... Please move discussion specific to platform conversion to #30

@jonpugh jonpugh mentioned this issue Feb 6, 2018
6 tasks
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

No branches or pull requests

2 participants