Skip to content

.gitlab/ci/conda.yml: use retry() for Conda commands

Karl Wette requested to merge ANU-CGA/lalsuite:CI-conda-retry into master

Description

The retry() macro defined in .gitlab-ci.yml is first extended with two features:

  • set RETRY_EXIT_PATTERN to an awk pattern to exit the command if the pattern is detected in its output
  • set RETRY_CLEANUP to a cleanup command to execute before re-attempting the command

retry() is then used to run conda commands:

  • RETRY_EXIT_PATTERN='/appears to be corrupted/' to catch error messages, which are caused by corrupted packages in $CONDA_PKGS_DIRS
  • RETRY_CLEANUP="rm -rf ${CONDA_PKGS_DIRS}" to remove the cache before retrying

An example failure of conda create due to package cache corruption is here.

This generalises code that was originally only applied to conda build. By wrapping it in the retry() macro it can be used for other conda commands. Conversely retry() may now be more useful to handle other troublesome commands.

API Changes and Justification

Backwards Compatible Changes

  • This change does not modify any class/function/struct/type definitions in a public C header file or any Python class/function definitions
  • This change adds new classes/functions/structs/types to a public C header file or Python module

Backwards Incompatible Changes

  • This change modifies an existing class/function/struct/type definition in a public C header file or Python module
  • This change removes an existing class/function/struct/type from a public C header file or Python module

If any of the Backwards Incompatible check boxes are ticked please provide a justification why this change is necessary and why it needs to be done in a backwards incompatible way.

Review Status

Please provide details on any reviews related to this change and and the associated reviewers.

Edited by Karl Wette

Merge request reports

Loading