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: Allow lens runtime selection via config #2684

Conversation

AndrewSisley
Copy link
Contributor

@AndrewSisley AndrewSisley commented Jun 4, 2024

Relevant issue(s)

Resolves #2683

Description

Allows lens runtime selection via config/cli param.

Also adds CI jobs to the matrix to test wasmer and wazero. I was hoping it would solve the windows build issue, but still no joy there :(

@AndrewSisley AndrewSisley added feature New feature or request area/schema Related to the schema system area/testing Related to any test or testing suite code quality Related to improving code quality labels Jun 4, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.12 milestone Jun 4, 2024
@AndrewSisley AndrewSisley self-assigned this Jun 4, 2024
@AndrewSisley AndrewSisley marked this pull request as draft June 4, 2024 16:57
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 61.81818% with 21 lines in your changes missing coverage. Please review.

Project coverage is 78.13%. Comparing base (25fc07d) to head (f9b6026).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2684      +/-   ##
===========================================
- Coverage    78.16%   78.13%   -0.03%     
===========================================
  Files          303      308       +5     
  Lines        23052    23081      +29     
===========================================
+ Hits         18018    18034      +16     
- Misses        3674     3680       +6     
- Partials      1360     1367       +7     
Flag Coverage Δ
all-tests 78.13% <61.82%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
internal/db/config.go 100.00% <ø> (ø)
internal/db/db.go 65.74% <100.00%> (+0.65%) ⬆️
internal/lens/registry.go 82.89% <100.00%> (+0.73%) ⬆️
cli/server_dump.go 25.00% <0.00%> (ø)
cli/start.go 45.69% <0.00%> (-0.40%) ⬇️
http/client_lens.go 0.00% <0.00%> (ø)
internal/lens/txn_registry.go 48.98% <66.67%> (+4.98%) ⬆️
node/lens_wasmer.go 50.00% <50.00%> (ø)
node/lens_wasmtime.go 66.67% <66.67%> (ø)
node/lens_wazero.go 50.00% <50.00%> (ø)
... and 3 more

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25fc07d...f9b6026. Read the comment docs.

@AndrewSisley AndrewSisley force-pushed the 2683-allow-lens-runtime-config branch 10 times, most recently from 4aaae15 to 6cf51d6 Compare June 4, 2024 20:22
Copy link
Contributor

@islamaliev islamaliev left a comment

Choose a reason for hiding this comment

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

LGTM! I just have some minor change requests

Comment on lines +67 to +71
- os: ubuntu-latest
client-type: go
database-type: badger-memory
mutation-type: collection-save
lens-type: wazero
Copy link
Contributor

Choose a reason for hiding this comment

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

question: didn't you mention in the description that you added wazero with Windows?

Copy link
Contributor Author

@AndrewSisley AndrewSisley Jun 5, 2024

Choose a reason for hiding this comment

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

Yeah, I'm pretty sure I updated the description yesterday once I failed to get that working in the CI - doesn't seem to have saved though. I've (re?) updated the description.

type LensRuntimeType string

const (
DefaultLens LensRuntimeType = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: please give it a reasonable value of add a documentation why there is only 1 value here and why it has to be empty string.

Copy link
Contributor Author

@AndrewSisley AndrewSisley Jun 5, 2024

Choose a reason for hiding this comment

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

Will do

  • Doc default + map

node/lens.go Show resolved Hide resolved
@AndrewSisley AndrewSisley force-pushed the 2683-allow-lens-runtime-config branch 3 times, most recently from 17150d0 to 87f8e0e Compare June 5, 2024 15:11
The node setup is far more powerful, and the new WithRuntime func will allow selecting the runtime via the CLI
@AndrewSisley AndrewSisley force-pushed the 2683-allow-lens-runtime-config branch from 87f8e0e to 6916237 Compare June 5, 2024 15:11
@AndrewSisley AndrewSisley force-pushed the 2683-allow-lens-runtime-config branch 2 times, most recently from 71b5046 to e53d161 Compare June 5, 2024 16:10
@AndrewSisley AndrewSisley marked this pull request as ready for review June 5, 2024 16:11
@AndrewSisley AndrewSisley requested a review from a team June 5, 2024 16:11
Copy link
Member

@nasdf nasdf left a comment

Choose a reason for hiding this comment

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

LGTM. Nice to see the node options expanded. One small documentation todo.

@@ -126,6 +126,7 @@ func MakeStartCommand() *cobra.Command {
http.WithAllowedOrigins(cfg.GetStringSlice("api.allowed-origins")...),
http.WithTLSCertPath(cfg.GetString("api.pubKeyPath")),
http.WithTLSKeyPath(cfg.GetString("api.privKeyPath")),
node.WithLensRuntime(node.LensRuntimeType(cfg.GetString("lens.runtime"))),
Copy link
Member

Choose a reason for hiding this comment

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

todo: can you add an entry to docs/config.md for this?

Copy link
Contributor Author

@AndrewSisley AndrewSisley Jun 5, 2024

Choose a reason for hiding this comment

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

Will do, thanks Keenan!

  • Have a look at config.md and add an entry

@AndrewSisley AndrewSisley force-pushed the 2683-allow-lens-runtime-config branch from 0ab2c8c to e53d161 Compare June 5, 2024 17:06
@AndrewSisley AndrewSisley requested a review from nasdf June 5, 2024 17:11
Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

LGTM

Adding these new required job names to merge the PR

@AndrewSisley AndrewSisley merged commit dd0e5af into sourcenetwork:develop Jun 5, 2024
36 of 37 checks passed
@AndrewSisley AndrewSisley deleted the 2683-allow-lens-runtime-config branch June 5, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema Related to the schema system area/testing Related to any test or testing suite code quality Related to improving code quality feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow configuration of Lens runtime type
4 participants