Skip to content

Track ddev sites without just using docker labels, to track all sites created #524

Closed

Description

@rfay

What happened (or feature request):

Currently, we are completely dependent on docker labels for site metadata. So when we need to know what sites exist, we ask Docker. That's a pretty big problem, because in a normal workflow devs may create sites, then rm them (no container any more), and have lots of sites out there, but ddev (and ddev-ui) have no way to know about them. But we'd like for the user to know about all the sites they're working with. In a best-case scenario, ddev list would show all valid sites (configured with a .ddev), not just the ones that have containers.

This is super-important if ddev-ui is to show all sites a user might be working with.

What you expected to happen:

How to reproduce this:

Version: Please include the output of ddev version, docker version and the project's .ddev/config.yaml.

Anything else do we need to know:

Related source links or issues:

Activity

  1. rickmanelius commented on Nov 2, 2017

    @rickmanelius
    Contributor

    Related #484

  2. rickmanelius commented on Dec 26, 2017

    @rickmanelius
    Contributor
  3. self-assigned this
    on Dec 26, 2017
  4. added this to the v1.3.0 milestone on Dec 26, 2017
  5. rickmanelius commented on Dec 26, 2017

    @rickmanelius
    Contributor

    I've tagged this with milestone v1.3 because this will definitely start impacting people that toggle between the UI and the CLI as it pertains to if users prefer stop versus remove. The remove flag is more appropriate when workign with a large number of sites because there are memory considerations. Also, ddev list relying on containers being available may require UI users to constantly re-add manually. There is more to discuss here, but this is simply to bump this up the priority list.

  6. rfay commented on Feb 7, 2018

    @rfay
    MemberAuthor

    This is being discussed more explicitly in #642, which has an explicit proposal (inventory ddev projects with a sqlite or yaml db). It seems to have been lost in this issue, which didn't have an explicit proposal, but #642 has the explicit proposal. Many of the issues were discussed in google doc but no final proposal. I'd say we should close this one and move forward with #642.

  7. rickmanelius commented on Feb 7, 2018

    @rickmanelius
    Contributor

    Hi @rfay. Thanks for uncovering this issue in the queue! I need to do a better job of pruning. That said I fully agree that the new issue #642 has a more robust, explicit proposal that can supersede this issue, which I'll close as per your suggestion. And the google doc linked here did capture the very conversation that I was referring to. I want to pull the pros/cons lists into this thread (posted below) just so it's more easily detectable when searching GitHub itself.

    And based on discussions, it looks like we're ready to evolve from the docker labels approach into the metadata approach because the filesystem strategy simply has too many assumptions and issues to consider it a viable path forward IMHO.


    1. Listing Apps/Sites

    There are at least 3 different places we can key off of to determine ddev capable repos.

    A. Docker labels (current method)
    B. Metadata
    C. Filesystem scanning

    Reviewing each to surface pros/cons.

    A. Docker Labels

    Pros

    • It already exists and works in our codebase.
    • It prevents having to create, track, and maintain a separate system.
    • It only shows projects that are active (running or paused state).

    Cons

    • If someone modifies that docker-compose file, we could be assuming something that is not true.
    • The GUI will be unaware of other code repos with an existing ddev config. Users will have to “add” and then locate it within the file system.
    • If GUI users use “stop” to avoid having to re-add, then docker images will likely go stale versus encouraging users to delete/replace.

    B. Metadata

    Pros

    • This would allow ddev CLI/GUI to be aware of configured repos that already exists and yet don’t have active/paused containers around.
    • This would allow for global targeting of apps/sites anywhere on the command line.
    • This would allow for a single source of truth for the GUI to read from regardless of states of containers or file systems.

    Cons

    • This is yet another data storage to create, track, and maintain.
    • This can be fragile. A user may delete the repo and we need the metadata to detect and adjust as a result of that change.

    C. Filesystem scanning

    Pros

    • This doesn’t rely on docker container states or another storage system.
    • Users can specify the folder by a preference setting.
    • GUI could easily detect and be aware of projects configured, to be configured for ddev.

    Cons

    • It’s not safe to assume users will want to use a single folder location.
    • It’s not safe to assume users will not store non-repo folders in this main folder.
    • The GUI would have to note non-configured sites.
    • Moving the folder via preferences would immediately cause the GUI to lose track of them all.

  8. modified the milestones: v1.3.0, v0.13.0 on Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions