Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update quickstart from template #2157

Merged
merged 15 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 82 additions & 1 deletion .github/workflows/update-templates-to-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
with:
python-version: ${{ inputs.python-version }}
stack-name: local
ref-zenml: 'main'
ref-zenml: ${{ github.ref }}
ref-template: '0.45.0' # Make sure it is aligned with ZENML_PROJECT_TEMPLATES from src/zenml/cli/base.py

- name: Clean-up
Expand Down Expand Up @@ -192,4 +192,85 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: 'NLP template updates in `examples/nlp-case` have been pushed.'
})


update-starter-template-to-examples:
name: update-starter-template-to-examples
runs-on: ${{ inputs.os }}
env:
ZENML_DEBUG: 1
ZENML_ANALYTICS_OPT_IN: false
PYTHONIOENCODING: "utf-8"
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: "YES"
if: github.event_name == 'pull_request' && ! startsWith(github.event.head_commit.message, 'GitBook:')

defaults:
run:
shell: bash

steps:
- name: Run template tests for zenml-io/template-starter
uses: zenml-io/template-starter/.github/actions/starter_template_test@main
with:
python-version: ${{ inputs.python-version }}
stack-name: local
ref-zenml: ${{ github.ref }}
ref-template: '2023.12.18' # Make sure it is aligned with ZENML_PROJECT_TEMPLATES from src/zenml/cli/base.py

- name: Clean-up
run: |
rm -rf ./local_checkout

- name: message-on-error
if: failure()
run: |
echo "::error title=zenml-io/template-starter project template testing failed with new version of
ZenML core!::\
Breaking changes affecting templates have been introduced. To mitigate this issue,\
please make the code in zenml-io/template-starter compatible with new version of\
ZenML core, release it and update release tag in zenml.cli.base.ZENML_PROJECT_TEMPLATES"

- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Check-out fresh Starter template
run: |
rm -rf examples/quickstart
mkdir -p examples/quickstart
printf 'info@zenml.io' | zenml init --path examples/quickstart --template starter --template-with-defaults
bash scripts/format.sh

- name: Check for changes
id: check_changes
run: |
if git diff --quiet "origin/${{ github.event.pull_request.head.ref }}"; then
echo "No active Git changes found."
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "Active Git changes found."
echo "changes=true" >> $GITHUB_OUTPUT
fi

- name: Commit and push template
if: steps.check_changes.outputs.changes == 'true'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add .
git commit -am "Auto-update of Starter template"
git push origin HEAD:${{ github.event.pull_request.head.ref }}

- name: Create PR comment
if: steps.check_changes.outputs.changes == 'true'
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Quickstart template updates in `examples/quickstart` have been pushed.'
})
2 changes: 1 addition & 1 deletion examples/e2e/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 2023.12.06-4-g1e3edc6
_commit: 2023.12.12
_src_path: gh:zenml-io/template-e2e-batch
data_quality_checks: true
email: ''
Expand Down
Binary file added examples/quickstart/.assets/cloud_mcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/quickstart/.assets/training_pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions examples/quickstart/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changes here will be overwritten by Copier
_commit: 0.43.0-48-g652a614
_src_path: gh:zenml-io/template-starter
email: ''
full_name: ZenML GmbH
open_source_license: apache
project_name: ZenML Starter
version: 0.1.0
2 changes: 2 additions & 0 deletions examples/quickstart/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.venv*
.requirements*
15 changes: 15 additions & 0 deletions examples/quickstart/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Apache Software License 2.0

Copyright (c) ZenML GmbH 2023. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
111 changes: 0 additions & 111 deletions examples/quickstart/README.md

This file was deleted.

Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions examples/quickstart/configs/feature_engineering.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# environment configuration
settings:
docker:
required_integrations:
- sklearn
requirements:
- pyarrow

# pipeline configuration
test_size: 0.35
15 changes: 15 additions & 0 deletions examples/quickstart/configs/inference.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# environment configuration
settings:
docker:
required_integrations:
- sklearn
requirements:
- pyarrow

# configuration of the Model Control Plane
model_version:
name: "breast_cancer_classifier"
version: "production"
license: Apache 2.0
description: A breast cancer classifier
tags: ["breast_cancer", "classifier"]
19 changes: 19 additions & 0 deletions examples/quickstart/configs/training_rf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# environment configuration
settings:
docker:
required_integrations:
- sklearn
requirements:
- pyarrow

# configuration of the Model Control Plane
model_version:
name: breast_cancer_classifier
version: rf
license: Apache 2.0
description: A breast cancer classifier
tags: ["breast_cancer", "classifier"]

# Configure the pipeline
parameters:
model_type: "rf" # Choose between rf/sgd
19 changes: 19 additions & 0 deletions examples/quickstart/configs/training_sgd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# environment configuration
settings:
docker:
required_integrations:
- sklearn
requirements:
- pyarrow

# configuration of the Model Control Plane
model_version:
name: breast_cancer_classifier
version: sgd
license: Apache 2.0
description: A breast cancer classifier
tags: ["breast_cancer", "classifier"]

# Configure the pipeline
parameters:
model_type: "sgd" # Choose between rf/sgd
15 changes: 15 additions & 0 deletions examples/quickstart/license
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Apache Software License 2.0

Copyright (c) ZenML GmbH 2023. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
16 changes: 16 additions & 0 deletions examples/quickstart/license_header
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Apache Software License 2.0
#
# Copyright (c) ZenML GmbH 2023. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
Loading