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

Allow 0 in draksetup scale to disable services, don't enable first drakrun worker on draksetup postinstall #972

Merged
merged 1 commit into from
Sep 27, 2024
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
9 changes: 3 additions & 6 deletions drakrun/drakrun/draksetup/postinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ def postinstall(generate_apivectors_profile):
create_vm_profiles(generate_apivectors_profile)

log.info("All right, drakrun setup is done.")
log.info("First instance of drakrun will be enabled automatically...")
subprocess.check_output("systemctl enable drakrun@1", shell=True)
subprocess.check_output("systemctl start drakrun@1", shell=True)

log.info("If you want to have more parallel instances, execute:")
log.info(" # draksetup scale <number of instances>")
log.info("If you want to enable drakrun worker, execute:")
log.info(" # draksetup scale 1")
log.info("or provide a higher number if you want to have more parallel VMs")
6 changes: 4 additions & 2 deletions drakrun/drakrun/draksetup/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
@click.argument("scale_count", type=int)
def scale(scale_count):
"""Enable or disable additional parallel instances of drakrun service.."""
if scale_count < 1:
raise RuntimeError("Invalid value of scale parameter. Must be at least 1.")
if scale_count >= 0:
raise RuntimeError(
"Invalid value of scale parameter - must be a positive number."
)

cur_services = set(list(get_enabled_drakruns()))
new_services = set([f"drakrun@{i}.service" for i in range(1, scale_count + 1)])
Expand Down
Loading