Skip to content

Allow vendor-specific extensions #17

Closed

Description

@ndeloof

What is the problem you're trying to solve
Compose specification is platform-neutral, and express a generic application model. But if we don't want this to just be an academic model, but a pragmatic one people can actually use for real-world application, we need to offer a way for vendors to support custom attributes. Compose specification do allready have such a support with x-* extension fields on top-level elements.

Describe the solution you'd like

  1. A generalization of the extension field support
  2. Recommendation to use vendor prefixes and document known ones

Doing so one could use a compose file like this one :

service:
  backend:
    deploy:
      placement:  
        x-aws-region:   "eu-west-3"
        x-azure-region: "france-central"

Unrecognized x- attributes should be ignored, which means the same compose file can both run locally, on AWS and Azure. If this proprietary extension is widely adopted and supported by many vendors, it would make it easier to debate about inclusion in a future version of the specification.

Use of vendor prefixes also limit the risk for conflicting extensions with distinct meaning by vendors.

Additional context
Add any other context about the feature request here.

Activity

  1. hangyan commented on Jan 19, 2020

    @hangyan
    Collaborator

    Can the x- field support other data types?

  2. ndeloof commented on Jan 19, 2020

    @ndeloof
    CollaboratorAuthor

    x-* fields can be any type, the spec nor the schema do define any constraint on it.
    So can be either just a simple type, or a full nested structure.

  3. hangyan commented on Jan 21, 2020

    @hangyan
    Collaborator

    Even though, this number of the x-* fields could grow rapidly, i was hoping an extension filed to include all of this. If we allow x-* fields everywhere, i'm afrid it will destroy the origin structure of a docker-compose file.

  4. ndeloof commented on Jan 21, 2020

    @ndeloof
    CollaboratorAuthor

    Defining an extension section would isolate custom fiels from the elements they apply to. Please also note x-* already exist in opensource docker-compose file format (for top-level fields), and are used by docker CLI.

    I also expect the number of x-* fields to grow, and that this could trigger discussions on extending the spec to support more use-case if some ome them are supported on a significant number of implementations. Consider those a way to introduce "experimental" features by vendors, just like browsers do with CSS.

  5. hangyan commented on Jan 21, 2020

    @hangyan
    Collaborator

    Ok. This seems a better choice.

  6. ndeloof commented on Feb 11, 2020

    @ndeloof
    CollaboratorAuthor

    see docker/compose#7200 for discussion before spec is made public

  7. added
    Approved 👍
    on May 7, 2020
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

    Approved 👍

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions