Skip to content

[PRODCRE-1483] obs stack fixed location - #2331

Merged
Tofel merged 2 commits into
mainfrom
prodcre-1483-obs-without-fs-embed
Dec 17, 2025
Merged

Tofel merged 2 commits into
mainfrom
prodcre-1483-obs-without-fs-embed

Conversation

@Tofel

@Tofel Tofel commented Dec 17, 2025 •

Copy link
Copy Markdown
Contributor

With this change we'd always extract observability files to a fixed location: ~/./local/share/ctf instead of to the current directory. Why? So that we can execute obs/bs commands in different contexts.

Currently, if you run ctf obs u in one folder, then teardown via ctf obs d run in another directly won't work, because Docker compose file will be missing. With the change commands become independent of execution context. Plus they limit the possibility of committing extracted files by mistake, if the up command was run in repo, that doesn't have these files in .gitignore.


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes centralize and organize observability resources into a user's home directory, improving file management and accessibility. This standardization simplifies navigating, updating, and maintaining observability components by having a consistent directory structure across different environments.

What

  • framework/observability.go
    • Added a constant CTFCacheDir representing the directory path .local/share/ctf for storing observability files.
    • Introduced a new function getObservabilityDir to construct and return the observability directory path based on the user's home directory.
    • Modified extractAllFiles function to extract files into the observability directory instead of the current directory.
    • Updated BlockScoutUp, BlockScoutDown, ObservabilityUpOnlyLoki, ObservabilityUp, and ObservabilityUpFull functions to use the observability directory for operations.
    • Altered ObservabilityDown function to remove resources from the new observability directory structure.

Copilot AI review requested due to automatic review settings December 17, 2025 14:15
@Tofel
Tofel requested a review from a team as a code owner December 17, 2025 14:15
@github-actions

Copy link
Copy Markdown

👋 Tofel, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the observability stack to extract files to a fixed directory in the user's home directory (~/.local/share/ctf) instead of the current working directory, and removes the cleanup of these files on teardown.

Key Changes:

  • Observability files are now extracted to ~/.local/share/ctf instead of the current working directory
  • Teardown functions no longer delete the extracted observability files
  • All observability functions now use the fixed directory path for docker compose operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread framework/observability.go Outdated
Comment thread framework/observability.go
@Tofel
Tofel merged commit 8444cb7 into main Dec 17, 2025
73 of 75 checks passed
@Tofel
Tofel deleted the prodcre-1483-obs-without-fs-embed branch December 17, 2025 16:21
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.

4 participants