Skip to content

Conversation

@cogniware-devops
Copy link
Contributor

Updated Commit of Cogniware IMS after resetting the fork and merge history

Commit Description for CogniwareIMS

Description

This commit introduces a clean, release-ready version of CogniwareIMS (AI-Powered Inventory Management System) after resetting the fork and merge history. The release includes comprehensive improvements to test scripts, enhanced CI compatibility, and full OPEA compliance.

Key Improvements

Test Script Enhancements:

  • Robust IP Address Detection: Implemented fallback mechanism to 127.0.0.1 when hostname -I fails, ensuring compatibility across all CI environments
  • Timeout Handling: Added wait_for_service() helper function with configurable timeouts (30 attempts = 300 seconds) to prevent infinite loops in CI
  • Container Readiness Validation: Enhanced container checks to wait for containers to be running before validating logs, with retry logic and clear progress messages
  • Retry Logic for API Calls: Implemented retry mechanism (up to 3 attempts) for chat completion endpoints with graceful handling of empty responses
  • Enhanced Error Handling: Comprehensive error messages with attempt counts, container status checks, and proper cleanup on failures

OPEA Compliance:

  • All required files present and properly structured
  • Test scripts follow OPEA best practices and patterns
  • Docker Compose structure compliant with OPEA standards
  • Kubernetes Helm charts included
  • Complete documentation (README, deployment guide, data setup, compliance summary)

Code Quality:

  • Removed all temporary and development files
  • Clean repository structure ready for submission
  • All test scripts syntax validated
  • Proper .gitignore configuration

Motivation

The previous version had CI failures due to:

  1. Test scripts hanging indefinitely in CI environments
  2. IP address detection failures causing connection errors
  3. Container log checks running before containers were ready
  4. Missing timeout handling in service validation loops

This release addresses all these issues and provides a production-ready, CI-friendly implementation that follows OPEA standards.

Context

This is a complete rebuild of CogniwareIMS after resetting the fork and merge history to provide a clean submission to the OPEA GenAIExamples repository. All improvements are based on the CI maintenance plan and lessons learned from previous PR submissions.

Issues

  • Resolves CI test failures related to timeout and IP address detection issues
  • Addresses test script reliability in CI environments
  • n/a (New submission after fork reset)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
    • Fixed test script timeout issues
    • Fixed IP address detection failures
    • Fixed container readiness validation
  • Others (enhancement, documentation, validation, etc.)
    • Enhanced test script error handling
    • Improved CI compatibility
    • Complete OPEA compliance verification
    • Comprehensive documentation updates

Dependencies

No new 3rd party dependencies introduced. All dependencies remain the same as the original implementation:

Backend:

  • FastAPI
  • OPEA comps library
  • PostgreSQL driver
  • Redis client
  • HuggingFace transformers

Frontend:

  • Next.js
  • React
  • TypeScript
  • Tailwind CSS

Infrastructure:

  • Docker & Docker Compose
  • Kubernetes (for GMC deployment)
  • Helm (for Kubernetes charts)

All dependencies are already specified in:

  • backend/requirements.txt
  • frontend/package.json
  • docker_compose/intel/cpu/xeon/compose.yaml

Tests

Test Script Validation

  1. Syntax Validation

    bash -n tests/test_compose_on_xeon.sh
    # Result: ✓ Test script syntax valid
  2. Test Script Improvements Verified

    • IP address detection with fallback: ✓
    • Timeout handling in all service checks: ✓
    • Container readiness validation: ✓
    • Retry logic for API calls: ✓
    • Enhanced error messages: ✓

Test Coverage

Docker Compose Tests:

  • tests/test_compose_on_xeon.sh - Complete E2E test for Intel Xeon
    • Builds Docker images
    • Starts all services
    • Validates microservices (Redis, PostgreSQL, TGI, LLM, Embedding, Retriever, Reranking)
    • Tests backend endpoints (health, chat, knowledge stats)
    • Validates frontend accessibility
    • Proper cleanup

Kubernetes Tests:

  • tests/test_gmc_on_xeon.sh - GMC deployment test for Kubernetes

