Skip to content

Instantly share code, notes, and snippets.

@schbetsy
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schbetsy/81a82b74e71240c519c7 to your computer and use it in GitHub Desktop.
Save schbetsy/81a82b74e71240c519c7 to your computer and use it in GitHub Desktop.
IronWorker - execute binary from ruby worker

IronWorker log shows this output:

get file from AWS
TODO: Call solver with file at cube.stl
/mnt/task/solver_worker.rb:7:in `exec': Permission denied - solver/sns (Errno::EACCES)
	from /mnt/task/solver_worker.rb:7:in `<top (required)>'
	from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from __runner__.rb:224:in `<main>'
total 12
drwxr-xr-x 3 nobody root 4096 May 17 19:32 .
drwxr-xr-x 4 nobody root 4096 May 17 19:34 ..
drwxr-xr-x 2 nobody root 4096 May 17 19:32 sns
Deleted file
runtime "ruby"
stack "ruby-2.1"
merge_gem 'fog'
file 'sns', 'solver/sns'
full_remote_build true
exec "solver_worker.rb"
# ... code to pull a file from AWS storage and
# save it to the IronWorker environment at `save_location`.
puts "get file from AWS"
begin
`chmod +x solver/sns`
puts `ls -la solver/`
exec('solver/sns', save_location)
ensure
File.delete(save_location)
puts "Deleted file"
end
@schbetsy
Copy link
Author

Line 7 of solver_worker.rb should run the sns executable with the filepath at save_location as its argument, but instead it gets a Permission denied - solver/sns (Errno::EACCES) error, as shown in output.md.

@schbetsy
Copy link
Author

I was using this code as a reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment