3
description: Set up for windows jobs
7
description: which cuda version to install, 'cpu' for none
13
- name: Display EC2 information
17
function get_ec2_metadata() {
18
# Pulled from instance metadata endpoint for EC2
19
# see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
21
curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
23
echo "ami-id: $(get_ec2_metadata ami-id)"
24
echo "instance-id: $(get_ec2_metadata instance-id)"
25
echo "instance-type: $(get_ec2_metadata instance-type)"
26
echo "system info $(uname -a)"
29
- name: Enable long paths on Windows
32
Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
37
# Windows conda is baked into the AMI at this location
38
CONDA="C:\Jenkins\Miniconda3\condabin\conda.bat"
41
echo "CONDA_RUN=${CONDA} run --no-capture-output";
42
echo "CONDA_BUILD=${CONDA} run conda-build";
43
echo "CONDA_INSTALL=${CONDA} install";
52
PYTHON3=$(${CONDA_RUN} which python3)
55
if [[ "${EXIT_CODE}" == "0" ]]; then
56
echo "Found Python3 at ${PYTHON3}, adding it into GITHUB_PATH"
58
PYTHON_PATH=$(dirname "${PYTHON3}")
59
echo "${PYTHON_PATH}" >> "${GITHUB_PATH}"
65
PYTHON=$(${CONDA_RUN} which python)
68
if [[ "${EXIT_CODE}" == "0" ]]; then
69
echo "Found Python at ${PYTHON}, set Python3 alias and add it into GITHUB_PATH"
71
PYTHON3=$(echo "${PYTHON}" | sed "s/python/python3/")
74
ln -s "${PYTHON}" "${PYTHON3}"
76
PYTHON_PATH=$(dirname "${PYTHON}")
77
echo "${PYTHON_PATH}" >> "${GITHUB_PATH}"
79
echo "Found no Python using ${CONDA_RUN}"
83
- name: Get temporary directory used by Windows Python
86
TMPDIR=$(python -c 'import tempfile; print(tempfile.gettempdir());')
87
echo "TMPDIR=${TMPDIR}" >> "${GITHUB_ENV}"
91
- name: Disables Windows Defender scheduled and real-time scanning for files in directories used by PyTorch
92
continue-on-error: true
95
Add-MpPreference -ExclusionPath $(Get-Location).tostring(),$Env:TMPDIR,"C:\Jenkins\Miniconda3" -ErrorAction Ignore
96
# Let's both exclude the path and disable Windows Defender completely just to be sure
97
# that it doesn't interfere
98
Set-MpPreference -DisableRealtimeMonitoring $True -ErrorAction Ignore
100
- name: Install sysinternals handle tool
101
continue-on-error: true
104
choco install handle -y
105
handle C:\actions-runner\_work\