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

chore: Init repo structure, add workflows, scripts, etc. #1

Merged
merged 1 commit into from
Jan 12, 2024
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
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a bug report a module in MLOps-Modules
title: "[BUG]"
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is. Be ABSOLUTELY sure to give the path of the module (ex `modules/sagemaker/sagemaker-studio`).
Any bug that does not explicitly refer to a pertinent module will be closed without inspection.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest a new feature for MLOps-Module
title: "[FEATURE]"
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. If the feature is related to an existing module,
be ABSOLUTELY sure to give the path of the module (ex `modules/sagemaker/sagemaker-studio`).

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
67 changes: 67 additions & 0 deletions .github/workflows/module-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Module Checks

on:
push:
branches: ["main"]
paths: ['modules/**']

pull_request:
branches: ["main", "release/*", "stable"]
paths: ['modules/**']

workflow_dispatch:

jobs:
get-modules:
name: Get Modules
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-modules.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get modules
id: get-modules
run: |
set -x
# Get all the modules that have the directory "tests"
MODULES=$(find modules -type d -name "tests" | cut -d/ -f 2-3 | uniq)
# Create our json structure [{"module_name": "..."}]
MODULES_JSON=$(echo "$MODULES" | jq -R -s 'split("\n")' | jq '[ .[] | select(length > 0) ]' | jq 'map({"module_name": .})')
# Export the modules as json to the outputs
echo 'matrix<<EOF' >> $GITHUB_OUTPUT
echo $MODULES_JSON >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT

test:
name: Run unit tests for module ${{ matrix.modules.module_name }}
needs: get-modules
strategy:
fail-fast: false
matrix:
modules: ${{ fromJson(needs.get-modules.outputs.matrix) }}
python-version: [3.9]
runs-on: ubuntu-latest
env:
MODULE_PATH: 'modules/${{ matrix.modules.module_name }}'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Requirements
run: |
set -x
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -r $MODULE_PATH/requirements.txt
- name: Static checks and linting (mypy, flake8, black, isort)
run: scripts/validate.sh --language python --path $MODULE_PATH/
- name: Pytest
run: cd $MODULE_PATH/ && pytest
Loading