Skip to content

Conversation

@dagardner-nv
Copy link
Contributor

@dagardner-nv dagardner-nv commented Oct 7, 2025

Description

  • Adds a docker compose yaml to bootstrap the required services needed to run integration tests locally
  • Change redis version to the same version used in the documentation.
  • Set gitlab service pull policy to if-not-present

By Submitting this PR I confirm:

  • I am familiar with the Contributing Guidelines.
  • We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.
    • Any contribution which contains commits that are not Signed-Off will not be accepted.
  • When the PR is ready for review, new or existing tests cover these changes.
  • When the PR is ready for review, the documentation is up to date with these changes.

Summary by CodeRabbit

  • Tests
    • Added a docker-compose services setup for integration tests including etcd, Milvus, MinIO, MySQL, OpenSearch, Phoenix, and Redis with healthchecks and dependencies.
    • Updated default MySQL test credentials to “my_password”.
  • Chores
    • CI/test service definitions standardized with explicit image references and a uniform pull policy for clarity and consistency.

@dagardner-nv dagardner-nv self-assigned this Oct 7, 2025
@dagardner-nv dagardner-nv requested a review from a team as a code owner October 7, 2025 23:52
@dagardner-nv dagardner-nv added improvement Improvement to existing functionality non-breaking Non-breaking change labels Oct 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 7, 2025

Walkthrough

Adds explicit image names and pull_policy: if-not-present to CI service entries, changes the default MySQL test password fallback to "my_password", and introduces a new docker-compose services file defining multiple test infrastructure services with ports, environment, and healthchecks.

Changes

Cohort / File(s) Summary of Changes
CI service specs
\.gitlab-ci.yml
Replaced shorthand service images with explicit named entries (e.g., mysql:9.3, redis:8.0), added aliases where applicable, and applied pull_policy: if-not-present uniformly to services (minio, mysql, redis, etcd, milvus, opensearch, etc.).
MySQL test credentials
packages/nvidia_nat_mysql/tests/test_mysql_object_store.py
Default MySQL root password fallback changed from "my-secret-pw" to "my_password" in comments, aiomysql.connect call, and MySQLObjectStoreClientConfig fallback.
Test infra compose
tests/test_data/docker-compose.services.yml
New compose services file added listing etcd, milvus (depends on etcd/minio), minio, mysql (with root password env), opensearch, phoenix, and redis; includes ports, environment variables, container names, and healthchecks.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Tester
  participant TestRunner
  participant Env as "Env Vars"
  participant MySQLClient as "aiomysql.connect"
  participant MySQL as "MySQL Service"

  Tester->>TestRunner: start NAT MySQL tests
  TestRunner->>Env: read ROOT_PASSWORD
  alt env provided
    Env-->>TestRunner: return provided password
  else env missing
    note right of TestRunner#ffeadb: fallback to "my_password"
    TestRunner-->>TestRunner: use "my_password"
  end
  TestRunner->>MySQLClient: connect(host, user=root, password)
  MySQLClient->>MySQL: authenticate
  MySQL-->>MySQLClient: OK / ERR
  MySQLClient-->>TestRunner: connection result
  TestRunner-->>Tester: test outcomes
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

ci, tests, infrastructure

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly summarizes the primary change of the pull request by stating that a Docker Compose YAML is being added to facilitate integration tests, it uses the imperative mood, is under the 72-character limit, and accurately reflects the main objective without including unnecessary detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dagardner-nv dagardner-nv marked this pull request as draft October 7, 2025 23:53
@coderabbitai coderabbitai bot added the feature request New feature or request label Oct 7, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/nvidia_nat_mysql/tests/test_mysql_object_store.py (1)

64-64: Fix inconsistent MySQL password default.

Line 64 still uses the old default password 'my-secret-pw', while lines 28 and 39 have been updated to 'my_password'. This inconsistency will cause test failures when the environment variable MYSQL_ROOT_PASSWORD is not set, as the docker-compose file uses my_password as the default.

Apply this diff to fix the inconsistency:

-                                             password=os.environ.get('MYSQL_ROOT_PASSWORD', 'my-secret-pw')))
+                                             password=os.environ.get('MYSQL_ROOT_PASSWORD', 'my_password')))
🧹 Nitpick comments (1)
tests/test_data/docker-compose.services.yml (1)

90-94: Add healthcheck for Redis service.

The Redis service lacks a healthcheck, which can lead to race conditions when tests attempt to connect before Redis is fully ready. Other services in this compose file include healthchecks for reliability.

Add a healthcheck to ensure Redis is ready:

   redis:
     image: redis:8.0
     container_name: test-redis
     ports:
       - 6379:6379
+    healthcheck:
+      test: ["CMD", "redis-cli", "ping"]
+      interval: 10s
+      timeout: 5s
+      retries: 5
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a06926e and 9d23039.

📒 Files selected for processing (3)
  • .gitlab-ci.yml (1 hunks)
  • packages/nvidia_nat_mysql/tests/test_mysql_object_store.py (2 hunks)
  • tests/test_data/docker-compose.services.yml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)

In workflow/config YAML, set llms.._type: nat_test_llm to stub responses.

Files:

  • tests/test_data/docker-compose.services.yml
**/*.{py,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)

**/*.{py,yaml,yml}: Configure response_seq as a list of strings; values cycle per call, and [] yields an empty string.
Configure delay_ms to inject per-call artificial latency in milliseconds for nat_test_llm.

