Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
add bootstrap container for AIML50 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
smurawski authored and FBoucher committed Dec 6, 2019
1 parent af5bc26 commit 26c5ea4
Show file tree
Hide file tree
Showing 40 changed files with 31,564 additions and 0 deletions.
26 changes: 26 additions & 0 deletions aiml50/bootstrap-container/Dockerfile
@@ -0,0 +1,26 @@
FROM mcr.microsoft.com/powershell

# Install apt-get
RUN apt-get update && \
apt-get install curl -y && \
apt-get install wget -y

RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

RUN wget -O azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux
RUN tar -xf azcopy.tar.gz

RUN az extension add -n azure-devops

RUN mkdir /images
RUN wget -O images.tar.gz https://globaleventcdn.blob.core.windows.net/assets/aiml/aiml50/images.tar.gz
RUN tar -xf images.tar.gz

RUN mkdir /modules
COPY modules /modules
COPY ReleaseSeer.json /
COPY boot-strap.ps1 /
RUN chmod 777 boot-strap.ps1

# Add entrypoint
CMD ["/bootstrap.ps1"]
38 changes: 38 additions & 0 deletions aiml50/bootstrap-container/README.md
@@ -0,0 +1,38 @@
# Bootstrap Container

This container image helps fill gaps in the provisioning process.

## Contents

Based on the PowerShell Core container

Software:

* Curl
* Wget
* Azure CLI
* Azure DevOps extension to the Az CLI
* AzCopy
* VSTeam PowerShell module (and supporting modules)

Content files:

* ReleaseSeer.json - Azure DevOps Release template
* Images - training images and product images for the website (pulled from the event CDN at container build time)

## Bootstrap process

The container starts a PowerShell script that (in this order):

* Verifies or creates a project named `AIML50` in the targeted Azure DevOps organization.
* Verifies or adds the `ms-air-aiagility/vss-services-azureml` extension to the organization
* Verifies or creates an artifact feed called `SeerPackages`
* Verifies or creates a variable group called `aiml50-demo`
* Verifies or imports the ReleaseSeer release definition
* Copies the image files out to the Azure storage created by the deployment template
* Begins to poll for the Tailwind Traders site to be up and running. (Polls every 10 seconds.)
* This polling will, once the site is running, trigger the scaffolding of the database project, allowing the next step to proceed.
* Connect to the Azure SQL Database to insert a record for a wrench (Attempts up to 5 times with 120 sleep in between attempts)
* Checks for an existing ID number and inserts if missing.

