Skip to content
Merged

Dev #25

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
77 changes: 74 additions & 3 deletions .github/workflows/dev-sync-to-s3.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: DEVELOPMENT - Upload JSON configs to S3
name: DEV | Uplaod & Sync

on:
push:
Expand All @@ -12,10 +12,44 @@ permissions:
contents: read

jobs:
upload:
validate:
name: Validate Pricing Configs
runs-on: ubuntu-latest
environment: DEV_ENVs
steps:
- name: Checkout models repo
uses: actions/checkout@v4

- name: Validate JSON files
run: |
echo "════════════════════════════════════════════════════════════"
echo " VALIDATING PRICING CONFIGS"
echo "════════════════════════════════════════════════════════════"

ERRORS=0

for file in pricing/*.json; do
if ! jq empty "$file" 2>/dev/null; then
echo "❌ Invalid JSON: $file"
ERRORS=$((ERRORS + 1))
else
echo "✅ $file"
fi
done

if [ $ERRORS -gt 0 ]; then
echo ""
echo "❌ Validation failed with $ERRORS error(s)"
exit 1
fi

echo ""
echo "✅ All JSON files are valid!"

upload-to-s3:
name: Upload to S3
needs: validate
runs-on: ubuntu-latest
environment: DEV_ENVs
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -58,3 +92,40 @@ jobs:
--exclude "*" \
--include "*.json" \
--delete

trigger-deployments:
name: Trigger Deployments
needs: upload-to-s3
runs-on: ubuntu-latest
environment: DEV_ENVs
steps:
- name: Generate GitHub App Token
id: app_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: portkey-ai
repositories: winky,gateway-enterprise-node

- name: DEV | Trigger Winky workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/portkey-ai/winky/actions/workflows/build-pricing-and-deploy.yml/dispatches \
-d '{"ref":"dev","inputs":{"source_repo":"portkey-ai/models","source_commit":"${{ github.sha }}","triggered_by":"${{ github.actor }}"}}'

echo "✅ Triggered winky build-pricing-and-deploy workflow (staging)"

- name: DEV | Trigger Gateway workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/portkey-ai/gateway-enterprise-node/actions/workflows/sync-and-deploy.yml/dispatches \
-d '{"ref":"dev","inputs":{"source_branch":"dev","source_commit":"${{ github.sha }}","triggered_by":"${{ github.actor }}"}}'

echo "✅ Triggered gateway sync-and-deploy workflow (staging)"
80 changes: 0 additions & 80 deletions .github/workflows/sync-pricing-to-gateway-dev.yml

This file was deleted.

80 changes: 0 additions & 80 deletions .github/workflows/sync-pricing-to-gateway.yml

This file was deleted.

77 changes: 74 additions & 3 deletions .github/workflows/sync-to-s3.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Upload JSON configs to S3
name: PROD | Uplaod & Sync

on:
push:
Expand All @@ -12,10 +12,44 @@ permissions:
contents: read

jobs:
upload:
validate:
name: Validate Pricing Configs
runs-on: ubuntu-latest
environment: ENVs
steps:
- name: Checkout models repo
uses: actions/checkout@v4

- name: Validate JSON files
run: |
echo "════════════════════════════════════════════════════════════"
echo " VALIDATING PRICING CONFIGS"
echo "════════════════════════════════════════════════════════════"

ERRORS=0

for file in pricing/*.json; do
if ! jq empty "$file" 2>/dev/null; then
echo "❌ Invalid JSON: $file"
ERRORS=$((ERRORS + 1))
else
echo "✅ $file"
fi
done

if [ $ERRORS -gt 0 ]; then
echo ""
echo "❌ Validation failed with $ERRORS error(s)"
exit 1
fi

echo ""
echo "✅ All JSON files are valid!"

upload-to-s3:
name: Upload to S3
needs: validate
runs-on: ubuntu-latest
environment: ENVs
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -58,3 +92,40 @@ jobs:
--exclude "*" \
--include "*.json" \
--delete

trigger-deployments:
name: Trigger Deployments
needs: upload-to-s3
runs-on: ubuntu-latest
environment: ENVs
steps:
- name: Generate GitHub App Token
id: app_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: portkey-ai
repositories: winky,gateway-enterprise-node

- name: Trigger Winky workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/portkey-ai/winky/actions/workflows/build-pricing-and-deploy.yml/dispatches \
-d '{"ref":"main","inputs":{"source_repo":"portkey-ai/models","source_commit":"${{ github.sha }}","triggered_by":"${{ github.actor }}"}}'

echo "✅ Triggered winky build-pricing-and-deploy workflow (production)"

- name: Trigger Gateway workflow
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.app_token.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/portkey-ai/gateway-enterprise-node/actions/workflows/sync-and-deploy.yml/dispatches \
-d '{"ref":"main","inputs":{"source_branch":"main","source_commit":"${{ github.sha }}","triggered_by":"${{ github.actor }}"}}'

echo "✅ Triggered gateway sync-and-deploy workflow (production)"
2 changes: 1 addition & 1 deletion general/ai21.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ai21",
"description": "",
"description": "ai21 labs",
"default": {
"params": [
{ "key": "max_tokens", "defaultValue": 256, "minValue": 1, "maxValue": 8192 },
Expand Down