Skip to content

[sonic-package-manager] Use tag to start application#22911

Merged
qiluo-msft merged 2 commits intosonic-net:masterfrom
DavidZagury:master_fix_app_extension_instllation
Jul 21, 2025
Merged

[sonic-package-manager] Use tag to start application#22911
qiluo-msft merged 2 commits intosonic-net:masterfrom
DavidZagury:master_fix_app_extension_instllation

Conversation

@DavidZagury
Copy link
Contributor

This is done in order to be able to start using tag which will provide a user-friendly identifier when running docker ps.

Needed PR: sonic-net/sonic-utilities#3917

Why I did it

To fix #22124 while keeping the wanted ability to get real image while using docker ps

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Modified docker_image_ctl.j2 to add support for using docker_image_tag when starting containers
  • Added a new condition to check if docker_image_tag is defined and not none
  • If a tag is specified, it will be used instead of the default latest tag

How to verify it

  1. Install a package using sonic-package-manager
  2. Run docker ps to verify that the container is running with the correct tag
  3. Check the container configuration to ensure the tag is properly saved

Which release branch to backport (provide reason below if selected)

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@DavidZagury DavidZagury requested a review from lguohan as a code owner June 10, 2025 09:58
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DavidZagury
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DavidZagury
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DavidZagury
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DavidZagury
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DavidZagury
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

This is done in order to be able to start using tag which will provide a user-friendly identifier when running docker ps.
@DavidZagury DavidZagury force-pushed the master_fix_app_extension_instllation branch from 651d03a to 55c92e6 Compare July 3, 2025 18:53
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@liushilongbuaa liushilongbuaa left a comment

Choose a reason for hiding this comment

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

LGTM

-v /var/run/docker-syncd$DEV:/var/run/sswsyncd \
"docker-$GBSYNCD_PLATFORM":latest \
{%- elif docker_image_tag is defined and docker_image_tag is not none %}
{{docker_image_tag}} \
Copy link
Collaborator

@qiluo-msft qiluo-msft Jul 14, 2025

Choose a reason for hiding this comment

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

{{docker_image_tag}}

Is the intention "{{docker_image_name}}:{{docker_image_tag}}" ?
If this is not your current implementation, suggest change design this way. #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qiluo-msft , docker_image_tag already contains the full name used to install the docker image.
For example, in dhcp-relay it would contain "docker-dhcp-relay:latest"

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is confusing. Could you change the design to "{{docker_image_name}}:{{docker_image_tag}}"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It won't always have the {{docker_image_name}}:{{docker_image_tag}} schema, for example, the user can install using a image digest and then this is what it will get in in that variable.

How about changing the name to docker_image_reference?
This could mean both the both the image name with the tag and also image digest

Copy link
Collaborator

Choose a reason for hiding this comment

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

docker_image_reference looks good name to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qiluo-msft
Since the sonic-utilities PR was already merged, we needed another PR to change the name:
sonic-net/sonic-utilities#3998

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DavidZagury
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft merged commit 301b454 into sonic-net:master Jul 21, 2025
20 checks passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202505: #23421

qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this pull request Jul 31, 2025
What I did
Rename the variable tag to docker_image_reference since it can also hold image digest.

How I did it
Change the variable name to match the name agreed on sonic-net/sonic-buildimage#22911

How to verify it
Install App Extension
mssonicbld added a commit to mssonicbld/sonic-utilities that referenced this pull request Aug 4, 2025
<!--
    Please make sure you've read and understood our contributing guidelines:
    https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

    ** Make sure all your commits include a signature generated with `git commit -s` **

    If this is a bug fix, make sure your description includes "closes #xxxx",
    "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
    issue when the PR is merged.

    If you are adding/modifying/removing any command or utility script, please also
    make sure to add/modify/remove any unit tests from the tests
    directory as appropriate.

    If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
    subcommand, or you are adding a new subcommand, please make sure you also
    update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
    your changes.

    Please provide the following information:
-->

#### What I did
Rename the variable tag to docker_image_reference since it can also hold image digest.

#### How I did it
Change the variable name to match the name agreed on  sonic-net/sonic-buildimage#22911

#### How to verify it
Install App Extension

#### Previous command output (if the output of a command-line utility has changed)

#### New command output (if the output of a command-line utility has changed)
mssonicbld added a commit to sonic-net/sonic-utilities that referenced this pull request Aug 4, 2025
<!--
 Please make sure you've read and understood our contributing guidelines:
 https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

 failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` **

 If this is a bug fix, make sure your description includes "closes #xxxx",
 "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
 issue when the PR is merged.

 If you are adding/modifying/removing any command or utility script, please also
 make sure to add/modify/remove any unit tests from the tests
 directory as appropriate.

 If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
 subcommand, or you are adding a new subcommand, please make sure you also
 update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
 your changes.

 Please provide the following information:
-->

#### What I did
Rename the variable tag to docker_image_reference since it can also hold image digest.

#### How I did it
Change the variable name to match the name agreed on sonic-net/sonic-buildimage#22911

#### How to verify it
Install App Extension

#### Previous command output (if the output of a command-line utility has changed)

#### New command output (if the output of a command-line utility has changed)
YairRaviv pushed a commit to YairRaviv/sonic-utilities that referenced this pull request Jan 12, 2026
What I did
Rename the variable tag to docker_image_reference since it can also hold image digest.

How I did it
Change the variable name to match the name agreed on sonic-net/sonic-buildimage#22911

How to verify it
Install App Extension
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.

Regression: External App Extensions fail to start

6 participants