If the bootstrap container fails to run, it should be able to re-run without affecting already configured parts.
230 changes: 230 additions & 0 deletions aiml50/bootstrap-container/ReleaseSeer.json
@@ -0,0 +1,230 @@
{
"name": "Release Seer",
"variables": {},
"variableGroups": [
"$($VariableGroup.id)"
],
"environments": [
{
"name": "Deploy to ACI",
"rank": 1,
"variables": {},
"variableGroups": [],
"preDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false
}
]
},
"deployStep": { },
"postDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false
}
]
},
"deployPhases": [
{
"deploymentInput": {
"parallelExecution": {
"parallelExecutionType": 0
},
"agentSpecification": {
"identifier": "ubuntu-18.04"
},
"skipArtifactsDownload": false,
"artifactsDownloadInput": {
"downloadInputs": []
},
"demands": [],
"enableAccessToken": false,
"timeoutInMinutes": 0,
"jobCancelTimeoutInMinutes": 1,
"condition": "succeeded()",
"overrideInputs": {}
},
"rank": 1,
"phaseType": 1,
"name": "Agent job",
"refName": null,
"workflowTasks": [
{
"environment": {},
"taskId": "46e4be58-730b-4389-8a2f-ea10b3e5e815",
"version": "1.*",
"name": "Get Universal Packages version",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"connectedServiceNameARM": "`$(subscription_workspace)",
"scriptLocation": "inlineScript",
"scriptPath": "",
"inlineScript": "az extension add -n azure-cli-ml\n\necho \"Retrieving universal package version for model `$(Release.Artifacts._seer.DefinitionName):`$(Release.Artifacts._seer.BuildNumber)\"\n\nmodelId=\"`$(Release.Artifacts._seer.DefinitionName):`$(Release.Artifacts._seer.BuildNumber)\"\npkgver=`$(az ml model show -i `$modelId -w \"`$(session)`$(event)\" -g `$(resource_group) --query 'tags.uver' -o tsv)\n\necho \"Universal Packages version is `$pkgver\"\n\necho \"##vso[task.setvariable variable=UniversalPackageId]`$pkgver\"",
"args": "",
"addSpnToEnvironment": "false",
"useGlobalConfig": "false",
"cwd": "",
"failOnStandardError": "false"
}
},
{
"environment": {},
"taskId": "e0b79640-8625-11e8-91be-db2878ff888a",
"version": "0.*",
"name": "Download deployment and inferencing code",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"command": "download",
"downloadDirectory": "`$(System.DefaultWorkingDirectory)/deploymentcode",
"internalOrExternalDownload": "internal",
"externalEndpoint": "",
"feedListDownload": "$($PackageFeed.ID)",
"packageListDownload": "",
"versionListDownload": "`$(UniversalPackageId)",
"feedDownloadExternal": "",
"packageDownloadExternal": "",
"versionDownloadExternal": "",
"publishDirectory": "`$(Build.ArtifactStagingDirectory)",
"internalOrExternalPublish": "internal",
"externalEndpoints": "",
"feedListPublish": "",
"publishPackageMetadata": "true",
"packageListPublish": "",
"feedPublishExternal": "",
"packagePublishExternal": "",
"versionPublishSelector": "patch",
"versionPublish": "",
"packagePublishDescription": "",
"verbosity": "None",
"publishedPackageVar": ""
}
},
{
"environment": {},
"taskId": "d9237456-3431-4c1d-b7bf-d6b937425f0f",
"version": "0.*",
"name": "Azure ML Model Deploy",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"connectedServiceNameARM": "`$(subscription_workspace)",
"validateProfile": "false",
"inputData": "",
"overwriteParams": "false",
"modelProfileName": "myprofile",
"profileResultJson": "",
"modelSourceType": "modelArtifact",
"modelName": "",
"modelVersion": "",
"inferencePath": "`$(System.DefaultWorkingDirectory)/deploymentcode/inferenceconfig.json",
"deploymentTarget": "ACI",
"aksCluster": "",
"deploymentName": "seer-deployment",
"deployConfig": "`$(System.DefaultWorkingDirectory)/deploymentcode/deploymentconfig.json",
"overwriteExistingDeployment": "true"
}
},
{
"environment": {},
"taskId": "46e4be58-730b-4389-8a2f-ea10b3e5e815",
"version": "1.*",
"name": "Set ImagePredictorEndpoint",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"connectedServiceNameARM": "`$(subscription)",
"scriptLocation": "inlineScript",
"scriptPath": "",
"inlineScript": "endpoint=`$(az container show --resource-group `$(resource_group) --name seer-deployment --query ipAddress.fqdn -o tsv)\naz webapp config appsettings set -g `$(resource_group) -n `$(session)`$(event) --settings ImagePredictorEndpoint=\"http://`$endpoint/score?image=\"",
"args": "",
"addSpnToEnvironment": "false",
"useGlobalConfig": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
]
}
],
"environmentOptions": {
"emailNotificationType": "OnlyOnFailure",
"emailRecipients": "release.environment.owner;release.creator",
"skipArtifactsDownload": false,
"timeoutInMinutes": 0,
"enableAccessToken": false,
"publishDeploymentStatus": true,
"badgeEnabled": false,
"autoLinkWorkItems": false,
"pullRequestDeploymentEnabled": false
},
"demands": [],
"conditions": [
{
"name": "ReleaseStarted",
"conditionType": 1,
"value": ""
}
],
"executionPolicy": {
"concurrencyCount": 1,
"queueDepthCount": 0
},
"schedules": [],
"retentionPolicy": {
"daysToKeep": 30,
"releasesToKeep": 3,
"retainBuild": true
},
"processParameters": {},
"properties": {
"LinkBoardsWorkItems": {
"$type": "System.String",
"$value": "False"
}
},
"preDeploymentGates": {
"id": 0,
"gatesOptions": null,
"gates": []
},
"postDeploymentGates": {
"id": 0,
"gatesOptions": null,
"gates": []
},
"environmentTriggers": []

}
]
}

0 comments on commit 26c5ea4

Please sign in to comment.