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

ci: Use correct keys for the gitlab caches #4008

Merged
merged 8 commits into from
Jan 10, 2025

Conversation

paulgessinger
Copy link
Member

@paulgessinger paulgessinger commented Jan 9, 2025

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

Summary by CodeRabbit

  • Chores
    • Updated GitLab CI/CD cache configuration to streamline cache management during build processes.
    • Enhanced cache key generation by incorporating additional reference variables for improved specificity.
    • Excluded .gitlab-ci.yml from checks in the YAML validation process.

Copy link

coderabbitai bot commented Jan 9, 2025

Walkthrough

Refined the caching configuration, we have. In the .gitlab-ci.yml file, changes made to the build_linux_ubuntu and .linux_ubuntu_extra jobs. The cache key format, updated it is, now incorporating CLONE_URL and HEAD_REF variables. Enhance specificity, these changes do, while the overall structure remains intact. Excluded .gitlab-ci.yml from check-yaml validations in .pre-commit-config.yaml, we also did.

Changes

File Change Summary
.gitlab-ci.yml Updated cache configuration for multiple jobs, referencing new .ccache_base. Cache key and fallback keys modified to include CLONE_URL and HEAD_REF.
.pre-commit-config.yaml Excluded .gitlab-ci.yml from checks performed by the check-yaml hook.

Possibly related PRs

  • ci: Lint updates #3958: The changes in the .pre-commit-config.yaml file regarding the check-yaml hook exclusion of .gitlab-ci.yml are related to the main PR, which also modifies the .pre-commit-config.yaml to exclude the same file from checks.

Suggested labels

Infrastructure, automerge

Suggested reviewers

  • AJPfleger

Poem

Cache keys dance, like lightsabers bright 🌟
Ref and URL, now in perfect might
CI flows smooth, as the Force would decree
Yoda approves, with a knowing glee! 🤖
Caching wisdom, young padawan sees 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60a16b5 and dff2aac.

📒 Files selected for processing (1)
  • .gitlab-ci.yml (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: merge-sentinel
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: unused_files
  • GitHub Check: macos
  • GitHub Check: missing_includes
  • GitHub Check: linux_ubuntu_extra (ubuntu2204_clang, 20)
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20)
  • GitHub Check: build_debug
  • GitHub Check: linux_ubuntu
🔇 Additional comments (2)
.gitlab-ci.yml (2)

81-81: Wise, the path of centralization is.

The cache configuration, centralized it now is. DRY principles, followed they are. Approve this change, I do.

Also applies to: 114-114, 196-196, 301-301, 377-377


Line range hint 35-35: Use the Force wisely, you must. Standard GitLab variables, they are.

The HEAD_SHA variable, undefined it remains. Use CI_COMMIT_SHA instead, you should:

-    - git checkout $HEAD_SHA
+    - git checkout $CI_COMMIT_SHA

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added this to the next milestone Jan 9, 2025
andiwand
andiwand previously approved these changes Jan 9, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
.gitlab-ci.yml (2)

196-199: Improved, the cache key configuration has been, hmmmm.

More precise cache identification, this change brings. Using HEAD_REF and HEAD_SHA, better granularity in caching mechanism, we achieve. Wise choice, it is, to fall back to branch-level cache with HEAD_REF alone.

Benefits, this change brings:

  • Per-commit cache specificity, we gain
  • Branch-level fallback, we maintain
  • Cache pollution between branches, we prevent

196-199: Consistency in cache keys across all jobs, maintain we should.

Notice I do, that other jobs like build_exatrkx, build_exatrkx_cpu, .linux_ubuntu_extra, and .lcg_base_job, still use the old cache key format. Harmonize the cache configuration across all jobs, we must.

Apply this pattern to other jobs as well:

 cache:
-  key: ccache-${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}-${CCACHE_KEY_SUFFIX}
+  key: ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${HEAD_REF}-${HEAD_SHA}
   fallback_keys:
-    - ccache-${CI_JOB_NAME}-${CI_DEFAULT_BRANCH}-${CCACHE_KEY_SUFFIX}
+    - ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${HEAD_REF}-
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d37131 and 9bd2bf7.

📒 Files selected for processing (1)
  • .gitlab-ci.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: macos
  • GitHub Check: linux_ubuntu_extra (ubuntu2204_clang, 20)
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20)
  • GitHub Check: linux_ubuntu
  • GitHub Check: build_debug

.gitlab-ci.yml Outdated Show resolved Hide resolved
andiwand
andiwand previously approved these changes Jan 9, 2025
@paulgessinger
Copy link
Member Author

@andiwand let's wait to merge this until I've seen it run.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
.gitlab-ci.yml (1)

Line range hint 189-229: Active job, same weakness it has.

In the active build job, the same issue persists. At line 214, HEAD_SHA variable undefined it is:

-    - git checkout $HEAD_SHA
+    - git checkout $CI_COMMIT_SHA
🧹 Nitpick comments (1)
.gitlab-ci.yml (1)

230-445: Wisdom about the path forward, share I must.

Throughout the pipeline, a pattern of issues I see:

  1. Undefined variables (HEAD_REF, HEAD_SHA) used consistently they are
  2. Many jobs commented out they are, yet share the same weakness

A path to improvement, suggest I do:

  1. Define these variables in the pipeline configuration, you must
  2. Or migrate to standard GitLab CI variables across all jobs, you should
  3. Before uncommenting jobs, fix these issues you must
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27267a5 and 7ae70f6.

📒 Files selected for processing (1)
  • .gitlab-ci.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: merge-sentinel
🔇 Additional comments (1)
.gitlab-ci.yml (1)

9-18: Undefined in the Force, these variables are. A disturbance, I sense.

The cache configuration template uses undefined variables:

  • HEAD_REF and HEAD_SHA, defined they are not
  • Standard GitLab CI variables, they are not
  • Risk of cache failures, there is

Recommend using standard GitLab CI variables:

-    - key: ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${HEAD_REF}-${HEAD_SHA}
-      fallback_keys:
-        - ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${HEAD_REF}-
-        - ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-main-
+    - key: ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
+      fallback_keys:
+        - ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${CI_COMMIT_REF_NAME}-
+        - ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-main-

.gitlab-ci.yml Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Jan 9, 2025

📊: Physics performance monitoring for 26cc255

Full contents

physmon summary

@paulgessinger
Copy link
Member Author

Ok this seems to be working now. Can you go again @andiwand?

@kodiakhq kodiakhq bot merged commit d6eb834 into acts-project:main Jan 10, 2025
44 checks passed
@acts-project-service
Copy link
Collaborator

🔴 Athena integration test results [d6eb834]

Build job with this PR failed!

Please investigate the build job for the pipeline!

@acts-project-service acts-project-service added the Breaks Athena build This PR breaks the Athena build label Jan 10, 2025
@paulgessinger paulgessinger deleted the ci/gitlab-caches branch January 10, 2025 10:12
This was referenced Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaks Athena build This PR breaks the Athena build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants