-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable Windows CAB packages (#807) The installer script now installs a CAB package containing the IoT Edge daemon, the Moby engine, and the Moby CLI. Install-SecurityDaemon and Uninstall-SecurityDaemon have been renamed to Install-IoTEdge and Uninstall-IoTEdge respectively. The original names have been kept as aliases for backward-compatibility. There are also three new commands - Deploy-IoTEdge, Initialize-IoTEdge and Update-IoTEdge. Deploy-IoTEdge installs the CAB and Initialize-IoTEdge generates the config.yaml. Install-IoTEdge just calls Deploy and Initialize in sequence. Update-IoTEdge updates the CAB; there is no longer a need to uninstall and reinstall to update the daemon. The -DeleteMobyDataRoot and -DeleteConfig switches have been removed from\ Uninstall-IoTEdge since they only existed to maintain the container images and config.yaml in update scenarios. Since Uninstall is no longer needed for update scenarios, it will always delete the Moby data root and config.yaml The Moby engine service is now always installed and started, even when using Linux containers. Since it listens on a different named pipe, it will not interfere with an existing Docker for Windows install. * Fix homedir in config.yaml generated by Windows installer (#890) * Cleanup logging (#889) * Cleanup logging * Don't let `takeown` block on a user prompt (#910) `takeown` prompts the user to allow it to take ownership of a directory if the user does not have the "List" permission for it. If this prompt happens during the uninstaller, it blocks the uninstaller with no indication that the user needs to press Y to continue. With this change, the `/d y` switch is used to answer Y to the prompt automatically. This is likely the reason for issues like #793 * Fix of image auth regex (#913) On a run of the E2E tests it was observed that the existing regex matched a comment containing the word 'auth' and the replace was consequently broken. This fix attempts to search for the auth under the agent section. * Cleanup packaging to make it more suitable for the release job (#892) * Cleanup packaging to make it more suitable for the release job * Catch download failures properly * Enable resigning of the package catalog
- Loading branch information
Showing
7 changed files
with
1,278 additions
and
616 deletions.
There are no files selected for viewing
This file contains 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 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,75 @@ | ||
<?xml version='1.0' encoding='utf-8' standalone='yes'?> | ||
<identity | ||
xmlns="urn:Microsoft.CompPlat/ManifestSchema.v1.00" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
name="IoTEdge" | ||
namespace="Azure" | ||
owner="Microsoft" | ||
> | ||
<files> | ||
<file source="$(_REPO_ROOT)\edgelet\contrib\config\windows\config.yaml" destinationDir="$(runtime.programFiles)\iotedge" /> | ||
<file source="$(_REPO_ROOT)\edgelet\target\release\iotedge.exe" destinationDir="$(runtime.programFiles)\iotedge" /> | ||
<file source="$(_REPO_ROOT)\edgelet\target\release\iotedged.exe" destinationDir="$(runtime.programFiles)\iotedge" /> | ||
<file source="$(_REPO_ROOT)\edgelet\target\release\iotedged.pdb" destinationDir="$(runtime.programFiles)\iotedge" /> | ||
<file source="$(_REPO_ROOT)\edgelet\target\release\iotedged_eventlog_messages.dll" destinationDir="$(runtime.programFiles)\iotedge" /> | ||
<file source="$(_REPO_ROOT)\edgelet\hsm-sys\azure-iot-hsm-c\build\Release\iothsm.dll" destinationDir="$(runtime.programFiles)\iotedge" /> | ||
<file source="$(_OPENSSL_ROOT_DIR)\bin\libeay32.dll" destinationDir="$(runtime.programFiles)\iotedge" /> | ||
<file source="$(_REPO_ROOT)\edgelet\contrib\docs\LICENSE" destinationDir="$(runtime.programFiles)\iotedge\LICENSE" /> | ||
<file source="$(_REPO_ROOT)\edgelet\contrib\docs\ThirdPartyNotices" destinationDir="$(runtime.programFiles)\iotedge\LICENSE" /> | ||
<file source="$(_REPO_ROOT)\edgelet\contrib\docs\trademark" destinationDir="$(runtime.programFiles)\iotedge\LICENSE" /> | ||
|
||
<file source="$(_REPO_ROOT)\moby-engine\dockerd.exe" destinationDir="$(runtime.programFiles)\iotedge-moby" /> | ||
<file source="$(_REPO_ROOT)\moby-engine\LICENSE" destinationDir="$(runtime.programFiles)\iotedge-moby\legal-engine" /> | ||
<file source="$(_REPO_ROOT)\moby-engine\ThirdPartyNotices" destinationDir="$(runtime.programFiles)\iotedge-moby\legal-engine" /> | ||
|
||
<file source="$(_REPO_ROOT)\moby-cli\docker.exe" destinationDir="$(runtime.programFiles)\iotedge-moby" /> | ||
<file source="$(_REPO_ROOT)\moby-cli\LICENSE" destinationDir="$(runtime.programFiles)\iotedge-moby\legal-cli" /> | ||
<file source="$(_REPO_ROOT)\moby-cli\ThirdPartyNotices" destinationDir="$(runtime.programFiles)\iotedge-moby\legal-cli" /> | ||
</files> | ||
<regKeys> | ||
<regKey keyName="$(hklm.system)\CurrentControlSet\Services\EventLog\Application\iotedged"> | ||
<regValue name="CustomSource" value="1" type="REG_DWORD" /> | ||
<regValue name="EventMessageFile" value="$(runtime.programFiles)\iotedge\iotedged_eventlog_messages.dll" type="REG_SZ" /> | ||
<regValue name="TypesSupported" value="7" type="REG_DWORD" /> | ||
</regKey> | ||
<regKey keyName="$(hklm.system)\CurrentControlSet\Services\EventLog\Application\iotedge-moby"> | ||
<regValue name="CustomSource" value="1" type="REG_DWORD" /> | ||
<regValue name="EventMessageFile" value="$(runtime.programFiles)\iotedge-moby\dockerd.exe" type="REG_SZ" /> | ||
<regValue name="TypesSupported" value="7" type="REG_DWORD" /> | ||
</regKey> | ||
</regKeys> | ||
<service | ||
description="Moby Engine" | ||
displayName="Moby Engine" | ||
errorControl="normal" | ||
imagePath="$(runtime.programFiles)\iotedge-moby\dockerd.exe -H npipe:////./pipe/iotedge_moby_engine --exec-opt isolation=process --run-service --data-root $(runtime.programData)\iotedge-moby --exec-root $(runtime.programData)\iotedge-moby\\exec-root" | ||
name="iotedge-moby" | ||
objectName="LocalSystem" | ||
sidType="unrestricted" | ||
start="auto" | ||
startAfterInstall="none" | ||
type="win32OwnProcess" | ||
/> | ||
<service | ||
dependOnService="iotedge-moby" | ||
description="Azure IoT Edge Daemon" | ||
displayName="Azure IoT Edge Daemon" | ||
errorControl="normal" | ||
imagePath="$(runtime.programFiles)\iotedge\iotedged.exe -c $(runtime.programData)\iotedge\config.yaml" | ||
name="iotedge" | ||
objectName="LocalSystem" | ||
sidType="unrestricted" | ||
start="auto" | ||
startAfterInstall="none" | ||
type="win32OwnProcess"> | ||
<failureActions resetPeriod="0"> | ||
<actions> | ||
<action | ||
delay="1000" | ||
type="restartService" | ||
/> | ||
</actions> | ||
</failureActions> | ||
</service> | ||
</identity> |
This file contains 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,141 @@ | ||
Param([Switch] $CreateTemplate, [Switch] $CreateCab, [Switch] $SkipInstallCerts) | ||
|
||
$EdgeCab = "Microsoft-Azure-IoTEdge.cab" | ||
$EdgeTemplate = "Package-Template" | ||
|
||
Function New-Cabinet([String] $Destination, [String[]] $Files, [String] $Path) | ||
{ | ||
$Ddf = [IO.Path]::GetTempFileName() | ||
$CabinetName = Split-Path -Leaf $Destination | ||
$DiskDirectory = Split-Path -Parent $Destination | ||
if (-not $DiskDirectory) { | ||
$DiskDirectory = "." | ||
} | ||
$DiskDirectory = (Get-Item -Path $DiskDirectory).FullName | ||
$Directories = $Files | Group-Object -Property { Split-Path -Parent $_ } | ||
$DdfContent = @" | ||
.Option Explicit | ||
.Set SourceDir=$Path | ||
.Set DiskDirectoryTemplate=$DiskDirectory | ||
.Set CabinetNameTemplate=$CabinetName | ||
.Set CompressionType=LZX | ||
.Set Compress=on | ||
.Set UniqueFiles=Off | ||
.Set Cabinet=On | ||
.Set MaxDiskSize=0 | ||
"@ | ||
$Directories | ForEach-Object { | ||
$Directory = $_.Name | ||
if (-not $Directory) | ||
{ | ||
$Directory = " ;" | ||
} | ||
$Files = $_.Group | ||
$DdfContent += @" | ||
.Set DestinationDir=$Directory | ||
$($OFS="`r`n"; $Files) | ||
"@ | ||
} | ||
$DdfContent | Out-File $Ddf -Encoding Ascii | ||
|
||
$DdfContent | ||
|
||
makecab.exe /f $Ddf | ||
if ($LASTEXITCODE) { | ||
Throw "Failed to create cab" | ||
} | ||
|
||
Remove-Item $Ddf | ||
} | ||
|
||
Function New-Package([string] $Name, [string] $Version) | ||
{ | ||
$pkggen = "${Env:ProgramFiles(x86)}\Windows Kits\10\tools\bin\i386\pkggen.exe" | ||
$manifest = "edgelet\build\windows\$Name.wm.xml" | ||
$cwd = "." | ||
Invoke-Expression "& '$pkggen' $manifest /universalbsp /variables:'_REPO_ROOT=..\..\..;_OPENSSL_ROOT_DIR=$env:OPENSSL_ROOT_DIR' /cpu:amd64 /version:$Version" | ||
if ($LASTEXITCODE) { | ||
Throw "Failed to package cab" | ||
} | ||
|
||
if (Test-Path $EdgeTemplate) { | ||
Remove-Item -Path $EdgeTemplate -Recurse -Force | ||
} | ||
New-Item -ItemType Directory -Path $EdgeTemplate | ||
Invoke-Expression "& ${Env:SystemRoot}\system32\Expand.exe $EdgeCab -f:* $EdgeTemplate" | ||
if ($LASTEXITCODE) { | ||
Throw "Failed to expand cab" | ||
} | ||
Remove-Item -Path $EdgeCab | ||
} | ||
|
||
if ($CreateTemplate) { | ||
$docker_cli_uri = "https://github.com/Azure/azure-iotedge/releases/download/1.0.5/moby-cli_3.0.2.zip" | ||
$docker_engine_uri = "https://conteng.blob.core.windows.net/mby/moby-engine_3.0.3.zip" | ||
|
||
$env:PATH = "$env:PATH;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\tools\bin\i386" | ||
$env:SIGNTOOL_OEM_SIGN = '/a /s my /i "Windows OEM Intermediate 2017 (TEST ONLY)" /n "Windows OEM Test Cert 2017 (TEST ONLY)" /fd SHA256' | ||
$env:SIGN_MODE = 'Test' | ||
$env:SIGN_OEM = '1' | ||
$env:SIGN_WITH_TIMESTAMP = '0' | ||
$env:WSKCONTENTROOT = 'C:\Program Files (x86)\Windows Kits\10' | ||
|
||
if (-not $SkipInstallCerts) { | ||
cmd /c installoemcerts.cmd | ||
} | ||
|
||
$ProgressPreference = 'SilentlyContinue' | ||
Invoke-WebRequest $docker_cli_uri -out "moby-cli.zip" -UseBasicParsing | ||
if (Test-Path "moby-cli") { | ||
Remove-Item -Path "moby-cli" -Recurse -Force | ||
} | ||
Expand-Archive -Path "moby-cli.zip" -DestinationPath "moby-cli" | ||
|
||
Invoke-WebRequest $docker_engine_uri -out "moby-engine.zip" -UseBasicParsing | ||
if (Test-Path "moby-engine") { | ||
Remove-Item -Path "moby-engine" -Recurse -Force | ||
} | ||
Expand-Archive -Path "moby-engine.zip" -DestinationPath "moby-engine" | ||
|
||
# | ||
# IoTEdge | ||
# | ||
|
||
Write-Host ("IoTEdge source version '{0}'" -f $env:VERSION) | ||
|
||
# VERSION is either 1.0.7~dev or 1.0.7 | ||
$splitVersion = $env:VERSION -split "~" | ||
if ($splitVersion.Length -eq 1) { | ||
$version = $env:VERSION | ||
$splitVersion = $version -split "\." | ||
if ($splitVersion.Length -eq 3) { | ||
$version = ("{0}.0" -f $version) | ||
} | ||
if ($version -notmatch "\d+\.\d+\.\d+\.\d+") { | ||
throw "Windows package requires VERSION in form major.minor.build.revision, each segment having 0-65535" | ||
} | ||
} | ||
else { | ||
# we need 255^2 tops per segment | ||
$major = ($splitVersion[0] -split "\.")[0] | ||
$splitSuffix = ($splitVersion[1] -split "\.") | ||
$dateSegment = ($splitSuffix[-2])[-8..-1] -join "" | ||
$date = [datetime]::ParseExact($dateSegment, "yyyyMMdd", $null) | ||
$dateEncoded = ("{0}{1}" -f ($date.ToString("yy")), $date.DayOfYear.ToString("000")) | ||
$buildPerDay = $splitSuffix[-1] | ||
$version = "0.{0}.{1}.{2}" -f $major, $dateEncoded, $buildPerDay | ||
} | ||
|
||
Write-Host "IoTEdge using version '$version'" | ||
|
||
New-Package -Name "iotedge" -Version $version | ||
} | ||
elseif ($CreateCab) { | ||
$TemplateDirLength = ((Get-Item -Path $EdgeTemplate).FullName.Length + 1) | ||
$Files = Get-ChildItem -Path $EdgeTemplate -Recurse | Where-Object { -not $_.PSIsContainer } | ForEach-Object { | ||
return $_.FullName.Remove(0, $TemplateDirLength) | ||
} | ||
New-Cabinet -Destination $EdgeCab -Files $Files -Path $EdgeTemplate | ||
} |
Oops, something went wrong.