Skip to content

Conversation

@Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Feb 25, 2025

Description

This pull request updates the .github/workflows/test-docker.yml workflow to improve how Docker images are built and tested in CI. The changes make the workflow more flexible and robust by expanding its triggers, supporting architecture-specific builds, and using modern Docker build actions.

Workflow trigger and environment improvements:

  • The workflow now runs on a schedule (weekly), on tag pushes, and on pull requests that modify key files (Dockerfile, pyproject.toml, poetry.lock, and the workflow itself), instead of only manual dispatch.
  • Environment variables are now set within the job, and Docker image tags are dynamically generated to include the runner architecture and commit SHA, improving traceability and multi-arch support.

Docker build process enhancements:

  • The workflow uses the official docker/setup-buildx-action and docker/build-push-action to build images, replacing the previous manual docker build step for better reliability and future extensibility.
  • The runner architecture is detected and incorporated into the Docker image tag, allowing for architecture-specific builds and easier debugging.

Related Issue(s)

Checklist

  • I've read the CONTRIBUTING guidelines.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • @mentions of the person or team responsible for reviewing proposed changes.

@Pouyanpi Pouyanpi force-pushed the ci/docker-test branch 7 times, most recently from c056354 to cca2007 Compare February 25, 2025 10:50
@Pouyanpi Pouyanpi changed the title Ci/docker test ci: enable docker test workflow Feb 25, 2025
@Pouyanpi Pouyanpi self-assigned this Apr 2, 2025
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Pouyanpi Pouyanpi marked this pull request as ready for review November 28, 2025 12:20
@Pouyanpi Pouyanpi requested a review from Copilot November 28, 2025 12:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables the Docker test workflow by adding scheduled runs, push-on-tag triggers, and modernizing the Docker build process. The workflow now runs weekly on Sundays, on version tag pushes, and can be manually triggered.

Key Changes:

  • Adds scheduled (weekly) and tag-based triggers to the workflow
  • Modernizes Docker build process using official GitHub Actions
  • Implements architecture-specific tagging using commit SHA

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 28, 2025

Greptile Overview

Greptile Summary

Enabled the Docker test workflow to run on schedule (weekly), tag pushes, and manual dispatch. The workflow was previously mostly disabled with commented-out triggers.

Key Changes:

  • Uncommented and enabled push.tags trigger, added weekly schedule (cron: "0 0 * * 0")
  • Moved IMAGE env var from workflow-level to job-level, added GH_TOKEN
  • Replaced custom Docker build with docker/build-push-action@v6 and docker/setup-buildx-action@v3
  • Fixed tagging logic: replaced version extraction from GITHUB_REF with github.sha + architecture suffix to work for all trigger types
  • Added architecture detection step for multi-arch compatibility

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured CI/CD improvements that enable a previously disabled workflow. The key fix—replacing the broken version extraction logic with github.sha—ensures the workflow functions correctly for all trigger types (scheduled, tag, manual). Using official Docker actions improves reliability and maintainability.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
.github/workflows/test-docker.yml 5/5 Enabled workflow with schedule/tag triggers, replaced env variables with job-level env, switched to docker/build-push-action, and fixed tagging to use commit SHA for all trigger types

Sequence Diagram

sequenceDiagram
    participant Trigger as Workflow Trigger<br/>(schedule/tag/manual)
    participant GHA as GitHub Actions Runner
    participant Docker as Docker Engine
    participant Container as Test Container
    participant Server as NeMo Guardrails Server

    Trigger->>GHA: Trigger workflow
    GHA->>GHA: Checkout code
    GHA->>GHA: Detect runner architecture (uname -m)
    GHA->>GHA: Set tag: IMAGE:SHA-ARCH
    GHA->>Docker: Setup Buildx
    GHA->>Docker: Build image with tag
    Docker-->>GHA: Image built
    GHA->>Container: Run container (port 8000)
    Container->>Server: Start NeMo Guardrails
    GHA->>Server: Poll health endpoint
    Server-->>GHA: Ready
    GHA->>Server: Check /v1/rails/configs (200?)
    Server-->>GHA: HTTP 200
    GHA->>Server: Run test requests
    Server-->>GHA: Test responses
    GHA->>Container: Stop container
    GHA->>Container: Remove container
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Pouyanpi Pouyanpi merged commit 55a5344 into develop Nov 28, 2025
3 checks passed
@Pouyanpi Pouyanpi deleted the ci/docker-test branch November 28, 2025 12:33
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.

2 participants