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

pgx mirage #78

Merged
merged 15 commits into from
May 4, 2020
Merged

pgx mirage #78

merged 15 commits into from
May 4, 2020

Conversation

anuragsoni
Copy link
Contributor

@anuragsoni anuragsoni commented May 3, 2020

TODO

  • Update CI to build/test that the unikernel works
  • Add documentation for how to build/run the unikernel example

Closes #67

@anuragsoni anuragsoni marked this pull request as draft May 3, 2020 00:22
@coveralls
Copy link

coveralls commented May 3, 2020

Coverage Status

Coverage increased (+0.9%) to 69.302% when pulling 11c3adf on try-pgx-mirage into b8a81c2 on master.

@anuragsoni anuragsoni changed the title Try pgx mirage pgx mirage May 3, 2020
@anuragsoni anuragsoni marked this pull request as ready for review May 3, 2020 03:07
@anuragsoni
Copy link
Contributor Author

Tested manually by running the example unikernel against a postgres instance running on google cloud.

@anuragsoni anuragsoni force-pushed the try-pgx-mirage branch 3 times, most recently from 5a8a32c to 1232d90 Compare May 3, 2020 16:32
pgx_lwt/src/pgx_lwt.ml Show resolved Hide resolved
pgx_lwt/src/s.ml Outdated

module type Pgx_impl = sig
include Pgx.S with type 'a IO.t = 'a Lwt.t
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? Isn't this just Pgx.S with type IO.t := Lwt.t?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I had initially done this as i need to return a first class module from the pgx_lwt_mirage.connect function and parameterized types aren't supported for packed modules. But I didn't realize that I can just create a temporary alias inside the mirage backend an then i won't need to create this temporary instance. I'll update the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The module alias is now just Pgx_lwt.S and is shared across the different lwt backends

@@ -0,0 +1,28 @@
(* Draft for cherry-picking into pgx.
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this came from when i copied the license header from the gist linked to in the issue for mirage. I wasn't sure what content i'm allowed to touch in such situation

Copy link
Contributor

Choose a reason for hiding this comment

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

We can edit this comment as long as we leave the license block alone and only add to the copyright section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the header to remove the comment about cherry-picking

@@ -1,3 +1,3 @@
(library
(name pgx_test)
(libraries alcotest base64 pgx))
(libraries alcotest base64 pgx pgx_value_core))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does Pgx_test need a dependency on this? I thought Pgx_value_core handled its own testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should be removed. I'll update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now removed

pgx_lwt/src/pgx_lwt.mli Outdated Show resolved Hide resolved
pgx/src/pgx.ml Outdated
@@ -471,7 +471,8 @@ module type IO = Io_intf.S
module type S = Pgx_intf.S

module Make (Thread : IO) = struct
open Thread
module IO = Thread
open IO
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for this change? It looks like it creates a bunch of downstream complexity (like the Pgx_lwt.Io_intf module) but doesn't seem to change anything else?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we did this to accomidate Pgx_lwt, but I think we should keep our interface here simple and let Pgx_lwt do more complicated things to generate the interface if necessary. I'll try to make an example.

Copy link
Contributor

@brendanlong brendanlong left a comment

Choose a reason for hiding this comment

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

Nevermind, this looks good

@anuragsoni anuragsoni merged commit ff5a4aa into master May 4, 2020
@anuragsoni anuragsoni deleted the try-pgx-mirage branch May 4, 2020 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mirage support
3 participants