Repository navigation
Service user - #12
Merged
Merged
Service user#12
Conversation
… under user and not root for security and consistency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix expired deployment re-adoption and run services as the installing user
Summary
Fix a sync-loop bug that re-adopts expired deployments after deletion, and switch all systemd services from running as root to running as the installing user. This also consolidates data paths (model cache, logs, packages) under the Aquila data directory so behavior is identical between interactive and service mode.
Motivation
Two issues surfaced after running the cluster overnight as systemd services:
Expired deployments reappear after deletion. The sync loop's adoption filter skips
"stopped"and"error"statuses but not"expired", so every deleted expired deployment is re-created within 5 seconds. The client never cleans up_statusesentries for expired deployments, keeping them reportable forever via/deployments/status.Manage card shows wrong models and 0 GB weights. All systemd units lacked a
User=directive, so services ran as root. The HF model cache resolved to/root/.cache/huggingfaceinstead of the installing user's directory, causing the client agent to report a completely different set of cached models than what users expected. The same root-vs-user mismatch affectedVLLM_CLIENT_ROOT(deployment logs, uploaded packages, compile caches).Changes
sync.py): Add"expired"to the adoption skip filter so expired deployments are not re-adopted after deletion.deployments.py): Best-effort stop the container before removing the DB row, preventing any active deployment from being re-adopted.cli.py): AddUser=/Group=(resolved viaSUDO_USER) to all four service units (infra, backend, frontend, client). SetXDG_RUNTIME_DIRon the client unit and callloginctl enable-lingerso rootless Podman sockets survive logout.cli.py,config.py): WriteHF_CACHE_DIRandVLLM_CLIENT_ROOTas absolute paths in the client.env, pointing into the Aquila runtime directory. Update defaults inconfig.pyto~/.local/share/aquila/modelsand addvllm_client_rootas a proper pydantic setting.cli.py): Add/root/.cache/huggingface,~/.cache/huggingface, and/root/.vllm-clientas legacy cleanup targets.operations.md,deployments.md, and clientREADME.mdto reflect new defaults andVLLM_CLIENT_ROOT.Testing
/root/.cache/huggingfacecontents while users expected thellmuser's cache).Notes
Existing services continue running as root until re-deployed with
aquila host up --service/aquila client up --service. Model weights in the old root-owned cache (/root/.cache/huggingface) will need to be moved to the new location or re-downloaded.