Skip to content

Commit fdf4862

Browse files
Merge pull request #1343 from ericstj/packageValidation
Restore before packing
2 parents 92347b2 + 787727c commit fdf4862

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

azure-pipelines.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ jobs:
126126
condition: eq(variables['BuildLibTorchPackages'], 'true')
127127
displayName: Download libtorch native CUDA binaries
128128

129-
- script: dotnet build -c $(BuildConfig) src/TorchSharp/TorchSharp.csproj /p:SkipCuda=true /p:SkipTests=true
129+
- script: dotnet build -c $(BuildConfig) src/TorchSharp/TorchSharp.csproj /p:SkipCuda=true /p:SkipTests=true
130130
displayName: Build linux
131131

132-
- script: dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true
132+
- script: dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true
133133
displayName: Build TorchVision
134134

135-
- script: dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true
135+
- script: dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true
136136
displayName: Build TorchAudio
137137

138138
- publish: $(Build.SourcesDirectory)/bin/obj/packprep/$(BuildConfig)
@@ -169,13 +169,13 @@ jobs:
169169
displayName: Download libtorch native CUDA binaries
170170

171171

172-
- script: dotnet build -c $(BuildConfig) src/TorchSharp/TorchSharp.csproj /p:SkipCuda=true /p:SkipTests=true
172+
- script: dotnet build -c $(BuildConfig) src/TorchSharp/TorchSharp.csproj /p:SkipCuda=true /p:SkipTests=true
173173
displayName: Build Windows
174174

175-
- script: dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true
175+
- script: dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true
176176
displayName: Build TorchVision
177177

178-
- script: dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true
178+
- script: dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true
179179
displayName: Build TorchAudio
180180

181181
- publish: $(Build.SourcesDirectory)/bin/obj/packprep/$(BuildConfig)
@@ -198,13 +198,13 @@ jobs:
198198
condition: eq(variables['BuildLibTorchPackages'], 'true')
199199
displayName: Download libtorch native binaries
200200

201-
- script: dotnet build -c $(BuildConfig) src/TorchSharp/TorchSharp.csproj /p:SkipCuda=true /p:SkipTests=true
201+
- script: dotnet build -c $(BuildConfig) src/TorchSharp/TorchSharp.csproj /p:SkipCuda=true /p:SkipTests=true
202202
displayName: Build mac-x64
203203

204-
- script: dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true
204+
- script: dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true
205205
displayName: Build TorchVision
206206

207-
- script: dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true
207+
- script: dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true
208208
displayName: Build TorchAudio
209209

210210
- publish: $(Build.SourcesDirectory)/bin/obj/packprep/$(BuildConfig)
@@ -387,8 +387,11 @@ jobs:
387387
- script: rmdir /s /q $(Pipeline.Workspace)\WindowsAssets
388388
displayName: Free up space (windows assets in workspace)
389389

390+
- script: dotnet restore pkg/pack.proj /p:Configuration=Release
391+
displayName: Restore package projects
392+
390393
# Pack TorchSharp (and libtorch-cpu if BuildLibTorchPackages is true)
391-
- script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:IncludeTorchSharpPackage=true /p:IncludeLibTorchCpuPackages=$(BuildLibTorchPackages) src/TorchSharp/TorchSharp.csproj
394+
- script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:IncludeTorchSharpPackage=true /p:IncludeLibTorchCpuPackages=$(BuildLibTorchPackages) pkg/pack.proj
392395
displayName: Create Packages
393396

394397
- script: rmdir /q /s bin\obj
@@ -444,7 +447,10 @@ jobs:
444447
- script: rmdir /s /q $(Pipeline.Workspace)\WindowsAssets
445448
displayName: Free up space (windows assets in workspace)
446449

447-
- script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:IncludeTorchSharpPackage=false /p:IncludeLibTorchCpuPackages=false /p:IncludeLibTorchCudaPackages=true src/TorchSharp/TorchSharp.csproj
450+
- script: dotnet restore pkg/pack.proj /p:Configuration=Release
451+
displayName: Restore package projects
452+
453+
- script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:IncludeTorchSharpPackage=false /p:IncludeLibTorchCpuPackages=false /p:IncludeLibTorchCudaPackages=true pkg/pack.proj
448454
displayName: Create Packages
449455

450456
# We are 10GB space-constrained on the Azure Pipelines CI system so clean up what we can
@@ -515,7 +521,10 @@ jobs:
515521
- script: rm -fr $(Pipeline.Workspace)/LinuxAssets
516522
displayName: Free up space (linux assets in workspace)
517523

518-
- script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:IncludeTorchSharpPackage=false /p:IncludeLibTorchCpuPackages=false /p:IncludeLibTorchCudaPackages=true src/TorchSharp/TorchSharp.csproj
524+
- script: dotnet restore pkg/pack.proj /p:Configuration=Release
525+
displayName: Restore package projects
526+
527+
- script: dotnet pack -c $(BuildConfig) --no-build -v:n /p:SkipNative=true /p:SkipTests=true /p:IncludeTorchSharpPackage=false /p:IncludeLibTorchCpuPackages=false /p:IncludeLibTorchCudaPackages=true pkg/pack.proj
519528
displayName: Create Packages
520529

521530
# We are 10GB space-constrained on the Azure Pipelines CI system so clean up what we can

pkg/pack.proj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@
1313
<PackProject Include="**\TorchSharp-cuda-windows.nupkgproj" />
1414
<PackProject Include="**\TorchVision.nupkgproj" />
1515
</ItemGroup>
16-
<Target Name="Pack">
16+
<Target Name="Restore">
1717
<Message Text="Restoring packaging projects..." Importance="high" />
18-
19-
<Warning Text="Packages will be incomplete and unusable on linux platforms. To get a complete package you need the LibTorchSharp.so binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
18+
<MSBuild Projects="%(PackProject.Identity)" Targets="Restore" />
19+
</Target>
20+
<Target Name="Pack" DependsOnTargets="Restore">
21+
<Warning Text="Packages will be incomplete and unusable on linux platforms. To get a complete package you need the LibTorchSharp.so binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
2022
Condition="'$(IncludeTorchSharpPackage)' == 'true' AND !Exists('$(PackagePreparationPath)\TorchSharp\runtimes\linux-x64\native\libLibTorchSharp.so')" />
21-
<Warning Text="Packages will be incomplete and unusable on win-x64 platform. To get a complete package you need the LibTorchSharp.dll binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
23+
<Warning Text="Packages will be incomplete and unusable on win-x64 platform. To get a complete package you need the LibTorchSharp.dll binaries for other platforms and copy them into '$(PackagePreparationPath)' to make complete packages. This is automated by Azure Pipelines."
2224
Condition="'$(IncludeTorchSharpPackage)' == 'true' AND !Exists('$(PackagePreparationPath)\TorchSharp\runtimes\win-x64\native\LibTorchSharp.dll')" />
2325

24-
<MSBuild Projects="%(PackProject.Identity)" Targets="Restore" />
2526
<MSBuild Projects="%(PackProject.Identity)" Targets="Pack" />
2627

2728
<Message Text="Done packing!" Importance="high" />

0 commit comments

Comments
 (0)