-
Notifications
You must be signed in to change notification settings - Fork 2
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
About tasks folder and executable files #2
Comments
[UPDATE] This is my complete env setup function Configure : function(logger) {
this.logger=logger;
var self=this;
// add temporary folder and task root folder to PATH
process.env['PATH'] = process.env['PATH'] + ':/tmp/:' + process.env['LAMBDA_TASK_ROOT']
var result = {}
execute(result, {
shell: "echo `ls /tmp/`", // logs output of /tmp/ dir on your lambda machine
logOutput: true
})
.then(function(result) {
self.logger.info("MediaHelper tmp ls %s", result);
return execute(result, {
shell: "cp ./ffmpeg /tmp/.; chmod 755 /tmp/ffmpeg", // copies an ffmpeg binary to /tmp/ and chmods permissions to run it
logOutput: true
})
})
.then(function(result) {
self.logger.info("MediaHelper ffmpeg copy %s", result);
return execute(result, {
shell: "cp ./ffprobe /tmp/.; chmod 755 /tmp/ffprobe", // copies an ffmpeg binary to /tmp/ and chmods permissions to run it
logOutput: true
})
})
.then(function(result) {
elf.logger.info("MediaHelper ffprobe copy %s", result);
return execute(result, {
shell: "echo `ls /tmp/`", // logs output of /tmp/ dir on your lambda machine
logOutput: true
})
})
.then(function(result) {
self.logger.info("MediaHelper tmp ls %s", result);
})
.fail(function(err) {
self.logger.error("MediaHelper: Failed executable setup %s",err);
});
} for the folder structure showed above. |
[UPDATE] |
Thanks for bringing this up - i need to update the example, i don't believe It may be the same detail addressed in the update here: This was a year ago now - it may be that lamba is even easier to
|
@russmatney Thanks, what I have found is that without the copy the |
Hey @loretoparisi – sorry for the delay on my part here. I've been catching up with everything and have finally made time for this. It's been over a year since I've worked with aws lambda directly, I'm happy to re-familiarize and clean this up if it's of benefit to you (and probably others). From what I understand, it seems a simple solution would be another api option that handles the Just want to make sure I'm on the right track here. If it'd be more helpful for me to focus on the other questions you had re: logging, etc. Perhaps if there's enough meat there, I'll start an outline for a wiki with some practical usage details. Let me know and I can get a prototype going! |
Hi @russmatney, so at the end I realized that, since recents lambda OS udpates, there is not need anymore to if(self._options.copyBinaries)
{
var result = {}
execute(result, {
shell: "cp ./ffmpeg /tmp/.; chmod 755 /tmp/ffmpeg", // copies an ffmpeg binary to /tmp/ and chmods permissions to run it
logOutput: true
})
.then(function(result) {
return execute(result, {
shell: "cp ./ffprobe /tmp/.; chmod 755 /tmp/ffprobe", // copies an ffmpeg binary to /tmp/ and chmods permissions to run it
logOutput: true
})
})
.then(function(result) {
self.logger.info("LambdaAPIHelper.Configure done.");
})
.fail(function(err) {
self.logger.error("LambdaAPIHelper.Configure: error %s",err);
});
} //copyBinaries but having ├── config.js
├── ffmpeg
├── ffprobe
├── index.js
└── lambdaapihelper.js and I just execute those binaries using as path Thank you, and if you make a wiki for logging question, etc. this would help as well! |
I don't get this code
Is that means that the executable
must be
in the/var/task
folder or they can be in a arbitrary folder?When I upload my zip file (via S3) to Lambda the executable are at the same level of the
index.js
likeSo in this case can I do like
and I get as logging
Is that correct? This brings me to the second question about logging, where is logging output going? I can see in CloudWatch
but not the commands output logged for the
ls
.Latest but not least question, as soon as I configure the executable (hopefully ok) I call this function
and this one for
ffmpeg
what I get is this then
Does this mean that the executable was not found? While the lines does not show exec arguments I have passed to
cp.execFile
?Thank you.
The text was updated successfully, but these errors were encountered: