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

refactor docker and change buildkit-syft-scanner reference to ghcr.io #2577

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

kpango
Copy link
Collaborator

@kpango kpango commented Aug 7, 2024

Description

SSIA

Related Issue

Versions

  • Vald Version: v1.7.13
  • Go Version: v1.22.6
  • Rust Version: v1.80.0
  • 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 CI/CD workflow for Docker image scanning.
    • Enhanced Dockerfile generation with support for optional build stage names.
  • Bug Fixes

    • Updated annotations in Kubernetes deployment configurations to reflect changes in ConfigMap checksums.
  • Documentation

    • Improved comments in Dockerfiles for clarity on auto-generated status and maintainer information.
  • Chores

    • Updated dependency versions in the project to ensure compatibility with the latest libraries.
    • Cleaned up redundant code and variables in multiple Dockerfiles for better maintainability.

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Aug 7, 2024

[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

Copy link
Contributor

coderabbitai bot commented Aug 7, 2024

Caution

Review failed

The head commit changed during the review from 94aa336 to ea18fb4.


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.

Copy link

cloudflare-workers-and-pages bot commented Aug 7, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: ea18fb4
Status: ✅  Deploy successful!
Preview URL: https://313f9700.vald.pages.dev
Branch Preview URL: https://refactor-dockerfile.vald.pages.dev

View logs

@github-actions github-actions bot added size/XL and removed size/L labels Aug 7, 2024
@kpango kpango force-pushed the refactor/dockerfile branch 2 times, most recently from d3c70cb to 94aa336 Compare August 7, 2024 22:04
coderabbitai[bot]
coderabbitai bot previously approved these changes Aug 7, 2024
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, codebase verification and nitpick comments (1)
Makefile.d/docker.mk (1)

71-71: Verify and update references to ensure consistency in SBOM generation.

The codebase still contains a reference to the old image docker/buildkit-syft-scanner:edge in dockers/buildkit/syft/scanner/Dockerfile, while the new image ghcr.io/vdaas/vald/vald-buildkit-syft-scanner:nightly is used in Makefile.d/docker.mk. Ensure that all relevant files are updated to use the new image to maintain consistency and avoid potential issues in the SBOM generation process.

  • dockers/buildkit/syft/scanner/Dockerfile: Update the image reference if needed.
Analysis chain

Verify the implications of using a nightly build for SBOM generation.

Switching to a nightly build (ghcr.io/vdaas/vald/vald-buildkit-syft-scanner:nightly) could introduce instability or new features. Ensure that this change aligns with your project's stability requirements and that any potential issues are documented and tested.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of the nightly build for SBOM generation.

# Test: Check for references to the old and new scanner images. Expect: No references to the old image.
rg --type makefile $'docker/buildkit-syft-scanner:edge|ghcr.io/vdaas/vald/vald-buildkit-syft-scanner:nightly'

Length of output: 143


Script:

#!/bin/bash
# Description: Verify usage of the nightly build for SBOM generation.

# Test: Check for references to the old and new scanner images in all files.
rg 'docker/buildkit-syft-scanner:edge|ghcr.io/vdaas/vald/vald-buildkit-syft-scanner:nightly'

Length of output: 293

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3457a5b and 94aa336.

Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • rust/Cargo.lock is excluded by !**/*.lock
Files selected for processing (36)
  • .gitfiles (7 hunks)
  • .github/workflows/_docker-image.yaml (1 hunks)
  • Makefile (1 hunks)
  • Makefile.d/docker.mk (1 hunks)
  • dockers/agent/core/agent/Dockerfile (3 hunks)
  • dockers/agent/core/faiss/Dockerfile (3 hunks)
  • dockers/agent/core/ngt/Dockerfile (3 hunks)
  • dockers/agent/sidecar/Dockerfile (3 hunks)
  • dockers/binfmt/Dockerfile (1 hunks)
  • dockers/buildbase/Dockerfile (1 hunks)
  • dockers/buildkit/Dockerfile (1 hunks)
  • dockers/buildkit/syft/scanner/Dockerfile (1 hunks)
  • dockers/ci/base/Dockerfile (3 hunks)
  • dockers/dev/Dockerfile (3 hunks)
  • dockers/discoverer/k8s/Dockerfile (3 hunks)
  • dockers/gateway/filter/Dockerfile (3 hunks)
  • dockers/gateway/lb/Dockerfile (3 hunks)
  • dockers/gateway/mirror/Dockerfile (3 hunks)
  • dockers/index/job/correction/Dockerfile (3 hunks)
  • dockers/index/job/creation/Dockerfile (3 hunks)
  • dockers/index/job/readreplica/rotate/Dockerfile (3 hunks)
  • dockers/index/job/save/Dockerfile (3 hunks)
  • dockers/index/operator/Dockerfile (3 hunks)
  • dockers/manager/index/Dockerfile (3 hunks)
  • dockers/operator/helm/Dockerfile (3 hunks)
  • dockers/tools/benchmark/job/Dockerfile (3 hunks)
  • dockers/tools/benchmark/operator/Dockerfile (3 hunks)
  • dockers/tools/cli/loadtest/Dockerfile (3 hunks)
  • go.mod (4 hunks)
  • hack/docker/gen/main.go (9 hunks)
  • k8s/discoverer/deployment.yaml (1 hunks)
  • k8s/gateway/gateway/lb/deployment.yaml (1 hunks)
  • k8s/index/operator/configmap.yaml (1 hunks)
  • k8s/index/operator/deployment.yaml (1 hunks)
  • k8s/manager/index/deployment.yaml (1 hunks)
  • versions/JAEGER_OPERATOR_VERSION (1 hunks)
Files skipped from review due to trivial changes (29)
  • Makefile
  • dockers/agent/core/agent/Dockerfile
  • dockers/agent/core/faiss/Dockerfile
  • dockers/agent/core/ngt/Dockerfile
  • dockers/agent/sidecar/Dockerfile
  • dockers/binfmt/Dockerfile
  • dockers/buildbase/Dockerfile
  • dockers/buildkit/Dockerfile
  • dockers/buildkit/syft/scanner/Dockerfile
  • dockers/ci/base/Dockerfile
  • dockers/dev/Dockerfile
  • dockers/discoverer/k8s/Dockerfile
  • dockers/gateway/filter/Dockerfile
  • dockers/gateway/lb/Dockerfile
  • dockers/gateway/mirror/Dockerfile
  • dockers/index/job/correction/Dockerfile
  • dockers/index/job/creation/Dockerfile
  • dockers/index/job/readreplica/rotate/Dockerfile
  • dockers/index/job/save/Dockerfile
  • dockers/index/operator/Dockerfile
  • dockers/manager/index/Dockerfile
  • dockers/operator/helm/Dockerfile
  • dockers/tools/benchmark/job/Dockerfile
  • dockers/tools/benchmark/operator/Dockerfile
  • dockers/tools/cli/loadtest/Dockerfile
  • go.mod
  • k8s/discoverer/deployment.yaml
  • k8s/index/operator/deployment.yaml
  • versions/JAEGER_OPERATOR_VERSION
Additional comments not posted (10)
.github/workflows/_docker-image.yaml (1)

83-83: Approved: Addition of Stargz snapshotter.

The addition of --oci-worker-snapshotter=stargz to the buildkitd-flags is a beneficial change for optimizing image pulls.

k8s/manager/index/deployment.yaml (1)

49-49: ConfigMap checksum updated.

The update to the checksum/configmap annotation will trigger a rolling update of the deployment, ensuring the application uses the latest configuration.

k8s/gateway/gateway/lb/deployment.yaml (1)

48-48: ConfigMap checksum updated.

The update to the checksum/configmap annotation will trigger a rolling update of the deployment, ensuring the application uses the latest configuration.

hack/docker/gen/main.go (3)

60-61: Approve the addition of AliasImage and BuildStageName features.

The introduction of AliasImage and BuildStageName enhances the configurability of Dockerfile generation. Ensure that existing configurations are updated to leverage these new features where applicable.


Line range hint 191-200: Ensure backward compatibility with the new Data struct fields.

The addition of AliasImage and BuildStageName to the Data struct provides more flexibility. Verify that these changes do not break existing configurations or assumptions in the codebase.


668-695: Verify the impact of new entries with AliasImage set to true.

The new entries (vald-buildbase, vald-buildkit, vald-binfmt, vald-buildkit-syft-scanner) with AliasImage set to true introduce conditional build stages. Ensure that these changes are tested and documented.

k8s/index/operator/configmap.yaml (2)

28-28: Approve version updates and configuration refinements.

The updates to version v1.7.13 and the configuration refinements, including the tcp_cork option change, are approved. Ensure that the performance impact of enabling tcp_cork is tested, as it may affect network behavior.


28-28: Verify the impact of enabling tcp_cork in socket options.

Changing tcp_cork to true can affect TCP performance by reducing packet fragmentation. Verify that this change aligns with your network performance goals and does not introduce unexpected behavior.

.gitfiles (2)

88-88: Addition of new GitHub workflow file.

The addition of .github/workflows/dockers-buildkit-syft-scanner-image.yaml likely enhances CI/CD capabilities related to Docker image scanning. Ensure this workflow is correctly configured and tested.

Verification successful

GitHub Workflow File Verified and Configured.

The .github/workflows/dockers-buildkit-syft-scanner-image.yaml file is present and correctly configured to automate Docker image builds and scans. This enhancement should improve the CI/CD pipeline's efficiency and reliability. Ensure that the referenced workflow and Dockerfile paths are accurate and that secrets are properly managed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the presence and content of the new GitHub workflow file.

# Test: Check if the file exists and output its content for review.
fd 'dockers-buildkit-syft-scanner-image.yaml' --base-directory .github/workflows --exec cat

Length of output: 1627


528-528: Addition of new Dockerfile.

The addition of dockers/buildkit/syft/scanner/Dockerfile suggests improvements in the Docker setup, possibly related to the buildkit-syft-scanner. Ensure this Dockerfile is correctly configured and tested.

Verification successful

Dockerfile successfully added and configured.

The dockers/buildkit/syft/scanner/Dockerfile is present and correctly configured as part of an automated setup. Ensure that any dependencies or related systems are also updated and tested as needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the presence and content of the new Dockerfile.

# Test: Check if the file exists and output its content for review.
fd 'Dockerfile' --base-directory dockers/buildkit/syft/scanner --exec cat

Length of output: 883

@datelier datelier merged commit 656664e into main Aug 8, 2024
186 checks passed
@datelier datelier deleted the refactor/dockerfile branch August 8, 2024 00:30
kpango added a commit that referenced this pull request Aug 8, 2024
…dkit-syft-scanner reference to ghcr.io

Signed-off-by: kpango <[email protected]>
kpango added a commit that referenced this pull request Aug 8, 2024
…dkit-syft-scanner reference to ghcr.io

Signed-off-by: kpango <[email protected]>
kpango added a commit that referenced this pull request Aug 8, 2024
…dkit-syft-scanner reference to ghcr.io (#2578)

Signed-off-by: kpango <[email protected]>
@kpango kpango mentioned this pull request Oct 11, 2024
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.

4 participants