Add updating instructions; check for non running docker containers (#58)

* docs: Update README with instructions for updating Archon via Docker and local Python installation

* fix: Improve container management in run_docker.py - Check for existing containers, stop if running, and force remove if necessary
This commit is contained in:
cannuri
2025-03-19 13:56:49 +01:00
committed by GitHub
parent e967b1d783
commit b93cd043ab
2 changed files with 68 additions and 6 deletions

View File

@@ -90,6 +90,42 @@ streamlit run streamlit_ui.py
4. Access the Streamlit UI at http://localhost:8501.
### Updating Archon
#### Option 1: Docker
To get the latest updates for Archon when using Docker:
```bash
# Pull the latest changes from the repository (from within the archon directory)
git pull
# Rebuild and restart the containers with the latest changes
python run_docker.py
```
The `run_docker.py` script will automatically:
- Detect and remove any existing Archon containers (whether running or stopped)
- Rebuild the containers with the latest code
- Start fresh containers with the updated version
#### Option 2: Local Python Installation
To get the latest updates for Archon when using local Python installation:
```bash
# Pull the latest changes from the repository (from within the archon directory)
git pull
# Install any new dependencies
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Restart the Streamlit UI
# (If you're already running it, stop with Ctrl+C first)
streamlit run streamlit_ui.py
```
This ensures you're always running the most recent version of Archon with all the latest features and bug fixes.
### Setup Process
After installation, follow the guided setup process in the Intro section of the Streamlit UI:

View File

@@ -75,19 +75,45 @@ def main():
print("Error building main Archon container")
return 1
# Check if the container is already running
# Check if the container exists (running or stopped)
try:
result = subprocess.run(
["docker", "ps", "-q", "--filter", "name=archon-container"],
["docker", "ps", "-a", "-q", "--filter", "name=archon-container"],
check=True,
capture_output=True,
text=True
)
if result.stdout.strip():
print("\n=== Stopping existing Archon container ===")
run_command(["docker", "stop", "archon-container"])
run_command(["docker", "rm", "archon-container"])
except subprocess.SubprocessError:
print("\n=== Removing existing Archon container ===")
container_id = result.stdout.strip()
print(f"Found container with ID: {container_id}")
# Check if the container is running
running_check = subprocess.run(
["docker", "ps", "-q", "--filter", "id=" + container_id],
check=True,
capture_output=True,
text=True
)
# If running, stop it first
if running_check.stdout.strip():
print("Container is running. Stopping it first...")
stop_result = run_command(["docker", "stop", container_id])
if stop_result != 0:
print("Warning: Failed to stop container gracefully, will try force removal")
# Remove the container with force flag to ensure it's removed
print("Removing container...")
rm_result = run_command(["docker", "rm", "-f", container_id])
if rm_result != 0:
print("Error: Failed to remove container. Please remove it manually with:")
print(f" docker rm -f {container_id}")
return 1
print("Container successfully removed")
except subprocess.SubprocessError as e:
print(f"Error checking for existing containers: {e}")
pass
# Run the Archon container