-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Sudivate/scoringimage #54
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
287cba3
added image creation script for web app
sudivate 9f0ba63
added model version as variable
sudivate 1c31f15
images for webapp release
sudivate 1279bb0
corrected indentation
sudivate 4e4b7ce
updated doc for web app release
sudivate 6571210
Update getting_started.md
sudivate 9d49b9f
Update getting_started.md
sudivate f5fd2c7
Update getting_started.md
sudivate fadf372
Update getting_started.md
sudivate 3a55d51
correcting doc
sudivate ffd37fd
correcting doc
sudivate 85f19ac
correcting doc
sudivate 7ea160e
correcting doc
sudivate 7c8206a
correcting doc
sudivate a6ec9a2
Update getting_started.md
sudivate 65b4ce3
PR comments
sudivate a610ad1
updating link
sudivate 984399b
updating links to script
sudivate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import os | ||
| from azureml.core import Workspace | ||
| from azureml.core.image import ContainerImage, Image | ||
| from azureml.core.model import Model | ||
| from dotenv import load_dotenv | ||
| from azureml.core.authentication import ServicePrincipalAuthentication | ||
|
|
||
| load_dotenv() | ||
|
|
||
| TENANT_ID = os.environ.get('TENANT_ID') | ||
| APP_ID = os.environ.get('APP_ID') | ||
| APP_SECRET = os.environ.get('APP_SECRET') | ||
| WORKSPACE_NAME = os.environ.get('WORKSPACE_NAME') | ||
| SUBSCRIPTION_ID = os.environ.get('SUBSCRIPTION_ID') | ||
| RESOURCE_GROUP = os.environ.get('RESOURCE_GROUP') | ||
| MODEL_NAME = os.environ.get('MODEL_NAME') | ||
| MODEL_VERSION = os.environ.get('MODEL_VERSION') | ||
| IMAGE_NAME = os.environ.get('IMAGE_NAME') | ||
|
|
||
|
|
||
| SP_AUTH = ServicePrincipalAuthentication( | ||
| tenant_id=TENANT_ID, | ||
| service_principal_id=APP_ID, | ||
| service_principal_password=APP_SECRET) | ||
|
|
||
| ws = Workspace.get( | ||
| WORKSPACE_NAME, | ||
| SP_AUTH, | ||
| SUBSCRIPTION_ID, | ||
| RESOURCE_GROUP | ||
| ) | ||
|
|
||
|
|
||
| model = Model(ws, name=MODEL_NAME, version=MODEL_VERSION) | ||
| os.chdir("./code/scoring") | ||
|
|
||
| image_config = ContainerImage.image_configuration( | ||
| execution_script="score.py", | ||
| runtime="python", | ||
| conda_file="conda_dependencies.yml", | ||
| description="Image with ridge regression model", | ||
| tags={"area": "diabetes", "type": "regression"}, | ||
| ) | ||
|
|
||
| image = Image.create( | ||
| name=IMAGE_NAME, models=[model], image_config=image_config, workspace=ws | ||
| ) | ||
|
|
||
| image.wait_for_creation(show_output=True) | ||
|
|
||
| if image.creation_state != "Succeeded": | ||
| raise Exception("Image creation status: {image.creation_state}") | ||
|
|
||
| print("{}(v.{} [{}]) stored at {} with build log {}".format( | ||
| image.name, | ||
| image.version, | ||
| image.creation_state, | ||
| image.image_location, | ||
| image.image_build_log_uri, | ||
| ) | ||
| ) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.