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
fix(exec-script-tmp): uses tmp and mounts volume instead of creating locally #53
Conversation
Looks like this approach is still causing issues:
|
Mac's default
|
@Fluidbyte I pulled this branch and ran |
src/index.js
Outdated
// If override set, use that | ||
? process.env.DEVLAB_TMP | ||
// If MacOS TEMPDIR, use /tmp, else try to find using os-tmpdir | ||
: process.env.TEMPDIR ? '/tmp' : require('os-tmpdir')() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
I'm not really happy with this approach because it seems to be hit or miss. It worked fine for me just letting it default to |
Latest commit creates a module which will (I think) do a better job. It's process is:
Seems to work everywhere I've tested. Would love some local testing both with and without The best way to check this is with |
The latest approach seems to be checking out where I've tested it. If I can get a couple/few people to check it out it would be appreciated. QA Test Process
If the above look good give me a nod and once I'll get it merged and published. |
README.md
Outdated
@@ -25,6 +25,8 @@ npm install devlab -g | |||
|
|||
*Obvious Note: You need to have [Docker](https://www.docker.com/) installed as well.* | |||
|
|||
**Important Note**: In order to run the tasks, Devlab creates a temp file (`devlab.sh`). The tool will do it's best to determine the best location (usually `/tmp`), but this can be explicitly set by specifying the environment variable `DEVLAB_TMP`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's
-> its
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed, just not showing up here...
} else if (isWriteable('/tmp')) { | ||
// Use (most common) /tmp | ||
return '/tmp' | ||
} else if (isWriteable(require('os-tmpdir')())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be preferred over /tmp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would think that, the problem is it tries to use TMPDIR
on Mac which is /var/folders/...
and is not shared with Docker on install. In most cases /tmp
should work fine and is how you would expect an application to work on *nix systems. This basically is just used when all else fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. I do remember having odd trouble with os-tmpdir
in the past, which seemed silly since the whole point of that module is that it should just work. Thanks for the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this really is the use-case for weird, non-standard setups or Windows.
I pulled the latest and ran |
Checked out ^^^. All good. |
Sorry for the delay, this is on my list for testing. |
2 failures on a fresh pull and deps install. Output trimmed to relevant parts. LMK what I can do to help:
Just to be sure, ran it again with fresh deps and got the same results. |
That will install department in the test project, then |
hang tight |
🎉
|
👍 |
Instead of creating local
devlab.sh
this will create in the OS's temp dir, mount, and execute.Why this wasn't done initially is on me; I just defaulted to
/tmp
but this caused issues on Mac and Circle. Now the temp directory is determined by the/src/tempdir
module which will allow either a custom setting via theDEVLAB_TMP
environment variable, or will try to determine the best temp directory to use.Tested both on my linux server and on my local Mac.
Closes #49 by no longer storing this exec script local.