Skip to content

Commit 4e749d9

Browse files
authored
Merge pull request #395 from h-vetinari/artefact
Fix artefact persistence on windows
2 parents b9aa810 + 593c89a commit 4e749d9

File tree

4 files changed

+133
-13
lines changed

4 files changed

+133
-13
lines changed

.github/workflows/conda-build.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
8080

8181
- name: Build on Linux
82+
id: build-linux
8283
if: matrix.os == 'ubuntu'
8384
env:
8485
CONFIG: ${{ matrix.CONFIG }}
@@ -109,6 +110,7 @@ jobs:
109110
./.scripts/run_docker_build.sh
110111
111112
- name: Build on macOS
113+
id: build-macos
112114
if: matrix.os == 'macos'
113115
env:
114116
CONFIG: ${{ matrix.CONFIG }}
@@ -132,13 +134,19 @@ jobs:
132134
./.scripts/run_osx_build.sh
133135
134136
- name: Build on windows
137+
id: build-windows
138+
if: matrix.os == 'windows'
135139
shell: cmd
136140
run: |
137141
set "flow_run_id=github_%GITHUB_RUN_ID%"
138142
set "remote_url=https://github.com/%GITHUB_REPOSITORY%"
139143
set "sha=%GITHUB_SHA%"
140144
call ".scripts\run_win_build.bat"
141145
env:
146+
# default value; make explicit for now (pending smithy-improvements),
147+
# as it needs to be synchronized with artefact generation below; see
148+
# https://github.com/conda-forge/conda-smithy/issues/2345
149+
CONDA_BLD_DIR: C:\bld
142150
MINIFORGE_HOME: D:\Miniforge
143151
PYTHONUNBUFFERED: 1
144152
CONFIG: ${{ matrix.CONFIG }}
@@ -147,45 +155,72 @@ jobs:
147155
BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }}
148156
FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }}
149157
STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }}
150-
if: matrix.os == 'windows'
158+
159+
- name: Determine build outcome
160+
# this is to merge the status of the linux/osx/win builds into
161+
# something we can easily reuse during artefact generation
162+
id: determine-status
163+
if: ${{ always() }}
164+
shell: bash
165+
env:
166+
OS: ${{ matrix.os }}
167+
run: |
168+
if [[ "$OS" == "ubuntu" ]]; then
169+
STATUS="${{ steps.build-linux.outcome }}"
170+
elif [[ "$OS" == "macos" ]]; then
171+
STATUS="${{ steps.build-macos.outcome }}"
172+
elif [[ "$OS" == "windows" ]]; then
173+
STATUS="${{ steps.build-windows.outcome }}"
174+
fi
175+
if [ -z "$STATUS" ]; then
176+
# jobs that never ran will have empty status
177+
STATUS="cancelled"
178+
fi
179+
echo "status=$STATUS" >> $GITHUB_OUTPUT
180+
151181
- name: Prepare conda build artifacts
182+
continue-on-error: true
152183
id: prepare-artifacts
153184
shell: bash
154-
if: ${{ always() }}
185+
# we do not want to trigger artefact creation if the build was cancelled
186+
if: ${{ steps.determine-status.outputs.status != 'cancelled' }}
155187
env:
188+
CI: github_actions
156189
CONFIG: ${{ matrix.CONFIG }}
157190
SHORT_CONFIG: ${{ matrix.SHORT_CONFIG }}
191+
JOB_STATUS: ${{ steps.determine-status.outputs.status }}
158192
OS: ${{ matrix.os }}
159-
MINIFORGE_HOME_WIN: D:\Miniforge
160193
run: |
161-
export CI=github_actions
162194
export CI_RUN_ID=$GITHUB_RUN_ID
163195
export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)"
164196
export ARTIFACT_STAGING_DIR="$GITHUB_WORKSPACE"
165197
if [ $OS == "macos" ]; then
166198
export CONDA_BLD_DIR="${MINIFORGE_HOME:-${HOME}/miniforge3}/conda-bld"
167199
elif [ $OS == "windows" ]; then
168-
export CONDA_BLD_DIR="${MINIFORGE_HOME_WIN//\\//}/conda-bld"
200+
# this should be populated consistently by smithy, see above
201+
export CONDA_BLD_DIR="C:\\bld"
169202
else
170203
export CONDA_BLD_DIR="build_artifacts"
171204
fi
172205
# Archive everything in CONDA_BLD_DIR except environments
173206
# Archive the CONDA_BLD_DIR environments only when the job fails
174207
# Use different prefix for successful and failed build artifacts
175208
# so random failures don't prevent rebuilds from creating artifacts.
176-
JOB_STATUS="${{ job.status }}"
177209
if [ $JOB_STATUS == "failure" ]; then
178210
export BLD_ARTIFACT_PREFIX="conda_artifacts"
179211
export ENV_ARTIFACT_PREFIX="conda_envs"
180212
else
181213
export BLD_ARTIFACT_PREFIX="conda_pkgs"
182214
fi
183-
./.scripts/create_conda_build_artifacts.sh
184-
continue-on-error: true
215+
if [ $OS == "windows" ]; then
216+
pwsh -Command ". '.scripts/create_conda_build_artifacts.bat'"
217+
else
218+
./.scripts/create_conda_build_artifacts.sh
219+
fi
185220
186221
- name: Store conda build artifacts
187222
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
188-
if: ${{ always() && steps.prepare-artifacts.outcome == 'success' }}
223+
if: ${{ steps.prepare-artifacts.outcome == 'success' }}
189224
with:
190225
name: ${{ steps.prepare-artifacts.outputs.BLD_ARTIFACT_NAME }}
191226
path: ${{ steps.prepare-artifacts.outputs.BLD_ARTIFACT_PATH }}
@@ -194,7 +229,8 @@ jobs:
194229

195230
- name: Store conda build environment artifacts
196231
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
197-
if: ${{ failure() && steps.prepare-artifacts.outcome == 'success' }}
232+
# only relevant if build failed, see above
233+
if: ${{ steps.determine-status.outputs.status == 'failure' && steps.prepare-artifacts.outcome == 'success' }}
198234
with:
199235
name: ${{ steps.prepare-artifacts.outputs.ENV_ARTIFACT_NAME }}
200236
path: ${{ steps.prepare-artifacts.outputs.ENV_ARTIFACT_PATH }}

.scripts/create_conda_build_artifacts.bat

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conda-forge.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ azure:
22
free_disk_space: true
33
settings_linux:
44
timeoutInMinutes: 1
5-
settings_win:
6-
variables:
7-
CONDA_BLD_PATH: C:\\bld\\
85
bot:
96
abi_migration_branches:
107
- v2.6.x

recipe/meta.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ source:
7272

7373
build:
7474
number: {{ build }}
75+
# debug: only rebuild variants that failed
76+
skip: true # [not (cuda_compiler_version != "None" and (win64 or aarch64))]
7577
# This logic allows two rc variants to be defined in the conda_build_config, but only one to actually be built.
7678
# We want to be able to define two variants in the cbc so we can assign different labels to each in the upload channel
7779
# (by zipping is_rc with channel_targets). This prevents rc builds being used unless specifically requested.
@@ -446,6 +448,12 @@ outputs:
446448
{% set skips = skips ~ " or (TestLinalgCPU and test_pca_lowrank_cpu)" %} # [aarch64]
447449
{% set skips = skips ~ " or (TestLinalgCPU and test_svd_lowrank_cpu)" %} # [aarch64]
448450
{% set skips = skips ~ " or (TestMkldnnCPU and test_lstm_cpu)" %} # [aarch64]
451+
# very long-running tests in emulation
452+
{% set skips = skips ~ " or test_eigh_lwork_lapack" %} # [aarch64]
453+
{% set skips = skips ~ " or test_gradgrad_nn_LSTM" %} # [aarch64]
454+
{% set skips = skips ~ " or test_grad_nn_Transformer" %} # [aarch64]
455+
{% set skips = skips ~ " or test_inverse_errors_large" %} # [aarch64]
456+
{% set skips = skips ~ " or (TestXNNPACKConv1dTransformPass and test_conv1d_basic)" %} # [aarch64]
449457
# errors (possibly QEMU-related) with openblas 0.3.30
450458
{% set skips = skips ~ " or test_addbmm or test_baddbmm or test_bmm" %} # [aarch64]
451459
# doesn't crash, but gets different result on aarch + CUDA

0 commit comments

Comments
 (0)