本文整理汇总了Python中mrjob.emr.EMRJobRunner._create_master_bootstrap_script方法的典型用法代码示例。如果您正苦于以下问题:Python EMRJobRunner._create_master_bootstrap_script方法的具体用法?Python EMRJobRunner._create_master_bootstrap_script怎么用?Python EMRJobRunner._create_master_bootstrap_script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mrjob.emr.EMRJobRunner
的用法示例。
在下文中一共展示了EMRJobRunner._create_master_bootstrap_script方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_no_bootstrap_script_if_not_needed
# 需要导入模块: from mrjob.emr import EMRJobRunner [as 别名]
# 或者: from mrjob.emr.EMRJobRunner import _create_master_bootstrap_script [as 别名]
def test_no_bootstrap_script_if_not_needed(self):
script_path = os.path.join(self.tmp_dir, 'b.py')
runner = EMRJobRunner(conf_path=False,
bootstrap_mrjob=False)
runner._create_master_bootstrap_script(dest=script_path)
assert not os.path.exists(script_path)
# bootstrap actions don't figure into the master bootstrap script
runner = EMRJobRunner(conf_path=False,
bootstrap_mrjob=False,
bootstrap_actions=['foo', 'bar baz'])
runner._create_master_bootstrap_script(dest=script_path)
assert not os.path.exists(script_path)
示例2: test_master_bootstrap_script_is_valid_python
# 需要导入模块: from mrjob.emr import EMRJobRunner [as 别名]
# 或者: from mrjob.emr.EMRJobRunner import _create_master_bootstrap_script [as 别名]
def test_master_bootstrap_script_is_valid_python(self):
# create a fake src tarball
with open(os.path.join(self.tmp_dir, 'foo.py'), 'w'): pass
yelpy_tar_gz_path = os.path.join(self.tmp_dir, 'yelpy.tar.gz')
tar_and_gzip(self.tmp_dir, yelpy_tar_gz_path, prefix='yelpy')
# do everything
runner = EMRJobRunner(conf_path=False,
bootstrap_cmds=['echo "Hi!"', 'true', 'ls'],
bootstrap_files=['/tmp/quz'],
bootstrap_mrjob=True,
bootstrap_python_packages=[yelpy_tar_gz_path],
bootstrap_scripts=['speedups.sh', '/tmp/s.sh'])
script_path = os.path.join(self.tmp_dir, 'b.py')
runner._create_master_bootstrap_script(dest=script_path)
assert os.path.exists(script_path)
py_compile.compile(script_path)