Skip to content

devops: Dockerfile and Staging Integration Requirements for CI/CD Pipeline#3491

Open
SparshGarg999 wants to merge 1 commit into
openai:mainfrom
SparshGarg999:3489-dockerfile-staging-pipeline
Open

devops: Dockerfile and Staging Integration Requirements for CI/CD Pipeline#3491
SparshGarg999 wants to merge 1 commit into
openai:mainfrom
SparshGarg999:3489-dockerfile-staging-pipeline

Conversation

@SparshGarg999

@SparshGarg999 SparshGarg999 commented Jul 11, 2026

Copy link
Copy Markdown
  • I understand that this repository is auto-generated and my pull request may not be merged

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:

  1. Dockerfile (Multi-Stage Build):

    • Stage 1 (builder): Uses python:3.12-alpine as 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).
    • Stage 2 (runner): Copies the virtual environment to a clean python:3.12-alpine runner image. This results in an optimized, minimal image size suitable for Kubernetes/ECS orchestration.
    • Includes a native HEALTHCHECK checking http://localhost:8080/healthz.
  2. Staging HTTP Mock Server (examples/staging_server.py):

    • Employs Python's built-in http.server module for a zero-dependency, lightweight footprint.
    • Listens on port 8080.
    • Exposes /healthz returning status code 200 OK for orchestration engine health probing.
    • Exposes /smoke-test to execute validation verifying the SDK package is successfully importable and printing its active version.
  3. Staging Deployment GHA Workflow (.github/workflows/staging-deploy.yml):

    • Triggered on push (merge) to the main branch.
    • Builds the Docker image specifying the runner target stage.
    • Runs the container locally, waits up to 30 seconds for the health checks to transition to healthy, and triggers the /smoke-test endpoint to verify readiness.
    • Cleans up containers post-run.
  4. Integration Guide (docs/staging-integration.md):

    • Provides clear manual build/run commands.
    • Explains environment variable injection (e.g. OPENAI_API_KEY, OPENAI_ORG_ID, PORT).
    • Outlines automated health checks and step-by-step staging rollback/recovery procedures.

Additional context & links

Closes #3489

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>
@SparshGarg999 SparshGarg999 requested a review from a team as a code owner July 11, 2026 05:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Dockerfile

# Upgrade pip and install package dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir .

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dockerfile and Staging Integration Requirements for CI/CD Pipeline

1 participant