Skip to content

Spin Factors - #2519

Closed
lann wants to merge 22 commits into
spinframework:mainfrom
lann:factors
Closed

Spin Factors#2519
lann wants to merge 22 commits into
spinframework:mainfrom
lann:factors

Conversation

@lann

@lann lann commented May 20, 2024

Copy link
Copy Markdown
Collaborator

ref #2518

This has been turned into the factors branch

@lann lann mentioned this pull request May 21, 2024
@lann
lann force-pushed the factors branch 3 times, most recently from 86f4bb7 to f1dc5ed Compare May 23, 2024 13:03
Comment thread crates/core/src/lib.rs
Comment thread crates/factor-outbound-networking/src/lib.rs Outdated
Comment thread crates/factor-outbound-networking/src/lib.rs Outdated
Comment thread crates/factor-outbound-networking/src/lib.rs Outdated
.component_allowed_hosts
.get(ctx.app_component().id())
.cloned()
.context("missing component allowed hosts")?;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This error message is a bit weak. Perhaps:

Suggested change
.context("missing component allowed hosts")?;
.with_context(|| format!("missing allowed outbound hosts configuration for component {}", ctx.app_component().id()))?;

Comment thread crates/factor-outbound-networking/src/lib.rs Outdated
Comment thread crates/factor-outbound-networking/src/lib.rs Outdated
Comment thread crates/factor-wasi/src/lib.rs
Comment thread crates/factors/src/lib.rs Outdated
Comment thread crates/factors/src/factor.rs Outdated
Comment thread crates/factor-wasi/src/lib.rs Outdated
Comment thread crates/factors/src/spin_factors.rs Outdated
Comment thread crates/factors/src/runtime_config.rs Outdated
Comment thread crates/factors/src/runtime_config.rs Outdated
Comment thread crates/factors/src/factor.rs Outdated
Comment thread crates/factor-outbound-networking/src/lib.rs Outdated
Comment thread crates/factors/src/factor.rs Outdated
Comment thread crates/factors/src/factor.rs Outdated
Comment thread crates/factors/src/factor.rs Outdated
Comment thread crates/factors/src/factor.rs Outdated
Comment thread crates/factor-variables/src/provider_type.rs Outdated
Comment thread crates/factor-variables/src/provider_type.rs Outdated
Comment thread crates/factor-variables/src/provider_type.rs Outdated
Comment thread crates/factor-variables/src/provider_type.rs
Comment thread crates/factors/src/prepare.rs Outdated
}
}

pub trait SelfInstanceBuilder: 'static {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This and DefaultInstanceBuilder are nice, but I'm not convinced they're worth it. It seems like they might make things harder to understand in order to save a few lines of boilerplate...

Comment thread crates/factors/src/runtime_factors.rs Outdated
/// The default implementation returns an empty schema, which accepts any
/// configuration.
fn runtime_config_json_schema(&self) -> impl serde::Serialize {
HashMap::<(), ()>::new()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is somewhat of a placeholder for now, thinking about how to support #2529 (comment)

Comment thread crates/factors/src/runtime_factors.rs Outdated
Comment on lines +99 to +101
// TODO: This seems fine, but then again I don't understand why `FieldOffset`'s
// own `Sync`ness depends on `U`...
unsafe impl<T: RuntimeFactors, F1: Factor, F2: Factor> Sync for StateGetter2<T, F1, F2> {}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

A little spooky, but less spooky than what I had before...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this need to stay here? If so, can you try rewriting the comment as to why this is actually safe to do?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have a fork of field-offset that fixes it, but I'm not sure that anyone is actually maintaining upstream 😬.

If that PR doesn't get merged I'm not sure I even want to keep the dependency...

Comment thread crates/factors-derive/src/lib.rs Outdated
@lann
lann force-pushed the factors branch 2 times, most recently from eeeb140 to 6fbd5b7 Compare June 20, 2024 21:03
lann added 13 commits June 25, 2024 14:25
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
And shorten some generic params.

Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Also address a bunch of feedback.

Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
lann added 9 commits June 25, 2024 14:25
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Also sneak in Factor::runtime_config_json_schema

Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
Signed-off-by: Lann Martin <lann.martin@fermyon.com>
@lann

lann commented Jun 25, 2024

Copy link
Copy Markdown
Collaborator Author

Closing this in favor of working on the factors branch.

@lann lann closed this Jun 25, 2024
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.

2 participants