SAGE remote agent — receives and executes file transfer instructions from the platform
Project description
st-agent — SAGE Remote Agent
Lightweight daemon that runs on destination servers. It connects to the SAGE platform via SSE, receives transfer instructions, and executes them using rsync/rclone.
Install
From wheel (air-gapped / no internet)
# On the build machine (has internet):
cd st-agent
pip install build
python -m build # creates dist/st_agent-0.1.0-py3-none-any.whl
# Copy the wheel to the remote server, then:
pip install st_agent-0.1.0-py3-none-any.whl
From Git (direct)
pip install "git+https://github.com/sachin-techstax/sync_system.git#subdirectory=st-agent"
From source
git clone https://github.com/sachin-techstax/sync_system.git
cd sync_system/st-agent
pip install .
Prerequisites on remote server
- Python 3.10+
rsync(for Linux-to-Linux transfers)rclone(optional, for cloud transfers)
# Ubuntu/Debian
sudo apt install -y rsync python3 python3-pip
# RHEL/CentOS
sudo yum install -y rsync python3 python3-pip
Usage
1. Register with the platform
st-agent register \
--url http://<platform-ip>:6212 \
--api-key <your-api-key> \
--name "server-prod-01"
This generates an RSA keypair, registers with the platform, and saves config to ~/.st-agent/.
2. Start the agent
st-agent start
The agent will:
- Connect to the platform via SSE (Server-Sent Events)
- Send heartbeats every 15 seconds
- Execute transfer instructions (rsync, rclone)
- Report progress back to the platform in real-time
3. Run as a systemd service (recommended)
sudo tee /etc/systemd/system/st-agent.service << 'EOF'
[Unit]
Description=SAGE Agent
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/st-agent start
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now st-agent
sudo systemctl status st-agent
4. Check status
st-agent status
Configuration
Config is stored in ~/.st-agent/config.json after registration. The agent also stores its RSA keypair in ~/.st-agent/.
Architecture
Platform (hub) Remote Server
┌──────────────┐ SSE stream ┌──────────────┐
│ FastAPI │ ───────────────▸│ st-agent │
│ /api/agents │ │ daemon │
│ │◂─── heartbeat ──│ │
│ │◂─── progress ───│ rsync/rclone │
└──────────────┘ └──────────────┘
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file st_agent-0.3.0.tar.gz.
File metadata
- Download URL: st_agent-0.3.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b309452d6e6fec76b02379584b5691c7af42c6afeb76afc501f767b76f3a4da8
|
|
| MD5 |
3019dd548d5f9a595f0b879ac24cc7ce
|
|
| BLAKE2b-256 |
d3e5e0c15c52d8f3a939bd67e5e33483e8c03a2a5f2783395b009e03b8fce270
|
File details
Details for the file st_agent-0.3.0-py3-none-any.whl.
File metadata
- Download URL: st_agent-0.3.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acefc7dafc0e059fd801fe4a3a184cf86e7ac628f8f5dfd1e042dd1bb16f9de3
|
|
| MD5 |
974dc31a70ba7f3e61e3f206ce2f1acf
|
|
| BLAKE2b-256 |
c6aa2c5e89c5c0c03ba1b98845fcda79016b39beeb44a1f82bd774a29d53a7e4
|