Skip to content

[AutoML]mlnet CLI nupkg creation/signing #3606

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 5 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
<Message Importance="High" Text="Building packages ..." />

<ItemGroup>
<PkgProject Include="pkg\Microsoft.ML.Auto\Microsoft.ML.Auto.nupkgproj" />
<PkgProject Include="pkg\Microsoft.ML.Auto\*.nupkgproj" />
<PkgProject Include="pkg\mlnet\*.nupkgproj" />
</ItemGroup>

<MSBuild Projects="@(PkgProject)"
Expand Down
201 changes: 99 additions & 102 deletions build/vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,113 +8,110 @@ resources:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-8bba86b-20190314145033

phases:
################################################################################
- phase: Linux
################################################################################
variables:
BuildConfig: Release
OfficialBuildId: $(BUILD.BUILDNUMBER)
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_MULTILEVEL_LOOKUP: 0
queue:
name: DotNet-Build
demands:
- agent.os -equals linux
container: CentosContainer
steps:
# Only build native assets to avoid conflicts.
- script: echo no-op
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
displayName: Build
# ################################################################################
# - phase: Linux
# ################################################################################
# variables:
# BuildConfig: Release
# OfficialBuildId: $(BUILD.BUILDNUMBER)
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
# DOTNET_MULTILEVEL_LOOKUP: 0
# queue:
# name: DotNet-Build
# demands:
# - agent.os -equals linux
# container: CentosContainer
# steps:
# # Only build native assets to avoid conflicts.
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
# displayName: Build

# - task: PublishBuildArtifacts@1
# displayName: Publish Linux package assets
# inputs:
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
# artifactName: PackageAssets
# artifactType: container
# - task: PublishBuildArtifacts@1
# displayName: Publish Linux package assets
# inputs:
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
# artifactName: PackageAssets
# artifactType: container

################################################################################
- phase: MacOS
################################################################################
variables:
BuildConfig: Release
OfficialBuildId: $(BUILD.BUILDNUMBER)
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_MULTILEVEL_LOOKUP: 0
queue:
name: DotNetCore-Build
demands:
- agent.os -equals Darwin
steps:
- script: echo no-op
# - script: brew update && brew install libomp && brew link libomp --force
displayName: Install build dependencies
# Only build native assets to avoid conflicts.
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
# displayName: Build
# ################################################################################
# - phase: MacOS
# ################################################################################
# variables:
# BuildConfig: Release
# OfficialBuildId: $(BUILD.BUILDNUMBER)
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
# DOTNET_MULTILEVEL_LOOKUP: 0
# queue:
# name: DotNetCore-Build
# demands:
# - agent.os -equals Darwin
# steps:
# - script: brew update && brew install libomp && brew link libomp --force
# displayName: Install build dependencies
# # Only build native assets to avoid conflicts.
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
# displayName: Build

# - task: PublishBuildArtifacts@1
# displayName: Publish macOS package assets
# inputs:
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
# artifactName: PackageAssets
# artifactType: container
# - task: PublishBuildArtifacts@1
# displayName: Publish macOS package assets
# inputs:
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
# artifactName: PackageAssets
# artifactType: container

################################################################################
- phase: Windows_x86
################################################################################
variables:
BuildConfig: Release
OfficialBuildId: $(BUILD.BUILDNUMBER)
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_MULTILEVEL_LOOKUP: 0
_SignType: real
_UseEsrpSigning: true
_TeamName: DotNetCore
queue:
name: DotNetCore-Build
demands:
- agent.os -equals Windows_NT
steps:
# ################################################################################
# - phase: Windows_x86
# ################################################################################
# variables:
# BuildConfig: Release
# OfficialBuildId: $(BUILD.BUILDNUMBER)
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
# DOTNET_MULTILEVEL_LOOKUP: 0
# _SignType: real
# _UseEsrpSigning: true
# _TeamName: DotNetCore
# queue:
# name: DotNetCore-Build
# demands:
# - agent.os -equals Windows_NT
# steps:

# - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
# displayName: Install MicroBuild Signing Plugin
# inputs:
# signType: '$(_SignType)'
# zipSources: false
# esrpSigning: '$(_UseEsrpSigning)'
# env:
# TeamName: $(_TeamName)
# continueOnError: false
# condition: and(succeeded(), in(variables._SignType, 'real', 'test'))
# - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
# displayName: Install MicroBuild Signing Plugin
# inputs:
# signType: '$(_SignType)'
# zipSources: false
# esrpSigning: '$(_UseEsrpSigning)'
# env:
# TeamName: $(_TeamName)
# continueOnError: false
# condition: and(succeeded(), in(variables._SignType, 'real', 'test'))

# Only build native assets to avoid conflicts.
# - script: ./build.cmd -buildNative -$(BuildConfig) -buildArch=x86 -skipRIDAgnosticAssets
- script: echo no-op
displayName: Build
# # Only build native assets to avoid conflicts.
# - script: ./build.cmd -buildNative -$(BuildConfig) -buildArch=x86 -skipRIDAgnosticAssets
# displayName: Build

