Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
5c5a94dd
"docs/git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "88429853b932471cfdfefd259855d6b8a23aa7c3"
Unverified
Commit
5c5a94dd
authored
Apr 04, 2023
by
Philip Meier
Committed by
GitHub
Apr 04, 2023
Browse files
enable Windows CPU CI on GHA (#7475)
parent
781f512b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
11 deletions
+75
-11
.github/scripts/setup-env.sh
.github/scripts/setup-env.sh
+22
-5
.github/scripts/unittest.sh
.github/scripts/unittest.sh
+2
-6
.github/workflows/test-windows.yml
.github/workflows/test-windows.yml
+51
-0
No files found.
.github/scripts/setup-env.sh
View file @
5c5a94dd
...
@@ -14,23 +14,26 @@ case $(uname) in
...
@@ -14,23 +14,26 @@ case $(uname) in
Darwin
)
Darwin
)
OS_TYPE
=
macos
OS_TYPE
=
macos
;;
;;
MSYS
*
)
OS_TYPE
=
windows
;;
*
)
*
)
echo
"Unknown OS type:"
$(
uname
)
echo
"Unknown OS type:"
$(
uname
)
exit
1
exit
1
;;
;;
esac
esac
echo
'::group::Uninstall system JPEG libraries on macOS'
# The x86 macOS runners, e.g. the GitHub Actions native "macos-12" runner, has some JPEG libraries installed by default
# that interfere with our build. We uninstall them here and use the one from conda below.
if
[[
"
${
OS_TYPE
}
"
==
"macos"
&&
$(
uname
-m
)
==
x86_64
]]
;
then
if
[[
"
${
OS_TYPE
}
"
==
"macos"
&&
$(
uname
-m
)
==
x86_64
]]
;
then
echo
'::group::Uninstall system JPEG libraries on macOS'
# The x86 macOS runners, e.g. the GitHub Actions native "macos-12" runner, has some JPEG libraries installed by
# default that interfere with our build. We uninstall them here and use the one from conda below.
JPEG_LIBS
=
$(
brew list |
grep
jpeg
)
JPEG_LIBS
=
$(
brew list |
grep
jpeg
)
echo
$JPEG_LIBS
echo
$JPEG_LIBS
for
lib
in
$JPEG_LIBS
;
do
for
lib
in
$JPEG_LIBS
;
do
brew uninstall
--ignore-dependencies
--force
$lib
||
true
brew uninstall
--ignore-dependencies
--force
$lib
||
true
done
done
echo
'::endgroup::'
fi
fi
echo
'::endgroup::'
echo
'::group::Create build environment'
echo
'::group::Create build environment'
# See https://github.com/pytorch/vision/issues/7296 for ffmpeg
# See https://github.com/pytorch/vision/issues/7296 for ffmpeg
...
@@ -66,10 +69,24 @@ ltt install --progress-bar=off \
...
@@ -66,10 +69,24 @@ ltt install --progress-bar=off \
torch
torch
if
[[
$GPU_ARCH_TYPE
==
'cuda'
]]
;
then
if
[[
$GPU_ARCH_TYPE
==
'cuda'
]]
;
then
python
3
-c
"import torch; exit(not torch.cuda.is_available())"
python
-c
"import torch; exit(not torch.cuda.is_available())"
fi
fi
echo
'::endgroup::'
echo
'::endgroup::'
if
[[
"
${
OS_TYPE
}
"
==
"windows"
]]
;
then
echo
'::group::Install third party dependencies prior to TorchVision install on Windows'
# `easy_install`, i.e. `python setup.py` has problems downloading the dependencies due to SSL.
# Thus, we install them upfront with `pip` to avoid that.
# Instead of fixing the SSL error, we can probably maintain this special case until we switch away from the deprecated
# `easy_install` anyway.
python setup.py egg_info
# The requires.txt cannot be used with `pip install -r` directly. The requirements are listed at the top and the
# optional dependencies come in non-standard syntax after a blank line. Thus, we just extract the header.
sed
-e
'/^$/,$d'
*
.egg-info/requires.txt
>
requirements.txt
pip
install
--progress-bar
=
off
-r
requirements.txt
echo
'::endgroup::'
fi
echo
'::group::Install TorchVision'
echo
'::group::Install TorchVision'
python setup.py develop
python setup.py develop
echo
'::endgroup::'
echo
'::endgroup::'
...
...
.github/scripts/unittest.sh
View file @
5c5a94dd
...
@@ -4,15 +4,11 @@ set -euo pipefail
...
@@ -4,15 +4,11 @@ set -euo pipefail
./.github/scripts/setup-env.sh
./.github/scripts/setup-env.sh
# Prepare conda
# Activate conda environment
CONDA_PATH
=
$(
which conda
)
eval
"
$($(
which conda
)
shell.bash hook
)
"
&&
conda deactivate
&&
conda activate ci
eval
"
$(
${
CONDA_PATH
}
shell.bash hook
)
"
conda activate ci
echo
'::group::Install testing utilities'
echo
'::group::Install testing utilities'
pip
install
--progress-bar
=
off pytest pytest-mock pytest-cov
pip
install
--progress-bar
=
off pytest pytest-mock pytest-cov
echo
'::endgroup::'
echo
'::endgroup::'
echo
'::group::Run unittests'
pytest
--junit-xml
=
"
${
RUNNER_TEST_RESULTS_DIR
}
/test-results.xml"
-v
--durations
=
25
pytest
--junit-xml
=
"
${
RUNNER_TEST_RESULTS_DIR
}
/test-results.xml"
-v
--durations
=
25
echo
'::endgroup::'
.github/workflows/test-windows.yml
0 → 100644
View file @
5c5a94dd
name
:
Tests on Windows
on
:
pull_request
:
push
:
branches
:
-
nightly
-
main
-
release/*
workflow_dispatch
:
jobs
:
unittests
:
strategy
:
matrix
:
python-version
:
-
"
3.8"
-
"
3.9"
-
"
3.10"
-
"
3.11"
runner
:
[
"
windows.4xlarge"
]
gpu-arch-type
:
[
"
cpu"
]
# FIXME: enable this as soon as nvjpeg is available on the Windows runner
# include:
# - python-version: "3.8"
# runner: windows.8xlarge.nvidia.gpu
# gpu-arch-type: cuda
# gpu-arch-version: "11.7"
fail-fast
:
false
uses
:
pytorch/test-infra/.github/workflows/windows_job.yml@main
with
:
repository
:
pytorch/vision
runner
:
${{ matrix.runner }}
timeout
:
120
script
:
|
set -euxo pipefail
export PYTHON_VERSION=${{ matrix.python-version }}
export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }}
export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }}
# TODO: Port this to pytorch/test-infra/.github/workflows/windows_job.yml
export PATH="/c/Jenkins/Miniconda3/Scripts:${PATH}"
if [[ $GPU_ARCH_TYPE == 'cuda' ]]; then
# TODO: This should be handled by the generic Windows job the same as its done by the generic Linux job
export CUDA_HOME="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${{ matrix.gpu-arch-version }}"
export CUDA_PATH="${CUDA_HOME}"
fi
./.github/scripts/unittest.sh
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment