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

Start k3d in ci-container and execute e2e test to k8s cluster #2553

Closed
wants to merge 7 commits into from

Conversation

hlts2
Copy link
Collaborator

@hlts2 hlts2 commented Jul 31, 2024

Description

As titled

Related Issue

Versions

  • Vald Version: v1.7.12
  • Go Version: v1.22.5
  • Rust Version: v1.77.2
  • Docker Version: v27.1.1
  • Kubernetes Version: v1.30.3
  • Helm Version: v3.15.3
  • NGT Version: v2.2.4
  • Faiss Version: v1.8.0

Checklist

Special notes for your reviewer

Summary by CodeRabbit

  • New Features

    • Introduced a new job detect-ci-container which enhances the CI workflow by dynamically determining the appropriate container image based on specific conditions.
    • Updated multiple jobs to utilize the new detect-ci-container, improving flexibility and responsiveness in the workflow.
  • Bug Fixes

    • Removed outdated pull_request event trigger types, streamlining how workflows are activated.
  • Improvements

    • Enhanced container specifications across various jobs to enable privileged execution and better network configurations, ensuring a more effective testing environment.
    • Changed service access configuration in Helm values for Docker environments to improve routing.
    • Improved robustness of URL processing in the port forwarding functionality, reducing potential errors related to incorrect URL formats.

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Copy link
Contributor

coderabbitai bot commented Jul 31, 2024

Walkthrough

Walkthrough

The recent updates to the GitHub Actions workflows introduce a new job, detect-ci-container, enhancing the CI/CD pipeline's adaptability by determining the appropriate container image based on specific conditions. This job replaces the previous dependency on dump-contexts-to-log. Additionally, the removal of certain event triggers streamlines workflow execution, allowing for a broader range of conditions under which workflows will run, ultimately improving responsiveness and efficiency during integration testing. Changes in API port configuration and URL handling further refine service interactions.

Changes

Files Change Summary
.github/actions/setup-k3d/action.yaml Added --api-port host.docker.internal:6550 to the OPTIONS variable for k3d setup, modifying API interaction.
.github/workflows/e2e-chaos.yaml, Removed types from pull_request, added detect-ci-container job for container detection, updated chaos test jobs to depend on this new job instead of dump-contexts-to-log.
.github/workflows/e2e-code-bench-agent.yaml, Updated container options for jobs to include "--privileged --add-host host.docker.internal:host-gateway", enhancing networking capabilities.
.github/workflows/e2e-max-dim.yml, Introduced detect-ci-container job, updated e2e-max-dimension-insert to depend on it, added container configuration with image and options.
.github/workflows/e2e-profiling.yml Added detect-ci-container job, updated e2e-profiling to depend on it, included container section with image and options.
.github/workflows/e2e.yml Removed types from pull_request, updated multiple jobs to depend on detect-ci-container, and added container specifications for various jobs.
tests/e2e/kubernetes/portforward/portforward.go Modified the Start method to improve URL handling for hostIP, ensuring compatibility with both HTTP and HTTPS prefixes.
.github/helm/values/values-chaos.yaml Changed the host attribute under the ingress section from "localhost" to "host.docker.internal", adapting access for Docker environments.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Copy link

cloudflare-workers-and-pages bot commented Jul 31, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4ada8ea
Status: ✅  Deploy successful!
Preview URL: https://0821604e.vald.pages.dev
Branch Preview URL: https://feat-execute-e2e-in-dood.vald.pages.dev

View logs

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cd2bbab and fe08e65.

Files selected for processing (6)
  • .github/actions/setup-k3d/action.yaml (1 hunks)
  • .github/workflows/e2e-chaos.yaml (4 hunks)
  • .github/workflows/e2e-code-bench-agent.yaml (2 hunks)
  • .github/workflows/e2e-max-dim.yml (1 hunks)
  • .github/workflows/e2e-profiling.yml (1 hunks)
  • .github/workflows/e2e.yml (9 hunks)
Additional comments not posted (17)
.github/actions/setup-k3d/action.yaml (1)

79-79: LGTM! Ensure the new API port configuration is correctly utilized.

The addition of --api-port host.docker.internal:6550 looks good. Verify that this configuration is correctly utilized in the codebase.

.github/workflows/e2e-code-bench-agent.yaml (2)

61-61: LGTM! The container options enhance capabilities.

The addition of --privileged --add-host host.docker.internal:host-gateway enhances the container's capabilities. Ensure these options are necessary and used correctly.


89-89: LGTM! The container options enhance capabilities.

The addition of --privileged --add-host host.docker.internal:host-gateway enhances the container's capabilities. Ensure these options are necessary and used correctly.

.github/workflows/e2e-max-dim.yml (3)

34-36: LGTM! The new job enhances functionality.

The addition of the detect-ci-container job enhances the workflow's functionality by integrating a container detection step.


39-39: LGTM! The job dependency ensures proper sequencing.

Updating the e2e-max-dimension-insert job to depend on detect-ci-container ensures proper sequencing and enhances the workflow.


42-44: LGTM! The container configuration enhances the job's capabilities.

