Skip to content
name: Deep Tree Echo ML Pipeline
on:
push:
branches: [ main ]
paths:
- 'app/deep-tree-echo/**'
- '.github/workflows/deep-tree-echo.yml'
pull_request:
branches: [ main ]
paths:
- 'app/deep-tree-echo/**'
jobs:
test-and-train:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install reservoirpy numpy pytest
- name: Install Node.js dependencies
run: |
npm install
npm install numpy-ts
- name: Run tests
run: |
npm test -- app/deep-tree-echo
- name: Train base model
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
python scripts/train_reservoir.py
env:
MODEL_ARTIFACTS_PATH: ./models
- name: Upload model artifacts
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
with:
name: model-artifacts
path: ./models
optimize-and-deploy:
needs: test-and-train
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download model artifacts
uses: actions/download-artifact@v2
with:
name: model-artifacts
path: ./models
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install optimization dependencies
run: |
pip install reservoirpy numpy optuna
- name: Run hyperparameter optimization
run: |
python scripts/optimize_reservoir.py
env:
OPTUNA_STORAGE: sqlite:///models/optuna.db
- name: Update deployment configuration
run: |
python scripts/update_config.py
env:
MODEL_CONFIG_PATH: ./app/deep-tree-echo/config.json
- name: Deploy updated model
if: success()
run: |
# Add deployment steps here
echo "Model deployed successfully"