Skip to content

GSoC 18 Summary

RamyElkest edited this page Aug 13, 2018 · 7 revisions

Introduction

In April 2018 I was accepted as part of the Google Summer of Code program to work with libvirt on generating nodejs bindings for the C libvirt API (see here for more details).

With Martin Kletzander and Erik Skultety as my mentors, I've worked over the following three months on this repository to aiming for our goal.

Weekly updates

Weekly updates (including what was done and links to PRs) can be found here. (thanks to a suggestion by mentors).

I've included it here for convenience

Week 1 (May 14)


Week 2 (May 21)


Week 3 (May 28)


Week 4 (June 4)

  • Created a PR to create generation infrastructure, this includes
    • A generator script that (for now) just outputs the previous manual code to files
    • A bunch of npm scripts to:
      • check libvirt version / api xmls / etc.
      • run the generate script
      • install and test
    • a makefile to wrap the npm scripts
  • Created proof of concept for defining js interface using node-addon-api (wrapping c++ objects).
  • My main aim was to highlight that we can arrive to something like this where with a bit of framework forwarding calls is a(n easily generatable) one liner
    • However I still stand by our decision to expose the API as a JS API. I think we're now in a good position to fill out the JS vs. C(++) API design decision
  • I tried to get in touch with the node-libvirt contributors in hope to schedule a few minutes to discuss any difficulties/hacks they had etc. however no response just yet.

Week 5 (June 11)

  • Repository (branch) cleanup to move things along
  • Created travis CI to run on PRs
  • Opened PR for initial Override and manual infrastructure to enable overridding generated functions (although we don't have the generated stubs yet)
  • Committed manual implementation of virConnectClose and partial virConnectRegisterCloseCallback (but still requires some work before PR)..
  • (Started work on API parser, but nothing useful yet)

Week 6 (June 18)


Week 7 (June 25)

  • Refactoring generators
  • Following functions are now generated using the parser and a whitelist with Generating most manual functions
    • virConnectOpen
    • virConnectClose
    • virDomainLookupByName
    • virDomainGetID
    • virDomainGetURI

Week 8 (July 2)


Week 9 (July 9)


Week 10 (July 16) & Week 11 (July 23)

  • Major refactoring to allow:
    • Adding file dependencies at runtime
    • Adding ability to override default generators (and manual implementations)
    • Adding support to generate library level functions (eg. libvirt.open, etc.)
    • Adding support to generated enums at library level
  • Started Architecture documentation

Week 12 (July 30)


Final Week (Aug 6)

Final Deliverable

The gsoc18 branch represents a frozen snapshot of the final deliverable for GSoC18.

What's pending

Although this is a solid step in the right direction, there's still plenty to be done for this project.

  • sanitytest.js currently reports ~65% of functions have been generated. We need more work to get this closer to 100%.
  • Issues that have been raised which need to be addressed.
  • It would be good to get it battle-tested before hitting v1.0.0. Through additional tests and additional users.
  • The milestones page highlights some potentially beneficial future improvements like an async API and typescript interface definitions.
Clone this wiki locally