The container configuration for the e2e-max-dimension-insert job, including the image and options, enhances the job's capabilities.

.github/workflows/e2e-profiling.yml (3)

35-37: LGTM! The new job detect-ci-container is well-defined.

The conditional statement ensures that the job runs only under specific conditions, which is a good practice for controlling job execution.


40-40: Dependency update approved.

The e2e-profiling job now depends on detect-ci-container, which aligns with the new job addition and ensures proper control flow.


43-45: Container specification approved.

The container section ensures that the e2e-profiling job runs in a specific container environment, enhancing flexibility and consistency.

.github/workflows/e2e-chaos.yaml (4)

25-26: Trigger condition update approved.

The removal of the types specification under the pull_request trigger broadens the conditions under which the workflow is triggered, enhancing responsiveness.


37-39: LGTM! The new job detect-ci-container is well-defined.

The conditional statement ensures that the job runs only under specific conditions, which is a good practice for controlling job execution.


42-42: Dependency update approved.

The jobs agent-failure, random-pod-failure, agent-network-partition, and clusterwide-network-bandwidth now depend on detect-ci-container, which aligns with the new job addition and ensures proper control flow.

Also applies to: 83-83, 124-124, 165-165


45-47: Container specification approved.

The container section ensures that the jobs run in a specific container environment, enhancing flexibility and consistency.

Also applies to: 86-88, 127-129, 168-170

.github/workflows/e2e.yml (4)

25-26: Trigger condition update approved.

The removal of the types specification under the pull_request trigger broadens the conditions under which the workflow is triggered, enhancing responsiveness.


36-38: LGTM! The new job detect-ci-container is well-defined.

The conditional statement ensures that the job runs only under specific conditions, which is a good practice for controlling job execution.


41-41: Dependency update approved.

The jobs now depend on detect-ci-container, which aligns with the new job addition and ensures proper control flow.

Also applies to: 82-82, 145-145, 190-190, 231-231, 268-268, 302-302, 353-353


44-46: Container specification approved.

The container section ensures that the jobs run in a specific container environment, enhancing flexibility and consistency.

Also applies to: 85-87, 148-150, 193-195, 234-236, 271-273, 305-307, 356-358

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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fe08e65 and fe544c3.

Files selected for processing (4)
  • .github/workflows/e2e-chaos.yaml (4 hunks)
  • .github/workflows/e2e-max-dim.yml (1 hunks)
  • .github/workflows/e2e-profiling.yml (1 hunks)
  • .github/workflows/e2e.yml (8 hunks)
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/e2e-chaos.yaml
  • .github/workflows/e2e-profiling.yml
Additional comments not posted (9)
.github/workflows/e2e-max-dim.yml (1)

39-44: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.

.github/workflows/e2e.yml (8)

40-45: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.


189-194: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.


144-149: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.


230-235: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.


301-306: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.


81-86: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.


352-357: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.


267-272: Verify the necessity of the --privileged option.

The --privileged option grants extended privileges to the container, which can pose security risks. Ensure that this option is necessary for the job.

Comment on lines +34 to +36
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the if condition for better control.

The if condition is commented out. It should be uncommented to ensure the job runs only under the specified conditions.

-    # if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
+    if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
detect-ci-container:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml

Comment on lines +35 to +37
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the if condition for better control.

The if condition is commented out. It should be uncommented to ensure the job runs only under the specified conditions.

-    # if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
+    if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
detect-ci-container:
# if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml
detect-ci-container:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-deploy'
uses: ./.github/workflows/_detect-ci-container.yml

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fe544c3 and 8d999da.

Files selected for processing (2)
  • .github/actions/setup-e2e/action.yaml (1 hunks)
  • .github/workflows/e2e-profiling.yml (2 hunks)
Files skipped from review due to trivial changes (1)
  • .github/actions/setup-e2e/action.yaml
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e-profiling.yml

hlts2 added 2 commits July 31, 2024 16:51
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8d999da and 1d21fdb.

Files selected for processing (1)
  • tests/e2e/kubernetes/portforward/portforward.go (1 hunks)
Additional comments not posted (1)
tests/e2e/kubernetes/portforward/portforward.go (1)

71-71: LGTM! Improved URL handling.

The change from strings.TrimLeft to two calls to strings.TrimPrefix ensures that both "http://" and "https://" prefixes are correctly handled, improving robustness.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1d21fdb and 10aa9bb.

Files selected for processing (1)
  • .github/workflows/e2e-chaos.yaml (8 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e-chaos.yaml

hlts2 added 2 commits July 31, 2024 17:24
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 10aa9bb and 4ada8ea.

Files selected for processing (2)
  • .github/helm/values/values-chaos.yaml (1 hunks)
  • .github/workflows/e2e.yml (9 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/e2e.yml
Additional comments not posted (1)
.github/helm/values/values-chaos.yaml (1)

38-38: Change approved: Update host to host.docker.internal.

The change from "localhost" to "host.docker.internal" is appropriate for routing traffic correctly in containerized environments.

@hlts2 hlts2 closed this Jul 31, 2024
@hlts2 hlts2 deleted the feat/execute-e2e-in-dood branch August 1, 2024 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants