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

mesos module: add running tasks in service tests #19825

Closed
wants to merge 1 commit into from

Conversation

kamilchm
Copy link
Member

Motivation for this change

Mesos needs better automatic checks when upgrading. Each update can brake some kind of tasks (#19064).
I want to have tests for my use cases, where I need to spawn docker or task provided as .tar.gz.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC: @cstrahan, @kevincox, @benley, @philip-wernersbach

@mention-bot
Copy link

@kamilchm, thanks for your PR! By analyzing the history of the files in this pull request, we identified @offlinehacker, @benley and @qknight to be potential reviewers.

def statusUpdate(self, driver, update):
if update.state == mesos_pb2.TASK_FAILED:
driver.stop()
sys.exit(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this end up logging anything useful for debugging if it fails?

Copy link
Member

@benley benley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good! Just a few tiny comments/questions

$slave->waitForOpenPort(5051);

# is slave registred?
$master->waitUntilSucceeds("curl --fail http://master:5050/master/slaves".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're trying to reduce output clutter, you might also want to use curl -s and grep -q here

chmod +x $out/mesos_test.py

echo "done" > test.result
tar czvf $out/test.tar.gz test.result
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe skip the v, just do tar czf

$master->succeed("${pkgs.mesos}/bin/mesos-execute --master=master:5050".
" --resources=\"cpus:0.1;mem:32\" --name=simple-docker".
" --containerizer=docker --docker_image=echo".
" --shell=false --command=\"done\" | grep TASK_FINISHED");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grep -q here too

@philip-wernersbach
Copy link

philip-wernersbach commented Oct 24, 2016

Would I be able to run these tests on CentOS with Nix and Nixpkgs installed? If so, how?

Also, does this test the curl impurity described here?

@kamilchm
Copy link
Member Author

@benley thx for comments, I fixed all.

@philip-wernersbach could you provide curl test case in form of a TaskInfo or mesos-execute command? It would be helpful to reproduce the issue.

@philip-wernersbach
Copy link

@kamilchm I'll create a mesas-execute command as a test case

@cstrahan
Copy link
Contributor

I'm going to try to expand on this work soon. I'm making decent progress on packaging Mesos 1.1.0 here: #21416

@cstrahan cstrahan self-assigned this Dec 26, 2016
@kamilchm kamilchm closed this Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants