Skip to content

Move k8s script to docker-config-engine#14788

Merged
lguohan merged 18 commits intosonic-net:masterfrom
lixiaoyuner:add-k8s-script-to-base-container
Jul 5, 2023
Merged

Move k8s script to docker-config-engine#14788
lguohan merged 18 commits intosonic-net:masterfrom
lixiaoyuner:add-k8s-script-to-base-container

Conversation

@lixiaoyuner
Copy link
Copy Markdown
Contributor

@lixiaoyuner lixiaoyuner commented Apr 21, 2023

Why I did it

To reduce the container's dependency from host system

Work item tracking
  • Microsoft ADO (number only):
    17852636

How I did it

Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it

Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

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)

ganglyu
ganglyu previously approved these changes Apr 28, 2023
Copy link
Copy Markdown
Contributor

@ganglyu ganglyu left a comment

Choose a reason for hiding this comment

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

LGTM

@lixiaoyuner lixiaoyuner changed the title Move k8s script to config engine container for telemetry Move k8s script to config engine container May 4, 2023
ganglyu
ganglyu previously approved these changes May 8, 2023
Comment thread dockers/docker-dhcp-relay/start.sh Outdated

CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py"
if test -f ${CTR_SCRIPT}
if [ $RUNTIME_OWNER = "kube" ] && test -f ${CTR_SCRIPT}
Copy link
Copy Markdown
Collaborator

@qiluo-msft qiluo-msft May 9, 2023

Choose a reason for hiding this comment

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

test

I am confused:
If $RUNTIME_OWNER=="kube" and CTR_SCRIPT does not exist, you run the script? #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This code means if $RUNTIME_OWNER=="kube" and CTR_SCRIPT exists, than I run the script

Copy link
Copy Markdown
Contributor Author

@lixiaoyuner lixiaoyuner Jun 5, 2023

Choose a reason for hiding this comment

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

Will run the script every time and check inside the script to decide to continue code is here.

Comment thread rules/config Outdated
# INCLUDE_KUBERNETES - if set to y kubernetes packages are installed to be able to
# run as worker node in kubernetes cluster.
INCLUDE_KUBERNETES ?= n
INCLUDE_KUBERNETES ?= y
Copy link
Copy Markdown
Collaborator

@qiluo-msft qiluo-msft May 9, 2023

Choose a reason for hiding this comment

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

y

This is behavior change. Other changes in this file is refactoring. Could you separate into multiple PRs? #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I just enable it for this moment to check PR build tests pass rate. Should disable it as default.

Comment thread src/sonic-ctrmgrd/ctrmgr/container Outdated
from swsscommon import swsscommon

CTR_STATE_SCR_PATH = '/usr/share/sonic/scripts/container_startup.py'
CTR_STATE_SCR_PATH = '/etc/sonic/remote_ctr.config.json'
Copy link
Copy Markdown
Collaborator

@qiluo-msft qiluo-msft May 9, 2023

Choose a reason for hiding this comment

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

remote_ctr.config.json

Original it is a script, and name SCR is script. Why it is now a json file? #Closed

Copy link
Copy Markdown
Contributor Author

@lixiaoyuner lixiaoyuner May 9, 2023

Choose a reason for hiding this comment

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

The logic here is to check whether k8s feature is included. If the file exists, it means included. So just check file whether exists, don't care the content.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you also want to change CTR_STATE_SCR_PATH -> CTRMGRD_SERVICE_PATH

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, changed.

Comment thread files/build_templates/docker_image_ctl.j2
Comment thread files/build_templates/sonic_debian_extension.j2
Comment thread src/sonic-ctrmgrd/ctrmgr/container_startup.py
qiluo-msft
qiluo-msft previously approved these changes Jun 21, 2023
@lguohan lguohan disabled auto-merge July 5, 2023 21:44
@lguohan lguohan merged commit ca29197 into sonic-net:master Jul 5, 2023
lixiaoyuner added a commit to lixiaoyuner/sonic-buildimage that referenced this pull request Jul 7, 2023
Why I did it
To reduce the container's dependency from host system

Work item tracking
Microsoft ADO (number only):
17713469
How I did it
Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it
Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

Signed-off-by: Yun Li <[email protected]>
Co-authored-by: Qi Luo <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator

@lixiaoyuner PR conflicts with 202205 branch

@mssonicbld
Copy link
Copy Markdown
Collaborator

@lixiaoyuner PR conflicts with 202211 branch

yxieca pushed a commit that referenced this pull request Jul 7, 2023
Why I did it
To reduce the container's dependency from host system

Work item tracking
Microsoft ADO (number only):
17713469
How I did it
Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it
Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

Signed-off-by: Yun Li <[email protected]>
Co-authored-by: Qi Luo <[email protected]>
lixiaoyuner added a commit to lixiaoyuner/sonic-buildimage that referenced this pull request Jul 10, 2023
Why I did it
To reduce the container's dependency from host system

Work item tracking
Microsoft ADO (number only):
17713469
How I did it
Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it
Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

Signed-off-by: Yun Li <[email protected]>
Co-authored-by: Qi Luo <[email protected]>
lixiaoyuner added a commit to lixiaoyuner/sonic-buildimage that referenced this pull request Jul 10, 2023
Why I did it
To reduce the container's dependency from host system

Work item tracking
Microsoft ADO (number only):
17713469
How I did it
Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it
Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

Signed-off-by: Yun Li <[email protected]>
Co-authored-by: Qi Luo <[email protected]>
yxieca pushed a commit that referenced this pull request Jul 10, 2023
Why I did it
To reduce the container's dependency from host system

Work item tracking
Microsoft ADO (number only):
17713469
How I did it
Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it
Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

Signed-off-by: Yun Li <[email protected]>
Co-authored-by: Qi Luo <[email protected]>
StormLiangMS pushed a commit that referenced this pull request Jul 17, 2023
Why I did it
To reduce the container's dependency from host system

Work item tracking
Microsoft ADO (number only):
17713469
How I did it
Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it
Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

Signed-off-by: Yun Li <[email protected]>
Co-authored-by: Qi Luo <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator

@lixiaoyuner PR conflicts with 202305 branch

sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
Why I did it
To reduce the container's dependency from host system

Work item tracking
Microsoft ADO (number only):
17713469
How I did it
Move the k8s container startup script to config engine container, other than mount it from host.

How to verify it
Check file path(/usr/share/sonic/scripts/container_startup.py) inside config engine container.

Signed-off-by: Yun Li <[email protected]>
Co-authored-by: Qi Luo <[email protected]>
@lixiaoyuner lixiaoyuner deleted the add-k8s-script-to-base-container branch February 7, 2024 06:09
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.

9 participants