-
Notifications
You must be signed in to change notification settings - Fork 33
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
cmd/worker: run task from file #594
Conversation
Thanks @buchanae . Will test this weekend. QQ - by "logging is broken" do you mean that stderr/out are not captured, or that job metrics are not written to a file? |
Error, think you forgot to add the additional flag to possible options? $ funnel worker run -f examples/hello-world.json .
Error: unknown shorthand flag: 'f' in -f |
Hrm, looks like the
I meant that the task logs/state are not written back to the database. Logs are written to stderr, I believe. |
Whoops, that was the issue. Working now, thanks! |
Can confirm that this is working as expected for my needs. Also helpful for local dev/test of task files. What is the likelihood of merging into main repo? |
Nice! We'll get this in sometime this week. |
Actually just got an error running examples/s3.json {
"attempt": 0,
"cmd": "docker run -i --read-only --rm --name bct5fmd3fkig03t5idc0-0 -v /funnel_root/funnel-work-dir/bct5fmd3fkig03t5idc0/tmp:/tmp:rw -v /funnel_root/funnel-work-dir/bct5fmd3fkig03t5idc0/tmp/file.xml:/tmp/file.xml:ro ubuntu md5sum /tmp/file.xml",
"index": 0,
"level": "info",
"msg": "Running command",
"ns": "worker",
"taskID": "bct5fmd3fkig03t5idc0",
"time": "2018-07-02T16:50:38Z",
"timestamp": "2018-07-02T16:50:38.494883827Z"
} {
"attempt": 0,
"index": 0,
"level": "info",
"msg": "EXECUTOR_STDERR",
"ns": "worker",
"stderr": "md5sum: /tmp/file.xml: Is a directory\n",
"taskID": "bct5fmd3fkig03t5idc0",
"time": "2018-07-02T16:50:39Z",
"timestamp": "2018-07-02T16:50:39.2357146Z"
}
|
I'm getting a download error from that example:
|
In your case, I'm guessing that the file is missing, so docker mounts the volume ( |
I've tried a different public S3 file with the same error as above. File downloads successfully, root cause error is coming from MD5 tool that is not able to handle a directory mount. NOTE: This is using Amazon ECS-Optimized AMI which defaults to Docker version 17.12.1-ce Works fine for my local dev box Docker version 18.03 |
Oh wait, I was using a private S3 file. Likely the same error, file was not actually downloaded, but the worker reports a successful download ... Any way to tell funnel to leave the files on disk? |
I'm not sure I follow. How is the worker getting to the execute step if the download failed? It should be stopping if downloads fail. We have a flag:
is that what you're looking for? |
Can confirm that the file actually does download.
|
ah, yes, that's an interesting point. Try downloading the file to a location in the container outside Looks like we always add a |
Same error. I think I know what is going on. I had a funnel as a Docker container with a WORKDIR specification that was different than the host mount, which meant that the launched sibling container that is running the task did not see the same filesystem that the main container saw, causing a mismatch ... it is discussed a bit in this blog article on sibling containers Temp solution is to ensure that the paths of WORKDIR and bind mounts given to a Docker that launches sibling container(s) for the executor(s) matches the expectations. Longer term, may have to have a flag that supplies additional mounts to task containers as part of the worker config? |
I've run into this before too. It takes some mental gymnastics to visualize which process puts files where. Docker-in-docker would be simpler to reason about in this respect, not sure exactly what the tradeoffs are.
Yes, that sounds good and should be simple. We've talked about templating the entire executor (docker) command anyway. |
@delagoya we were chatting about the sibling containers issue, and another idea was to bake funnel into the AMI. |
You mean the Funnel server in the AMI, and have a container task contact it
for work?
…On Fri, Jul 6, 2018 at 3:08 PM Alex Buchanan ***@***.***> wrote:
@delagoya <https://github.com/delagoya> we were chatting about the
sibling containers issue, and another idea was to bake funnel into the AMI.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#594 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAACxsEF67tuEsqZsVx6sIFr0hNQeBJDks5uD7WhgaJpZM4U8Qxm>
.
|
Something like that. Or, maybe give the worker an internal REST endpoint(s) so the server can be cut out. |
76d0da1
to
bf72c62
Compare
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.
Tests please.
@delagoya Just curious, did this work out for you in the end? |
Worked great! Especially like the addition of base64 encoded string. Removes the need to write out a file before invoking, which means we can use the standard Docker container you publish. |
@delagoya requested a CLI entrypoint for running the worker on a task file.
This is the 20-minute hack version. It works, but needs some cleanup. Logging is currently broken, so there's no output.
Run as
funnel worker run -f examples/hello-world.json
.