Skip to content

Commit

Permalink
debugged VM setup windows script for adding Anaconda to system path
Browse files Browse the repository at this point in the history
  • Loading branch information
hangzh-msft committed Feb 17, 2015
1 parent a4e8b4d commit 2739225
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Misc/MachineSetup/Azure_VM_Setup_Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function InstallAnacondaAndPythonDependencies
#Anaconda adds itself to the path, but unfortunately after the python2.7 install. We override this by setting the path here.
$addToPath = $pathToAnaconda+ ";" + $pathToAnaconda + "\Scripts;" + $sysDrive + "\python27;"
[Environment]::SetEnvironmentVariable("Path", $addToPath + $env:Path, "Machine")
$env:Path=[System.Environment]::GetEnvironmentVariable("Path","Machine")
}

Write-Output "Updating IPython"
Expand Down Expand Up @@ -228,13 +229,11 @@ function DownloadRawFromGitWithFileList($base_url, $file_list_name, $destination
}
}

function GetSampleNotebooksFromGit(){
Write-Output "Getting Sample Notebooks from Azure-MachineLearning-DataScience Git Repository"
$base_url = "https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/DataScienceProcess/iPythonNotebooks/"
$notebook_list_name = "Notebook_List.txt"
$destination_dir = Join-Path $notebook_dir "AzureMLSamples"

DownloadRawFromGitWithFileList $base_url $notebook_list_name $destination_dir
function GetSampleFilesFromGit($base_url, $list_name, $destination_dir){
#Write-Output "Getting Sample Notebooks from Azure-MachineLearning-DataScience Git Repository"
$file_url = "https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/DataScienceProcess/" + $base_url + "/"

DownloadRawFromGitWithFileList $file_url $list_name $destination_dir
}

function GetSampleScriptsFromGit(){
Expand Down Expand Up @@ -270,8 +269,14 @@ Write-Output "This script has been tested against the Azure Virtual Machine Imag
Write-Output "Other OS Versions may work but are not officially supported."

InstallAnacondaAndPythonDependencies
GetSampleNotebooksFromGit
GetSampleScriptsFromGit
#GetSampleNotebooksFromGit
#GetSampleScriptsFromGit
Write-Output "Fetching the sample IPython Notebooks..."
$dest_dir = $notebook_dir + "\DataScienceSamples"
GetSampleFilesFromGit "iPythonNotebooks" "Notebook_List.txt" $dest_dir
Write-Output "Fetching the sample script files..."
$dest_dir = $script_dir
GetSampleFilesFromGit "DataScienceScripts" "Script_List.txt" $dest_dir
InstallAzureUtilities
SetupIPythonNotebookService
ScheduleAndStartIPython
Expand Down

0 comments on commit 2739225

Please sign in to comment.