Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable some worker pods for helm testing workflow #8671

Merged
merged 4 commits into from
Nov 12, 2024
Merged

Conversation

azhavoro
Copy link
Contributor

@azhavoro azhavoro commented Nov 8, 2024

a couple of warkflow runs on this branch https://github.com/cvat-ai/cvat/actions/runs/11744289016/job/32791689399

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

  • New Features

    • Enhanced configuration for scaling and environment settings in the CVAT application.
    • Introduced environment variable NUMPROCS for improved performance in worker and export components.
  • Bug Fixes

    • Adjusted replica settings to optimize resource allocation for various components.

Copy link
Contributor

coderabbitai bot commented Nov 8, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes involve updates to the helm-chart/test.values.yaml file for the CVAT application. Key modifications include the introduction of replicas and additionalEnv settings for the worker and export components, both set to 1 and including an environment variable NUMPROCS. The utils component's replicas value is adjusted to 0, and an annotation section is added with replicas: 0. Other components remain unchanged, maintaining their original configurations.

Changes

File Change Summary
helm-chart/test.values.yaml - Added replicas: 1 and additionalEnv with NUMPROCS for worker in cvat section.
- Added replicas: 1 and additionalEnv with NUMPROCS for export in cvat section.
- Updated replicas: 0 for utils in cvat section.
- Added annotation with replicas: 0 in cvat section.
- No changes to backend, frontend, redis, keydb, and traefik sections.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Worker
    participant Export
    participant Utils
    participant Annotation

    User->>Worker: Request for processing
    Worker->>Worker: Set NUMPROCS to 2
    Worker-->>User: Process completed

    User->>Export: Request for export
    Export->>Export: Set NUMPROCS to 2
    Export-->>User: Export completed

    User->>Utils: Request for utility
    Utils-->>User: No active instances (replicas: 0)

    User->>Annotation: Check annotations
    Annotation-->>User: No active instances (replicas: 0)
Loading

🐰 "In the garden where changes bloom,
New settings sprout, dispelling gloom.
Workers and exports, side by side,
With NUMPROCS set, they take in stride.
While utils rest, their time will come,
In this patch, the future's spun!" 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@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: 0

🧹 Outside diff range and nitpick comments (2)
helm-chart/test.values.yaml (2)

25-29: Document the rationale for worker configuration.

The export worker configuration mirrors the import worker settings. Consider adding a comment explaining why these specific values (replicas: 1, NUMPROCS: '2') were chosen for the testing environment.

    export:
+       # Reduced replicas and increased NUMPROCS for testing environment
+       # to optimize resource usage while maintaining necessary capacity
        replicas: 1
        additionalEnv:
        - name: NUMPROCS
          value: '2'

17-33: Update documentation and changelog.

These configuration changes should be:

  1. Documented in the changelog
  2. Reflected in the testing documentation
  3. Added to the PR description with explanation of the testing strategy

This will help other developers understand the rationale behind these changes and their impact on the testing workflow.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a6fd1e5 and 9c24481.

📒 Files selected for processing (1)
  • helm-chart/test.values.yaml (1 hunks)
🔇 Additional comments (2)
helm-chart/test.values.yaml (2)

17-20: Verify testing workflow performance with reduced worker replicas.

Setting replicas: 1 with NUMPROCS: '2' means we'll have fewer worker pods but each worker will handle 2 processes. While this reduces resource usage, we should ensure it doesn't negatively impact testing performance.

Could you confirm if this configuration has been tested to ensure:

  1. Tests complete within acceptable time limits
  2. No resource bottlenecks occur during parallel test execution

31-33: ⚠️ Potential issue

Verify test coverage with disabled utils and annotation pods.

Setting replicas: 0 for both utils and annotation pods completely disables these services. Please ensure:

  1. No test scenarios depend on these services
  2. This won't cause any test failures or unexpected behavior
✅ Verification successful

Let me gather more specific information about how these services are used in the tests.


Let me check one more aspect to understand if these services are used in test setup or teardown.


Based on the gathered information, I can now provide a final response:

Setting replicas to 0 for utils and annotation pods is safe for testing

The investigation shows that while there are many test files referencing "utils" and "annotation", these are primarily related to test cases for API endpoints and SDK functionality, not actual dependencies on the utils and annotation services. The evidence shows:

  1. No direct service dependencies found in test configurations
  2. The references in test files are about testing annotation-related APIs/features
  3. No test fixtures or setup/teardown procedures require these services
  4. These services are typically used in production (default 1 replica in values.yaml) but aren't critical for test execution
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for test files that might depend on utils or annotation services
rg -l -g "test_*.py" "utils|annotation" 

# Search for any direct references to these services in test configurations
rg -l "utils:|annotation:" tests/ helm-chart/

Length of output: 1686


Script:

#!/bin/bash
# Check content of test files for actual dependencies on utils/annotation services
rg -C2 "utils.*service|annotation.*service" tests/

# Check helm chart values to understand the default configuration
cat helm-chart/values.yaml | grep -A5 -B5 "utils:\|annotation:"

# Look for any test setup/configuration files
fd "conftest|pytest.*conf" tests/

# Check if there are any specific test markers or fixtures related to these services
rg -C2 "@pytest.(fixture|mark).*utils|@pytest.(fixture|mark).*annotation" tests/

Length of output: 5220


Script:

#!/bin/bash
# Check test setup/teardown in conftest files
cat tests/python/conftest.py
cat tests/python/sdk/conftest.py
cat tests/python/cli/conftest.py

# Check if there are any test dependencies defined in setup files
fd "setup.py|requirements.*" tests/

Length of output: 591

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.20%. Comparing base (a6fd1e5) to head (d24bbf0).
Report is 7 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8671      +/-   ##
===========================================
- Coverage    74.25%   74.20%   -0.05%     
===========================================
  Files          401      401              
  Lines        43465    43504      +39     
  Branches      3950     3950              
===========================================
+ Hits         32273    32282       +9     
- Misses       11192    11222      +30     
Components Coverage Δ
cvat-ui 78.52% <ø> (-0.01%) ⬇️
cvat-server 70.51% <ø> (-0.08%) ⬇️

replicas: 1
additionalEnv:
- name: NUMPROCS
value: '2'
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we even need 2? Why not make it 1?

utils:
additionalEnv:
- name: DJANGO_SETTINGS_MODULE
value: cvat.settings.testing_rest
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't seem right that you can just remove this. This settings module contains a setting specifically related to the cleaning queue, IMPORT_CACHE_CLEAN_DELAY; so presumably there's a test that depends on this. How can the test still work with this removed?

Copy link
Contributor

@Marishka17 Marishka17 Nov 12, 2024

Choose a reason for hiding this comment

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

How can the test still work with this removed?

If I remember correctly, these tests were skipped because they were unstable.

Copy link

sonarcloud bot commented Nov 12, 2024

@SpecLad SpecLad merged commit c7ed14c into develop Nov 12, 2024
34 checks passed
@SpecLad SpecLad deleted the az/helm-big-runner branch November 12, 2024 12:04
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.

4 participants