Skip to content
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
58 changes: 46 additions & 12 deletions .github/actions/demo-notebook/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
name: Execute demo notebooks
description: Installs python3, validmind, checks dependencies then executes ONLY the Intro for Model Developers notebook with development heap tracking
description: Installs python3, validmind, checks dependencies then executes ONLY the training notebook series with development heap tracking

inputs:
env_file:
description: "Load the created .env file"
dev_env:
description: "Load the created dev.env file"
required: true
valid_env:
description: "Load the created valid.env file"
required: true

runs:
using: "composite"
steps:
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-pip-${{ runner.os }}-${{ hashFiles('.github/actions/demo-notebook/action.yml') }}
restore-keys: |
python-pip-${{ runner.os }}-

- name: Install python3 for Jupyter Notebooks
shell: bash
run: |
Expand All @@ -29,23 +40,46 @@ runs:
run: |
python -m ipykernel install --user --name validmind --display-name "ValidMind Library"

- name: Ensure .env file is available
- name: Ensure dev.env file is available
shell: bash
id: find_env
id: find_dev_env
run: |
if [ ! -f "${{ inputs.env_file }}" ]; then
echo "Error: .env file not found at ${{ inputs.env_file }}"
if [ ! -f "${{ inputs.dev_env }}" ]; then
echo "Error: dev.env file not found at ${{ inputs.dev_env }}"
exit 1
fi

- name: Execute ONLY the ValidMind for model development series with heap development
shell: bash
if: ${{ steps.find_env.outcome == 'success' }}
if: ${{ steps.find_dev_env.outcome == 'success' }}
run: |
cd site
source ../${{ inputs.env_file }}
cp ../${{ inputs.dev_env }} ../.env
source ../.env
quarto render --profile exe-demo notebooks/EXECUTED/model_development &> render_errors.log || {
echo "Execute for ValidMind for model development series failed";
cat render_errors.log;
exit 1;
echo "Execute for ValidMind for model development series failed";
cat render_errors.log;
exit 1;
}

- name: Ensure valid.env file is available
shell: bash
id: find_valid_env
run: |
if [ ! -f "${{ inputs.valid_env }}" ]; then
echo "Error: valid.env file not found at ${{ inputs.valid_env }}"
exit 1
fi

- name: Execute ONLY the ValidMind for model validation series with heap development
shell: bash
if: ${{ steps.find_valid_env.outcome == 'success' }}
run: |
cd site
cp ../${{ inputs.valid_env }} ../.env
source ../.env
quarto render --profile exe-demo notebooks/EXECUTED/model_validation &> render_errors.log || {
echo "Execute for ValidMind for model validation series failed";
cat render_errors.log;
exit 1;
}
62 changes: 48 additions & 14 deletions .github/actions/prod-notebook/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
name: Execute prod notebooks
description: Installs python3, validmind, checks dependencies then executes ONLY the Intro for Model Developers notebook with production heap tracking
name: Execute production notebooks
description: Installs python3, validmind, checks dependencies then executes ONLY the training notebook series with production heap tracking

inputs:
env_file:
description: "Load the created .env file"
dev_env:
description: "Load the created dev.env file"
required: true
valid_env:
description: "Load the created valid.env file"
required: true

runs:
using: "composite"
steps:
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-pip-${{ runner.os }}-${{ hashFiles('.github/actions/prod-notebook/action.yml') }}
restore-keys: |
python-pip-${{ runner.os }}-

- name: Install python3 for Jupyter Notebooks
shell: bash
run: |
Expand All @@ -29,23 +40,46 @@ runs:
run: |
python -m ipykernel install --user --name validmind --display-name "ValidMind Library"

- name: Ensure .env file is available
- name: Ensure dev.env file is available
shell: bash
id: find_env
id: find_dev_env
run: |
if [ ! -f "${{ inputs.env_file }}" ]; then
echo "Error: .env file not found at ${{ inputs.env_file }}"
if [ ! -f "${{ inputs.dev_env }}" ]; then
echo "Error: dev.env file not found at ${{ inputs.dev_env }}"
exit 1
fi

- name: Execute ONLY the ValidMind for model development series with heap production
shell: bash
if: ${{ steps.find_env.outcome == 'success' }}
if: ${{ steps.find_dev_env.outcome == 'success' }}
run: |
cd site
source ../${{ inputs.env_file }}
cp ../${{ inputs.dev_env }} ../.env
source ../.env
quarto render --profile exe-prod notebooks/EXECUTED/model_development &> render_errors.log || {
echo "Execute for ValidMind for model development series failed";
cat render_errors.log;
exit 1;
}
echo "Execute for ValidMind for model development series failed";
cat render_errors.log;
exit 1;
}

