-
Notifications
You must be signed in to change notification settings - Fork 267
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
Implement CustomLogPipes
for Spin Logging/IO
#471
Conversation
@lann @itowlson @radu-matei for review~ |
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
…onfiguration Signed-off-by: danbugs <[email protected]>
e5864db
to
578a904
Compare
Note: I had to do a force push to fix commits that weren't signed-off~ I was under the impression that having a Edit: Initially I did a lazy |
578a904
to
675b211
Compare
Signed-off-by: Lann <[email protected]>
Signed-off-by: itowlson <[email protected]>
…ns (spinframework#422) * added wildcard host and a rust outbound http example * updated outbound http upstream Signed-off-by: Jiaxiao Zhou <[email protected]>
- Adds integration test for Go SDK. - Builds TinyGo examples CI will only run these tests on ubuntu because it's platform agnostic. Signed-off-by: Adam Reese <[email protected]>
Signed-off-by: itowlson <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
Signed-off-by: danbugs <[email protected]>
675b211
to
0e39baf
Compare
@danbugs Thanks for the PR! We're currently working on the 0.2 release so might not get to this until tomorrow or Monday. |
To provide an update on this from #438 (and maybe close that issue soon), it turns out that I couldn't really make the current architecture use our own pipes — As previously implied, the meat and potatoes of logging is done in
execute
:https://github.com/fermyon/spin/blob/c3ff7d90fe115daa3fa85ce3e626c738e7baef76/crates/http/src/spin.rs#L19-L59
It's there that
capture_io_to_memory
,prepare_component
(that receives redirects), and, subsequently,redirect_to_mem_buffer
are called.Considering our builder is set w/
with_engine()
, as per:https://github.com/fermyon/spin/blob/1fbfb23b4e96a580d6d4f4b6d617e916974493f1/crates/engine/src/lib.rs#L103-L119
I tried emulating the work done in
execute
in thebuild
stage similar to how thestore
does it:https://github.com/fermyon/spin/blob/0f51ad0b86b798ae18cb4f211f0c3fcfbbe9a156/crates/engine/src/lib.rs#L304-L316
... but, nothing came of it as
execute
would eventually run and override/never access myRuntimeContext
WASI context data.All and all, this PR allows users to set
CustomLogPipes
when creating theirExecutionContextConfiguration
— theseCustomLogPipes
are later accessed byexecute
and passed in tocapture_io_to_memory
(which has a side-effect onprepare_component
) providing a good and needed override of Spin's default settings.