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

AL-5682: Improve logging of terraform start env step #114

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions alts/worker/runners/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def get_test_executor_params(self) -> dict:

def __terraform_init(self):
with FileLock(TF_INIT_LOCK_PATH, timeout=60, thread_local=False):
return local['terraform'].with_cwd(self._work_dir).run(
return local['terraform'].with_env(TF_LOG='TRACE').with_cwd(self._work_dir).run(
('init', '-no-color'),
timeout=CONFIG.provision_timeout,
)
Expand Down Expand Up @@ -701,7 +701,7 @@ def start_env(self):
cmd_args = ['apply', '--auto-approve', '-no-color']
if self.TF_VARIABLES_FILE:
cmd_args.extend(['--var-file', self.TF_VARIABLES_FILE])
return local['terraform'].with_cwd(self._work_dir).run(
return local['terraform'].with_env(TF_LOG='TRACE').with_cwd(self._work_dir).run(
args=cmd_args,
retcode=None,
timeout=CONFIG.provision_timeout,
Expand Down Expand Up @@ -1492,7 +1492,7 @@ def _stop_env(self):
cmd_args = ['destroy', '--auto-approve', '-no-color']
if self.TF_VARIABLES_FILE:
cmd_args.extend(['--var-file', self.TF_VARIABLES_FILE])
return local['terraform'].with_cwd(self._work_dir).run(
return local['terraform'].with_env(TF_LOG='TRACE').with_cwd(self._work_dir).run(
args=cmd_args,
retcode=None,
timeout=CONFIG.provision_timeout,
Expand Down Expand Up @@ -1711,7 +1711,7 @@ def start_env(self):
# VM gets its IP address only after deploy.
# To extract it, the `vm_ip` output should be defined
# in Terraform main file.
ip_exit_code, ip_stdout, ip_stderr = local['terraform'].with_cwd(
ip_exit_code, ip_stdout, ip_stderr = local['terraform'].with_env(TF_LOG='TRACE').with_cwd(
self._work_dir).run(
args=('output', '-raw', '-no-color', 'vm_ip'),
retcode=None,
Expand Down
2 changes: 1 addition & 1 deletion alts/worker/runners/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def clone_third_party_repo(
return test_repo_path

def _stop_env(self):
_, container_id, _ = local['terraform'].with_cwd(
_, container_id, _ = local['terraform'].with_env(TF_LOG='TRACE').with_cwd(
self._work_dir).run(
args=('output', '-raw', '-no-color', 'container_id'),
retcode=None,
Expand Down
2 changes: 1 addition & 1 deletion alts/worker/runners/opennebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _stop_env(self):
'Cannot stop VM conventionally. Output:\n%s\nStderr:\n%s',
stop_out, stop_err
)
id_exit_code, vm_id, id_stderr = local['terraform'].with_cwd(
id_exit_code, vm_id, id_stderr = local['terraform'].with_env(TF_LOG='TRACE').with_cwd(
self._work_dir).run(
args=('output', '-raw', '-no-color', 'vm_id'),
retcode=None,
Expand Down
Loading