Merged
Conversation
Implement the next packaging/distribution slice for issue #53 on top of origin/master. This changes the agent install layout from an in-place overwrite to a versioned release directory under /opt/grapheon/agent/releases/<version> with a stable /opt/grapheon/agent/current symlink. The shipped systemd service now executes the current symlink target so upgrades and rollbacks do not require editing unit files. Add lifecycle helpers for release-based host management: - upgrade-passive-agent.sh - rollback-passive-agent.sh - uninstall-passive-agent.sh Extend the agent release artifact contents to include those lifecycle scripts, and extend the GitHub release workflow to upload a sha256 checksum alongside the agent tarball. Add packaging tests that verify versioned installs and rollback behavior using a fake systemctl, bump the agent version to 0.3.0, and update the agent changelog plus packaging/deployment docs accordingly.
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.
Summary
This PR implements the next packaging/distribution slice for passive-agent issue #53.
It focuses on lifecycle management for already-versioned agent releases:
currentsymlink switchingRelated: #53.
What Changed
Versioned host install layout
Changed the host install model from a single in-place runtime copy to a versioned release layout:
/opt/grapheon/agent/releases/<version>//opt/grapheon/agent/currentinstall-passive-agent.shnow installs the runtime into the versioned release directory and repointscurrentto the new version.deploy/grapheon-agent.servicenow runs:/opt/grapheon/agent/current/grapheon_agent.pyThis means upgrades and rollbacks can switch versions without rewriting the unit file.
Lifecycle helper scripts
Added:
scripts/upgrade-passive-agent.shscripts/rollback-passive-agent.shscripts/uninstall-passive-agent.shBehavior:
upgrade-passive-agent.shinstalls the new versioned release and reports the previous/current versionrollback-passive-agent.sh <version>repointscurrentto an already-installed prior releaseuninstall-passive-agent.shremoves agent files and units, with optional--purge-stateThis makes lifecycle management reproducible instead of manual file copying.
Artifact and release metadata
Extended the release artifact contents to include the lifecycle scripts.
Extended the GitHub release workflow so the passive-agent release also uploads:
grapheon-agent-vX.Y.Z.tar.gz.sha256That gives operators a minimal verification path for downloaded release artifacts.
Tests
Added packaging-focused tests in:
agent/tests/test_packaging_scripts.pyCoverage includes:
currentsymlink targeting the installed releasecurrentto an older installed versionsystemctlintegration so lifecycle behavior is tested without requiring systemd in CIVersion and changelog
Bumped the passive agent version:
agent/VERSION->0.3.0Updated:
agent/CHANGELOG.mdThe changelog entry covers:
Files Of Interest
deploy/grapheon-agent.servicescripts/install-passive-agent.shscripts/upgrade-passive-agent.shscripts/rollback-passive-agent.shscripts/uninstall-passive-agent.shscripts/build-agent-artifact.sh.github/workflows/release.ymlagent/tests/test_packaging_scripts.pyagent/VERSIONagent/CHANGELOG.mddocs/agent_quickstart.mddocs/release-process.mdTesting
Ran:
python3 scripts/validate_versions.pybash -n scripts/build-agent-artifact.sh scripts/install-passive-agent.sh scripts/upgrade-passive-agent.sh scripts/rollback-passive-agent.sh scripts/uninstall-passive-agent.shbash scripts/build-agent-artifact.sh 0.3.0 /tmp/grapheon-agent-v0.3.0.tar.gztar -tzf /tmp/grapheon-agent-v0.3.0.tar.gznix develop -c .venv/bin/python -m pytest agent/tests/test_packaging_scripts.pynix develop -c .venv/bin/python -m pytestResult:
369 passed, 1 skippedScope Notes
This PR does not add distro-native packages (
.deb/.rpm) or artifact signing yet.What it does add is the first practical release-lifecycle layer on top of the existing agent artifact and image work:
mastervia the tarball