Skip to content
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

Azure updates for MacOS/Windows/Linux #530

Merged
merged 1 commit into from
Aug 19, 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
78 changes: 35 additions & 43 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Azure CI build file
# Azure CI build file
# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema


Expand Down Expand Up @@ -34,24 +34,12 @@ jobs:
cxxCompiler: g++
cCompiler: gcc
installSh: ''
# CentOS 7 gcc VFX CY2020:
# agentImage: 'ubuntu-16.04'
# containerImage: aswfstaging/ci-openexr:2020.0
# cxxCompiler: g++
# cCompiler: gcc
# installSh: ''
CentOS 7 Clang 7 VFX CY2019:
agentImage: 'ubuntu-16.04'
containerImage: aswfstaging/ci-openexr:2019.0
cxxCompiler: clang++
cCompiler: clang
installSh: ''
# CentOS 7 Clang 7 VFX CY2020:
# agentImage: 'ubuntu-16.04'
# containerImage: aswfstaging/ci-openexr:2020.0
# cxxCompiler: clang++
# cCompiler: clang
# installSh: ''
pool:
vmImage: $(agentImage)
container: $[ variables['containerImage'] ]
Expand All @@ -72,6 +60,7 @@ jobs:
cxxCompiler: $(cxxCompiler)
cCompiler: $(cCompiler)
cmakeOpts: -- -j4
excludeTests: 'PyIlmBase.PyImath*'

- task: PublishTestResults@2
condition: succeededOrFailed()
Expand Down Expand Up @@ -120,54 +109,57 @@ jobs:
steps:
- template: share/ci/templates/checkout.yml
- bash: |
share/ci/scripts/macos/install.sh
share/ci/scripts/macos/install_python.sh 2.7.16
share/ci/scripts/macos/install_python.sh 3.7.4
share/ci/scripts/macos/install.sh
displayName: Install dependencies

- template: share/ci/templates/configure.yml
parameters:
cmakeOpts: |
-DPYTHON_INCLUDE_DIR=$(python-config --prefix)/include/python2.7 \
-DPYTHON_LIBRARY=$(python-config --prefix)/lib/libpython2.7.dylib \
-DPYTHON_EXECUTABLE=$(which python2)
cmakeOpts: ''

- template: share/ci/templates/build.yml
parameters:
cmakeOpts: -- -j4
excludeTests: 'PyIlmBase.PyImath_*'


# ------------------------------------------------------------------------------
# Windows
# ------------------------------------------------------------------------------
#- job: Windows
# strategy:
# matrix:
# 2016 MSVC 14.16:
# agentImage: 'vs2017-win2016'
# buildSharedLibs: ON
- job: Windows
strategy:
matrix:
2016 MSVC 14.16:
agentImage: 'vs2017-win2016'
buildSharedLibs: ON
# 2016 MSVC 14.16 (Static):
# agentImage: 'vs2017-win2016'
# buildSharedLibs: OFF
# 2012 MSVC 14.0:
# agentImage: 'vs2015-win2012r2'
# buildSharedLibs: ON
# pool:
# vmImage: $(agentImage)
#
# steps:
# - template: share/ci/templates/checkout.yml
# - powershell: |
# share/ci/scripts/windows/install_python.ps1 2.7.16
# share/ci/scripts/windows/install_cmake.ps1 3.12.4
# displayName: Install dependencies
#
# - template: share/ci/templates/configure.yml
# parameters:
# buildSharedLibs: $(buildSharedLibs)
# verbose: ON
# cmakeOpts: |
# -DCMAKE_GENERATOR_PLATFORM=x64 \
# -DPYTHON_EXECUTABLE=$(which python)
#
# - template: share/ci/templates/build.yml
pool:
vmImage: $(agentImage)

steps:
- template: share/ci/templates/checkout.yml
- powershell: |
share/ci/scripts/windows/install_cmake.ps1 3.12.4
share/ci/scripts/windows/install_python.ps1 2.7.16
share/ci/scripts/windows/install_python.ps1 3.7.4
share/ci/scripts/windows/install_zlib.ps1 1.2.11
displayName: Install dependencies

- template: share/ci/templates/configure.yml
parameters:
buildSharedLibs: $(buildSharedLibs)
verbose: ON
cmakeOpts: ''

- template: share/ci/templates/build.yml
parameters:
cmakeOpts: --
excludeTests: 'PyIlmBase.PyImath_*|OpenEXR.IlmImf$'


4 changes: 3 additions & 1 deletion share/ci/scripts/macos/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
set -ex

brew update
brew install glew
brew install boost
brew install boost-python
brew install boost-python3
17 changes: 16 additions & 1 deletion share/ci/scripts/macos/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
set -ex

PYTHON_VERSION="$1"
PYTHON_MAJOR="$(echo ${PYTHON_VERSION} | cut -f 1 -d .)"

MACOS_MAJOR="$(sw_vers -productVersion | cut -f 1 -d .)"
MACOS_MINOR="$(sw_vers -productVersion | cut -f 2 -d .)"

echo "Installing Python ${PYTHON_VERSION} Major ${PYTHON_MAJOR}"

