I do this:
` base_task = Task.create(project_name=self.regression_project_name,
task_name=BASE_TASKS[block_type][engine], task_type=task_type)
params = base_task.export_task()
Git repo
params['script']['repository'] = subprocess.check_output(['git', 'config', '--get', 'remote.origin.url'],
cwd=REPO_NAME).decode().strip()
Git commit
params['script']['version_num'] = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
cwd=REPO_NAME).decode().strip()
Git branch
params['script']['branch'] = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
cwd=REPO_NAME).decode().strip()
Git diff
params['script']['diff'] = subprocess.check_output(['git', 'diff'],
cwd=REPO_NAME).decode()
Dir to execute code from - . corresponds to base git repo
params['script']['working_dir'] = '.'
Code execution script path
params['script']['entry_point'] = os.path.relpath(EXECUTABLES[(engine, block_type)], REPO_NAME)
Conda env path to run from TODO: change this to the env on host to interperter once trains stabilizes
params['execution']['docker_cmd'] = '/home/egarbin/.conda/envs/regression'
So it wouldn't try to install packages from cache (as it takes the given conda env)
params['script']['requirements']['pip'] = '\n \n'
params['script']['requirements']['conda'] = '\n \n'
base_task.update_task(params) `