""" Python script that triggers sagemaker flow""" | |
import sys | |
import subprocess | |
def main(): | |
# Let's skip arg names | |
script_name = sys.argv[2] | |
repo = sys.argv[4] | |
repo_name = repo.split('/')[-1] | |
cmd = f'git clone {repo} && cd {repo_name} && sh {script_name}' | |
output = subprocess.run(cmd.split(), stdout=subprocess.PIPE) | |
print(output.stdout.decode()) | |
if __name__ == '__main__': | |
main() | |