From 1b5445c7fbbe3cc5409208bd2bc8f6504bf12135 Mon Sep 17 00:00:00 2001 From: "Harish S. Kulkarni" Date: Thu, 11 Jul 2019 15:35:35 -0700 Subject: [PATCH 1/5] Initial commit for redistributing TF binaries as a nuget package --- src/TensorFlowNET.Redist/CommonPackage.props | 24 +++ .../TensorFlowNET.Redist.nupkgproj | 195 ++++++++++++++++++ ...orflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha | 1 + ...sorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha | 1 + ...nsorflow-cpu-windows-x86_64-1.14.0.zip.sha | 1 + 5 files changed, 222 insertions(+) create mode 100644 src/TensorFlowNET.Redist/CommonPackage.props create mode 100644 src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj create mode 100644 src/TensorFlowNET.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha create mode 100644 src/TensorFlowNET.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha create mode 100644 src/TensorFlowNET.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha diff --git a/src/TensorFlowNET.Redist/CommonPackage.props b/src/TensorFlowNET.Redist/CommonPackage.props new file mode 100644 index 000000000..08fbb153a --- /dev/null +++ b/src/TensorFlowNET.Redist/CommonPackage.props @@ -0,0 +1,24 @@ + + + + + + PreserveNewest + false + %(Filename)%(Extension) + + + PreserveNewest + false + %(Filename)%(Extension) + + + + \ No newline at end of file diff --git a/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj b/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj new file mode 100644 index 000000000..06ce49745 --- /dev/null +++ b/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj @@ -0,0 +1,195 @@ + + + + $(MSBuildThisFileDirectory) + $(ProjRoot)bin\ + $(ProjRoot)obj\ + $(BinDir)packages\ + + + true + false + + x64 + netstandard2.0 + 1.14.0 + 1 + + CopyFilesFromArchive + + win + linux + osx + $(PackageRid)-$(TargetArchitecture) + + TensorFlowNET.Redist + The TensorFlow Authors + netstandard2.0 + $(MSBuildProjectName) contains the TensorFlow C library version $(TensorFlowVersion) redistributed as a NuGet package. + LICENSE.txt + true + Copyright 2019 The TensorFlow Authors. All rights reserved. + https://www.tensorflow.org + https://github.com/tensorflow/tensorflow/releases/tag/v$(TensorFlowVersion) + $(PackageTags) TensorFlow + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_downloadFiles Include="@(TensorFlowArchive);@(AdditionalDownloadFile)" Url="%(Identity)" DestinationFile="%(DownloadFile)" /> + + + + + + + + + + + + + + + + + + + @(FilesWithHashes->'%(FileHash)') + $([System.IO.File]::ReadAllText('%(LocalShaFile)')) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_fileFromArchive Include="%(TensorFlowArchive.FilesFromArchive)" ExtractDirectory="%(TensorFlowArchive.ExtractDirectory)" Runtime="%(TensorFlowArchive.Runtime)" /> + <_fileFromArchive DestinationFile="%(FileName)%(Extension)"/> + <_fileFromArchive PackagePath="runtimes\%(_fileFromArchive.Runtime)\native\%(_fileFromArchive.DestinationFile)" /> + + + <_fileFromArchive Condition="'%(DestinationFile)' == 'LICENSE'" PackagePath="THIRD_PARTY_NOTICES.txt" Runtime="" /> + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/TensorFlowNET.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha b/src/TensorFlowNET.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha new file mode 100644 index 000000000..951c4556e --- /dev/null +++ b/src/TensorFlowNET.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha @@ -0,0 +1 @@ +7002EF701BD23C5EF5FF94192E935F0DDF960A21BE2531CEE158586830C00E0BA889900F7F6E8AB568BEE0ACF1F5A6A246BB43D11C4109E9DC782B46377D8142 \ No newline at end of file diff --git a/src/TensorFlowNET.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha b/src/TensorFlowNET.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha new file mode 100644 index 000000000..784640a02 --- /dev/null +++ b/src/TensorFlowNET.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha @@ -0,0 +1 @@ +E3F6D0309117E9E45780ECF8BC4D0268B3FC9F12E3E38FFE58496789330A4ACD2DC8FF721F3B8900357F6155F8A54000E45B99495F823486B558E8B42532392D \ No newline at end of file diff --git a/src/TensorFlowNET.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha b/src/TensorFlowNET.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha new file mode 100644 index 000000000..b7d6402c4 --- /dev/null +++ b/src/TensorFlowNET.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha @@ -0,0 +1 @@ +59A2B80B441439B851202358CE4A65BA0DDDB319A8A29E87B135DCD9954BC5B0628F2C0C8E72D6942EA3CDCE172805C2BD5421815B3D0210B62BC0936DC59A08 \ No newline at end of file From bc7026fea14cb7272f453f5edc6f3ce75bfb3107 Mon Sep 17 00:00:00 2001 From: "Harish S. Kulkarni" Date: Fri, 12 Jul 2019 13:40:27 -0700 Subject: [PATCH 2/5] Changed project file to use nuspec file --- .../TensorFlowNET.Redist.nupkgproj | 53 ++++++++----------- src/TensorFlowNET.Redist/redist.nuspec | 26 +++++++++ 2 files changed, 47 insertions(+), 32 deletions(-) create mode 100644 src/TensorFlowNET.Redist/redist.nuspec diff --git a/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj b/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj index 06ce49745..82f82ebac 100644 --- a/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj +++ b/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj @@ -2,50 +2,38 @@ $(MSBuildThisFileDirectory) - $(ProjRoot)bin\ - $(ProjRoot)obj\ - $(BinDir)packages\ - + $(ProjDir)bin\ + $(ProjDir)obj\ - true - false - x64 netstandard2.0 1.14.0 1 + $(BinDir)packages\ + $(MSBuildProjectName) + 0.15.0 + + true + false + + Redist.nuspec + packageId=$(PackageId);version=$(PackageVersion) + $(ProjDir) + CopyFilesFromArchive - + win linux osx $(PackageRid)-$(TargetArchitecture) - TensorFlowNET.Redist - The TensorFlow Authors - netstandard2.0 - $(MSBuildProjectName) contains the TensorFlow C library version $(TensorFlowVersion) redistributed as a NuGet package. - LICENSE.txt - true - Copyright 2019 The TensorFlow Authors. All rights reserved. - https://www.tensorflow.org - https://github.com/tensorflow/tensorflow/releases/tag/v$(TensorFlowVersion) - $(PackageTags) TensorFlow - false - - - - - - - - - + @@ -174,14 +162,15 @@ TargetPath="$(PackageAssetsPath)$(MSBuildProjectName)\LICENSE.txt" /> - + TargetPath="$(NativeAssetsBuiltPath)\%(_fileFromArchive.DestinationFile)" />--> + diff --git a/src/TensorFlowNET.Redist/redist.nuspec b/src/TensorFlowNET.Redist/redist.nuspec new file mode 100644 index 000000000..f1e934be5 --- /dev/null +++ b/src/TensorFlowNET.Redist/redist.nuspec @@ -0,0 +1,26 @@ + + + + $packageId$ + $version$ + The TensorFlow Authors + The TensorFlow Authors + true + LICENSE.txt + https://aka.ms/deprecateLicenseUrl + https://www.tensorflow.org/ + TensorFlowNET.Redist contains the TensorFlow C library version 1.14.0 redistributed as a NuGet package. + https://github.com/tensorflow/tensorflow/releases/tag/v1.14.0 + Copyright 2019 The TensorFlow Authors. All rights reserved. + TensorFlow + + + + + + + + + + + \ No newline at end of file From a2dceb5b919c2aa9ef7d1193efeb177c4f6bc001 Mon Sep 17 00:00:00 2001 From: Harish Kulkarni Date: Fri, 12 Jul 2019 15:01:21 -0700 Subject: [PATCH 3/5] Made extracted files writeables to permit repeated running of pack command --- src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj b/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj index 82f82ebac..622b9d12c 100644 --- a/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj +++ b/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj @@ -139,6 +139,9 @@ WorkingDirectory="$(MSBuildThisFileDirectory)" Command="tar -xzmv --hard-dereference -f %(TensorFlowArchive.DownloadFile) -C %(TensorFlowArchive.ExtractDirectory)" /> + + @@ -174,6 +177,7 @@ + From 7a8e007e5473b51eb66dcac67aedb0a2c3ff88a7 Mon Sep 17 00:00:00 2001 From: "Harish S. Kulkarni" Date: Fri, 12 Jul 2019 15:46:11 -0700 Subject: [PATCH 4/5] Renamed package to SciSharp.TensorFlow.Redist --- .../CommonPackage.props | 0 .../SciSharp.TensorFlow.Redist.nupkgproj} | 0 ...libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha | 0 .../libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha | 0 .../libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha | 0 .../redist.nuspec | 12 ++++++------ 6 files changed, 6 insertions(+), 6 deletions(-) rename src/{TensorFlowNET.Redist => SciSharp.TensorFlow.Redist}/CommonPackage.props (100%) rename src/{TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj => SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj} (100%) rename src/{TensorFlowNET.Redist => SciSharp.TensorFlow.Redist}/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha (100%) rename src/{TensorFlowNET.Redist => SciSharp.TensorFlow.Redist}/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha (100%) rename src/{TensorFlowNET.Redist => SciSharp.TensorFlow.Redist}/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha (100%) rename src/{TensorFlowNET.Redist => SciSharp.TensorFlow.Redist}/redist.nuspec (64%) diff --git a/src/TensorFlowNET.Redist/CommonPackage.props b/src/SciSharp.TensorFlow.Redist/CommonPackage.props similarity index 100% rename from src/TensorFlowNET.Redist/CommonPackage.props rename to src/SciSharp.TensorFlow.Redist/CommonPackage.props diff --git a/src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj b/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj similarity index 100% rename from src/TensorFlowNET.Redist/TensorFlowNET.Redist.nupkgproj rename to src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj diff --git a/src/TensorFlowNET.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha b/src/SciSharp.TensorFlow.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha similarity index 100% rename from src/TensorFlowNET.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha rename to src/SciSharp.TensorFlow.Redist/libtensorflow-cpu-darwin-x86_64-1.14.0.tar.gz.sha diff --git a/src/TensorFlowNET.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha b/src/SciSharp.TensorFlow.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha similarity index 100% rename from src/TensorFlowNET.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha rename to src/SciSharp.TensorFlow.Redist/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz.sha diff --git a/src/TensorFlowNET.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha b/src/SciSharp.TensorFlow.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha similarity index 100% rename from src/TensorFlowNET.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha rename to src/SciSharp.TensorFlow.Redist/libtensorflow-cpu-windows-x86_64-1.14.0.zip.sha diff --git a/src/TensorFlowNET.Redist/redist.nuspec b/src/SciSharp.TensorFlow.Redist/redist.nuspec similarity index 64% rename from src/TensorFlowNET.Redist/redist.nuspec rename to src/SciSharp.TensorFlow.Redist/redist.nuspec index f1e934be5..d2527c8bd 100644 --- a/src/TensorFlowNET.Redist/redist.nuspec +++ b/src/SciSharp.TensorFlow.Redist/redist.nuspec @@ -9,8 +9,8 @@ LICENSE.txt https://aka.ms/deprecateLicenseUrl https://www.tensorflow.org/ - TensorFlowNET.Redist contains the TensorFlow C library version 1.14.0 redistributed as a NuGet package. - https://github.com/tensorflow/tensorflow/releases/tag/v1.14.0 + $packageId$ contains the TensorFlow C library version $version$ redistributed as a NuGet package. + https://github.com/tensorflow/tensorflow/releases/tag/v$version$ Copyright 2019 The TensorFlow Authors. All rights reserved. TensorFlow @@ -18,9 +18,9 @@ - - - - + + + + \ No newline at end of file From 580ae1a5e55ae28cdc8ce22413b9a12c80cde193 Mon Sep 17 00:00:00 2001 From: Harish Kulkarni Date: Fri, 12 Jul 2019 16:26:04 -0700 Subject: [PATCH 5/5] Changed version to match tensorflow version and reduced verbosity in tar command --- .../SciSharp.TensorFlow.Redist.nupkgproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj b/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj index 622b9d12c..79eaa5648 100644 --- a/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj +++ b/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist.nupkgproj @@ -12,7 +12,7 @@ $(BinDir)packages\ $(MSBuildProjectName) - 0.15.0 + $(TensorFlowVersion) true false @@ -137,7 +137,7 @@ + Command="tar -xzm --hard-dereference -f %(TensorFlowArchive.DownloadFile) -C %(TensorFlowArchive.ExtractDirectory)" />