Use container for python 3.6 compatibility issue#400
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request modifies the CI/CD workflow to address Python 3.6 compatibility issues by using a Docker container for Linux builds. The workflow now runs Linux tests inside an ubuntu:20.04 container while keeping Windows tests on the native runner.
Changes:
- Switched Linux OS from
ubuntu-20.04toubuntu-latestwith a container override toubuntu:20.04 - Split all workflow steps into OS-specific variants (Linux vs Windows) with explicit shell specifications
- Changed Python installation approach: manual installation via apt-get for Linux, actions/setup-python for Windows
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| apt-get update | ||
| apt-get install -y python3.6 python3.6-dev python3-pip git |
There was a problem hiding this comment.
The ubuntu:20.04 container image is minimal and does not include git by default. The git commands in the "Fetch core files from open_dev branch" step (lines 32-33) will execute before git is installed here on line 47. This will cause the workflow to fail. Consider either installing necessary tools (including git) as the first step after checkout, or using a container image that includes git pre-installed, such as ubuntu:20.04 with git layer or a custom image.
| - name: Fetch core files from open_dev branch (Linux) | ||
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| run: | | ||
| git fetch origin open_dev | ||
| git checkout origin/open_dev -- _core | ||
|
|
||
| - name: Fetch core files from open_dev branch (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| git fetch origin open_dev | ||
| git checkout origin/open_dev -- _core |
There was a problem hiding this comment.
The duplicated logic for fetching core files between Linux and Windows steps is identical except for the shell specification. Since both steps execute the same git commands, consider consolidating them into a single step with conditional shell specification, or remove the shell specification and rely on the appropriate default shell for each OS. This would improve maintainability.
| apt-get update | ||
| apt-get install -y python3.6 python3.6-dev python3-pip git |
There was a problem hiding this comment.
When running actions/checkout inside a container, git may encounter "dubious ownership" errors due to UID mismatches between the container user and the repository owner. Consider adding 'git config --global --add safe.directory /github/workspace' or similar after git installation and before any git operations, or ensure the container runs as the correct user. This is a common issue when using containers in GitHub Actions.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Updated the installation process for Python 3.6 and its dependencies.
Add environment variables for non-interactive installation and timezone setup.
Replaced Python installation method with source compilation and added necessary dependencies.
No description provided.