Files:

  • tests/test_data/docker-compose.services.yml
  • packages/nvidia_nat_mysql/tests/test_mysql_object_store.py
**/*

⚙️ CodeRabbit configuration file

**/*: # Code Review Instructions

  • Ensure the code follows best practices and coding standards. - For Python code, follow
    PEP 20 and
    PEP 8 for style guidelines.
  • Check for security vulnerabilities and potential issues. - Python methods should use type hints for all parameters and return values.
    Example:
    def my_function(param1: int, param2: str) -> bool:
        pass
  • For Python exception handling, ensure proper stack trace preservation:
    • When re-raising exceptions: use bare raise statements to maintain the original stack trace,
      and use logger.error() (not logger.exception()) to avoid duplicate stack trace output.
    • When catching and logging exceptions without re-raising: always use logger.exception()
      to capture the full stack trace information.

Documentation Review Instructions - Verify that documentation and comments are clear and comprehensive. - Verify that the documentation doesn't contain any TODOs, FIXMEs or placeholder text like "lorem ipsum". - Verify that the documentation doesn't contain any offensive or outdated terms. - Verify that documentation and comments are free of spelling mistakes, ensure the documentation doesn't contain any

words listed in the ci/vale/styles/config/vocabularies/nat/reject.txt file, words that might appear to be
spelling mistakes but are listed in the ci/vale/styles/config/vocabularies/nat/accept.txt file are OK.

Misc. - All code (except .mdc files that contain Cursor rules) should be licensed under the Apache License 2.0,

and should contain an Apache License 2.0 header comment at the top of each file.

  • Confirm that copyright years are up-to date whenever a file is changed.

Files:

  • tests/test_data/docker-compose.services.yml
  • packages/nvidia_nat_mysql/tests/test_mysql_object_store.py
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/nat-test-llm.mdc)

**/*.py: Programmatic use: create TestLLMConfig(response_seq=[...], delay_ms=...), add with builder.add_llm("", cfg).
When retrieving the test LLM wrapper, use builder.get_llm(name, wrapper_type=LLMFrameworkEnum.) and call the framework’s method (e.g., ainvoke, achat, call).

**/*.py: In code comments/identifiers use NAT abbreviations as specified: nat for API namespace/CLI, nvidia-nat for package name, NAT for env var prefixes; do not use these abbreviations in documentation
Follow PEP 20 and PEP 8; run yapf with column_limit=120; use 4-space indentation; end files with a single trailing newline
Run ruff check --fix as linter (not formatter) using pyproject.toml config; fix warnings unless explicitly ignored
Respect naming: snake_case for functions/variables, PascalCase for classes, UPPER_CASE for constants
Treat pyright warnings as errors during development
Exception handling: use bare raise to re-raise; log with logger.error() when re-raising to avoid duplicate stack traces; use logger.exception() when catching without re-raising
Provide Google-style docstrings for every public module, class, function, and CLI command; first line concise and ending with a period; surround code entities with backticks
Validate and sanitize all user input, especially in web or CLI interfaces
Prefer httpx with SSL verification enabled by default and follow OWASP Top-10 recommendations
Use async/await for I/O-bound work; profile CPU-heavy paths with cProfile or mprof before optimizing; cache expensive computations with functools.lru_cache or external cache; leverage NumPy vectorized operations when beneficial

Files:

  • packages/nvidia_nat_mysql/tests/test_mysql_object_store.py
packages/*/tests/**/*.py

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

If a package contains Python code, include tests in a tests/ directory at the same level as pyproject.toml

Files:

  • packages/nvidia_nat_mysql/tests/test_mysql_object_store.py
packages/**/*

⚙️ CodeRabbit configuration file

packages/**/*: - This directory contains optional plugin packages for the toolkit, each should contain a pyproject.toml file. - The pyproject.toml file should declare a dependency on nvidia-nat or another package with a name starting
with nvidia-nat-. This dependency should be declared using ~=<version>, and the version should be a two
digit version (ex: ~=1.0).

  • Not all packages contain Python code, if they do they should also contain their own set of tests, in a
    tests/ directory at the same level as the pyproject.toml file.

Files:

  • packages/nvidia_nat_mysql/tests/test_mysql_object_store.py

@dagardner-nv dagardner-nv removed the feature request New feature or request label Oct 7, 2025
@dagardner-nv dagardner-nv marked this pull request as ready for review October 8, 2025 00:14
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.gitlab-ci.yml (1)

91-93: Redis image still lacks RediSearch modules

The plain redis:8.0 image omits RediSearch, so commands like redis.commands.search.* will continue to break. Please swap to redis/redis-stack:8.0 (or otherwise load the module) to restore those features; this matches the prior review guidance.

-    - name: redis:8.0
-      alias: redis
-      pull_policy: if-not-present
+    - name: redis/redis-stack:8.0
+      alias: redis
+      pull_policy: if-not-present
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d23039 and 6695efd.

📒 Files selected for processing (1)
  • .gitlab-ci.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: CI Pipeline / Check

@dagardner-nv
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 299561f into NVIDIA:release/1.3 Oct 8, 2025
17 checks passed
@dagardner-nv dagardner-nv deleted the david-tests-docker-compose branch October 8, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement to existing functionality non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants