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

OpenaAI API Key secret is added to Github Actions #30

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
51 changes: 43 additions & 8 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Development

on:
push:
branches:
- "main"

pull_request:
branches:
- '**'
- "**"

jobs:
unit-tests:
Expand All @@ -20,24 +24,55 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
run: |
python -m pip install tox
- name: Run unit tests
run: tox -e test-unit -- -m "smoke or sanity"
run: |
python -m tox -e test-unit -- -m "smoke or sanity"

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.8"
python: ["3.12", "3.8"]
env:
GUIDELLM__OPENAI__API_KEY: ${{secrets.openai-automation-token}}
steps:
- name: Authenticate to GCP
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.NM_PYPI_SA }}
- name: Access OpenAI API Key from Secret Manager
run: |
echo "GUIDELLM__OPENAI__API_KEY=$(gcloud secrets versions access latest --secret=openai-automation-token)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
run: python -m pip install tox
- name: Run integration tests
run: tox -e test-integration -- -m smoke
run: python -m tox -e test-integration -- -m smoke

publish:
if: github.event_name == 'pull_request' || github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Build & Publish the distribution
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
env:
GUIDELLM_BUILD_TYPE: dev
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Build and Publish Candidate Release
uses: neuralmagic/nm-actions/actions/publish_pypi@main
with:
publish_pypi: false
publish_pypi_internal: true
29 changes: 28 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nightly

on:
schedule:
- cron: '0 0 * * *' # Runs at midnight every night
- cron: "0 0 * * *"

jobs:
unit-tests:
Expand Down Expand Up @@ -37,6 +37,15 @@ jobs:
- "3.9"
- "3.8"
steps:
- name: Authenticate to GCP
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.NM_PYPI_SA }}
- name: Access OpenAI API Key from Secret Manager
run: |
echo "GUIDELLM__OPENAI__API_KEY=$(gcloud secrets versions access latest --secret=openai-automation-token)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -67,3 +76,21 @@ jobs:
run: pip install tox
- name: Run e2e tests
run: tox -e test-e2e -- -m smoke

publish:
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
env:
GUIDELLM_BUILD_TYPE: nightly
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Build and Publish a Candidate Release
uses: neuralmagic/nm-actions/actions/publish_pypi@main
with:
publish_pypi: true
publish_pypi_internal: true
40 changes: 0 additions & 40 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
branches:
- '**'
- "**"

jobs:
quality-check:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Release

on:
push:
tags:
- v*
branches:
- release/**

Expand Down Expand Up @@ -38,6 +40,15 @@ jobs:
- "3.9"
- "3.8"
steps:
- name: Authenticate to GCP
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.NM_PYPI_SA }}
- name: Access OpenAI API Key from Secret Manager
run: |
echo "GUIDELLM__OPENAI__API_KEY=$(gcloud secrets versions access latest --secret=openai-automation-token)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -68,3 +79,22 @@ jobs:
run: pip install tox
- name: Run e2e tests
run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75

publish:
name: Build & Publish the distribution
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
env:
GUIDELLM_BUILD_TYPE: release
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Build and Publish Final Release
uses: neuralmagic/nm-actions/actions/publish_pypi@main
with:
publish_pypi: true
publish_pypi_internal: true
98 changes: 98 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Staging

on:
push:
branches:
- release/**

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run unit tests
run: tox -e test-unit -- --cov-report=term-missing --cov --cov-fail-under=75

integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- name: Authenticate to GCP
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.NM_PYPI_SA }}
- name: Access OpenAI API Key from Secret Manager
run: |
echo "GUIDELLM__OPENAI__API_KEY=$(gcloud secrets versions access latest --secret=openai-automation-token)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run integration tests
run: tox -e test-integration -- --cov-report=term-missing --cov --cov-fail-under=75

e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run e2e tests
run: tox -e test-e2e -- --cov-report=term-missing --cov --cov-fail-under=75

publish:
name: Build & Publish the distribution
needs: [unit-tests, integration-tests, e2e-tests]
runs-on: ubuntu-latest
env:
GUIDELLM_BUILD_TYPE: release
GUIDELLM_BUILD_NUMBER: ${{ github.event.pull_request.number || github.run_number }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Build and Publish a Candidate Release
uses: neuralmagic/nm-actions/actions/publish_pypi@main
with:
publish_pypi: false
publish_pypi_internal: true
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ deps =
loguru
toml
commands =
python utils/inject_build_props.py
python -m build


Expand Down
Empty file removed utils/__init__.py
Empty file.
Loading