Draft: Pass special gcsfuse app-name in mounts from CTK blueprints#5240
Draft: Pass special gcsfuse app-name in mounts from CTK blueprints#5240gargnitingoogle wants to merge 2 commits intoGoogleCloudPlatform:developfrom
Conversation
This ensures the substring 'ctk' in all gcsfuse mounts created using cluster-toolkit. GCSFuse mounts created this way have 'ctk' in the useragent fields in all the GCS calls, which can be used to measure the GCS traffic coming from gcsfuse mounts created using cluster-toolkit. This will be used by GCSFuse team for their usage and impact study.
Summary of ChangesHello @gargnitingoogle, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces changes across several scripts to ensure that Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to add a special app-name to gcsfuse mount options for tracking purposes. The implementation is consistent across a Python script and two shell scripts. My review has identified a critical bug in the Python script where an f-string was missed, which would prevent the feature from working correctly. I've also pointed out several debug statements that should be removed before merging and suggested a minor improvement to a regular expression in the shell scripts for better readability. Overall, the changes are logical, and all identified issues should be addressed.
| break | ||
|
|
||
| if not app_name_found: | ||
| mount_options.append("app_name={ctk_tag}") |
There was a problem hiding this comment.
There appears to be a bug in this line. You are using a standard string, but it seems an f-string was intended to interpolate the ctk_tag variable. As written, it will append the literal text app_name={ctk_tag}.
| mount_options.append("app_name={ctk_tag}") | |
| mount_options.append(f"app_name={ctk_tag}") |
|
|
||
| if fs_type == "gcsfuse": | ||
| ctk_tag="ctk-from-python" | ||
| log.info(f"DEBUG [setup_network_storage.py]: fs_type={fs_type} mount_options={mount_options}") |
|
|
||
| if [ "${FS_TYPE}" = "gcsfuse" ]; then | ||
| ctk_tag="ctk-from-mount-sh" | ||
| if [[ ! "${MOUNT_OPTIONS}" =~ [c,C][t,T][k,K] ]]; then |
There was a problem hiding this comment.
|
|
||
| if [ "${FS_TYPE}" = "gcsfuse" ]; then | ||
| ctk_tag="ctk-from-sh" | ||
| echo "DEBUG [mount.sh]: Before logic fs_type=${FS_TYPE} mount_options=${MOUNT_OPTIONS}" |
| if [ "${FS_TYPE}" = "gcsfuse" ]; then | ||
| ctk_tag="ctk-from-sh" | ||
| echo "DEBUG [mount.sh]: Before logic fs_type=${FS_TYPE} mount_options=${MOUNT_OPTIONS}" | ||
| if [[ ! "${MOUNT_OPTIONS}" =~ [c,C][t,T][k,K] ]]; then |
There was a problem hiding this comment.
|
/gcbrun |
Submission Checklist
NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.