# This workaround is needed for building Python on macOS >= 10.14:
# https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes

Expand All @@ -16,9 +19,21 @@ if [[ "$MACOS_MAJOR" -gt 9 && "$MACOS_MINOR" -gt 13 ]]; then
-target /
fi

brew install pyenv
unset CFLAGS

brew update
brew install pyenv openssl

CFLAGS="-I/usr/local/Cellar/openssl/1.0.2s/include"
LDFLAGS="-L/usr/local/Cellar/openssl/1.0.2s/lib"

echo 'eval "$(pyenv init -)"' >> .bash_profile
source .bash_profile
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -v ${PYTHON_VERSION}
pyenv global ${PYTHON_VERSION}

if [[ ${PYTHON_MAJOR}=2 ]]; then
pip install numpy
else
pip3 install numpy
fi
16 changes: 14 additions & 2 deletions share/ci/scripts/windows/install_python.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
$pythonVersion = $Args[0]
$pythonMajor = ($pythonVersion -split '\.')[0]

Write-Host "Installing python version ${pythonVersion}"

if ($pythonMajor -eq "3")
{
Invoke-WebRequest "https://www.python.org/ftp/python/${pythonVersion}/python-${pythonVersion}-amd64.exe" -OutFile "C:\python-${pythonVersion}-amd64.exe"
& "C:\python-${pythonVersion}-amd64.exe" /quiet /l* C:\_python.log TARGETDIR=C:\_python
}
else
{
Invoke-WebRequest "https://www.python.org/ftp/python/${pythonVersion}/python-${pythonVersion}.amd64.msi" -OutFile "C:\python-${pythonVersion}-amd64.msi"
msiexec /i "C:\python-${pythonVersion}-amd64.msi" /quiet /l* C:\_python.log TARGETDIR=C:\_python
}

Invoke-WebRequest "https://www.python.org/ftp/python/${pythonVersion}/python-${pythonVersion}.amd64.msi" -OutFile "C:\python-${pythonVersion}.amd64.msi"
msiexec /i "C:\python-${pythonVersion}.amd64.msi" /quiet /l* C:\_python.log TARGETDIR=C:\_python
Write-Host "##vso[task.prependpath]C:\_python"
Write-Host "##vso[task.prependpath]C:\_python\Scripts"
30 changes: 30 additions & 0 deletions share/ci/scripts/windows/install_zlib.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$zlibVersion = $Args[0]
$zlibMajorMinor = [io.path]::GetFileNameWithoutExtension("$zlibVersion")
$zlibVersionConcise = $zlibVersion -replace '[.]',''
$zlibArchive = "https://www.zlib.net/zlib${zlibVersionConcise}.zip"

$zlibRoot = "C:\"
$zlibBuildPath = "${zlibRoot}\zlib-${zlibVersion}"
$zlibInstallPath = "C:\_zlib"
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe"

Write-Host "Retrieving ${zlibArchive}"
Invoke-WebRequest "${zlibArchive}" -OutFile "${zlibRoot}\zlib-${zlibVersion}.zip"
Write-Host "Expanding archive ${zlibRoot}\zlib-${zlibVersion}.zip"
Expand-Archive "${zlibRoot}\zlib-${zlibVersion}.zip" -DestinationPath "${zlibRoot}"

cd $zlibBuildPath
mkdir _build
cd _build
cmake .. -G"Visual Studio 15 2017" -DCMAKE_INSTALL_PREFIX="${zlibInstallPath}"

Write-Host "Building ${zlibBuildPath}\_build\INSTALL.vcxproj" -foregroundcolor green
& "${msbuild}" "${zlibBuildPath}\_build\INSTALL.vcxproj" /P:Configuration=Release

cd $zlibInstallPath
Write-Host "ls ${zlibInstallPath}"
& ls

Write-Host "##vso[task.prependpath]${zlibInstallPath}"
Write-Host "##vso[task.prependpath]${zlibInstallPath}\bin"

6 changes: 5 additions & 1 deletion share/ci/templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ parameters:
cxxCompiler: ''
cCompiler: ''
cmakeOpts: ''
excludeTests: ''

steps:
- bash: |
Expand All @@ -23,6 +24,9 @@ steps:
workingDirectory: _build
displayName: Build OpenEXR

- template: test.yml
- template: test.yml
parameters:
buildType: ${{ parameters.buildType }}
excludeTests: ${{ parameters.excludeTests }}


15 changes: 14 additions & 1 deletion share/ci/templates/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# azure-pipelines template file
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops

parameters:
buildType: Release
excludeTests: ''

steps:
- bash: |
ctest -T Test -E PyIlmBase.* --output-on-failure -VV
exclusionFlags=""
if [[ -n "${{ parameters.excludeTests}}" ]]; then
exclusionFlags="-E ${{ parameters.excludeTests }}"
echo "Excluding tests ${{ parameters.excludeTests }}"
fi
ctest -T Test \
$exclusionFlags \
-C ${{ parameters.buildType }} \
--output-on-failure \
-VV
workingDirectory: _build
displayName: Test OpenEXR