From fd3ef0f6be489bb197ab961d86b4cf0e47f6c5d1 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Fri, 15 Nov 2024 13:08:04 +0000 Subject: [PATCH] CI : Build and test GafferML --- .github/workflows/main.yml | 4 +- .github/workflows/main/installONNX.py | 55 +++++++++++++++++++++++++++ .github/workflows/main/sconsOptions | 1 + 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 .github/workflows/main/installONNX.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 768795a5dec..9c401080c34 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: publish: true containerImage: testRunner: Invoke-Expression - testArguments: -excludedCategories performance GafferTest GafferVDBTest GafferUSDTest GafferSceneTest GafferDispatchTest GafferOSLTest GafferImageTest GafferUITest GafferImageUITest GafferSceneUITest GafferDispatchUITest GafferOSLUITest GafferUSDUITest GafferVDBUITest GafferDelightUITest GafferTractorTest GafferTractorUITest + testArguments: -excludedCategories performance GafferTest GafferVDBTest GafferUSDTest GafferSceneTest GafferDispatchTest GafferOSLTest GafferImageTest GafferUITest GafferImageUITest GafferSceneUITest GafferDispatchUITest GafferOSLUITest GafferUSDUITest GafferVDBUITest GafferDelightUITest GafferTractorTest GafferTractorUITest GafferMLTest GafferMLUITest sconsCacheMegabytes: 800 jobs: 4 @@ -139,6 +139,8 @@ jobs: echo GAFFER_DEPENDENCIES_HASH=`python .github/workflows/main/installDependencies.py ${{ matrix.dependenciesURL != '' && format( '--archiveURL {0}', matrix.dependenciesURL ) || '' }} --dependenciesDir ${{ env.GAFFER_BUILD_DIR }} --outputFormat "{archiveDigest}"` >> $GITHUB_ENV ./.github/workflows/main/installDelight.py echo DELIGHT=$GITHUB_WORKSPACE/3delight >> $GITHUB_ENV + ./.github/workflows/main/installONNX.py + echo ONNX_ROOT=$GITHUB_WORKSPACE/onnxruntime >> $GITHUB_ENV shell: bash - name: Install Mesa (Windows) diff --git a/.github/workflows/main/installONNX.py b/.github/workflows/main/installONNX.py new file mode 100755 index 00000000000..abe4d95b2d6 --- /dev/null +++ b/.github/workflows/main/installONNX.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +########################################################################## +# +# Copyright (c) 2024, Cinesite VFX Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of Image Engine Design nor the names of any +# other contributors to this software may be used to endorse or +# promote products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +########################################################################## + +import pathlib +import sys +import subprocess +from urllib.request import urlretrieve + +version = "1.19.2" + +if sys.platform == "linux" : + url = f"https://github.com/microsoft/onnxruntime/releases/download/v{version}/onnxruntime-linux-x64-{version}.tgz" +elif sys.platform == "darwin" : + url = f"https://github.com/microsoft/onnxruntime/releases/download/v{version}/onnxruntime-osx-arm64-{version}.tgz" + +print( "Downloading ONNX \"{}\"".format( url ) ) +archiveFileName, headers = urlretrieve( url ) + +pathlib.Path( "onnxruntime" ).mkdir() + +subprocess.check_call( + [ "tar", "-xf", archiveFileName, "-C", "onnxruntime", "--strip-components=1" ] +) diff --git a/.github/workflows/main/sconsOptions b/.github/workflows/main/sconsOptions index 61fbf0ff529..04969ac3e19 100644 --- a/.github/workflows/main/sconsOptions +++ b/.github/workflows/main/sconsOptions @@ -45,6 +45,7 @@ BUILD_CACHEDIR = os.environ["GAFFER_CACHE_DIR"] ARNOLD_ROOT = os.environ.get( "ARNOLD_ROOT", "" ) DELIGHT_ROOT = os.environ["DELIGHT"] +ONNX_ROOT = os.environ["ONNX_ROOT"] BUILD_DIR = os.environ["GAFFER_BUILD_DIR"] INSTALL_DIR = os.path.join( "install", os.environ["GAFFER_BUILD_NAME"] )