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

Introduce new config format with volume support and versioning #2113

Closed
wants to merge 19 commits into from

Conversation

shin-
Copy link

@shin- shin- commented Sep 30, 2015

This is a work in progress (volume support is not implemented) submitted early so we can start discussing the design approach and new schema.


@validate_top_level_object
def get_config_version(config):
return config.get('version')

Choose a reason for hiding this comment

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

This doesn't need to be in a separate function. It's a dict lookup so can just be a line in pre_process_config function and then that way we're not doing validate_top_level_object twice.

@dnephin dnephin mentioned this pull request Oct 6, 2015
@michaeljs1990
Copy link

Sorry, just so i understand correctly... Docker compose is going to be switching to using json now instead of yaml files? Just want to get ready for this change since i'll be upgrading as soon as the new version comes out.

@dnephin
Copy link

dnephin commented Oct 6, 2015

@michaeljs1990 no we're not switching to json. We can use jsonschema with yaml configuration since they deserialize into the same python structure.

@michaeljs1990
Copy link

@dnephin thanks, sorry for the confusion.

@shin- shin- force-pushed the 2110-volumes_config_support branch from 6bf736b to 6e1c4a7 Compare October 7, 2015 01:38
@shin- shin- force-pushed the 2110-volumes_config_support branch 3 times, most recently from 607af35 to 2bdaabf Compare October 8, 2015 14:25
@dnephin dnephin added this to the 1.6.0 milestone Nov 2, 2015
shin- and others added 9 commits November 6, 2015 19:36
The validation module has been updated to detect automatically which
version is being used and switch schemas accordingly.

Signed-off-by: Joffrey F <[email protected]>
This change effectively discards the contents of the 'volumes' dictionary
if using a v2 config. This will be implemented separately.
The version is detected dynamically to support both legacy and v2 formats.

Signed-off-by: Joffrey F <[email protected]>
Rewrite some of the logic to better accomodate differing formats
now and in the future.

Signed-off-by: Joffrey F <[email protected]>
Reference service definition in the base field schema (v1) instead
of copying it over. Limit acceptable types for driver options in
volume definition.

Signed-off-by: Joffrey F <[email protected]>
To support the expanding config format, we now use a complex
`config.Config` object containing version, services, and volumes
information. project.Project updated accordingly and tests take
the new format into account.

Signed-off-by: Joffrey F <[email protected]>
Add Volume class that supports basic volume operations (creation,
removal, inspection). Project class sets up volume at the
beginning of Project.up()
Volume config is now properly passed down to Project class.

Signed-off-by: Joffrey F <[email protected]>
API 1.21 is required to support volume declaration.
Update tearDown method for integration tests to remove test volumes.

Signed-off-by: Joffrey F <[email protected]>
The volume format returned by the API has changed in recent version,
causing issues when trying to recreate containers with volumes attached.

Signed-off-by: Joffrey F <[email protected]>
Volumes were being inserted in the services list, causing issues at
runtime.
Also catch API error when volume driver is invalid.

Signed-off-by: Joffrey F <[email protected]>
@shin- shin- force-pushed the 2110-volumes_config_support branch from 322f713 to 84a9f0e Compare November 6, 2015 19:02
Signed-off-by: Joffrey F <[email protected]>
@shin-
Copy link
Author

shin- commented Nov 19, 2015

Closing in favor of #2421 (because the code has undergone significant changes since, rewriting the PR had become easier than rebasing the changes).

@shin- shin- closed this Nov 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants