From e73bfea7444a4638b0ca118d1a72704cf94cf2b7 Mon Sep 17 00:00:00 2001 From: harupy Date: Thu, 18 Nov 2021 18:34:52 +0900 Subject: [PATCH 1/4] do not run pip install multiple times Signed-off-by: harupy --- dev/install-common-deps.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev/install-common-deps.sh b/dev/install-common-deps.sh index 132a64ff71fbe..6a8b984e97bfc 100755 --- a/dev/install-common-deps.sh +++ b/dev/install-common-deps.sh @@ -27,18 +27,19 @@ else fi export MLFLOW_HOME=$(pwd) +requirements="" # Install Python test dependencies only if we're running Python tests if [[ "$INSTALL_SMALL_PYTHON_DEPS" == "true" ]]; then # When downloading large packages from PyPI, the connection is sometimes aborted by the # remote host. See https://github.com/pypa/pip/issues/8510. # As a workaround, we retry installation of large packages. - retry-with-backoff pip install -r requirements/small-requirements.txt + requirements+=" -r requirements/small-requirements.txt" fi if [[ "$INSTALL_SKINNY_PYTHON_DEPS" == "true" ]]; then - retry-with-backoff pip install -r requirements/skinny-requirements.txt + requirements+=" -r requirements/skinny-requirements.txt" fi if [[ "$INSTALL_LARGE_PYTHON_DEPS" == "true" ]]; then - retry-with-backoff pip install -r requirements/large-requirements.txt + requirements+=" -r requirements/large-requirements.txt" # Install prophet's dependencies beforehand, otherwise pip would fail to build a wheel for prophet if [[ -z "$(pip cache list prophet --format abspath)" ]]; then @@ -49,9 +50,11 @@ if [[ "$INSTALL_LARGE_PYTHON_DEPS" == "true" ]]; then rm -rf $tmp_dir fi - retry-with-backoff pip install -r requirements/extra-ml-requirements.txt + requirements+=" -r requirements/extra-ml-requirements.txt" fi +retry-with-backoff pip install $requirements + # Install `mlflow-test-plugin` without dependencies pip install --no-dependencies tests/resources/mlflow-test-plugin From 0bec3a5350dbb4dad91b8273b5a76273a95732f1 Mon Sep 17 00:00:00 2001 From: harupy Date: Thu, 18 Nov 2021 18:45:41 +0900 Subject: [PATCH 2/4] do not run pip install when requirements is empty Signed-off-by: harupy --- dev/install-common-deps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/install-common-deps.sh b/dev/install-common-deps.sh index 6a8b984e97bfc..1e2121cdff1d8 100755 --- a/dev/install-common-deps.sh +++ b/dev/install-common-deps.sh @@ -53,7 +53,9 @@ if [[ "$INSTALL_LARGE_PYTHON_DEPS" == "true" ]]; then requirements+=" -r requirements/extra-ml-requirements.txt" fi -retry-with-backoff pip install $requirements +if [ ! -z $requirements ]; then + retry-with-backoff pip install $requirements +fi # Install `mlflow-test-plugin` without dependencies pip install --no-dependencies tests/resources/mlflow-test-plugin From 4cbff76624c833f61f2958c92e8d42bb840127dd Mon Sep 17 00:00:00 2001 From: harupy Date: Thu, 18 Nov 2021 18:51:01 +0900 Subject: [PATCH 3/4] fix if syntax Signed-off-by: harupy --- dev/install-common-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/install-common-deps.sh b/dev/install-common-deps.sh index 1e2121cdff1d8..450f8f66a82ef 100755 --- a/dev/install-common-deps.sh +++ b/dev/install-common-deps.sh @@ -53,7 +53,7 @@ if [[ "$INSTALL_LARGE_PYTHON_DEPS" == "true" ]]; then requirements+=" -r requirements/extra-ml-requirements.txt" fi -if [ ! -z $requirements ]; then +if [[ ! -z $requirements ]]; then retry-with-backoff pip install $requirements fi From 85406c6df8d9d3d9d28e1db995d36f0236d9ff17 Mon Sep 17 00:00:00 2001 From: harupy <17039389+harupy@users.noreply.github.com> Date: Fri, 7 Jan 2022 18:25:45 +0900 Subject: [PATCH 4/4] rename Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> --- dev/install-common-deps.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dev/install-common-deps.sh b/dev/install-common-deps.sh index 450f8f66a82ef..a50fd15bdc636 100755 --- a/dev/install-common-deps.sh +++ b/dev/install-common-deps.sh @@ -27,19 +27,19 @@ else fi export MLFLOW_HOME=$(pwd) -requirements="" +req_files="" # Install Python test dependencies only if we're running Python tests if [[ "$INSTALL_SMALL_PYTHON_DEPS" == "true" ]]; then # When downloading large packages from PyPI, the connection is sometimes aborted by the # remote host. See https://github.com/pypa/pip/issues/8510. # As a workaround, we retry installation of large packages. - requirements+=" -r requirements/small-requirements.txt" + req_files+=" -r requirements/small-requirements.txt" fi if [[ "$INSTALL_SKINNY_PYTHON_DEPS" == "true" ]]; then - requirements+=" -r requirements/skinny-requirements.txt" + req_files+=" -r requirements/skinny-requirements.txt" fi if [[ "$INSTALL_LARGE_PYTHON_DEPS" == "true" ]]; then - requirements+=" -r requirements/large-requirements.txt" + req_files+=" -r requirements/large-requirements.txt" # Install prophet's dependencies beforehand, otherwise pip would fail to build a wheel for prophet if [[ -z "$(pip cache list prophet --format abspath)" ]]; then @@ -50,11 +50,11 @@ if [[ "$INSTALL_LARGE_PYTHON_DEPS" == "true" ]]; then rm -rf $tmp_dir fi - requirements+=" -r requirements/extra-ml-requirements.txt" + req_files+=" -r requirements/extra-ml-requirements.txt" fi -if [[ ! -z $requirements ]]; then - retry-with-backoff pip install $requirements +if [[ ! -z $req_files ]]; then + retry-with-backoff pip install $req_files fi # Install `mlflow-test-plugin` without dependencies