[PRODCRE-1483] obs stack fixed location #2331
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this change we'd always extract observability files to a fixed location:
~/./local/share/ctfinstead of to the current directory. Why? So that we can executeobs/bscommands in different contexts.Currently, if you run
ctf obs uin one folder, then teardown viactf obs drun 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 theupcommand 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
CTFCacheDirrepresenting the directory path.local/share/ctffor storing observability files.getObservabilityDirto construct and return the observability directory path based on the user's home directory.extractAllFilesfunction to extract files into the observability directory instead of the current directory.BlockScoutUp,BlockScoutDown,ObservabilityUpOnlyLoki,ObservabilityUp, andObservabilityUpFullfunctions to use the observability directory for operations.ObservabilityDownfunction to remove resources from the new observability directory structure.