Skip to content

feat: stopping and starting worker exec before and after build #179

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
31 changes: 25 additions & 6 deletions agent/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,34 @@ def restart(self, web_only=False):
def rebuild_job(self):
return self.rebuild()

@step("Stop All Worker Execution")
def stop_worker_execution(self):
self.docker_execute("supervisorctl stop all")

@step("Start All Worker Execution")
def start_worker_execution(self):
self.docker_execute("supervisorctl start all")

@step("Rebuild Bench Assets")
def rebuild(self, apps: list[str] | None = None):
if not apps:
return self.docker_execute("bench build")

if len(apps) == 1:
return self.docker_execute(f"bench build --app {apps[0]}")
self.stop_worker_execution()

return self.docker_execute(f"bench build --apps {','.join(apps)}")
try:
if not apps:
build_result = self.docker_execute("bench build")
self.start_worker_execution()
return build_result

if len(apps) == 1:
build_result = self.docker_execute(f"bench build --app {apps[0]}")
self.start_worker_execution()
return build_result

build_result = self.docker_execute(f"bench build --apps {','.join(apps)}")
self.start_worker_execution()
return build_result
except Exception:
self.start_worker_execution()

@property
def apps(self):
Expand Down