devops: Dockerfile and Staging Integration Requirements for CI/CD Pipeline#3491
devops: Dockerfile and Staging Integration Requirements for CI/CD Pipeline#3491SparshGarg999 wants to merge 1 commit into
Conversation
This addresses issue openai#3489 by providing a multi-stage Dockerfile, a lightweight staging/health-check server, staging deployment workflows, and integration documentation. Signed-off-by: Sparsh Garg <76697238+SparshGarg999@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d3dfbb623
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| # Upgrade pip and install package dependencies | ||
| RUN pip install --no-cache-dir --upgrade pip && \ | ||
| pip install --no-cache-dir . |
There was a problem hiding this comment.
Copy the SDK sources before installing the package
In the Docker build, pip install . runs after only pyproject.toml and README.md have been copied into /app. This project’s wheel target packages src/openai, so at this point the image has no SDK sources for hatchling to package, and the Build Staging Image job will fail before the container or smoke tests can run. Copy src/ before this install step, or install dependencies separately from the local project.
Useful? React with 👍 / 👎.
| on: | ||
| push: | ||
| branches: | ||
| - master |
There was a problem hiding this comment.
Trigger staging deploys from main
This workflow listens only for pushes to master, but the repository’s release workflow and local branch setup use main as the active/default branch. With this trigger, normal pushes to main will not start the new staging deployment pipeline at all, so the added CI/CD path is effectively bypassed unless someone pushes a separate master branch.
Useful? React with 👍 / 👎.
Changes being requested
This Pull Request provides a robust, multi-stage Docker build and a staging integration setup that implements all requirements in #3489.
Key Components Introduced:
Dockerfile (Multi-Stage Build):
python:3.12-alpineas a base, installs compilation toolchains (gcc,musl-dev,libffi-dev,g++,cargo) to allow dependency builds, and installs the SDK package and its dependencies into a virtual environment (/opt/venv).python:3.12-alpinerunner image. This results in an optimized, minimal image size suitable for Kubernetes/ECS orchestration.HEALTHCHECKcheckinghttp://localhost:8080/healthz.Staging HTTP Mock Server (
examples/staging_server.py):http.servermodule for a zero-dependency, lightweight footprint.8080./healthzreturning status code200 OKfor orchestration engine health probing./smoke-testto execute validation verifying the SDK package is successfully importable and printing its active version.Staging Deployment GHA Workflow (
.github/workflows/staging-deploy.yml):mainbranch.runnertarget stage.healthy, and triggers the/smoke-testendpoint to verify readiness.Integration Guide (
docs/staging-integration.md):OPENAI_API_KEY,OPENAI_ORG_ID,PORT).Additional context & links
Closes #3489