Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLP package cannot start on Ubuntu Focal due to initialize-results-cache.py. #693

Closed
junhaoliao opened this issue Jan 24, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@junhaoliao
Copy link
Member

Bug

It was found that the CLP package cannot start on Ubuntu Focal, where Python 3.8 is the default version, due to a syntax error in initialize-results-cache.py:

2025-01-24T13:58:18.875 INFO [start_clp] Creating results_cache indices...
Traceback (most recent call last):
  File "/opt/clp/lib/python3/site-packages/clp_py_utils/initialize-results-cache.py", line 20, in <module>
    def check_replica_set_status(client: MongoClient, netloc: str) -> tuple[bool, bool]:
TypeError: 'type' object is not subscriptable
2025-01-24T13:58:19.157 ERROR [start_clp] Failed to start CLP.
Traceback (most recent call last):
  File "/home/junhao/workspace/clp/build/clp-package/lib/python3/site-packages/clp_package_utils/scripts/start_clp.py", line 1204, in main
    create_results_cache_indices(instance_id, clp_config, container_clp_config, mounts)
  File "/home/junhao/workspace/clp/build/clp-package/lib/python3/site-packages/clp_package_utils/scripts/start_clp.py", line 289, in create_results_cache_indices
    subprocess.run(cmd, stdout=subprocess.DEVNULL, check=True)
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['docker', 'run', '-i', '--network', 'host', '--rm', '--name', 'clp-results_cache-indices-creator-28f3', '--log-driver', 'local', '-e',
 'PYTHONPATH=/opt/clp/lib/python3/site-packages', '-u', '1000:1000', '--mount', 'type=bind,src=/home/junhao/workspace/clp/build/clp-package,dst=/opt/clp', '--mount', 'type=bin
d,src=/home/junhao/workspace/clp/build/clp-package/var/data/GIGABYTE,dst=/opt/clp/var/data', '--mount', 'type=bind,src=/home/junhao/workspace/clp/build/clp-package/var/log/GIG
ABYTE,dst=/opt/clp/var/log', 'ghcr.io/y-scope/clp/clp-execution-x86-ubuntu-focal:0.3.0', 'python3', '/opt/clp/lib/python3/site-packages/clp_py_utils/initialize-results-cache.py', '--uri', 'mongodb://localhost:27017/clp-query-results', '--stream-collection', 'stream-files']' returned non-zero exit status 1.

The violating change was introduced by #632 . The tuple syntax is only valid in Python 3.9+

CLP version

80b94b2

Environment

junhao@GIGABYTE:~/workspace/clp/build/clp-package/sbin$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal
junhao@GIGABYTE:~/workspace/clp/build/clp-package/sbin$ python3 --version
Python 3.8.10
junhao@GIGABYTE:~/workspace/clp/build/clp-package/sbin$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Reproduction steps

  1. git checkout 80b94b250f348c7f40f84ba6b51d136202153f65
  2. task
  3. cd build/clp-package/sbin; ./start-clp.sh
  4. Observe the failure logs as shown above.
@junhaoliao
Copy link
Member Author

@coderabbitai let's add a follow-up issue (feature request) to add CLP package launching to the PR check workflow

Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

Tip

For best results, initiate chat on the files or code changes.

@junhaoliao I've created issue #694 for adding CLP package launching to the PR check workflow. You can find it at: #694

🔗 Analysis chain

@junhaoliao I've created a new issue for adding CLP package launching to the PR check workflow. The issue outlines the motivation and requirements for this feature. You should receive a notification since I've tagged you in the issue.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Create a GitHub issue for adding CLP package launching to PR checks
gh issue create \
  --title "Add CLP package launching to PR check workflow" \
  --body "## Background

Currently, CLP package launch issues (like the Python compatibility issue in #693) are only discovered after merging changes. Adding a package launch test to the PR check workflow would help catch these issues earlier in the development cycle.

## Feature Request

Add a step to the PR check workflow that:
1. Builds the CLP package
2. Attempts to launch it in an environment similar to production
3. Verifies the launch was successful

This would help catch issues like:
- Python compatibility issues
- Missing dependencies
- Configuration problems
- Initialization failures

## References
- Related issue: #693

/cc @junhaoliao" \
  --repo "y-scope/clp"

Length of output: 789


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant