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

load extensions during compile time using go build tags #350

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

charithabandi
Copy link
Contributor

@charithabandi charithabandi commented Oct 13, 2023

With the changes in the PR, the action extensions can be loaded and baked into kwild during compile time.
We still support remote extensions, that users can create and deploy using docker.
Support for users to create extensions locally and register them to the extension registry.

Included maths extensions with build tag "ext_test", it's similar to the existing remote math extension. Updated the test scripts to create instances and execute methods on both local "maths" and remote "math" extensions.

@charithabandi charithabandi force-pushed the repo-refactor branch 3 times, most recently from 21bfcbe to c060fdb Compare October 13, 2023 19:21
@charithabandi charithabandi changed the title Repo refactor load extensions during compile time using go build tags Oct 13, 2023
@charithabandi charithabandi force-pushed the repo-refactor branch 2 times, most recently from f31bdfc to 10f07f4 Compare October 13, 2023 22:13
@charithabandi charithabandi force-pushed the repo-refactor branch 3 times, most recently from 452b501 to 69fd3e0 Compare October 16, 2023 16:35
@charithabandi charithabandi marked this pull request as ready for review October 16, 2023 16:35
extensions/actions/math.go Outdated Show resolved Hide resolved
extensions/actions/remote_extensions.go Outdated Show resolved Hide resolved
test/acceptance/test-data/test_db.kf Outdated Show resolved Hide resolved
@brennanjl
Copy link
Collaborator

A few pieces of feedback:

  • Some things, particularly regarding remote extensions, should be in internal, and not extensions/action. If the client doesn't need it, then it should go in internal.

  • I can see that a lot of code was ported over / used from the https://github.com/kwilteam/kwil-extensions repo. I think this is fine, but we should either:

a. have an extensions/action/utils repo, where this is contained, or
b. include it all in one file.

The expectation right now is that a user would register by importing a file and registering it here. Having many files that implement the functionality that they need to navigate around is weird.

  • The math extension example should be given a build tag. We don't want a random math extension included in all of our builds.

@charithabandi charithabandi force-pushed the repo-refactor branch 4 times, most recently from 8dd0134 to a2cc5ad Compare October 20, 2023 16:00
Copy link
Member

@jchappelow jchappelow left a comment

Choose a reason for hiding this comment

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

Sorry, this is an incomplete and speculative review. I will return to it asap.

go.mod Outdated Show resolved Hide resolved
internal/extensions/driver.go Outdated Show resolved Hide resolved
extensions/actions/extension.go Outdated Show resolved Hide resolved
internal/extensions/instance.go Outdated Show resolved Hide resolved
internal/extensions/driver.go Outdated Show resolved Hide resolved
internal/extensions/instance.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
extensions/actions/math.go Outdated Show resolved Hide resolved
extensions/actions/extension_registry.go Show resolved Hide resolved
@charithabandi charithabandi force-pushed the repo-refactor branch 2 times, most recently from 18b52e6 to 2dddabf Compare October 26, 2023 21:40
@charithabandi charithabandi merged commit 0238803 into main Oct 26, 2023
2 checks passed
@charithabandi charithabandi deleted the repo-refactor branch October 26, 2023 22:32
@jchappelow jchappelow added this to the v0.6.0 milestone Nov 6, 2023
brennanjl pushed a commit that referenced this pull request Feb 26, 2024
* load extensions during compile time using go build tags

* remove scalar values and Extension struct for local extensions
brennanjl pushed a commit that referenced this pull request Feb 26, 2024
* load extensions during compile time using go build tags

* remove scalar values and Extension struct for local extensions
jchappelow pushed a commit that referenced this pull request Feb 26, 2024
* load extensions during compile time using go build tags

* remove scalar values and Extension struct for local extensions
brennanjl pushed a commit that referenced this pull request Feb 26, 2024
* load extensions during compile time using go build tags

* remove scalar values and Extension struct for local extensions
brennanjl pushed a commit that referenced this pull request Feb 26, 2024
* load extensions during compile time using go build tags

* remove scalar values and Extension struct for local extensions
brennanjl pushed a commit that referenced this pull request Feb 26, 2024
* load extensions during compile time using go build tags

* remove scalar values and Extension struct for local extensions
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.

3 participants