Skip to content

Commit

Permalink
Merge branch 'zenml-io:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisserra authored Jan 30, 2024
2 parents 086d6b5 + cdd1452 commit db90781
Show file tree
Hide file tree
Showing 221 changed files with 9,381 additions and 2,629 deletions.
5 changes: 2 additions & 3 deletions .github/actions/setup_environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ runs:
bucket: caching # required
use-fallback: false # optional, use github actions cache fallback, default false
key: ${{ inputs.os }}-${{ inputs.cache_version }}-${{ inputs.python-version
}}-${{steps.date.outputs.week}}-${{inputs.install_integrations}}-${{ hashFiles('src/zenml/integrations/*/__init__.py')
}}
}}-${{inputs.install_integrations}}
path: |
~/.cache/pip
restore-keys: |
${{ inputs.os }}-${{ inputs.cache_version }}-${{ inputs.python-version }}-${{steps.date.outputs.week}}-${{inputs.install_integrations}}-${{ hashFiles('src/zenml/integrations/*/__init__.py') }}
${{ inputs.os }}-${{ inputs.cache_version }}-${{ inputs.python-version }}-${{inputs.install_integrations}}
# Disabled for now because it doesn't work well with multiple parallel jobs
# - uses: syphar/restore-pip-download-cache@v1
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/ci-fast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
name: Fast CI
on:
workflow_dispatch:
workflow_call:
push:
branches: [main]
paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
pull_request:
types: [opened, synchronize, ready_for_review]
paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docstring-check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-dind-runners
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Set up Python
uses: actions/setup-python@v5.0.0
with:
python-version: '3.10'
- name: Install current package as editable
run: pip install -U darglint
- name: Check docstrings
run: bash scripts/docstring.sh
sqlite-db-migration-testing:
runs-on: ubuntu-dind-runners
# if team member commented, not a draft, on a PR, using /fulltest
if: github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Set up Python 3.9
uses: actions/setup-python@v5.0.0
with:
python-version: '3.9'
- name: Test migrations across versions
run: bash scripts/test-migrations-mysql.sh sqlite
spellcheck:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Spelling checker
uses: crate-ci/typos@v1.17.0
with:
files: .
config: ./.typos.toml
update-templates-to-examples:
# this doesn't work on forked repositories (i.e. outside contributors)
# so we disable template updates for those PRs / branches
if: github.event.pull_request.head.repo.full_name == 'zenml-io/zenml'
uses: ./.github/workflows/update-templates-to-examples.yml
with:
python-version: '3.8'
os: ubuntu-latest
secrets: inherit
custom-ubuntu-setup-and-unit-test:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-dind-runners]
python-version: ['3.10']
fail-fast: false
uses: ./.github/workflows/unit-test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
custom-ubuntu-runners-integration-test:
strategy:
matrix:
os: [ubuntu-dind-runners]
python-version: ['3.10']
test_environment: [default, docker-server-docker-orchestrator-mysql]
fail-fast: false
uses: ./.github/workflows/integration-test-fast.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
test_environment: ${{ matrix.test_environment }}
secrets: inherit
108 changes: 68 additions & 40 deletions .github/workflows/ci.yml → .github/workflows/ci-slow.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
---
name: Build, Lint, Unit, Integration and Templates Tests
name: Slow CI
on:
workflow_dispatch:
workflow_call:
push:
branches: [main]
paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
pull_request:
types: [opened, synchronize, ready_for_review]
paths-ignore: [docs/**, docker/**, '*', '!pyproject.toml', '**.md']
types: [ready_for_review]
concurrency:
# New commit on branch cancels running workflows of the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mlstacks-compatibility-check:
if: github.event.pull_request.draft == false
docstring-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4.1.1
- name: Set up Python
uses: actions/setup-python@v5.0.0
with:
python-version: '3.10'
- name: Install current package as editable
run: pip install -U darglint
- name: Check docstrings
run: bash scripts/docstring.sh
sqlite-db-migration-testing:
runs-on: ubuntu-dind-runners
steps:
- uses: actions/checkout@v4.1.1
- name: Set up Python 3.9
uses: actions/setup-python@v5.0.0
with:
python-version: '3.9'
- name: Test migrations across versions
run: bash scripts/test-migrations-mysql.sh sqlite
small-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Set up Python
uses: actions/setup-python@v5.0.0
with:
Expand All @@ -32,87 +46,100 @@ jobs:
run: pip install mlstacks
- name: Check for broken dependencies
run: pip check
custom-ubuntu-runners-setup-and-test-python:
if: github.event.pull_request.draft == false
- name: Markdown link check
uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
folder-path: ./examples, ./docs/book, ./src
file-path: ./README.md, ./LICENSE, ./RELEASE_NOTES.md, CODE-OF-CONDUCT.md,
CONTRIBUTING.md, CLA.md, RELEASE_NOTES.md, ROADMAP.md
config-file: .github/workflows/markdown_check_config.json
continue-on-error: true
- name: Security check
run: |
pip install bandit
bash scripts/check-security.sh
- name: Check for alembic branch divergence
env:
ZENML_DEBUG: 0
run: |
pip install alembic
bash scripts/check-alembic-branches.sh
update-templates-to-examples:
# this doesn't work on forked repositories (i.e. outside contributors)
# so we disable template updates for those PRs / branches
uses: ./.github/workflows/update-templates-to-examples.yml
with:
python-version: '3.8'
os: ubuntu-latest
secrets: inherit
custom-ubuntu-unit-test:
strategy:
matrix:
os: [ubuntu-dind-runners]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
uses: ./.github/workflows/unit-test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
windows-setup-and-test-python:
if: github.event.pull_request.draft == false
windows-unit-test:
strategy:
matrix:
os: [windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
uses: ./.github/workflows/unit-test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
macos-setup-and-test-python:
if: github.event.pull_request.draft == false
macos-unit-test:
strategy:
matrix:
os: [macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
uses: ./.github/workflows/setup-python-environment.yml
uses: ./.github/workflows/unit-test.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
secrets: inherit
update-templates-to-examples:
# this doesn't work on forked repositories (i.e. outside contributors)
# so we disable template updates for those PRs / branches
if: github.event.pull_request.head.repo.full_name == 'zenml-io/zenml'
uses: ./.github/workflows/update-templates-to-examples.yml
with:
python-version: '3.8'
os: ubuntu-latest
secrets: inherit
windows-integration-test:
needs: [windows-setup-and-test-python]
strategy:
matrix:
os: [windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
test_environment: [default]
fail-fast: false
uses: ./.github/workflows/integration-test.yml
uses: ./.github/workflows/integration-test-slow.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
test_environment: ${{ matrix.test_environment }}
is-slow-ci: true
secrets: inherit
macos-integration-test:
needs: [macos-setup-and-test-python]
strategy:
matrix:
os: [macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
test_environment: [default]
fail-fast: false
uses: ./.github/workflows/integration-test.yml
uses: ./.github/workflows/integration-test-slow.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
test_environment: ${{ matrix.test_environment }}
is-slow-ci: true
secrets: inherit
custom-ubuntu-runners-integration-test:
needs: [custom-ubuntu-runners-setup-and-test-python]
custom-ubuntu-integration-test:
strategy:
matrix:
os: [ubuntu-dind-runners]
# Disabled temporarily while CI is overhauled
python-version: ['3.8', '3.9', '3.10']
# python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ['3.8', '3.9', '3.10', '3.11']
test_environment:
- default
- docker-server-docker-orchestrator-mysql
Expand All @@ -132,9 +159,10 @@ jobs:
- test_environment: docker-server-docker-orchestrator-mariadb
python-version: '3.11'
fail-fast: false
uses: ./.github/workflows/integration-test.yml
uses: ./.github/workflows/integration-test-slow.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
test_environment: ${{ matrix.test_environment }}
is-slow-ci: true
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
types: [opened]
jobs:
analyze:
if: github.event.pull_request.draft == false
if: github.event.pull_request.draft == false && github.repository == 'zenml-io/zenml'
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 360
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/generate-test-duration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Generate test duration file
on:
workflow_call:
schedule:
- cron: 0 8 * * 1 # Run every Monday at 8 am
jobs:
generate-test-duration-file:
name: Generate test duration file
runs-on: ubuntu-dind-runners
strategy:
fail-fast: false
env:
ZENML_DEBUG: 1
ZENML_ANALYTICS_OPT_IN: false
PYTHONIOENCODING: utf-8
# on MAC OS, we need to set this environment variable
# to fix problems with the fork() calls (see this thread
# for more information: http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html)
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: 'YES'
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4.1.1
with:
ref: develop
- name: Setup environment
uses: ./.github/actions/setup_environment
with:
cache_version: ${{ secrets.GH_ACTIONS_CACHE_KEY }}
python-version: '3.10'
os: ubuntu-dind-runners
runners_cache_access_key_id: ${{ secrets.RUNNERS_CACHE_ACCESS_KEY_ID }}
runners_cache_secret_access_key: ${{ secrets.RUNNERS_CACHE_SECRET_ACCESS_KEY }}
- name: Generate test duration file
continue-on-error: true
# Ubuntu integration tests run as 6 shards
run: |
bash scripts/test-coverage-xml.sh "" default "" "" store-durations
- name: Check difference in .test_durations
run: |
git diff --quiet || echo "Changes found"
if [ -n "$(git status --porcelain)" ]; then
# Commit changes directly to the specified branch
git add .test_durations
git commit -m "Update with new changes for test duration file at $(date +'%Y%m%d-%H%M%S')"
git push origin develop
else
echo "No changes in .test_durations"
fi
- name: Verify Python Env unaffected
run: |-
zenml integration list
pip list
pip check || true
Loading

0 comments on commit db90781

Please sign in to comment.