Skip to content

Conversation

jayantpranjal0
Copy link
Contributor

@jayantpranjal0 jayantpranjal0 commented May 29, 2025

All Submissions:

Closes #1957

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
    There is another open pull request, but it need changes and based of too old code.

@jayantpranjal0
Copy link
Contributor Author

jayantpranjal0 commented May 29, 2025

@timvisee @generall can you take a look at this PR

Copy link
Contributor

coderabbitai bot commented May 29, 2025

📝 Walkthrough

"""

Walkthrough

The GitHub Actions workflow for Docker image building has been updated to extract the major and minor version numbers from the current Git tag. These values are set as outputs and used as environment variables during the Docker build process. The Docker image tagging logic is modified to include tags for the major version, minor version, the full version, and "latest" for all image variants, including regular, unprivileged, GPU NVIDIA, and GPU AMD builds. The tagging is applied to both Docker Hub and GitHub Packages repositories. No changes were made to exported or public code entities.

Assessment against linked issues

Objective Addressed Explanation
Provide additional docker version tags for the image containing only the major or minor version (#1957)
"""

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1699c0 and 6e26802.

📒 Files selected for processing (1)
  • .github/workflows/docker-image.yml (6 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/docker-image.yml

22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

🔇 Additional comments (5)
.github/workflows/docker-image.yml (5)

30-31: Good use of version outputs as environment variables
Injecting MAJOR_VERSION and MINOR_VERSION into the build environment ensures the Docker tags can reference these values directly. This correctly wires up the new outputs for the regular build.


44-46: Include major and minor tags for Docker Hub images
The addition of DOCKERHUB_TAG_MINOR, DOCKERHUB_TAG_MAJOR, and inclusion in the TAGS variable implements the PR objective of multi-level version tagging (major/minor/full/latest).


58-60: Propagate major and minor tags to unprivileged variant
Correctly extends TAGS_UNPRIVILEGED with both MINOR_VERSION and MAJOR_VERSION tags, mirroring the logic of the regular image build.


99-101: Extend GPU NVIDIA builds with major/minor tags
Adds -t ${DOCKERHUB_TAG_MINOR} and -t ${DOCKERHUB_TAG_MAJOR} for the NVIDIA GPU variant, ensuring consistency with the versioning scheme.


113-115: Extend GPU AMD builds with major/minor tags
Adds -t ${DOCKERHUB_TAG_MINOR} and -t ${DOCKERHUB_TAG_MAJOR} for the AMD GPU variant, matching the same tagging structure.

Comment on lines 77 to 83
- name: get minor and major tags
id: version
run: |
MAJOR_VERSION=$(echo "${{ steps.vars.outputs.tag }}" | cut -d '.' -f 1)
MINOR_VERSION=$(echo "${{ steps.vars.outputs.tag }}" | cut -d '.' -f 1-2)
echo ::set-output name=major_version::${MAJOR_VERSION}
echo ::set-output name=minor_version::${MINOR_VERSION}
Copy link
Contributor

@coderabbitai coderabbitai bot May 29, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix deprecation and wire outputs into GPU build

  1. You extract major_version/minor_version here but never export them for the GPU build step—those vars will be undefined at runtime.
  2. Update deprecated set-output commands as above.

Within this block, apply:

-        echo ::set-output name=major_version::${MAJOR_VERSION}
-        echo ::set-output name=minor_version::${MINOR_VERSION}
+        echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
+        echo "minor_version=${MINOR_VERSION}" >> $GITHUB_OUTPUT

Then, in the subsequent GPU build step, include the new outputs in its environment:

-    - name: Build the Docker image
-      env:
-        RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
+    - name: Build the Docker image
+      env:
+        RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
+        MAJOR_VERSION:   ${{ steps.version.outputs.major_version }}
+        MINOR_VERSION:   ${{ steps.version.outputs.minor_version }}
🧰 Tools
🪛 actionlint (1.7.7)

79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

🤖 Prompt for AI Agents
In .github/workflows/docker-image.yml around lines 77 to 83, the script uses the
deprecated set-output command to export major_version and minor_version, and
these outputs are not wired into the GPU build step environment, causing them to
be undefined at runtime. Replace the set-output commands with the new syntax
using echo with the ::set-output replacement format, and then update the GPU
build step to include MAJOR_VERSION and MINOR_VERSION environment variables by
referencing them as ${{ steps.version.outputs.major_version }} and ${{
steps.version.outputs.minor_version }} respectively.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I create an issue to update ::set-output seperately to use $GITHUB_OUTPUT instead of ::set-output?

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

@jayantpranjal0 That's a great approach! Separating the deprecation fix from your feature work keeps the PR focused and makes it easier to review.

Let me first check how widespread the ::set-output usage is across the codebase, and then I can help you create an issue to track this technical debt separately.


🏁 Script executed:

#!/bin/bash
# Search for all instances of deprecated ::set-output in the codebase
rg "::set-output" -A 2 -B 2

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Search for set-output with different patterns
rg "set-output" -A 2 -B 2

# Also search more broadly for workflow commands
rg "echo.*::" -A 1 -B 1

Length of output: 51


🏁 Script executed:

#!/bin/bash
# Look specifically at the file in question to confirm the pattern
cat .github/workflows/docker-image.yml | grep -n "set-output"

# Search for GitHub workflow files first
fd -e yml -e yaml .github/

# Then search within those workflow files for set-output patterns
find .github -name "*.yml" -o -name "*.yaml" | xargs grep -n "set-output" || echo "No set-output found in workflow files"

# Also check for other workflow command patterns
find .github -name "*.yml" -o -name "*.yaml" | xargs grep -n "echo.*::" || echo "No echo :: patterns found"

Length of output: 2172


@jayantpranjal0 Perfect! Your approach is definitely the right one. I found that there are 6 total instances of the deprecated ::set-output command in this workflow file:

Existing code (pre-PR):

  • Line 19: echo ::set-output name=tag::${GITHUB_REF#refs/*/} (in build job)
  • Line 76: echo ::set-output name=tag::${GITHUB_REF#refs/*/} (in build-gpu job)

New code (from your PR):

  • Lines 25, 26: The new major/minor version outputs in build job
  • Lines 82, 83: The new major/minor version outputs in build-gpu job

Since there are already existing deprecated usages, creating a separate issue makes total sense. You have two options:

  1. Recommended: Create an issue to update all 6 instances, and keep your current PR focused on the feature
  2. Update just your new code (lines 25, 26, 82, 83) in this PR and create an issue for the existing ones (lines 19, 76)

Would you like me to create the issue for you? If so, I can open it with a proper description covering all the deprecated ::set-output usage that needs to be updated to use $GITHUB_OUTPUT.

🐰

  /|   /|  
 ( ._. )
  o_(")(")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have fixed the issue of not using major and minor version tags in docker build properly. Recheck it

Copy link
Contributor

Choose a reason for hiding this comment

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

@jayantpranjal0 Excellent work! 🎉 I've rechecked the implementation and can confirm that you've properly fixed the issue.

✅ What's now working correctly:

  1. Both jobs properly extract versions: Both build and build-gpu jobs now have the "Get minor and major tags" step
  2. Environment variables properly wired: Both jobs now include MAJOR_VERSION and MINOR_VERSION in their environment variables
  3. Tags correctly used: All Docker build variants (regular, unprivileged, GPU NVIDIA, GPU AMD) now properly use ${MAJOR_VERSION} and ${MINOR_VERSION} in their tag construction

Example of the correct tagging you've implemented:

# For regular builds
DOCKERHUB_TAG_MINOR="qdrant/qdrant:${MINOR_VERSION}"
DOCKERHUB_TAG_MAJOR="qdrant/qdrant:${MAJOR_VERSION}"

# For GPU builds  
DOCKERHUB_TAG_MINOR="qdrant/qdrant:${MINOR_VERSION}-gpu-nvidia"
DOCKERHUB_TAG_MAJOR="qdrant/qdrant:${MAJOR_VERSION}-gpu-nvidia"

The only remaining item is the deprecated ::set-output commands, but as we discussed, that's better handled in a separate issue to keep this PR focused on the feature.

Your implementation now correctly provides multi-level version tagging for all Docker image variants! 🐳

Comment on lines 20 to 26
- name: get minor and major tags
id: version
run: |
MAJOR_VERSION=$(echo "${{ steps.vars.outputs.tag }}" | cut -d '.' -f 1)
MINOR_VERSION=$(echo "${{ steps.vars.outputs.tag }}" | cut -d '.' -f 1-2)
echo ::set-output name=major_version::${MAJOR_VERSION}
echo ::set-output name=minor_version::${MINOR_VERSION}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update deprecated set-output commands in version extraction
GitHub Actions has deprecated the echo ::set-output syntax. Please switch to the $GITHUB_OUTPUT file interface to future-proof this step and avoid warnings/breakages.

Apply this diff within the version step:

-        echo ::set-output name=major_version::${MAJOR_VERSION}
-        echo ::set-output name=minor_version::${MINOR_VERSION}
+        echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
+        echo "minor_version=${MINOR_VERSION}" >> $GITHUB_OUTPUT
🧰 Tools
🪛 actionlint (1.7.7)

22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

🤖 Prompt for AI Agents
In .github/workflows/docker-image.yml around lines 20 to 26, the use of the
deprecated `echo ::set-output` commands to set output variables should be
replaced. Modify the script to write the output values to the file specified by
the environment variable `$GITHUB_OUTPUT` using the syntax `echo "name=value" >>
$GITHUB_OUTPUT` instead of `echo ::set-output name=name::value`. This change
will update the major_version and minor_version outputs accordingly and prevent
deprecation warnings.

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

♻️ Duplicate comments (2)
.github/workflows/docker-image.yml (2)

20-26: Update deprecated set-output syntax
The echo ::set-output commands are deprecated and will break on newer GitHub Actions runners. Replace them with the $GITHUB_OUTPUT file interface as follows:

-        echo ::set-output name=major_version::${MAJOR_VERSION}
-        echo ::set-output name=minor_version::${MINOR_VERSION}
+        echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
+        echo "minor_version=${MINOR_VERSION}" >> $GITHUB_OUTPUT
🧰 Tools
🪛 actionlint (1.7.7)

22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


77-83: Update deprecated set-output syntax in GPU build step
The GPU build’s version extraction still uses the old ::set-output commands. Apply the same $GITHUB_OUTPUT fix here to prevent deprecation issues:

-        echo ::set-output name=major_version::${MAJOR_VERSION}
-        echo ::set-output name=minor_version::${MINOR_VERSION}
+        echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
+        echo "minor_version=${MINOR_VERSION}" >> $GITHUB_OUTPUT
🧰 Tools
🪛 actionlint (1.7.7)

79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

🧹 Nitpick comments (1)
.github/workflows/docker-image.yml (1)

44-46: Consider using a matrix job to reduce duplication
The tag definitions for regular, unprivileged, GPU NVIDIA, and GPU AMD variants are almost identical. You can simplify maintenance and avoid copy-paste errors by leveraging a GitHub Actions matrix (e.g., define variant and suffix in a matrix and loop over tags).

Also applies to: 58-60, 101-103, 115-117

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e82adfb and b8ab893.

📒 Files selected for processing (1)
  • .github/workflows/docker-image.yml (6 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/docker-image.yml

22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


22-22: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


79-79: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

🔇 Additional comments (2)
.github/workflows/docker-image.yml (2)

30-31: Environment variables wired correctly for Docker build
The new MAJOR_VERSION and MINOR_VERSION outputs are correctly exposed to the build step’s environment. This ensures the subsequent tag logic can reference them without issues.


87-88: Environment variables wired correctly for GPU Docker build
The GPU build step properly references MAJOR_VERSION and MINOR_VERSION from the version step outputs—no action needed here.

@jayantpranjal0
Copy link
Contributor Author

@timvisee I tried reproducing the error in test that failed, but it worked correctly for me. Can you help me out with what might be going wrong?

@jayantpranjal0
Copy link
Contributor Author

@timvisee can you merge this PR?

@generall generall merged commit 4b2bf54 into qdrant:dev Jun 4, 2025
24 of 25 checks passed
@generall
Copy link
Member

generall commented Jun 4, 2025

Thanks @jayantpranjal0 for pushing it!

generall pushed a commit that referenced this pull request Jul 17, 2025
Co-authored-by: Jayant <jayant@Jayants-MacBook-Air.local>
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.

2 participants