remove unused command line parameter, add AnacondaBasePath option

This commit is contained in:
Wolfgang Manousek 2017-01-10 10:46:36 +01:00
Родитель 5d28532c4b
Коммит 1ba7faacc8
2 изменённых файлов: 20 добавлений и 24 удалений

Просмотреть файл

@ -18,21 +18,15 @@
.PARAMETER localCache .PARAMETER localCache
This optional parameter can be used to specify the directory downloaded components will be stored in This optional parameter can be used to specify the directory downloaded components will be stored in
.PARAMETER ServerLocation .PARAMETER AnacondaBasePath
This is an optional parameter. The script can install pre-compiled components, this parameter This is an optional parameter and can be used to specify an already installed Anaconda3 installation.
specifies the location on a server where this componentents are downloaded from. By default a version of Anaconda3 will be installed into [C:\local\Anaconda3-4.1.1-Windows-x86_64]
This is useful for a team environment to share the components which need to get compiled (Protobuf, Zlib, libzip)
.PARAMETER CloneDirectory .EXAMPLE
By default the installer should be executed out of the <CntkCloneRoot>\Scripts\devInstall\Windows directory. Out of this
location the installer computes the root directory of the CNTK clone. In the case the installer is in a different location,
the root directory of the CNTK clone can be specified using this parameter
.EXAMPLE
installer.ps1 installer.ps1
Run the installer and see what operations would be performed Run the installer and see what operations would be performed
.EXAMPLE .EXAMPLE
installer.ps1 -Execute installer.ps1 -Execute
Run the installer and install the development tools Run the installer and install the development tools
@ -41,10 +35,12 @@
Run the installer, but don't install any GPU specific tools Run the installer, but don't install any GPU specific tools
.EXAMPLE .EXAMPLE
installer.ps1 -Execute -NoGpu -CloneDirectory c:\repos\CNTKAlternate installer.ps1 -Execute -NoGpu
Run the installer, but don't install any GPU specific tools
.EXAMPLE .EXAMPLE
.\install.ps1 -Execute -AnacondaBasePath d:\mytools\Anaconda34
This will install Anaconda in the [d:\mytools\Anaconda34] directory, or reuse this Anaconda installation if the directory exists.
#> #>
@ -54,8 +50,7 @@ Param(
[parameter(Mandatory=$false)] [switch] $NoGpu, [parameter(Mandatory=$false)] [switch] $NoGpu,
[parameter(Mandatory=$false)] [string] $localCache = "c:\installCacheCntk", [parameter(Mandatory=$false)] [string] $localCache = "c:\installCacheCntk",
[parameter(Mandatory=$false)] [string] $InstallLocation = "c:\local", [parameter(Mandatory=$false)] [string] $InstallLocation = "c:\local",
[parameter(Mandatory=$false)] [string] $ServerLocation, [parameter(Mandatory=$false)] [string] $AnacondaBasePath = "C:\local\Anaconda3-4.1.1-Windows-x86_64")
[parameter(Mandatory=$false)] [string] $CloneDirectory)
$roboCopyCmd = "robocopy.exe" $roboCopyCmd = "robocopy.exe"
$localDir = $InstallLocation $localDir = $InstallLocation
@ -139,8 +134,8 @@ Function main
$operation += OpZlibVS15 -cache $localCache -targetFolder $localDir -repoDirectory $CloneDirectory $operation += OpZlibVS15 -cache $localCache -targetFolder $localDir -repoDirectory $CloneDirectory
$operation += OpZlibVS15Prebuild -cache $localCache -targetFolder $localDir $operation += OpZlibVS15Prebuild -cache $localCache -targetFolder $localDir
$operation += OpOpenCV31 -cache $localCache -targetFolder $localDir $operation += OpOpenCV31 -cache $localCache -targetFolder $localDir
$operation += OpAnaconda3411 -cache $localCache -targetFolder $localDir $operation += OpAnaconda3411 -cache $localCache -AnacondaBasePath $AnacondaBasePath
$operation += OpAnacondaEnv34 -targetFolder $localDir -repoDir $repositoryRootDir -repoName $reponame $operation += OpAnacondaEnv34 -AnacondaBasePath $AnacondaBasePath -repoDir $repositoryRootDir -repoName $reponame
$operationList = @() $operationList = @()
$operationList += (VerifyOperations $operation) $operationList += (VerifyOperations $operation)

Просмотреть файл

@ -1,10 +1,11 @@
function OpAnaconda3411( function OpAnaconda3411(
[parameter(Mandatory=$true)][string] $cache, [parameter(Mandatory=$true)][string] $cache,
[parameter(Mandatory=$true)][string] $targetFolder) [parameter(Mandatory=$true)][string] $AnacondaBasePath)
{ {
$targetFolder = Split-Path $AnacondaBasePath -Parent
$prodSubDir = Split-Path $AnacondaBasePath -Leaf
$prodName = "Anaconda3-4.1.1" $prodName = "Anaconda3-4.1.1"
$prodFile = "Anaconda3-4.1.1-Windows-x86_64.exe" $prodFile = "Anaconda3-4.1.1-Windows-x86_64.exe"
$prodSubDir = "Anaconda3-4.1.1-Windows-x86_64"
$targetPath = join-path $targetFolder $prodSubDir $targetPath = join-path $targetFolder $prodSubDir
$downloadSource = "https://repo.continuum.io/archive/Anaconda3-4.1.1-Windows-x86_64.exe" $downloadSource = "https://repo.continuum.io/archive/Anaconda3-4.1.1-Windows-x86_64.exe"
$downloadSize = 370055720 $downloadSize = 370055720
@ -17,13 +18,13 @@
} }
function OpAnacondaEnv34( function OpAnacondaEnv34(
[parameter(Mandatory=$true)][string] $targetFolder, [parameter(Mandatory=$true)][string] $AnacondaBasePath,
[parameter(Mandatory=$true)][string] $repoDir, [parameter(Mandatory=$true)][string] $repoDir,
[parameter(Mandatory=$true)][string] $reponame) [parameter(Mandatory=$true)][string] $reponame)
{ {
$prodName = "Python 3.4 Environment" $prodName = "Python 3.4 Environment"
$targetFolder = Split-Path $AnacondaBasePath -Parent
$prodSubDir = "Anaconda3-4.1.1-Windows-x86_64" $prodSubDir = Split-Path $AnacondaBasePath -Leaf
$targetPath = join-path $targetFolder $prodSubDir $targetPath = join-path $targetFolder $prodSubDir
$envName = "cntkdev-py34" $envName = "cntkdev-py34"
$envDir = "envs\$envName" $envDir = "envs\$envName"
@ -128,7 +129,7 @@ function OpMSMPI70SDK(
$downloadSource = "https://download.microsoft.com/download/D/7/B/D7BBA00F-71B7-436B-80BC-4D22F2EE9862/$remoteFilename"; $downloadSource = "https://download.microsoft.com/download/D/7/B/D7BBA00F-71B7-436B-80BC-4D22F2EE9862/$remoteFilename";
$downloadSize = 2285568 $downloadSize = 2285568
@( @{Name = "MSMPI SDK70 Installation"; ShortName = "CNTK"; VerifyInfo = "Checking for installed MSMPI 70 SDK"; ActionInfo = "Install MSMPI 70 SDK"; @( @{Name = "MSMPI SDK70 Installation"; ShortName = "CNTK"; VerifyInfo = "Checking for installed MSMPI 70 SDK"; ActionInfo = "Installing MSMPI 70 SDK";
Verification = @( @{Function = "VerifyWinProductVersion"; Match = "^Microsoft MPI SDK \(\d+\."; Version = "7.0.12437.6"; MatchExact = $false } ); Verification = @( @{Function = "VerifyWinProductVersion"; Match = "^Microsoft MPI SDK \(\d+\."; Version = "7.0.12437.6"; MatchExact = $false } );
#Verification = @( @{Function = "VerifyWinProductExists"; Match = "^Microsoft MPI SDK \(\d+\."; Compare = "^Microsoft MPI SDK \(7\.0\.12437\.6\)"; MatchExact = $false } ); #Verification = @( @{Function = "VerifyWinProductExists"; Match = "^Microsoft MPI SDK \(\d+\."; Compare = "^Microsoft MPI SDK \(7\.0\.12437\.6\)"; MatchExact = $false } );
Download = @( @{Function = "Download"; Method = "WebRequest"; Source = $downloadSource; Destination = "$cache\$localFilename"; ExpectedSize = $downloadSize } ); Download = @( @{Function = "Download"; Method = "WebRequest"; Source = $downloadSource; Destination = "$cache\$localFilename"; ExpectedSize = $downloadSize } );