Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Feature: New Toolkit configuration #507

Merged
merged 36 commits into from
May 1, 2018
Merged

Feature: New Toolkit configuration #507

merged 36 commits into from
May 1, 2018

Conversation

timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Apr 24, 2018

fix #503 Added a new toolkit key to abstract away the complexity of docker repo versioning.

toolkit:
  software: spark
  version: 2.2
  # environment: python
  # Optional version for the environment
  # environment_verion: 

  # Optional docker repository(To bring your custom docker image. Just specify the Toolkit software, version and environemnt if using default images)
  # docker_repo: <name of docker image repo (for more information, see https://github.com/Azure/aztk/blob/master/docs/12-docker-image.md)

Include error throwing if using invalid images which is a step in the direction for #266
image

Browse available toolkits with the aztk toolkit command
image

def validate(self) -> bool:
"""
Validate the config at its current state.
Raises: Error if invalid
"""
if self.toolkit is None:
raise error.InvalidModelError(
"Please supply a toolkit for the cluster")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should list available toolkits?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does if you input an invalid software

image


TOOLKIT_MAP = dict(
spark=ToolkitDefinition(
versions=["1.6", "2.1", "2.2"],
Copy link
Contributor

Choose a reason for hiding this comment

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

do we care about minor revisions?

Not sure if we support it, but 1.6 is actually 1.6.3. Also, 2.2 had several revisions to it as well, so probably worth being explicit.

Copy link
Member Author

Choose a reason for hiding this comment

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

this depends on how the docker images are created. I feel like we should not care about this here.
We are not going to provide multiple docker images per minor version. So being more precise will just break people when we update docker image 2.2.3 -> 2.2.4 for example

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we need to answer that question then. Are we going to do a 2.2.3 -> 2.2.4? I guess users probably shouldn't care too much about that and if they do, they can use a custom docker image... Seems fine then.

self._validate_required(["software", "version"])

if self.software not in TOOLKIT_MAP:
raise InvalidModelError("Toolkit {0} is not in the list of allowed toolkits {1}".format(
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick - add ' around the toolkit name

Toolkit 'spark' is not ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for print statements below

@jafreck jafreck added this to the v0.7.0 milestone Apr 28, 2018
@timotheeguerin timotheeguerin merged commit 7a7e63c into master May 1, 2018
@timotheeguerin timotheeguerin deleted the feature/toolkit branch May 1, 2018 23:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add abstracted docker_repo functionality
3 participants