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

WIP: Speed up build #2041

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

WIP: Speed up build #2041

wants to merge 1 commit into from

Conversation

oscarkraemer
Copy link
Collaborator

@oscarkraemer oscarkraemer commented Mar 25, 2024

Proposed changes

  • This changes tires to speed up the build process.
  • It assumes that requirements.txt will seldom be changed and therefor it can use a cached version.
  • Removing the git clone, as far as I can see there is no use of this clone BUT I might be wrong.
  • There should be no changes to https://csc-guide-preview.rahtiapp.fi/origin/testing-speedup/
  • It assumes that the /docs will be changed most frequently and therefor everything that is dependent on it is removed to the end of the Dockerfile

Checklist before requesting a review

  • I have followed the instructions in the Contributing and Styleguide documents.
  • My pull request passes all tests.
  • I have included a link to the appropriate preview page (select your branch from the list).

Comment on lines -25 to -29
RUN git clone --no-checkout https://github.com/CSCfi/csc-user-guide git_folder && \
if [ -d ".git" ]; then rm -r .git; fi && \
mv git_folder/.git . && \
rm -r git_folder && \
git reset HEAD --hard && \
Copy link
Member

Choose a reason for hiding this comment

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

AFAIK this is still needed to generate the modification dates in the pages.

Screenshot from 2024-03-25 14-27-51

Copy link
Member

Choose a reason for hiding this comment

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

Which is not present in the build done by Rahti BC. Keep in mind that the preview and the production are very different processes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤔 the git log says that the page was modified March 7 2023.

The Last update seems to be the same on the feature branch as well as master:
https://csc-guide-preview.rahtiapp.fi/origin/testing-speedup/cloud/
https://docs.csc.fi/cloud/

There is of course something that I still might be missing.

I'm also wondering that IF it is still needed maybe it would be possible to use ADD --keep-git-dir=true instead of COPY . /tmp

Copy link
Member

Choose a reason for hiding this comment

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

In a Build config OpenShift clones the code automatically but removes the .git directory before starting to run Dockerfile. I can prepare a demo example later today/tomorrow.

@rkronberg rkronberg added the on hold This is waiting for some specific event before it can be merged label Jul 4, 2024
@rkronberg rkronberg changed the title Speed up build WIP: Speed up build Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold This is waiting for some specific event before it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants