Skip to content

Commit

Permalink
reverted minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mpvgithub committed Jan 4, 2024
1 parent f4420a5 commit 2e43923
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion covalent_ec2_plugin/assets/infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ resource "null_resource" "deps_install" {
"echo 'Installing Covalent...'",

# TODO: Update to a variable version
"pip install \"covalent==${var.covalent_version}\"",
"pip install \"covalent${var.covalent_version}\"",
"chmod +x /tmp/script.sh",
"sudo bash /tmp/script.sh",
"echo ok"
Expand Down
8 changes: 4 additions & 4 deletions covalent_ec2_plugin/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ async def _run_async_subprocess(self, cmd: List[str], cwd=None, log_output: bool

return proc, stdout, stderr

def _get_tf_statefile_path(self) -> str:
state_file = f"{self._TF_DIR}/terraform.tfstate"
def _get_tf_statefile_path(self, task_metadata: Dict) -> str:
state_file = f"{self._TF_DIR}/ec2-{task_metadata['dispatch_id']}-{task_metadata['node_id']}.tfstate"
return state_file

async def _get_tf_output(self, var: str, state_file: str) -> str:
Expand All @@ -221,7 +221,7 @@ async def setup(self, task_metadata: Dict) -> None:
# locks or to ensure that terraform init is run just once)
subprocess.run(["terraform init"], cwd=self._TF_DIR, shell=True, check=True)

state_file = self._get_tf_statefile_path()
state_file = self._get_tf_statefile_path(task_metadata)

boto_session = boto3.Session(**self.boto_session_options())
profile = boto_session.profile_name
Expand Down Expand Up @@ -303,7 +303,7 @@ async def teardown(self, task_metadata: Dict) -> None:
"""
Invokes Terraform to terminate the instance and teardown supporting resources
"""
state_file = self._get_tf_statefile_path()
state_file = self._get_tf_statefile_path(task_metadata)

if not os.path.exists(state_file):
raise FileNotFoundError(
Expand Down

0 comments on commit 2e43923

Please sign in to comment.