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

Limit the size of the bundle to be deployed #382

Open
johnnyman727 opened this issue Oct 18, 2015 · 9 comments
Open

Limit the size of the bundle to be deployed #382

johnnyman727 opened this issue Oct 18, 2015 · 9 comments

Comments

@johnnyman727
Copy link
Contributor

Tessel has 64MB of RAM but not all 64MB are available because OpenWRT is running other processes and has some files (like /tmp) mounted in RAM.

Currently, you can try to deploy however large a bundle you'd like which could probably really mess up OpenWRT.

For now, we can check that the bundle is 32MB or less but we should eventually ask OpenWRT how much memory is free before deploying and limit it to that amount.

@rwaldron
Copy link
Contributor

👍

1 similar comment
@tcr
Copy link
Member

tcr commented Oct 18, 2015

👍

@HipsterBrown
Copy link
Contributor

Is this related to #383? Or this a separate check to make sure there is room for the bundle before deploying?

@rwaldron
Copy link
Contributor

There are two parts to this:

  1. Checking actual available memory
  2. Checking that the bundle byte length doesn't exceed the available memory; this operation calls the remote process command in part 1, then:
    • resolves, then proceeds with this operation
    • rejects, with some message describing the rejecting.

@dtex
Copy link
Contributor

dtex commented Oct 20, 2015

What about room for execution? Should we report back available memory after deployment? Maybe color code if it's below a certain threshold?

@johnnyman727
Copy link
Contributor Author

@rwaldron we should probably leave some amount of spare RAM for the user application. I'm not sure what a decent amount is though :/ Maybe a few MB?

@rwaldron
Copy link
Contributor

@johnnyman727 @dtex agree with both things. The previous part of the puzzle was just a mechanism to make the data available. All we need to do is decide how much we want to spare and go from there.

@johnnyman727
Copy link
Contributor Author

I think we can set an arbitrary spare RAM limit like 10MB and just see how well that works. Soon after launching, it would be awesome to put some analytics on the CLI and see what the average bundle sizes look like.

@Frijol
Copy link
Member

Frijol commented Sep 3, 2016

The fix for this will be located in t2-cli/deploy.js. Here's the function that deals with memory information: https://github.com/tessel/t2-cli/blob/master/lib/tessel/deploy.js#L37

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

6 participants