Test Script Features

The updated test_compose_on_xeon.sh includes:

  1. Robust Service Validation

    • Waits for containers to be running before log checks
    • Uses wait_for_service() helper with timeouts
    • Provides clear progress messages
  2. Error Recovery

    • Retries failed API calls
    • Handles empty responses gracefully
    • Comprehensive error diagnostics
  3. CI Compatibility

    • Works in environments where IP detection fails
    • Handles slow service startup
    • Prevents infinite loops

Manual Testing (Recommended Before PR)

To test locally:

cd tests
export HUGGINGFACEHUB_API_TOKEN=your_token_here
./test_compose_on_xeon.sh

Expected Test Results

  • All microservices start successfully
  • Health checks pass with proper timeouts
  • Backend endpoints respond correctly
  • Frontend is accessible
  • Clean shutdown and resource cleanup

Additional Notes

  • All test scripts follow the patterns documented in CI_MAINTENANCE_PLAN.md
  • The release build is ready for immediate PR submission
  • See PR_SUBMISSION_GUIDE.md for submission instructions
  • See RELEASE_NOTES.md for detailed release information

@github-actions
Copy link

github-actions bot commented Dec 30, 2025

Dependency Review

The following issues were found:
  • ❌ 1 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 4 package(s) with unknown licenses.
See the Details below.

Vulnerabilities

CogniwareIms/frontend/package-lock.json

NameVersionVulnerabilitySeverity
next14.0.4Authorization Bypass in Next.js Middlewarecritical
Next.js Server-Side Request Forgery in Server Actionshigh
Next.js Cache Poisoninghigh
Next.js authorization bypass vulnerabilityhigh
Next Vulnerable to Denial of Service with Server Componentshigh
Next has a Denial of Service with Server Components - Incomplete Fix Follow-Uphigh
Denial of Service condition in Next.js image optimizationmoderate
Next.js Allows a Denial of Service (DoS) with Server Actionsmoderate
Next.js Affected by Cache Key Confusion for Image Optimization API Routesmoderate
Next.js Content Injection Vulnerability for Image Optimizationmoderate
Next.js Improper Middleware Redirect Handling Leads to SSRFmoderate
Information exposure in Next.js dev server due to lack of origin verificationlow
Next.js Race Condition to Cache Poisoninglow

License Issues

CogniwareIms/backend/requirements.txt

PackageVersionLicenseIssue Type
aiohttp>= 3.11.0NullUnknown License
cryptography>= 43.0.7NullUnknown License
pypdf>= 4.0.0NullUnknown License
python-multipart>= 0.0.9NullUnknown License

Scanned Files

  • CogniwareIms/backend/requirements.txt
  • CogniwareIms/frontend/package-lock.json

@joshuayao
Copy link
Collaborator

joshuayao commented Dec 31, 2025

Hi @cogniware-devops per your request, we're trying to merge it today. Please fix the docker build issue ASAP. It blocks your image release. The other issues can be fixed after the merge.

target cogniwareims-ui: failed to solve: failed to compute cache key: failed to calculate checksum of ref b0997822-5ed3-4cb4-ba71-8613b75388c8::mf74pry03g39xt1tp5wo8qddd: "/frontend/package-lock.json": not found

https://github.com/opea-project/GenAIExamples/actions/runs/20602072408/job/59169776447?pr=2378

@cogniware-devops
Copy link
Contributor Author

Have made the changes

Updated Commit of Cogniware IMS after resetting the fork and merge history

Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
Signed-off-by: cogniware-devops <[email protected]>
@joshuayao joshuayao merged commit 5e96caa into opea-project:main Jan 1, 2026
21 of 30 checks passed
@joshuayao
Copy link
Collaborator

Hi @cogniware-devops For the other minor issues like relative path check failures in the documentation, please fix that after the merge in another PR. For the TEI model download issue, we will check the CI system after the new year holiday.

# Environment setup script for Cogniware IMS on Intel Xeon

# HuggingFace Configuration
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN:-""}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pls change HUGGINGFACEHUB_API_TOKEN to HF_TOKEN

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.

3 participants