Skip to content

Conversation

@pangpang20
Copy link
Contributor

Description

This pull request enhances the support for non-root users in the installation process of the GaussDB driver and Wagtail integration. It updates the README.md, wagtail_README.md, and install_gaussdb_driver.sh to ensure compatibility with non-root users by adjusting file permissions, environment configurations, and dynamic link library paths. Additionally, it introduces a backup of the compiler.py file for the GaussDB Django integration, addressing specific database operations and JSON handling improvements.

The changes aim to improve usability, ensure idempotent script execution, and provide clearer documentation for setting up the environment and running tests.

Changes Made

  • README.md:
    • Updated installation instructions for gaussdb pq to support non-root user (django) setup.
    • Modified test execution commands to use stable/5.2.x instead of stable-5.2.x for consistency.
  • wagtail_README.md:
    • Added detailed steps for creating and configuring a non-root wagtail user.
    • Updated virtual environment setup to use Python 3.10 and a user-specific directory (/$HOME/django_work).
    • Configured PyPI source to use a domestic mirror for faster installations.
    • Adjusted LD_LIBRARY_PATH to use user-specific paths (/$HOME/GaussDB_driver_lib).
    • Updated database migration instructions and added troubleshooting steps for first_published_at errors.
    • Fixed RemoveConstraint logic in Wagtail migrations.
  • install_gaussdb_driver.sh:
    • Added support for non-root users by removing sudo requirements for file operations where possible.
    • Configured user-level dynamic link library paths in ~/.bashrc and /etc/ld.so.conf.d/$(whoami).conf.
    • Used --no-same-owner in tar extraction to avoid permission issues for non-root users.
    • Improved verification logic to check for libpq in the user-specific library directory.
    • Added environment reload logic when the script is sourced.
  • gaussdb_django/compiler.py.bak:
    • Added a backup of the compiler.py file with custom SQL compilation logic for GaussDB.
    • Enhanced JSON handling for JSONArray, JSONObject, and key transforms.
    • Improved support for HasKey, HasKeys, and HasAnyKeys operations.
    • Added type casting and dynamic link library configuration for better database compatibility.

Testing

  • Verified the install_gaussdb_driver.sh script on HCE, CentOS (Hce2), Euler, and Kylin systems as a non-root user.
  • Ran the updated installation steps in README.md and wagtail_README.md to ensure the django and wagtail users can set up the environment without root privileges.
  • Executed database migrations for a Wagtail project and confirmed successful migration with [X] status.
  • Tested the GaussDBSQLCompiler by running queries involving JSONArray, JSONObject, and key transforms, ensuring correct SQL generation.
  • Validated that LD_LIBRARY_PATH is correctly set in ~/.bashrc and that ldconfig updates work for non-root users.
  • Ran the test suite with DJANGO_VERSION=stable/5.2.x python run_testing_worker.py and confirmed all tests pass.

@5xuanwen 5xuanwen merged commit 8f88834 into HuaweiCloudDeveloper:5.2.0 Oct 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants