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

feat: enable retrieving logs from services in stopped enclaves #1213

Merged
merged 5 commits into from Aug 31, 2023

Conversation

tedim52
Copy link
Contributor

@tedim52 tedim52 commented Aug 31, 2023

Description:

Enables retrieving logs in stopped enclaves.

Context:
Logs were stored/enclave uuid/service uuid.json. When an enclave is running, id logic translates shortened uuids and service names to service uuid. However when an enclave is stopped, the service identifier information is lost and that translation isn't possible so users wouldn't be able to retrieve logs from a stopped enclave via the service name or shortened uuid.

Adjusting the id logic would've required a larger refactor to persist service id info beyond enclave lifecycle.
This PR implements a cheaper solution - store logs /enclave uuid/service uuid.json, as well as /enclave uuid/service name.json and /enclave uuid/service short uuid.json, with the tradeoff of tripling log storage. I've added a TODO to develop a better solution.

Is this change user facing?

YES

@tedim52 tedim52 requested a review from Peeeekay August 31, 2023 14:48
@tedim52 tedim52 enabled auto-merge (squash) August 31, 2023 19:46
@tedim52 tedim52 merged commit 83c269c into main Aug 31, 2023
29 checks passed
@tedim52 tedim52 deleted the tedi/stopped-enclaves branch August 31, 2023 19:59
gbouv pushed a commit that referenced this pull request Sep 1, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.82.17](0.82.16...0.82.17)
(2023-09-01)


### Features

* enable retrieving logs from services in stopped enclaves
([#1213](#1213))
([83c269c](83c269c))
* Pass enclave name to Starlark global `kurtosis` module
([#1216](#1216))
([c5f2c97](c5f2c97))
* Persist runtime value store
([#1170](#1170))
([cfec9b3](cfec9b3))
* track the analytics toggle event
([#1217](#1217))
([10c461f](10c461f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
tedim52 added a commit that referenced this pull request Oct 6, 2023
## Description:
Due to this [PR](#1213),
the logs aggregator stores duplicate log files which causes log storage
to grow quickly. This change prevents storing duplicate logs by
periodically replacing the duplicate log files with symlinks to a single
log file. This allows logs to still be retrievable from stopped enclaves
using any service identifier without increasing log storage.

Also includes a small refactor to use a better supported pkg
(`spf13/afero`) to mock the filesystem that cleans up logging unit tests
quite a bit.


## Is this change user facing?
NO

## References:
#1213
#1394
#1459
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants