Skip to content

Commit 706e8c9

Browse files
authored
mlnet CLI nupkg creation/signing (#3606)
* mlnet CLI nupkg creation/signing * relmove includeinpackage from mlnet csproj * address PR comments -- some minor reshuffling of stuff * publish symbols for mlnet CLI * fix case in NLog.config
1 parent 1430ebf commit 706e8c9

File tree

7 files changed

+163
-108
lines changed

7 files changed

+163
-108
lines changed

build.proj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
<Message Importance="High" Text="Building packages ..." />
6969

7070
<ItemGroup>
71-
<PkgProject Include="pkg\Microsoft.ML.Auto\Microsoft.ML.Auto.nupkgproj" />
71+
<PkgProject Include="pkg\Microsoft.ML.Auto\*.nupkgproj" />
72+
<PkgProject Include="pkg\mlnet\*.nupkgproj" />
7273
</ItemGroup>
7374

7475
<MSBuild Projects="@(PkgProject)"

build/vsts-ci.yml

Lines changed: 99 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -8,113 +8,110 @@ resources:
88
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-8bba86b-20190314145033
99

1010
phases:
11-
################################################################################
12-
- phase: Linux
13-
################################################################################
14-
variables:
15-
BuildConfig: Release
16-
OfficialBuildId: $(BUILD.BUILDNUMBER)
17-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
18-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
19-
DOTNET_MULTILEVEL_LOOKUP: 0
20-
queue:
21-
name: DotNet-Build
22-
demands:
23-
- agent.os -equals linux
24-
container: CentosContainer
25-
steps:
26-
# Only build native assets to avoid conflicts.
27-
- script: echo no-op
28-
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
29-
displayName: Build
11+
# ################################################################################
12+
# - phase: Linux
13+
# ################################################################################
14+
# variables:
15+
# BuildConfig: Release
16+
# OfficialBuildId: $(BUILD.BUILDNUMBER)
17+
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
18+
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
19+
# DOTNET_MULTILEVEL_LOOKUP: 0
20+
# queue:
21+
# name: DotNet-Build
22+
# demands:
23+
# - agent.os -equals linux
24+
# container: CentosContainer
25+
# steps:
26+
# # Only build native assets to avoid conflicts.
27+
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
28+
# displayName: Build
3029

31-
# - task: PublishBuildArtifacts@1
32-
# displayName: Publish Linux package assets
33-
# inputs:
34-
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
35-
# artifactName: PackageAssets
36-
# artifactType: container
30+
# - task: PublishBuildArtifacts@1
31+
# displayName: Publish Linux package assets
32+
# inputs:
33+
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
34+
# artifactName: PackageAssets
35+
# artifactType: container
3736

38-
################################################################################
39-
- phase: MacOS
40-
################################################################################
41-
variables:
42-
BuildConfig: Release
43-
OfficialBuildId: $(BUILD.BUILDNUMBER)
44-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
45-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
46-
DOTNET_MULTILEVEL_LOOKUP: 0
47-
queue:
48-
name: DotNetCore-Build
49-
demands:
50-
- agent.os -equals Darwin
51-
steps:
52-
- script: echo no-op
53-
# - script: brew update && brew install libomp && brew link libomp --force
54-
displayName: Install build dependencies
55-
# Only build native assets to avoid conflicts.
56-
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
57-
# displayName: Build
37+
# ################################################################################
38+
# - phase: MacOS
39+
# ################################################################################
40+
# variables:
41+
# BuildConfig: Release
42+
# OfficialBuildId: $(BUILD.BUILDNUMBER)
43+
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
44+
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
45+
# DOTNET_MULTILEVEL_LOOKUP: 0
46+
# queue:
47+
# name: DotNetCore-Build
48+
# demands:
49+
# - agent.os -equals Darwin
50+
# steps:
51+
# - script: brew update && brew install libomp && brew link libomp --force
52+
# displayName: Install build dependencies
53+
# # Only build native assets to avoid conflicts.
54+
# - script: ./build.sh -buildNative -$(BuildConfig) -skipRIDAgnosticAssets
55+
# displayName: Build
5856

59-
# - task: PublishBuildArtifacts@1
60-
# displayName: Publish macOS package assets
61-
# inputs:
62-
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
63-
# artifactName: PackageAssets
64-
# artifactType: container
57+
# - task: PublishBuildArtifacts@1
58+
# displayName: Publish macOS package assets
59+
# inputs:
60+
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
61+
# artifactName: PackageAssets
62+
# artifactType: container
6563

66-
################################################################################
67-
- phase: Windows_x86
68-
################################################################################
69-
variables:
70-
BuildConfig: Release
71-
OfficialBuildId: $(BUILD.BUILDNUMBER)
72-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
73-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
74-
DOTNET_MULTILEVEL_LOOKUP: 0
75-
_SignType: real
76-
_UseEsrpSigning: true
77-
_TeamName: DotNetCore
78-
queue:
79-
name: DotNetCore-Build
80-
demands:
81-
- agent.os -equals Windows_NT
82-
steps:
64+
# ################################################################################
65+
# - phase: Windows_x86
66+
# ################################################################################
67+
# variables:
68+
# BuildConfig: Release
69+
# OfficialBuildId: $(BUILD.BUILDNUMBER)
70+
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
71+
# DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
72+
# DOTNET_MULTILEVEL_LOOKUP: 0
73+
# _SignType: real
74+
# _UseEsrpSigning: true
75+
# _TeamName: DotNetCore
76+
# queue:
77+
# name: DotNetCore-Build
78+
# demands:
79+
# - agent.os -equals Windows_NT
80+
# steps:
8381

84-
# - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
85-
# displayName: Install MicroBuild Signing Plugin
86-
# inputs:
87-
# signType: '$(_SignType)'
88-
# zipSources: false
89-
# esrpSigning: '$(_UseEsrpSigning)'
90-
# env:
91-
# TeamName: $(_TeamName)
92-
# continueOnError: false
93-
# condition: and(succeeded(), in(variables._SignType, 'real', 'test'))
82+
# - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
83+
# displayName: Install MicroBuild Signing Plugin
84+
# inputs:
85+
# signType: '$(_SignType)'
86+
# zipSources: false
87+
# esrpSigning: '$(_UseEsrpSigning)'
88+
# env:
89+
# TeamName: $(_TeamName)
90+
# continueOnError: false
91+
# condition: and(succeeded(), in(variables._SignType, 'real', 'test'))
9492

95-
# Only build native assets to avoid conflicts.
96-
# - script: ./build.cmd -buildNative -$(BuildConfig) -buildArch=x86 -skipRIDAgnosticAssets
97-
- script: echo no-op
98-
displayName: Build
93+
# # Only build native assets to avoid conflicts.
94+
# - script: ./build.cmd -buildNative -$(BuildConfig) -buildArch=x86 -skipRIDAgnosticAssets
95+
# displayName: Build
9996

100-
# - task: MSBuild@1
101-
# displayName: Sign Windows_x86 Binaries
102-
# inputs:
103-
# solution: build/sign.proj
104-
# msbuildArguments: /p:SignType=$(_SignType)
105-
# msbuildVersion: 15.0
106-
# continueOnError: false
97+
# - task: MSBuild@1
98+
# displayName: Sign Windows_x86 Binaries
99+
# inputs:
100+
# solution: build/sign.proj
101+
# msbuildArguments: /p:SignType=$(_SignType)
102+
# msbuildVersion: 15.0
103+
# continueOnError: false
107104

108-
# - task: PublishBuildArtifacts@1
109-
# displayName: Publish Windows_x86 package assets
110-
# inputs:
111-
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
112-
# artifactName: PackageAssets
113-
# artifactType: container
114-
115-
# Terminate all dotnet build processes.
116-
# - script: $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet.exe build-server shutdown
117-
# displayName: Dotnet Server Shutdown
105+
# - task: PublishBuildArtifacts@1
106+
# displayName: Publish Windows_x86 package assets
107+
# inputs:
108+
# pathToPublish: $(Build.SourcesDirectory)/bin/obj/packages
109+
# artifactName: PackageAssets
110+
# artifactType: container
111+
#
112+
# # Terminate all dotnet build processes.
113+
# - script: $(Build.SourcesDirectory)/Tools/dotnetcli/dotnet.exe build-server shutdown
114+
# displayName: Dotnet Server Shutdown
118115

119116
################################################################################
120117
- phase: Windows_x64
@@ -172,9 +169,9 @@ phases:
172169
- phase: Package
173170
################################################################################
174171
dependsOn:
175-
- Linux
176-
- MacOS
177-
- Windows_x86
172+
# - Linux
173+
# - MacOS
174+
# - Windows_x86
178175
- Windows_x64
179176
variables:
180177
BuildConfig: Release

pkg/mlnet/mlnet.nupkgproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
2+
  <PropertyGroup>
3+
    <TargetFramework>netcoreapp2.1</TargetFramework>
4+
    <PackageDescription>ML.NET command line tool.</PackageDescription>
5+
    <PackageType>DotNetCliTool</PackageType>
6+
    <ToolCommandName>mlnet</ToolCommandName>
7+
    <PackAsTool>true</PackAsTool>
8+
    <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
9+
    <GenerateDependencyFile>false</GenerateDependencyFile>
10+
    <CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
11+
  </PropertyGroup>
12+
13+
  <ItemGroup>
14+
    <PackageReference Include="Microsoft.CodeAnalysis" Version="2.10.0" />
15+
    <PackageReference Include="NLog" Version="4.5.11" />
16+
    <PackageReference Include="System.CodeDom" Version="4.5.0" />
17+
    <PackageReference Include="System.CommandLine.Experimental" Version="0.2.0-alpha.19174.3" />
18+
    <PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
19+
    <PackageReference Include="Microsoft.ApplicationInsights" Version="2.9.1" />
20+
    <PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
21+
<!-- references from AutoML -->
22+
<PackageReference Include="Microsoft.ML" Version="1.0.0-preview" />
23+
<PackageReference Include="Microsoft.ML.LightGBM" Version="1.0.0-preview" />
24+
<PackageReference Include="Microsoft.ML.Mkl.Components" Version="1.0.0-preview" />
25+
  </ItemGroup>
26+
27+
  <Target Name="CreateManifestResourceNames" />
28+
</Project>

pkg/mlnet/mlnet.symbols.nupkgproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
2+
<PropertyGroup>
3+
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
</PropertyGroup>
5+
  <ItemGroup>
6+
<Content Remove="$(PackageAssetsPath)$(PackageIdFolderName)\tools\**\*"/>
7+
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\tools\**\mlnet.dll" Pack="true" PackagePath="tools" />
8+
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\tools\**\mlnet.pdb" Pack="true" PackagePath="tools" />
9+
  </ItemGroup>
10+
</Project>

src/Microsoft.ML.Auto/Microsoft.ML.Auto.csproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,13 @@
1919
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2020
</PropertyGroup>
2121

22-
22+
<!-- here we place this assembly into CLI package dir so it gets included in CLI nuget -->
23+
<Import Project="..\mlnet\mlnet.Build.props" />
24+
25+
<Target Name="PrepareMlNetCLIPackageAssets" BeforeTargets="PreparePackageAssets">
26+
<ItemGroup>
27+
<PackageAsset Include="$(TargetPath)" RelativePath="$(MlNetPackagePath)" />
28+
</ItemGroup>
29+
</Target>
30+
2331
</Project>

src/mlnet/mlnet.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<MlNetPackagePath>mlnet\tools\netcoreapp2.1\any\</MlNetPackagePath>
4+
</PropertyGroup>
5+
</Project>

src/mlnet/mlnet.csproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp2.1</TargetFramework>
6-
<PackAsTool>true</PackAsTool>
76
<RootNamespace>Microsoft.ML.CLI</RootNamespace>
8-
<ToolCommandName>mlnet</ToolCommandName>
9-
<PackageId>mlnet</PackageId>
10-
<Authors>mlnet</Authors>
117
<!-- TODO: make the code compliant and remove the following two lines: -->
128
<UseStyleCopAnalyzer>false</UseStyleCopAnalyzer>
139
<UseMLCodeAnalyzer>false</UseMLCodeAnalyzer>
@@ -106,4 +102,14 @@
106102
</None>
107103
</ItemGroup>
108104

105+
<Import Project="mlnet.Build.props" />
106+
<Target Name="PrepareMlNetCLIPackageAssets" BeforeTargets="PreparePackageAssets">
107+
<ItemGroup>
108+
<PackageAsset Include="$(TargetPath)" RelativePath="$(MlNetPackagePath)" />
109+
<PackageAsset Include="$(ProjectDepsFilePath)" RelativePath="$(MlNetPackagePath)" />
110+
<PackageAsset Include="$(ProjectRuntimeConfigFilePath)" RelativePath="$(MlNetPackagePath)" />
111+
<PackageAsset Include="$(TargetDir)\NLog.config" RelativePath="$(MlNetPackagePath)" />
112+
<PackageAsset Include="$(TargetDir)\mlnet.pdb" RelativePath="$(MlNetPackagePath)" />
113+
</ItemGroup>
114+
</Target>
109115
</Project>

0 commit comments

Comments
 (0)