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

OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book #87375

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

mramendi
Copy link
Contributor

@mramendi mramendi commented Jan 21, 2025

For https://issues.redhat.com/browse/OSDOCS-13186

Version(s):

4.12, 4.13, 4.14, 4.15, 4.16, 4.17, 4.18

Issue:

OSDOCS 13186

Link to docs preview:

N/A

QE review:
N/A

Additional information:

This is a modification to the build_for_portal.py script, not to the documentation

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 21, 2025
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Jan 21, 2025

🤖 Wed Jan 22 13:46:12 - Prow CI generated the docs preview:

https://87375--ocpdocs-pr.netlify.app/

@gaurav-nelson
Copy link
Contributor

This is a significant improvement.
It brought down the size of the drupal-build dir from 3.5G to 106M. I also noticed faster processing of the script as well. Amazing work.

Copy link
Contributor

@aireilly aireilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work, this is going to be a great optimzation! 🥳

Added some nit comments but also a question regarding the imagefiles array that I think needs to be addressed.

# ADDED 21 Jan 2025: selective processing of images
# the set of file names is to be stored in imagefiles
# The initial value includes images defined in attributes (to copy every time)
imagefiles = {"kebab.png","app-launcher.png","red-hat-applications-menu-icon.jpg","delete.png"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we hard coding these values, and is there a risk that we miss new additions going forward? Also, are these uniform across all branches? Maybe we need to scan the attributes folder for images.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed the logic more carefully and realized that the prepopulation is unnecessary as the attributes file is scanned as part of looping through the includes. Regression testing showed that if I removed the prepopulation, the only difference was the disappearance of these four images from the API books, which otherwise have no images at all; a build-test of these books using asciidoctor-pdf shows that no issues are caused by removing these images.

build_for_portal.py Outdated Show resolved Hide resolved
build_for_portal.py Outdated Show resolved Hide resolved
@aireilly
Copy link
Contributor

aireilly commented Jan 22, 2025

Yes this is going to significantly speed up Prow too.

Local testing, got these results:

Current script:

real	**2m27.283s**
user	0m0.787s
sys	0m2.232s

Updated script:

real	**1m23.474s**
user	0m0.673s
sys	0m2.960s

…icate the entire image directory for every book
@aireilly
Copy link
Contributor

/lgtm great work. Will merge and CP as you see fit.

Copy link

openshift-ci bot commented Jan 22, 2025

@mramendi: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@aireilly aireilly merged commit d4b5f0f into openshift:main Jan 23, 2025
2 checks passed
@aireilly
Copy link
Contributor

Some older changes need to be CPd. Working on those now.

@aireilly
Copy link
Contributor

/cherry-pick enterprise-4.12

@aireilly
Copy link
Contributor

/cherry-pick enterprise-4.13

@aireilly
Copy link
Contributor

/cherry-pick enterprise-4.14

@aireilly
Copy link
Contributor

/cherry-pick enterprise-4.15

@aireilly
Copy link
Contributor

/cherry-pick enterprise-4.16

@aireilly
Copy link
Contributor

/cherry-pick enterprise-4.17

@aireilly
Copy link
Contributor

/cherry-pick enterprise-4.18

@openshift-cherrypick-robot

@aireilly: #87375 failed to apply on top of branch "enterprise-4.12":

Applying: OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book
Using index info to reconstruct a base tree...
M	build_for_portal.py
Falling back to patching base and 3-way merge...
Auto-merging build_for_portal.py
CONFLICT (content): Merge conflict in build_for_portal.py
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book

In response to this:

/cherry-pick enterprise-4.12

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

@aireilly: #87375 failed to apply on top of branch "enterprise-4.13":

Applying: OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book
Using index info to reconstruct a base tree...
M	build_for_portal.py
Falling back to patching base and 3-way merge...
Auto-merging build_for_portal.py
CONFLICT (content): Merge conflict in build_for_portal.py
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book

In response to this:

/cherry-pick enterprise-4.13

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

@aireilly: #87375 failed to apply on top of branch "enterprise-4.14":

Applying: OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book
Using index info to reconstruct a base tree...
M	build_for_portal.py
Falling back to patching base and 3-way merge...
Auto-merging build_for_portal.py
CONFLICT (content): Merge conflict in build_for_portal.py
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book

In response to this:

/cherry-pick enterprise-4.14

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

@aireilly: #87375 failed to apply on top of branch "enterprise-4.15":

Applying: OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book
Using index info to reconstruct a base tree...
M	build_for_portal.py
Falling back to patching base and 3-way merge...
Auto-merging build_for_portal.py
CONFLICT (content): Merge conflict in build_for_portal.py
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book

In response to this:

/cherry-pick enterprise-4.15

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

@aireilly: #87375 failed to apply on top of branch "enterprise-4.16":

Applying: OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book
Using index info to reconstruct a base tree...
M	build_for_portal.py
Falling back to patching base and 3-way merge...
Auto-merging build_for_portal.py
CONFLICT (content): Merge conflict in build_for_portal.py
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book

In response to this:

/cherry-pick enterprise-4.16

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

@aireilly: #87375 failed to apply on top of branch "enterprise-4.17":

Applying: OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book
Using index info to reconstruct a base tree...
M	build_for_portal.py
Falling back to patching base and 3-way merge...
Auto-merging build_for_portal.py
CONFLICT (content): Merge conflict in build_for_portal.py
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 OSDOCS 13186 modify build_for_portal.py to detect images and not duplicate the entire image directory for every book

In response to this:

/cherry-pick enterprise-4.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

@aireilly: #87375 failed to apply on top of branch "enterprise-4.18":

Patch is empty.
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To record the empty patch as an empty commit, run "git am --allow-empty".
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"

In response to this:

/cherry-pick enterprise-4.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@aireilly
Copy link
Contributor

@mramendi Argh. forgot about this. #81148

When these CPS get merged, we will go again here.

@aireilly
Copy link
Contributor

Not sure why the CPs are failing now. You will have to do manual CPs to get these changes into enterprise branches.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants