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

Merge support for binary modules #96

Closed
johnnyman727 opened this issue May 5, 2015 · 12 comments
Closed

Merge support for binary modules #96

johnnyman727 opened this issue May 5, 2015 · 12 comments
Assignees

Comments

@johnnyman727
Copy link
Contributor

@allanca has done quite a bit of work on this already and has an outstanding PR on the original CLI. We need to get this merged into the Tessel 2 CLI and the remote server set up.

@johnnyman727
Copy link
Contributor Author

@wprater Here's the order of operations:

  • The CLI needs to iterate through node_module dependencies and find those with binary dependencies. You can do that either by finding a bindings.gyp or checking for nan or bindings in the package.json dependencies. Here is an example.
  • Ping an S3 server to fetch each of the dependency binaries. I can set this up when you're ready or you can use a test server you have access to until this is about ready to merge. We'll need to figure out how to make the server accessible by all Team Members.
  • Inject them into the CLI tarball. It will need to happen between when we locate the entry point to the project and when we deploy it.

Bonus Points:

  • If the binary dependency is not on the server already, have the t2-cli send a request to another server to run t2-compiler to create that dependency and then save it on the S3 instance with the rest of the deps. Once it's done, inject that binary into the tarball like normal.

You'll need to to use the t2-compiler for creating binary dependencies to test with. Feel free to ping @tcr if you have any issues with that.

@rwaldron
Copy link
Contributor

@wprater any updates?

@rwaldron
Copy link
Contributor

I'm going to look at the deploy routines and see where I can expose the data needed for this

@rwaldron
Copy link
Contributor

@johnnyman727 I've updated your list above to indicate items that function (which is only the first). The Third item is in progress, using dummy tarballs.

@rwaldron rwaldron assigned rwaldron and unassigned wprater Nov 20, 2015
@johnnyman727
Copy link
Contributor Author

👍

rwaldron added a commit to rwaldron/t2-cli that referenced this issue Dec 2, 2015
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Dec 2, 2015
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Dec 15, 2015
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Dec 17, 2015
@Student007
Copy link
Member

@johnnyman727, @tcr or @rwaldron when I use t2 compile I get a tgz what includes a folder Release containing binding.node

If I like to use a binary on the current implementation of the t2-cli to push/run code on the Tessel 2 - what is necessary to do with the result of the t2 compiler ?

I would assume, manually edit the package.json what is generated by t2 init and copy the tgz to ... ??
Was reading https://github.com/mapbox/node-pre-gyp#2-add-a-new-target-to-bindinggyp but I am still a little bit unsure and confused. Maybe someone could give me a hint.
Also for handling deeper dependencies. For instance the noble package for USB Bluetooth LE has a binary dependency bluetooth-hci-socket so I have to rework the node_package/noble/package.json and replace theoptionalDependencies: bluetooth-hci-socket by something like

{
      "target_name": "action_after_build",
      "type": "none",
      "dependencies": [ "<(module_name)" ],
      "copies": [
        {
          "files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
          "destination": "<(module_path)"
        }
      ]
    }

does it work to manually use pre-compiled binaries or is the t2 run index.js --full not handling pre-compiled binaries the right way at the moment ?

@rwaldron
Copy link
Contributor

rwaldron commented Jan 4, 2016

@Student007 support has not landed yet.

@Student007
Copy link
Member

@rwaldron means at the moment I am required to copy this via scp to test my binary packages ... ok.

For others ask this: Well, I think a good trick will be to login to the vagrant vm and do npm install <your hole Tessel projekt> after scp it to the vagrant VM and copy the result (as tgz) via scp to the Tessel 2 ...
@rwaldron thanks for your great work - also when it is not landed yet - I read cross the code and saw your work 👏 !!

@rwaldron
Copy link
Contributor

rwaldron commented Jan 4, 2016

means at the moment I am required to copy this via scp to test my binary packages ... ok.

Yes, it's clumsy, but soon you won't have to do any t2 compile at all, it will be done ahead of time on a host server :)

And thanks!! :)

@Student007
Copy link
Member

@rwaldron need this currently for an lecture exam presentation - so I try to do it manually - your solution is a great thing and will grow minds ... about npms future ...

Maybe later we should describe the way binary developers could use a private installation with a changed binary server within the t2-cli... the reason is simple: It is not a good idea to publish untested solutions - but people will like to develop sensors/actuators directly for the Tessel-Community maybe ... so they should know how to do

(later ... it is a task for the future - but important for public trust - also).

@rwaldron
Copy link
Contributor

rwaldron commented Jan 4, 2016

Yeah, I definitely see the value there. We can visit that once we have more experience with pre compiled modules on T2 in practice :)

@Student007
Copy link
Member

👍

rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 5, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 5, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 6, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 6, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 6, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 6, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 6, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 7, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 7, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 7, 2016
rwaldron added a commit to rwaldron/t2-cli that referenced this issue Jan 7, 2016
johnnyman727 added a commit that referenced this issue Jan 11, 2016
WIP: Binary module inclusion support. Closes gh-96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants