Skip to content

Commit

Permalink
test: start service after running the installer instead of during (#146)
Browse files Browse the repository at this point in the history
Signed-off-by: Yutong Li <52769999+YutongLi291@users.noreply.github.com>
  • Loading branch information
YutongLi291 authored Aug 26, 2024
1 parent 152561e commit adac342
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/deadline_test_fixtures/deadline/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ def configure_worker_command(self, *, config: DeadlineWorkerConfiguration) -> st
+ f"--region {config.region} "
+ f"--user {config.agent_user} "
+ f"{'--allow-shutdown ' if config.allow_shutdown else ''}"
+ f"{'--start ' if config.start_service else ''}"
),
# fmt: on
]
Expand All @@ -546,6 +545,9 @@ def configure_worker_command(self, *, config: DeadlineWorkerConfiguration) -> st
f"Copy-Item -Path ~\\.aws\\* -Destination C:\\Users\\{config.agent_user}\\.aws\\models -Recurse; "
)

if config.start_service:
cmds.append('Start-Service -Name "DeadlineWorker"')

return "; ".join(cmds)

def userdata(self, s3_files) -> str:
Expand Down Expand Up @@ -746,7 +748,6 @@ def configure_worker_command(
+ f"--group {config.job_user_group} "
+ f"{'--allow-shutdown ' if config.allow_shutdown else ''}"
+ f"{'--no-install-service ' if config.no_install_service else ''}"
+ f"{'--start ' if config.start_service else ''}"
),
# fmt: on
f"runuser --login {self.configuration.agent_user} --command 'echo \"source /opt/deadline/worker/bin/activate\" >> $HOME/.bashrc'",
Expand All @@ -767,6 +768,9 @@ def configure_worker_command(

cmds.append(self.configure_agent_user_environment(config))

if config.start_service:
cmds.append("systemctl start deadline-worker")

return " && ".join(cmds)

def userdata(self, s3_files) -> str:
Expand Down

0 comments on commit adac342

Please sign in to comment.