- name: Ensure valid.env file is available
shell: bash
id: find_valid_env
run: |
if [ ! -f "${{ inputs.valid_env }}" ]; then
echo "Error: valid.env file not found at ${{ inputs.valid_env }}"
exit 1
fi

- name: Execute ONLY the ValidMind for model validation series with heap production
shell: bash
if: ${{ steps.find_valid_env.outcome == 'success' }}
run: |
cd site
cp ../${{ inputs.valid_env }} ../.env
source ../.env
quarto render --profile exe-prod notebooks/EXECUTED/model_validation &> render_errors.log || {
echo "Execute for ValidMind for model validation series failed";
cat render_errors.log;
exit 1;
}
60 changes: 47 additions & 13 deletions .github/actions/staging-notebook/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
name: Execute staging notebooks
description: Installs python3, validmind, checks dependencies then executes ONLY the Intro for Model Developers notebook with staging heap tracking
description: Installs python3, validmind, checks dependencies then executes ONLY the training notebook series with staging heap tracking

inputs:
env_file:
description: "Load the created .env file"
dev_env:
description: "Load the created dev.env file"
required: true
valid_env:
description: "Load the created valid.env file"
required: true

runs:
using: "composite"
steps:
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-pip-${{ runner.os }}-${{ hashFiles('.github/actions/staging-notebook/action.yml') }}
restore-keys: |
python-pip-${{ runner.os }}-

- name: Install python3 for Jupyter Notebooks
shell: bash
run: |
Expand All @@ -29,23 +40,46 @@ runs:
run: |
python -m ipykernel install --user --name validmind --display-name "ValidMind Library"

- name: Ensure .env file is available
- name: Ensure dev.env file is available
shell: bash
id: find_env
id: find_dev_env
run: |
if [ ! -f "${{ inputs.env_file }}" ]; then
echo "Error: .env file not found at ${{ inputs.env_file }}"
if [ ! -f "${{ inputs.dev_env }}" ]; then
echo "Error: dev.env file not found at ${{ inputs.dev_env }}"
exit 1
fi

- name: Execute ONLY the ValidMind for model development series with heap staging
shell: bash
if: ${{ steps.find_env.outcome == 'success' }}
if: ${{ steps.find_dev_env.outcome == 'success' }}
run: |
cd site
source ../${{ inputs.env_file }}
cp ../${{ inputs.dev_env }} ../.env
source ../.env
quarto render --profile exe-staging notebooks/EXECUTED/model_development &> render_errors.log || {
echo "Execute for iValidMind for model development series failed";
cat render_errors.log;
exit 1;
}
echo "Execute for ValidMind for model development series failed";
cat render_errors.log;
exit 1;
}

- name: Ensure valid.env file is available
shell: bash
id: find_valid_env
run: |
if [ ! -f "${{ inputs.valid_env }}" ]; then
echo "Error: valid.env file not found at ${{ inputs.valid_env }}"
exit 1
fi

- name: Execute ONLY the ValidMind for model validation series with heap staging
shell: bash
if: ${{ steps.find_valid_env.outcome == 'success' }}
run: |
cd site
cp ../${{ inputs.valid_env }} ../.env
source ../.env
quarto render --profile exe-staging notebooks/EXECUTED/model_validation &> render_errors.log || {
echo "Execute for ValidMind for model validation series failed";
cat render_errors.log;
exit 1;
}
41 changes: 28 additions & 13 deletions .github/workflows/deploy-docs-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,42 @@ jobs:
exit 1;
}

- name: Create .env file
id: create_env
# If yes then create the dev.env file for use in execution step
- name: Create dev.env file
if: steps.filter.outputs.notebooks == 'true'
id: create_dev_env
run: |
touch .env
echo VM_API_HOST=${{ secrets.PLATFORM_API_HOST }} >> .env
echo VM_API_KEY=${{ secrets.PLATFORM_API_KEY }} >> .env
echo VM_API_SECRET=${{ secrets.PLATFORM_API_SECRET }} >> .env
echo VM_API_MODEL=${{ secrets.PLATFORM_DEV_MODEL }} >> .env
cat .env
touch dev.env
echo VM_API_HOST=${{ secrets.PLATFORM_API_HOST }} >> dev.env
echo VM_API_KEY=${{ secrets.PLATFORM_API_KEY }} >> dev.env
echo VM_API_SECRET=${{ secrets.PLATFORM_API_SECRET }} >> dev.env
echo VM_API_MODEL=${{ secrets.PLATFORM_DEV_MODEL }} >> dev.env
cat dev.env

