From 7d371d27f2a974b682ffa16b71576e61e9338c34 Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Thu, 13 May 2021 10:35:56 -0700 Subject: [PATCH] [SPARK-35393][PYTHON][INFRA][TESTS] Recover pip packaging test in Github Actions ### What changes were proposed in this pull request? Currently pip packaging test is being skipped: ``` ======================================================================== Running PySpark packaging tests ======================================================================== Constructing virtual env for testing Missing virtualenv & conda, skipping pip installability tests Cleaning up temporary directory - /tmp/tmp.iILYWISPXW ``` See https://github.com/apache/spark/runs/2568923639?check_suite_focus=true GitHub Actions's image has its default Conda installed at `/usr/share/miniconda` but seems like the image we're using for PySpark does not have it (which is legitimate). This PR proposes to install Conda to use in pip packaging tests in GitHub Actions. ### Why are the changes needed? To recover the test coverage. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? It was tested in my fork: https://github.com/HyukjinKwon/spark/runs/2575126882?check_suite_focus=true ``` ======================================================================== Running PySpark packaging tests ======================================================================== Constructing virtual env for testing Using conda virtual environments Testing pip installation with python 3.6 Using /tmp/tmp.qPjTenqfGn for virtualenv Collecting package metadata (current_repodata.json): ...working... done Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): ...working... done Solving environment: ...working... done ## Package Plan ## environment location: /tmp/tmp.qPjTenqfGn/3.6 added / updated specs: - numpy - pandas - pip - python=3.6 - setuptools ... Successfully ran pip sanity check ``` Closes #32537 from HyukjinKwon/SPARK-35393. Authored-by: Hyukjin Kwon Signed-off-by: Dongjoon Hyun --- .github/workflows/build_and_test.yml | 9 +++++---- dev/run-pip-tests | 4 ---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ec0e6b584a6ad..be5978e7ecb97 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -72,8 +72,6 @@ jobs: INCLUDED_TAGS: ${{ matrix.included-tags }} HADOOP_PROFILE: ${{ matrix.hadoop }} HIVE_PROFILE: ${{ matrix.hive }} - # GitHub Actions' default miniconda to use in pip packaging test. - CONDA_PREFIX: /usr/share/miniconda GITHUB_PREV_SHA: ${{ github.event.before }} SPARK_LOCAL_IP: localhost steps: @@ -169,8 +167,6 @@ jobs: MODULES_TO_TEST: ${{ matrix.modules }} HADOOP_PROFILE: hadoop3.2 HIVE_PROFILE: hive2.3 - # GitHub Actions' default miniconda to use in pip packaging test. - CONDA_PREFIX: /usr/share/miniconda GITHUB_PREV_SHA: ${{ github.event.before }} SPARK_LOCAL_IP: localhost steps: @@ -221,10 +217,15 @@ jobs: run: | python3.6 -m pip install numpy 'pyarrow<3.0.0' pandas scipy xmlrunner python3.6 -m pip list + - name: Install Conda for pip packaging test + run: | + curl -s https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > miniconda.sh + bash miniconda.sh -b -p $HOME/miniconda # Run the tests. - name: Run tests run: | export APACHE_SPARK_REF=${{ steps.sync-branch.outputs.APACHE_SPARK_REF }} + export PATH=$PATH:$HOME/miniconda/bin ./dev/run-tests --parallelism 2 --modules "$MODULES_TO_TEST" - name: Upload test results to report if: always() diff --git a/dev/run-pip-tests b/dev/run-pip-tests index b322d3f61b444..cb64e88318a89 100755 --- a/dev/run-pip-tests +++ b/dev/run-pip-tests @@ -80,10 +80,6 @@ for python in "${PYTHON_EXECS[@]}"; do VIRTUALENV_PATH="$VIRTUALENV_BASE"/$python rm -rf "$VIRTUALENV_PATH" if [ -n "$USE_CONDA" ]; then - if [ -f "$CONDA_PREFIX/etc/profile.d/conda.sh" ]; then - # See also https://github.com/conda/conda/issues/7980 - source "$CONDA_PREFIX/etc/profile.d/conda.sh" - fi conda create -y -p "$VIRTUALENV_PATH" python=$python numpy pandas pip setuptools source activate "$VIRTUALENV_PATH" || conda activate "$VIRTUALENV_PATH" else