Rename pvcapid-worker to pvcworkerd

This commit is contained in:
Joshua Boniface 2023-11-15 19:13:48 -05:00
parent 5f1432ccdd
commit aef38639cf
8 changed files with 14 additions and 14 deletions

View File

@ -1,7 +1,7 @@
# Parallel Virtual Cluster Provisioner API provisioner worker unit file
# Parallel Virtual Cluster Celery Worker daemon unit file
[Unit]
Description = Parallel Virtual Cluster API provisioner worker
Description = Parallel Virtual Cluster Celery Worker daemon
After = network-online.target
[Service]
@ -9,7 +9,7 @@ Type = simple
WorkingDirectory = /usr/share/pvc
Environment = PYTHONUNBUFFERED=true
Environment = PVC_CONFIG_FILE=/etc/pvc/pvcapid.yaml
ExecStart = /usr/share/pvc/pvcapid-worker.sh
ExecStart = /usr/share/pvc/pvcworkerd.sh
Restart = on-failure
[Install]

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# pvcapid-worker.py - API Celery worker daemon startup stub
# pvcworkerd.py - API Celery worker daemon startup stub
# Part of the Parallel Virtual Cluster (PVC) system
#
# Copyright (C) 2018-2022 Joshua M. Boniface <joshua@boniface.me>

View File

@ -58,7 +58,7 @@ for HOST in ${HOSTS[@]}; do
echo " done."
echo -n "Restarting PVC daemons..."
ssh $HOST $SUDO systemctl restart pvcapid &>/dev/null
ssh $HOST $SUDO systemctl restart pvcapid-worker &>/dev/null
ssh $HOST $SUDO systemctl restart pvcworkerd &>/dev/null
ssh $HOST $SUDO systemctl restart pvcnoded &>/dev/null
echo " done."
echo -n "Waiting for node daemon to be running..."

View File

@ -4,7 +4,7 @@ api-daemon/pvc-api-db-upgrade usr/share/pvc
api-daemon/pvcapid.sample.yaml usr/share/pvc
api-daemon/pvcapid usr/share/pvc
api-daemon/pvcapid.service lib/systemd/system
api-daemon/pvcapid-worker.service lib/systemd/system
api-daemon/pvcapid-worker.sh usr/share/pvc
api-daemon/pvcworkerd.service lib/systemd/system
api-daemon/pvcworkerd.sh usr/share/pvc
api-daemon/provisioner usr/share/pvc
api-daemon/migrations usr/share/pvc

View File

@ -10,13 +10,13 @@ if systemctl is-active --quiet pvcapid.service; then
systemctl start pvcapid.service
fi
# Restart the worker daemon
if systemctl is-active --quiet pvcapid-worker.service; then
systemctl stop pvcapid-worker.service
systemctl start pvcapid-worker.service
if systemctl is-active --quiet pvcworkerd.service; then
systemctl stop pvcworkerd.service
systemctl start pvcworkerd.service
fi
if [ ! -f /etc/pvc/pvcapid.yaml ]; then
echo "NOTE: The PVC client API daemon (pvcapid.service) and the PVC provisioner worker daemon (pvcapid-worker.service) have not been started; create a config file at /etc/pvc/pvcapid.yaml, then run the database configuration (/usr/share/pvc/pvc-api-db-upgrade) and start them manually."
echo "NOTE: The PVC client API daemon (pvcapid.service) and the PVC Worker daemon (pvcworkerd.service) have not been started; create a config file at /etc/pvc/pvcapid.yaml, then run the database configuration (/usr/share/pvc/pvc-api-db-upgrade) and start them manually."
fi
# Clean up any old sample configs

View File

@ -188,7 +188,7 @@ def entrypoint():
# Restart the API daemons if applicable
logger.out("Restarting services", state="s")
common.run_os_command("systemctl restart pvcapid-worker.service")
common.run_os_command("systemctl restart pvcworkerd.service")
if zkhandler.read("base.config.primary_node") == config["node_hostname"]:
common.run_os_command("systemctl restart pvcapid.service")

View File

@ -607,7 +607,7 @@ class NodeInstance(object):
patroni_failed = False
time.sleep(0.2)
break
# 6. Start client API (and provisioner worker)
# 6. Start client API
if self.config["enable_api"]:
self.logger.out("Starting PVC API client service", state="i")
common.run_os_command("systemctl enable pvcapid.service")

View File

@ -80,7 +80,7 @@ def start_api_worker(logger, config):
if config["enable_api"]:
logger.out("Starting API worker daemon", state="i")
# TODO: Move our handling out of Systemd and integrate it directly as a subprocess?
common.run_os_command("systemctl start pvcapid-worker.service")
common.run_os_command("systemctl start pvcworkerd.service")
def start_system_services(logger, config):