diff --git a/.github/workflows/jira.pr.yml b/.github/workflows/jira.pr.yml deleted file mode 100644 index 45d1a3e03aaae..0000000000000 --- a/.github/workflows/jira.pr.yml +++ /dev/null @@ -1,20 +0,0 @@ -on: - pull_request: - branches: - - master - -name: Jira Ticket Creation for PRs - -jobs: - create_ticket: - name: Create Jira ticket over API - runs-on: ubuntu-latest - steps: - - name: Call REST API - shell: bash - run: > - curl - -u ${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }} - -H 'Content-Type: application/json' - --data-raw '{"fields":{"project":{"key":"ML"},"summary":"Review \"${{ github.event.pull_request.title }}\" by ${{ github.event.pull_request.user.login }} [${{ github.repository }} #${{ github.event.number }}] ","description":"${{ github.event.pull_request._links.html.href }}","customfield_10008":"ML-9504","assignee":{"name":"eng-ml-platform-team"},"issuetype":{"name":"Story"},"components":[{"name":"ML Platform"}]}}' - ${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/ diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml new file mode 100644 index 0000000000000..4c58c4746c748 --- /dev/null +++ b/.github/workflows/pythonapp.yml @@ -0,0 +1,27 @@ +name: MLflow tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + python-small: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.6 + uses: actions/setup-python@v1 + with: + python-version: 3.6 + - name: Install dependencies + run: | + export GITHUB_WORKFLOW=1 + INSTALL_SMALL_PYTHON_DEPS=true source ./travis/install-common-deps.sh + - name: Run tests + run: | + export GITHUB_WORKFLOW=1 + export PATH="$HOME/miniconda/bin:$PATH" + source activate test-environment + ./travis/run-small-python-tests.sh diff --git a/tests/models/test_cli.py b/tests/models/test_cli.py index 550e0921644a8..ca6175cdf428a 100644 --- a/tests/models/test_cli.py +++ b/tests/models/test_cli.py @@ -127,6 +127,7 @@ def test_model_with_no_deployable_flavors_fails_pollitely(): assert "No suitable flavor backend was found for the model." in stderr +@pytest.mark.large def test_serve_gunicorn_opts(iris_data, sk_model): if sys.platform == "win32": pytest.skip("This test requires gunicorn which is not available on windows.") @@ -159,6 +160,7 @@ def test_serve_gunicorn_opts(iris_data, sk_model): assert expected_command_pattern.search(stdout) is not None +@pytest.mark.large def test_predict(iris_data, sk_model): with TempDir(chdr=True) as tmp: with mlflow.start_run() as active_run: @@ -245,6 +247,7 @@ def test_predict(iris_data, sk_model): assert all(expected == actual) +@pytest.mark.large def test_prepare_env_passes(sk_model): if no_conda: pytest.skip("This test requires conda.") @@ -270,6 +273,7 @@ def test_prepare_env_passes(sk_model): assert p.wait() == 0 +@pytest.mark.large def test_prepare_env_fails(sk_model): if no_conda: pytest.skip("This test requires conda.") diff --git a/tests/projects/test_docker_projects.py b/tests/projects/test_docker_projects.py index 1e558759da979..24368b248aad3 100644 --- a/tests/projects/test_docker_projects.py +++ b/tests/projects/test_docker_projects.py @@ -26,6 +26,7 @@ def _build_uri(base_uri, subdirectory): @pytest.mark.parametrize("use_start_run", map(str, [0, 1])) +@pytest.mark.large def test_docker_project_execution( use_start_run, tmpdir, docker_example_base_image): # pylint: disable=unused-argument @@ -68,6 +69,7 @@ def test_docker_project_execution( ("databricks://some-profile", "-e MLFLOW_TRACKING_URI=databricks ") ]) @mock.patch('databricks_cli.configure.provider.ProfileConfigProvider') +@pytest.mark.large def test_docker_project_tracking_uri_propagation( ProfileConfigProvider, tmpdir, tracking_uri, expected_command_segment, docker_example_base_image): # pylint: disable=unused-argument diff --git a/tests/projects/test_projects.py b/tests/projects/test_projects.py index 6297a31345eb7..d69cb56ef37a9 100644 --- a/tests/projects/test_projects.py +++ b/tests/projects/test_projects.py @@ -189,6 +189,7 @@ def test_invalid_run_mode(): mlflow.projects.run(uri=TEST_PROJECT_DIR, backend="some unsupported mode") +@pytest.mark.large def test_use_conda(): """ Verify that we correctly handle the `use_conda` argument.""" # Verify we throw an exception when conda is unavailable @@ -207,6 +208,7 @@ def test_use_conda(): os.environ["CONDA_EXE"] = conda_exe_path +@pytest.mark.large def test_expected_tags_logged_when_using_conda(): with mock.patch.object(mlflow.tracking.MlflowClient, "set_tag") as tag_mock: try: diff --git a/travis/install-common-deps.sh b/travis/install-common-deps.sh index 3d2b059d84214..c08314f9d7e5d 100755 --- a/travis/install-common-deps.sh +++ b/travis/install-common-deps.sh @@ -2,17 +2,15 @@ set -ex sudo mkdir -p /travis-install -sudo chown travis /travis-install +if [[ -z $GITHUB_WORKFLOW ]]; then + sudo chown travis /travis-install +fi # (The conda installation steps below are taken from http://conda.pydata.org/docs/travis.html) # We do this conditionally because it saves us some downloading if the # version is the same. -if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh -O /travis-install/miniconda.sh; -else - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /travis-install/miniconda.sh; -fi +wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh -bash /travis-install/miniconda.sh -b -p $HOME/miniconda +bash miniconda.sh -b -p $HOME/miniconda export PATH="$HOME/miniconda/bin:$PATH" hash -r conda config --set always_yes yes --set changeps1 no @@ -28,21 +26,23 @@ python --version pip install --upgrade pip==19.3.1 # Install Python test dependencies only if we're running Python tests if [[ "$INSTALL_SMALL_PYTHON_DEPS" == "true" ]]; then - pip install -r ./travis/small-requirements.txt + pip install --quiet -r ./travis/small-requirements.txt fi if [[ "$INSTALL_LARGE_PYTHON_DEPS" == "true" ]]; then - pip install -r ./travis/large-requirements.txt + pip install --quiet -r ./travis/large-requirements.txt # Hack: make sure all spark-* scripts are executable. # Conda installs 2 version spark-* scripts and makes the ones spark # uses not executable. This is a temporary fix to unblock the tests. - ls -lha `find /home/travis/miniconda/envs/test-environment/ -path "*bin/spark-*"` - chmod 777 `find /home/travis/miniconda/envs/test-environment/ -path "*bin/spark-*"` - ls -lha `find /home/travis/miniconda/envs/test-environment/ -path "*bin/spark-*"` + ls -lha $(find $HOME/miniconda/envs/test-environment/ -path "*bin/spark-*") + chmod 777 $(find $HOME/miniconda/envs/test-environment/ -path "*bin/spark-*") + ls -lha $(find $HOME/miniconda/envs/test-environment/ -path "*bin/spark-*") fi pip install . export MLFLOW_HOME=$(pwd) # Remove boto config present in Travis VMs (https://github.com/travis-ci/travis-ci/issues/7940) -sudo rm -f /etc/boto.cfg +if [[ -z $GITHUB_WORKFLOW ]]; then + sudo rm -f /etc/boto.cfg +fi # Print current environment info pip list which mlflow