Skip to content

Commit

Permalink
Merge pull request #1525 from microsoft/staging
Browse files Browse the repository at this point in the history
Merge from staging to main for release 0.7.0
  • Loading branch information
anargyri authored Sep 14, 2021
2 parents 98d661e + 966353c commit 199dd80
Show file tree
Hide file tree
Showing 22 changed files with 1,043 additions and 254 deletions.
240 changes: 240 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# ---------------------------------------------------------

# NOTE:
# This file defines following CI workflow:
# ┌──────────┐ ┌─────────┐ ┌────────┐
# │ static ├─┬─► build* ├─┬─► test │
# │ analysis │ │ │ (cpu) │ │ │ report │
# └──────────┘ │ └─────────┘ │ └────────┘
# │ ┌─────────┐ │
# ├─► build* ├─┤
# │ │ (spark) │ │
# │ └─────────┘ │
# │ ┌─────────┐ │
# └─► build* ├─┘
# │ (gpu) │
# └─────────┘
# ....
# *each runs in PARALLEL the different combinations
# of python version, OS, test subsets, etc
#
# There are 3 compute environments our library is supporting: CPU, GPU and Spark
# This pipeline's goal is to ensure we run and pass our tests in these supported compute
# For all of the jobs in GPU build, we are using self-host VMs to run them.
# For the rest of the jobs, with the exception of integration tests (#1507), we will use default agents provided by GitHub
#
# ASCII chart created via https://asciiflow.com/
name: nightly

on:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
schedule:
- cron: '0 0 * * *' # basically running everyday at 12AM
# cron works with default branch (main) only: # https://github.community/t/on-schedule-per-branch/17525/2

push:
# because we can't schedule runs for non-main branches,
# to ensure we are running the build on the staging branch, we can add push policy for it
branches: [staging]

# enable manual trigger
workflow_dispatch:
input:
tags:
description: 'Test scenario tags'
default: 'Anything to describe this manual run (optional)'


jobs:
###############################################
############### STATIC-ANALYSIS ###############
###############################################
static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Install dependencies (tox)
run: |
python -m pip install --upgrade pip setuptools wheel
pip install tox
- name: Run flake8
# TODO: re-enable this flake8 block (turned off to get a draft of the pipeline infrastructure)
continue-on-error: true
run: |
tox -e flake8
###############################################
################## CPU-BUILD ##################
###############################################
build-cpu:
runs-on: ${{ matrix.os }}
needs: static-analysis
strategy:
matrix:
os: [ubuntu-latest]
python: [3.6]
# different kinds of tests are located in tests/<unit|integration|smoke> folders
test-kind: ['unit', 'smoke']
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html
test-marker: ['not spark and not gpu']
include:
# Integration tests need a powerful machine with more memory. GitHub-hosted agents only have 7GB memory.
# TODO: Optimization/refactoring should be done to ensure that these test can run in the default CI agent (#1507)
- os: self-hosted
python: 3.6
test-kind: 'integration'
test-marker: 'not spark and not gpu'

steps:
- uses: actions/checkout@v2
################# Run Python tests #################
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
# There are little documentation on how to call **local** actions
# https://docs.github.com/en/actions/creating-actions/about-actions#choosing-a-location-for-your-action
# but there is some working insights from this discussion:
# https://github.community/t/path-to-action-in-the-same-repository-as-workflow/16952/2
- name: Run ${{ matrix.test-kind }} tests ('${{ matrix.test-marker }}')
uses: ./.github/workflows/actions/run-tests
with:
test-kind: ${{ matrix.test-kind }}
test-marker: ${{ matrix.test-marker }}
# Currently GitHub workflow cannot call an action from another action
# https://github.community/t/call-an-action-from-another-action/17524
# Else this shared step can also be move to the local action: .github/workflows/actions/run-tests
- name: Upload Code Coverage
uses: actions/upload-artifact@v2
with:
name: code-cov
path: .coverage*

###############################################
################# SPARK-BUILD #################
###############################################
build-spark:
runs-on: ${{ matrix.os }}
needs: static-analysis
strategy:
matrix:
os: [ubuntu-latest]
java: [8]
python: [3.6]
# different kinds of tests are located in tests/<unit|integration|smoke> folders
test-kind: ['unit', 'smoke']
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html
test-marker: ['spark and not gpu']
include:
# Integration tests need a powerful machine with more memory. GitHub-hosted agents only have 7GB memory.
# TODO: Optimization/refactoring should be done to ensure that these test can run in the default CI agent (#1507)
- os: self-hosted
java: 8
python: 3.6
test-kind: 'integration'
test-marker: 'spark and not gpu'

steps:
- uses: actions/checkout@v2
################# Install spark dependencies (java) #################
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'

################# Run Python tests #################
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Run ${{ matrix.test-kind }} tests ('${{ matrix.test-marker }}')
uses: ./.github/workflows/actions/run-tests
with:
test-kind: ${{ matrix.test-kind }}
test-marker: ${{ matrix.test-marker }}

- name: Upload Code Coverage
uses: actions/upload-artifact@v2
with:
name: code-cov
path: .coverage*

###############################################
################# GPU-BUILD #################
###############################################
build-gpu:
runs-on: [self-hosted, Linux, gpu] # this is a union of labels to select specific self-hosted machine
needs: static-analysis
strategy:
matrix:
python: [3.6]
# different kinds of tests are located in tests/<unit|integration|smoke> folders
test-kind: ['unit', 'smoke', 'integration']
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html
test-marker: ['gpu and not spark']

steps:
- uses: actions/checkout@v2

################# Run Python tests #################
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Run ${{ matrix.test-kind }} tests ('${{ matrix.test-marker }}')
uses: ./.github/workflows/actions/run-tests
with:
test-kind: ${{ matrix.test-kind }}
test-marker: ${{ matrix.test-marker }}

- name: Upload Code Coverage
uses: actions/upload-artifact@v2
with:
name: code-cov
path: .coverage*

###############################################
############ TEST COVERAGE SUMMARY ############
###############################################
collect-code-cov:
runs-on: ubuntu-latest
needs: [build-cpu, build-spark, build-gpu]
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/[email protected]
with:
python-version: '3.6'

- name: Download coverage reports from all previous jobs
uses: actions/download-artifact@v2
with:
name: code-cov

- name: Merge coverage reports
uses: ./.github/workflows/actions/merge-cov

- name: Upload code coverage report to CodeCov
uses: codecov/[email protected]
with:
fail_ci_if_error: true
# comes from the last 'Merge coverage reports' step
files: ./coverage.xml
35 changes: 22 additions & 13 deletions .github/workflows/pr-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# ---------------------------------------------------------
name: pr-gate

on:
pull_request:
branches: [ staging, main ]
# development triggers can be removed afterwards.
push:
branches: [ laserprec/gpu-ci, laserprec/ghaction-sandbox* ]

# NOTE:
# This file defines following CI workflow:
#
# ┌──────────┐ ┌─────────┐ ┌────────┐
# │ static ├─┬─► build* ├─┬─► test │
# │ analysis │ │ │ (cpu) │ │ │ report │
Expand All @@ -29,7 +21,24 @@ on:
# *each runs in PARALLEL the different combinations
# of python version, OS, test subsets, etc
#
# ASCII chart created via https://asciiflow.com/
# There are 3 compute environments our library is supporting: CPU, GPU and Spark
# This pipeline's goal is to ensure we run and pass our tests in these supported compute envs
# For all of the jobs in GPU build, we are using self-host VMs to run them.
#
# ASCII chart created via https://asciiflow.com/
name: pr-gate

on:
pull_request:
branches: [ staging, main ]

# enable manual trigger
workflow_dispatch:
input:
tags:
description: 'Test scenario tags'
default: 'Anything to describe this manual run (optional)'


jobs:
###############################################
Expand Down Expand Up @@ -65,7 +74,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python: [3.6]
# different kind of tests are located in tests/<unit|integration|smoke> folders
# different kinds of tests are located in tests/<unit|integration|smoke> folders
test-kind: ['unit']
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html
test-marker: ['not gpu and not spark and not notebooks', 'notebooks and not gpu and not spark']
Expand Down Expand Up @@ -106,7 +115,7 @@ jobs:
os: [ubuntu-latest]
java: [8]
python: [3.6]
# different kind of tests are located in tests/<unit|integration|smoke> folders
# different kinds of tests are located in tests/<unit|integration|smoke> folders
test-kind: ['unit']
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html
test-marker: ['notebooks and spark and not gpu', 'spark and not notebooks and not gpu']
Expand Down Expand Up @@ -147,7 +156,7 @@ jobs:
strategy:
matrix:
python: [3.6]
# different kind of tests are located in tests/<unit|integration|smoke> folders
# different kinds of tests are located in tests/<unit|integration|smoke> folders
test-kind: ['unit']
# pytest markers configured in tox.ini. See https://docs.pytest.org/en/6.2.x/example/markers.html
test-marker: ['gpu and notebooks and not spark', 'gpu and not notebooks and not spark']
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# What's New

## Update September 9, 2021

We have a new release [Recommenders 0.7.0](https://github.com/microsoft/recommenders/releases/tag/0.7.0)!

In this, we have changed the names of the folders which contain the source code, so that they are more informative. This implies that you will need to change any import statements that reference the recommenders package. Specifically, the folder `reco_utils` has been renamed to `recommenders` and its subfolders have been renamed according to [issue 1390](https://github.com/microsoft/recommenders/issues/1390).

The recommenders package now supports three types of environments: [venv](https://docs.python.org/3/library/venv.html) and [virtualenv](https://virtualenv.pypa.io/en/latest/index.html#) with Python 3.6, [conda](https://docs.conda.io/projects/conda/en/latest/glossary.html?highlight=environment#conda-environment) with Python versions 3.6 and 3.7.

We have also added new evaluation metrics: _novelty, serendipity, diversity and coverage_ (see the [evalution notebooks](examples/03_evaluate/README.md)).

Code coverage reports are now generated for every PR, using [Codecov](https://about.codecov.io/).


## Update June 21, 2021

We have a new release [Recommenders 0.6.0](https://github.com/microsoft/recommenders/releases/tag/0.6.0)!
Expand Down
Loading

0 comments on commit 199dd80

Please sign in to comment.