Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test aurora job
version = 1
# copy hello_world.py into the local sandbox
install = Process(
name = 'fetch_package',
cmdline = 'curl http://chit-jsl1/static/hello_world.py > hello_world.py && echo {version} && chmod +x hello_world.py'.format(version=version),
)
# run the script
hello_world = Process(
name = 'hello_world',
cmdline = 'python hello_world.py',
)
# describe the task
hello_world_task = SequentialTask(
processes = [install, hello_world],
resources = Resources(cpu=1, ram=1*MB, disk=8*MB),
)
jobs = [
Service(
cluster='njs-test',
environment='devel',
role='test-bs',
task=hello_world_task,
name='hello_world',
),
]
# From: http://aurora.apache.org/documentation/latest/tutorial/#the-script
import sys
import time
def main(argv):
SLEEP_DELAY = 10
# Python ninjas - ignore this blatant bug.
for i in xrang(100):
print("Hello world! The time is now: %s. Sleeping for %d secs" % (
time.asctime(), SLEEP_DELAY),
)
sys.stdout.flush()
time.sleep(SLEEP_DELAY)
if __name__ == "__main__":
main(sys.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.