Skip to content

Manage ddev project list independently of docker container labels (yaml) #642

Closed

Description

@rfay

What happened (or feature request):

Over in #484 (comment) the discussion is underway about ddev start/stop/rm, and one of the key reasons we've kept containers around (the "stopped" state) is just because ddev doesn't know what projects it has unless docker tells it.

In reality we need to track projects separately from docker, because it's impossible for docker containers to represent the actual state of what a user may have set up.

We've talked at times about using a ddev-managed yaml file in ~/.ddev to track project state; It would probably be more appropriate to use a real database like sqlite instead. Basically every start would put the key information into the db, and ddev list would report the info from that database (whether sqlite or yaml or whatever). Additional docker container information would be used to supplement the information about project state.

This allows us to:

  • Fully catalog the projects that a user has created (and show their state)
  • Fully prevent name collisions on projects
  • Fully prevent databases accidentally being shared by projects.

Essentially, way back in the day (drud local days) docker containers were the easiest way to get info about projects, and we used it. But we've outgrown that, and it was inadequate always. It's time to leave it behind.

I'd envision the following behavior:

  • ddev start updates the database
  • ddev stop (our current "remove") also updates the db
  • ddev list uses the database and supplements with live docker info to present its list. But it would know of all projects. It could also know the status of db (size, and whether it exists or has been removed, which can be pretty important and useful)
  • Probably we'd need a new and completely separate ddev rmdb or something to trash the database, as database existence isn't really about start/stop/rm
  • There would probably need to be a new command to remove projects from the list that the user didn't want to show any more, and probably ddev list would need some new filter options, for example to not show projects that have no database, or to not show projects that are inactive.

Destruction of the list db would be nonfatal (just deletion of a file) and the database could be recreated naturally just by starting projects.

This is most likely a prerequisite to #484 (reorganize stop/rm commands)

Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)

3 - This appears relatively easy to implement, but will likely expose weaknesses in our code that will have to be dealt with.

Activity

  1. rfay commented on Feb 7, 2018

    @rfay
    MemberAuthor

    Note that #524 was the previous place this was being discussed, and there was an associated google doc with the various issues

  2. added this to the v1.3.0 milestone on Feb 7, 2018
  3. rickmanelius commented on Feb 7, 2018

    @rickmanelius
    Contributor

    Initial read looks good. A few thoughts (and these are just thoughts/brainstorming).

    • From a naming convention/organization, I wonder if it will make sense to switch from ddev list to ddev projects. I could see that then being used to target additions and removal of projects. Yes, running ddev config or ddev start assumes an insertion and update into the DB, but it would be possible to ddev project rm X
    • Upgrades. One thing that would be neat is tracking the config.yml version and highlighting to the user that they are out of date and may need to recreate.
    • This might also help address the long-standing feature request of global targetting As CLI user, I want the ability to interact with each site from any directory. #44

    I realize that we probably need to keep this initial scope small and tight, but I can see wider implications and opportunities that I at least want to surface as we're shaping this to an actionable state.

  4. modified the milestones: v1.3.0, v1.0.0 on Feb 13, 2018
  5. removed this from the v1.0.0 milestone on Jun 26, 2018
  6. 2 remaining items

  7. ultimike commented on Jul 22, 2018

    @ultimike
    SponsorContributor

    I think that having an alternate method to drive the results of ddev list (other than Docker containers) is a good idea. As someone who has taught DDEV to a few dozen folks at this point, I can attest that explaining that ddev list only shows projects that have containers built is counter-intuitive for users who aren't familiar with Docker.

    More than once, after using ddev rm on a project, and then not seeing the project in ddev list, I've had students ask me (worried), "what happened to my project!?"

    The idea to use a small database to keep track of projects with a .ddev/ directory is a good one, as I can envision all sorts of good project metadata that could be included and then output as part of ddev list 2.0:

    • Name
    • Type
    • Location
    • URLs
    • Status (running, stopped, removed)
    • Last time used
    • Created date
    • DDEV configuration version
    • Database size
    • Containers configured (web/db/dba/solr/etc...)

    I'm sure there's more that I can come up with.

    -mike

  8. rickmanelius commented on Jul 22, 2018

    @rickmanelius
    Contributor

    Since this has been a long time since we've revisited/updated, we will also need to clarify the language around ddev rm/stop/start because for a while we were going to remove "stop" and now I don't believe we will. The question then becomes how we delineate removing the containers, the config, the metadata, and/or the database. Not an impossible problem to solve, but just issues to work through as we approach this.

  9. added
    Prioritized
    and removed on Mar 22, 2019
  10. rfay commented on Mar 28, 2019

    @rfay
    MemberAuthor

    With the pull of #1502 this one is now completely unblocked in honor of @rickmanelius .

  11. changed the title [-]Manage ddev project list independently of docker container labels (sqlite or yaml)[/-] [+]Manage ddev project list independently of docker container labels (yaml)[/+] on Mar 28, 2019
  12. added 7 commits that reference this issue on May 16, 2019
    5c65cae
    4188b7d
    a3646da
    9f8147f
    e1f1464
    94d24c1
    86e52b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Prioritized

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions