|
4 | 4 |
|
5 | 5 | name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
|
6 | 6 |
|
7 |
| -variables: |
8 |
| - MyRunNumber: $[counter('MyRunNumber', 52201)] |
9 |
| - |
| 7 | +parameters: |
10 | 8 | # Set this to 'true' to build the libtorch-* packages as part of main branch CI and
|
11 | 9 | # push them to the artifacts feed of the Azure CI project
|
12 | 10 | BuildLibTorchPackages: false
|
13 | 11 | PushPackagesToFeed: false
|
14 | 12 |
|
| 13 | +variables: |
| 14 | + MyRunNumber: $[counter('MyRunNumber', 52201)] |
| 15 | + LinuxPrepScript: | |
| 16 | + ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) |
| 17 | + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D |
| 18 | + sudo apt-get -y update |
| 19 | + sudo apt-get -y install cmake git libunwind8 curl libomp-dev libomp5 |
| 20 | + wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb |
| 21 | + sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb |
| 22 | + sudo apt-get update; sudo apt-get install -y apt-transport-https && sudo apt-get update |
| 23 | + ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) |
| 24 | +
|
| 25 | + # Install Miniconda |
| 26 | + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh |
| 27 | + mkdir -p ~/miniconda3 |
| 28 | + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh |
| 29 | + bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 |
| 30 | + rm -rf ~/miniconda3/miniconda.sh |
| 31 | +
|
| 32 | + # Install cmake, clang and gxx_linux- |
| 33 | + eval "$(~/miniconda3/bin/conda shell.bash hook)" |
| 34 | + source activate base |
| 35 | + conda install -y cmake=3.22.1 clang=14.0.6 clangxx=14.0.6 gxx_linux-64=11.2.0 |
| 36 | + |
| 37 | +
|
15 | 38 | resources:
|
16 | 39 | containers:
|
17 | 40 | # - container: CentosContainer
|
|
29 | 52 | # This reports the GLIB_ and GLIBCXX_ dependencies on the system which ends up getting baked into
|
30 | 53 | # the generated libTorchSharp.so (and partly determines which Linux systems that binary will
|
31 | 54 | # be usable on), then installs clang-7.0 (LibTorch likes this for building C++ 14), then installs .NET 6.0
|
32 |
| - prepScript: |
33 |
| - ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) && |
34 |
| - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D && |
35 |
| - sudo apt-get -y update && |
36 |
| - sudo apt-get -y install cmake clang git libunwind8 curl libomp-dev libomp5 && |
37 |
| - wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && |
38 |
| - sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb && |
39 |
| - sudo apt-get update; sudo apt-get install -y apt-transport-https && sudo apt-get update && |
40 |
| - ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) |
| 55 | + prepScript: ${{ parameters.LinuxPrepScript }} |
41 | 56 | buildScript: dotnet build /p:SkipCuda=true -c
|
42 | 57 | testScript: dotnet test /p:SkipCuda=true --blame test/TorchSharpTest/TorchSharpTest.csproj -c
|
43 | 58 | pool:
|
@@ -106,55 +121,39 @@ jobs:
|
106 | 121 | packageType: sdk
|
107 | 122 | version: 6.x
|
108 | 123 | installationPath: $(Agent.ToolsDirectory)/dotnet
|
109 |
| - - script: |
110 |
| - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && |
111 |
| - mkdir -p ~/miniconda3 && |
112 |
| - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && |
113 |
| - bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 && |
114 |
| - rm -rf ~/miniconda3/miniconda.sh |
115 |
| - displayName: Install Miniconda |
116 |
| - |
117 |
| - - task: Bash@3 |
118 |
| - inputs: |
119 |
| - targetType: 'inline' |
120 |
| - script: | |
121 |
| - eval "$(~/miniconda3/bin/conda shell.bash hook)" |
122 |
| - source activate base |
123 |
| - echo "activate conda environment" |
124 |
| - conda activate base |
125 |
| - conda install -y cmake=3.22.1 clang=14.0.6 clangxx=14.0.6 gxx_linux-64=11.2.0 |
126 |
| - displayName: Install cmake, clang and gxx_linux-64 dependencies |
127 |
| - - script: |
128 |
| - ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) && |
129 |
| - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D && |
130 |
| - sudo apt-get -y update && |
131 |
| - sudo apt-get -y install git cmake libunwind8 curl libomp-dev libomp5 && |
132 |
| - wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && |
133 |
| - sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb && |
134 |
| - sudo apt-get update; sudo apt-get install -y apt-transport-https && sudo apt-get update && |
135 |
| - ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) |
| 124 | + - script: ${{ parameters.LinuxPrepScript }} |
136 | 125 | displayName: Install dependencies
|
137 | 126 |
|
138 |
| - - script: dotnet build -c $(BuildConfig) src/Redist/libtorch-cpu/libtorch-cpu.proj /p:UpdateSHA=true /p:SkipTests=true /p:TargetOS=linux /t:Build /p:IncludeLibTorchCpuPackages=true |
| 127 | + - script: | |
| 128 | + eval "$(~/miniconda3/bin/conda shell.bash hook)" |
| 129 | + source activate base |
| 130 | + dotnet build -c $(BuildConfig) src/Redist/libtorch-cpu/libtorch-cpu.proj /p:UpdateSHA=true /p:SkipTests=true /p:TargetOS=linux /t:Build /p:IncludeLibTorchCpuPackages=true |
139 | 131 | condition: eq(variables['BuildLibTorchPackages'], 'true')
|
140 | 132 | displayName: Download libtorch native binaries
|
141 | 133 |
|
142 |
| - - script: dotnet build -c $(BuildConfig) src/Redist/libtorch-cuda-12.1/libtorch-cuda-12.1.proj /p:UpdateSHA=true /p:SkipTests=true /p:TargetOS=linux /t:Build /p:IncludeLibTorchCudaPackages=true |
| 134 | + - script: | |
| 135 | + eval "$(~/miniconda3/bin/conda shell.bash hook)" |
| 136 | + source activate base |
| 137 | + dotnet build -c $(BuildConfig) src/Redist/libtorch-cuda-12.1/libtorch-cuda-12.1.proj /p:UpdateSHA=true /p:SkipTests=true /p:TargetOS=linux /t:Build /p:IncludeLibTorchCudaPackages=true |
143 | 138 | condition: eq(variables['BuildLibTorchPackages'], 'true')
|
144 | 139 | displayName: Download libtorch native CUDA binaries
|
145 | 140 |
|
146 | 141 | - script: |
|
147 | 142 | eval "$(~/miniconda3/bin/conda shell.bash hook)"
|
148 | 143 | source activate base
|
149 |
| - echo "activate conda environment" |
150 |
| - conda activate base |
151 | 144 | dotnet build -c $(BuildConfig) src/TorchSharp/TorchSharp.csproj /p:SkipCuda=true /p:SkipTests=true
|
152 | 145 | displayName: Build linux
|
153 | 146 |
|
154 |
| - - script: dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true |
| 147 | + - script: | |
| 148 | + eval "$(~/miniconda3/bin/conda shell.bash hook)" |
| 149 | + source activate base |
| 150 | + dotnet build -c $(BuildConfig) src/TorchVision/TorchVision.csproj /p:SkipCuda=true /p:SkipTests=true |
155 | 151 | displayName: Build TorchVision
|
156 | 152 |
|
157 |
| - - script: dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true |
| 153 | + - script: | |
| 154 | + eval "$(~/miniconda3/bin/conda shell.bash hook)" |
| 155 | + source activate base |
| 156 | + dotnet build -c $(BuildConfig) src/TorchAudio/TorchAudio.csproj /p:SkipCuda=true /p:SkipTests=true |
158 | 157 | displayName: Build TorchAudio
|
159 | 158 |
|
160 | 159 | - publish: $(Build.SourcesDirectory)/bin/obj/packprep/$(BuildConfig)
|
@@ -508,16 +507,7 @@ jobs:
|
508 | 507 | version: 6.x
|
509 | 508 | installationPath: $(Agent.ToolsDirectory)/dotnet
|
510 | 509 |
|
511 |
| - - script: |
512 |
| - ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) && |
513 |
| - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D && |
514 |
| - sudo apt-get -y update && |
515 |
| - sudo apt-get -y install cmake clang-7.0 git libunwind8 curl libomp-dev libomp5 && |
516 |
| - wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && |
517 |
| - sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb && |
518 |
| - sudo apt-get update; sudo apt-get install -y apt-transport-https && sudo apt-get update && |
519 |
| - ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX) |
520 |
| - conda install cmake=3.22.1 clang=14.0.6 clangxx=14.0.6 gxx_linux-64=11.2.0 |
| 510 | + - script: ${{ parameters.LinuxPrepScript }} |
521 | 511 | displayName: Install dependencies
|
522 | 512 |
|
523 | 513 | # We are 10GB space-constrained on the Azure Pipelines CI system so clean up what we can
|
|
0 commit comments