# Only execute the prod notebook if .env file is created
- name: Execute prod ValidMind for model development series
if: ${{ steps.create_env.outcome == 'success' }}
# If yes then create the valid.env file for use in execution step
- name: Create valid.env file
if: steps.filter.outputs.notebooks == 'true'
id: create_valid_env
run: |
touch valid.env
echo VM_API_HOST=${{ secrets.PLATFORM_API_HOST }} >> valid.env
echo VM_API_KEY=${{ secrets.PLATFORM_API_KEY }} >> valid.env
echo VM_API_SECRET=${{ secrets.PLATFORM_API_SECRET }} >> valid.env
echo VM_API_MODEL=${{ secrets.PLATFORM_VALID_MODEL }} >> valid.env
cat valid.env

# Only execute the production notebooks for training if .env files are created
- name: Execute production ValidMind for model development and validation series
if: ${{ steps.create_dev_env.outcome == 'success' && steps.create_valid_env.outcome == 'success' }}
uses: ./.github/actions/prod-notebook
id: execute-prod-notebook
with:
env_file: .env
dev_env: dev.env
valid_env: valid.env

# Prod bucket is in us-east-1
- name: Configure AWS credentials
run: aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} && aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} && aws configure set default.region us-east-1

- name: Deploy docs prod site
run: aws s3 sync site/_site s3://docs-ci-cd-prod/site --delete --exclude "site/installation/helm-repo/*" && aws cloudfront create-invalidation --distribution-id E2I9R40IH01NW3 --paths "/*" --no-cli-pager
run: aws s3 sync site/_site s3://docs-ci-cd-prod/site --delete --exclude "installation/helm-repo/*" && aws cloudfront create-invalidation --distribution-id E2I9R40IH01NW3 --paths "/*" --no-cli-pager
41 changes: 28 additions & 13 deletions .github/workflows/deploy-docs-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,42 @@ jobs:
exit 1;
}

- name: Create .env file
id: create_env
# If yes then create the dev.env file for use in execution step
- name: Create dev.env file
if: steps.filter.outputs.notebooks == 'true'
id: create_dev_env
run: |
touch .env
echo VM_API_HOST=${{ secrets.PLATFORM_API_HOST }} >> .env
echo VM_API_KEY=${{ secrets.PLATFORM_API_KEY }} >> .env
echo VM_API_SECRET=${{ secrets.PLATFORM_API_SECRET }} >> .env
echo VM_API_MODEL=${{ secrets.PLATFORM_DEV_MODEL }} >> .env
cat .env
touch dev.env
echo VM_API_HOST=${{ secrets.PLATFORM_API_HOST }} >> dev.env
echo VM_API_KEY=${{ secrets.PLATFORM_API_KEY }} >> dev.env
echo VM_API_SECRET=${{ secrets.PLATFORM_API_SECRET }} >> dev.env
echo VM_API_MODEL=${{ secrets.PLATFORM_DEV_MODEL }} >> dev.env
cat dev.env

# Only execute the staging notebook if .env file is created
- name: Execute staging ValidMind for model development series
if: ${{ steps.create_env.outcome == 'success' }}
# If yes then create the valid.env file for use in execution step
- name: Create valid.env file
if: steps.filter.outputs.notebooks == 'true'
id: create_valid_env
run: |
touch valid.env
echo VM_API_HOST=${{ secrets.PLATFORM_API_HOST }} >> valid.env
echo VM_API_KEY=${{ secrets.PLATFORM_API_KEY }} >> valid.env
echo VM_API_SECRET=${{ secrets.PLATFORM_API_SECRET }} >> valid.env
echo VM_API_MODEL=${{ secrets.PLATFORM_VALID_MODEL }} >> valid.env
cat valid.env

# Only execute the staging notebooks for training if .env files are created
- name: Execute staging ValidMind for model development and validation series
if: ${{ steps.create_dev_env.outcome == 'success' && steps.create_valid_env.outcome == 'success' }}
uses: ./.github/actions/staging-notebook
id: execute-staging-notebook
with:
env_file: .env
dev_env: dev.env
valid_env: valid.env

# Staging bucket is in us-west-2
- name: Configure AWS credentials
run: aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID_STAGING }} && aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY_STAGING }} && aws configure set default.region us-west-2

- name: Deploy docs staging site
run: aws s3 sync site/_site s3://docs-ci-cd-staging/site --delete --exclude "site/installation/helm-repo/*" && aws cloudfront create-invalidation --distribution-id E2FB73KGY63MV6 --paths "/*" --no-cli-pager
run: aws s3 sync site/_site s3://docs-ci-cd-staging/site --delete --exclude "installation/helm-repo/*" && aws cloudfront create-invalidation --distribution-id E2FB73KGY63MV6 --paths "/*" --no-cli-pager
Loading
Loading