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

- added windows support for pushing images to aws ecr #2500

Merged
merged 5 commits into from
Mar 4, 2020

Conversation

AndreyBulezyuk
Copy link
Contributor

  • import platform

What changes are proposed in this pull request?

Bugfix 2311. Added support for Windows in the Sagemaker mlflow sagemaker build-and-push-container CLI Command.

How is this patch tested?

Tested on Windows 10, Python 3.6.8 with execution of the code and successful deployment of local ML Model to AWS Sagemaker Service.
A final test on Linux machine would be great. (Can't do that at the moment)

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

(MLFlow Sagemaker CLI now supports sagemaker deployment from a Windows machine.)

What component(s) does this PR affect?

  • UI
  • CLI
  • API
  • REST-API
  • Examples
  • Docs
  • Tracking
  • Projects
  • Artifacts
  • Models
  • Scoring
  • Serving
  • R
  • Java
  • Python

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

@mparkhe mparkhe added rn/breaking-change Mention under Breaking Changes in Changelogs. rn/feature Mention under Features in Changelogs. and removed rn/breaking-change Mention under Breaking Changes in Changelogs. labels Feb 28, 2020
@AndreyBulezyuk
Copy link
Contributor Author

AndreyBulezyuk commented Mar 2, 2020

@mparkhe Do i have to do something with this PR in order to move it forward? Or do i just wait?

@mparkhe
Copy link
Collaborator

mparkhe commented Mar 3, 2020

@mparkhe Do i have to do something with this PR in order to move it forward? Or do i just wait?

Hi @AndreyBulezyuk: We will take a look at this PR shortly. Thank you for your patience.

@mparkhe mparkhe requested review from tomasatdatabricks and dbczumar and removed request for tomasatdatabricks March 3, 2020 01:21
Copy link
Contributor

@tomasatdatabricks tomasatdatabricks left a comment

Choose a reason for hiding this comment

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

Hi @AndreyBulezyuk, thanks for the PR!

Looks good, I tested it manually on linux and mac and it works as expected.
I only had one small question.

@@ -127,11 +128,23 @@ def push_image_to_ecr(image=DEFAULT_IMAGE_NAME):
# x = ecr_client.get_authorization_token()['authorizationData'][0]
# docker_login_cmd = "docker login -u AWS -p {token} {url}".format(token=x['authorizationToken']
# ,url=x['proxyEndpoint'])
docker_login_cmd = "$(aws ecr get-login --no-include-email)"
os_command_separator = ";\n"
if platform.system() == "Windows":
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we use sys.platform == "win32" elsewhere in the code to determine whether we're on Windows. Do you have a reason why do you use platform.system() == "Windows" instead? If it does not matter, we should use the same test. If it's more robust, we should replace the test in other places as a subsequent PR.

Copy link
Contributor Author

@AndreyBulezyuk AndreyBulezyuk Mar 4, 2020

Choose a reason for hiding this comment

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

I have no explicit reason for that, just made most sense. I also saw elsewhere in the code (project/init.py) that we use if os.name != "nt": to determine whether we are on windows.

I think i should research a bit more and find a more scalable way to figure out on what OS we are. Maybe i should take a look at how tensorflow or other major python projects do that?

Maybe an Object or Config File that would contain all resources for every os, like the terminal type, command separator, etc. Or maybe a library that does that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like tensorflow uses 'platform' quite often. Here their a simple method for windows identification:

def _is_windows():
  return platform.system() == "Windows"

Not sure if mlflow has a global repository of methods/helpers, but we could code a few OS identifying methods (like the one above) and use these helpers everywhere else in the code. This way if we decide to change the way we identify a OS, we must do so only in one location (helper/global methods).

How does that sound?

https://github.com/tensorflow/tensorflow/blob/b04371bc952f9f9668e862d82db71651fdef8dc6/third_party/gpus/check_cuda_libs.py#L42

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds great! Thanks for looking into it. I think we can do that in a followup though and merge this PR as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, merging now, thanks again for the contribution!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you in mlflow Slack? @tomasatdatabricks

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I am (name is Tomas Nykodym).

Copy link
Contributor

@tomasatdatabricks tomasatdatabricks left a comment

Choose a reason for hiding this comment

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

lgtm

@tomasatdatabricks tomasatdatabricks merged commit 32c0d7b into mlflow:master Mar 4, 2020
avflor pushed a commit to avflor/mlflow that referenced this pull request Aug 22, 2020
* - added windows support for pushing images to aws ecr
- import platform

* - fixed linting issue

* changed string format to python2 compatibility

* minor string format correction

* logging formatting interpolation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn/feature Mention under Features in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants