https://gitlab.inria.fr/jrye/mlflow-extra.git
Tip revision: a85ac107187e4a1f10a144dffd66df4c31a652a3 authored by Jan-Michael Rye on 28 July 2023, 15:18:49 UTC
Update GitLab CI
Update GitLab CI
Tip revision: a85ac10
install_and_run.sh
#!/usr/bin/env bash
set -euo pipefail
function show_help()
{
cat << HELP
SYNOPSIS
Run a command from the MLflow Extra package. The command will be installed in
a virtual environment if necessary.
USAGE
${0##*/} <command> [args]
EXAMPLE
${0##*/} mlflow-fix_artifacts ./mlruns
HELP
}
cmd=("$@")
if [[ ${#cmd[@]} == 0 || ${cmd[0]:0:7} != 'mlflow-' ]]
then
show_help
exit 1
fi
# Install MLflow Extra in a virtual environment if necessary.
if ! command -v "${cmd[0]}" >/dev/null 2>&1
then
# Clone the MLflow Extra repo if necessary.
if [[ ! -d mlflow-extra ]]
then
git clone 'git@gitlab.inria.fr:jrye/mlflow-extra.git'
fi
mlflow-extra/scripts/install.sh -u venv
source venv/bin/activate
fi
"${cmd[@]}"