# - task: MSBuild@1
# displayName: Sign Windows_x86 Binaries
# inputs:
# solution: build/sign.proj
# msbuildArguments: /p:SignType=$(_SignType)
# msbuildVersion: 15.0
# continueOnError: false
# - task: MSBuild@1
# displayName: Sign Windows_x86 Binaries
# inputs:
# solution: build/sign.proj
# msbuildArguments: /p:SignType=$(_SignType)
# msbuildVersion: 15.0
# continueOnError: false

# - task: PublishBuildArtifacts@1
# displayName: Publish Windows_x86 package assets
# inputs:
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
# artifactName: PackageAssets
# artifactType: container

# Terminate all dotnet build processes.
# - script: $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet.exe build-server shutdown
# displayName: Dotnet Server Shutdown
# - task: PublishBuildArtifacts@1
# displayName: Publish Windows_x86 package assets
# inputs:
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
# artifactName: PackageAssets
# artifactType: container
#
# # Terminate all dotnet build processes.
# - script: $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet.exe build-server shutdown
# displayName: Dotnet Server Shutdown

################################################################################
- phase: Windows_x64
Expand Down Expand Up @@ -172,9 +169,9 @@ phases:
- phase: Package
################################################################################
dependsOn:
- Linux
- MacOS
- Windows_x86
# - Linux
# - MacOS
# - Windows_x86
- Windows_x64
variables:
BuildConfig: Release
Expand Down
28 changes: 28 additions & 0 deletions pkg/mlnet/mlnet.nupkgproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <PackageDescription>ML.NET command line tool.</PackageDescription>
    <PackageType>DotNetCliTool</PackageType>
    <ToolCommandName>mlnet</ToolCommandName>
    <PackAsTool>true</PackAsTool>
    <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
    <GenerateDependencyFile>false</GenerateDependencyFile>
    <CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.CodeAnalysis" Version="2.10.0" />
    <PackageReference Include="NLog" Version="4.5.11" />
    <PackageReference Include="System.CodeDom" Version="4.5.0" />
    <PackageReference Include="System.CommandLine.Experimental" Version="0.2.0-alpha.19174.3" />
    <PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
    <PackageReference Include="Microsoft.ApplicationInsights" Version="2.9.1" />
    <PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
<!-- references from AutoML -->
<PackageReference Include="Microsoft.ML" Version="1.0.0-preview" />
<PackageReference Include="Microsoft.ML.LightGBM" Version="1.0.0-preview" />
<PackageReference Include="Microsoft.ML.Mkl.Components" Version="1.0.0-preview" />
  </ItemGroup>

  <Target Name="CreateManifestResourceNames" />
</Project>
10 changes: 10 additions & 0 deletions pkg/mlnet/mlnet.symbols.nupkgproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
  <ItemGroup>
<Content Remove="$(PackageAssetsPath)$(PackageIdFolderName)\tools\**\*"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be nice to add a comment here. But don't re-spin your PR just for the comment. Can add it later.

<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\tools\**\mlnet.dll" Pack="true" PackagePath="tools" />
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\tools\**\mlnet.pdb" Pack="true" PackagePath="tools" />
  </ItemGroup>
</Project>
10 changes: 9 additions & 1 deletion src/Microsoft.ML.Auto/Microsoft.ML.Auto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>


<!-- here we place this assembly into CLI package dir so it gets included in CLI nuget -->
<Import Project="..\mlnet\mlnet.Build.props" />

<Target Name="PrepareMlNetCLIPackageAssets" BeforeTargets="PreparePackageAssets">
<ItemGroup>
<PackageAsset Include="$(TargetPath)" RelativePath="$(MlNetPackagePath)" />
</ItemGroup>
</Target>

</Project>
5 changes: 5 additions & 0 deletions src/mlnet/mlnet.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<MlNetPackagePath>mlnet\tools\netcoreapp2.1\any\</MlNetPackagePath>
</PropertyGroup>
</Project>
14 changes: 10 additions & 4 deletions src/mlnet/mlnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PackAsTool>true</PackAsTool>
<RootNamespace>Microsoft.ML.CLI</RootNamespace>
<ToolCommandName>mlnet</ToolCommandName>
<PackageId>mlnet</PackageId>
<Authors>mlnet</Authors>
<!-- TODO: make the code compliant and remove the following two lines: -->
<UseStyleCopAnalyzer>false</UseStyleCopAnalyzer>
<UseMLCodeAnalyzer>false</UseMLCodeAnalyzer>
Expand Down Expand Up @@ -106,4 +102,14 @@
</None>
</ItemGroup>

<Import Project="mlnet.Build.props" />
<Target Name="PrepareMlNetCLIPackageAssets" BeforeTargets="PreparePackageAssets">
<ItemGroup>
<PackageAsset Include="$(TargetPath)" RelativePath="$(MlNetPackagePath)" />
<PackageAsset Include="$(ProjectDepsFilePath)" RelativePath="$(MlNetPackagePath)" />
<PackageAsset Include="$(ProjectRuntimeConfigFilePath)" RelativePath="$(MlNetPackagePath)" />
<PackageAsset Include="$(TargetDir)\NLog.config" RelativePath="$(MlNetPackagePath)" />
<PackageAsset Include="$(TargetDir)\mlnet.pdb" RelativePath="$(MlNetPackagePath)" />
</ItemGroup>
</Target>
</Project>