Skip to content

[action] [PR:20761] Improve setup-container.sh for Ubuntu 24.04 based docker-sonic-mgmt#779

Merged
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/20761
Oct 23, 2025
Merged

[action] [PR:20761] Improve setup-container.sh for Ubuntu 24.04 based docker-sonic-mgmt#779
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/20761

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

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

Approach

What is the motivation for this PR?

To support docker-sonic-mgmt based on Ubuntu 24.04, the setup-container.sh needs some minor improvements:

How did you do it?

  1. The Ubuntu 24.04 docker image as account "ubuntu" by default. Its uid could conflict with the user's uid. This change added code to best effort deleting this default "ubuntu" account.
  2. In old docker-sonic-mgmt, python3 is installed in virtual environment. In 2024, the docker-sonic-mgmt was updated to install python3 in global environment. It's no longer necessary to hack the virtual environment. This change adjusted the sequence of conditions for hacking venv, so that the code can fail faster to skip this step. In the future, this piece of code should can be deleted.

How did you verify/test it?

Use the updated script to setup sonic-mgmt container use both old and new docker-sonic-mgmt images.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:
Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [ ] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505

### Approach
#### What is the motivation for this PR?
To support docker-sonic-mgmt based on Ubuntu 24.04, the setup-container.sh needs some minor improvements:

#### How did you do it?
1. The Ubuntu 24.04 docker image as account "ubuntu" by default. Its uid could conflict with the user's uid. This change added code to best effort deleting this default "ubuntu" account.
2. In old docker-sonic-mgmt, python3 is installed in virtual environment. In 2024, the docker-sonic-mgmt was updated to install python3 in global environment. It's no longer necessary to hack the virtual environment. This change adjusted the sequence of conditions for hacking venv, so that the code can fail faster to skip this step. In the future, this piece of code should can be deleted.

#### How did you verify/test it?
Use the updated script to setup sonic-mgmt container use both old and new docker-sonic-mgmt images.

#### Any platform specific information?

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-mgmt#20761

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit e266e64 into Azure:202412 Oct 23, 2025
5 of 7 checks passed
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.

1 participant