Skip to content

Commit

Permalink
buildman: prevent systemd oneshot service from timing (PROJQUAY-3304) (
Browse files Browse the repository at this point in the history
…#1149)

If not set, TimeoutStartSec for the Docker service is set to
600. Since it's a service of type oneshot, this should either not be
set, or at least the length of the machine's lifetime.
  • Loading branch information
kleesc committed Feb 25, 2022
1 parent c5608d9 commit 3ca4407
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions buildman/manager/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def generate_cloud_config(
worker_tag=self.executor_config["WORKER_TAG"],
volume_size=self.executor_config.get("VOLUME_SIZE", "42G"),
max_lifetime_s=self.executor_config.get("MAX_LIFETIME_S", 10800),
timeout_start_sec=self.executor_config.get("MAX_LIFETIME_S", 10800),
ssh_authorized_keys=self.executor_config.get("SSH_AUTHORIZED_KEYS", []),
container_runtime=self.executor_config.get("CONTAINER_RUNTIME", "docker"),
ca_cert=self.executor_config.get("CA_CERT", self._ca_cert()),
Expand Down
4 changes: 4 additions & 0 deletions buildman/templates/cloudconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ WantedBy=multi-user.target
extra_args='--privileged --env-file /root/overrides.list -v /var/run/podman/podman.sock:/var/run/podman/podman.sock -v /etc/pki/ca-trust-source/anchors:/certs -e DOCKER_HOST=unix:/var/run/podman/podman.sock',
restart_policy='no',
oneshot=True,
timeout_start_sec=timeout_start_sec,
) | indent(6) }},
{% else %}
{{ dockersystemd("quay-builder",
Expand All @@ -156,6 +157,7 @@ WantedBy=multi-user.target
exec_stop_post=['/bin/sh -xc "/bin/sleep 120; /usr/bin/systemctl --no-block poweroff"'],
restart_policy='no',
oneshot=True,
timeout_start_sec=timeout_start_sec,
) | indent(6) }},
{% endif %}
{% else %}
Expand All @@ -169,6 +171,7 @@ WantedBy=multi-user.target
extra_args='--net=host --privileged --env-file /root/overrides.list -v /var/run/docker.sock:/var/run/docker.sock -v /etc/pki/ca-trust-source/anchors:/certs',
restart_policy='no',
oneshot=True,
timeout_start_sec=timeout_start_sec,
) | indent(6) }},
{% else %}
{{ dockersystemd("quay-builder",
Expand All @@ -181,6 +184,7 @@ WantedBy=multi-user.target
exec_stop_post=['/bin/sh -xc "/bin/sleep 120; /usr/bin/systemctl --no-block poweroff"'],
restart_policy='no',
oneshot=True,
timeout_start_sec=timeout_start_sec,
) | indent(6) }},
{% endif %}
{% endif %}
Expand Down

0 comments on commit 3ca4407

Please sign in to comment.