Skip to content

Commit

Permalink
[ENV DOCS]
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 19, 2024
1 parent 81d12c4 commit 9d471c2
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
46 changes: 45 additions & 1 deletion docs/swarms/install/workspace_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ WORKSPACE_DIR=/path/to/your/workspace
- Keeps track of agent interactions
- Preserves conversation logs

#### `SWARMS_AUTOUPDATE_ON`
- **Purpose**: Controls automatic updates of the Swarms framework
- **Type**: Boolean
- **Default**: `false`
- **Example**:
```bash
SWARMS_AUTOUPDATE_ON=true
```
- **Features**:
- Automatically updates to the latest stable version
- Ensures you have the newest features
- Maintains compatibility with the latest improvements
- Handles dependency updates
- **Considerations**:
- Set to `false` if you need version stability
- Recommended `true` for development environments
- Consider system requirements for auto-updates
- May require restart after updates

### Telemetry Configuration

#### `USE_TELEMETRY`
Expand Down Expand Up @@ -70,6 +89,9 @@ touch .env
# Basic configuration
WORKSPACE_DIR=./my_workspace

# Enable auto-updates
SWARMS_AUTOUPDATE_ON=true

# Enable telemetry
USE_TELEMETRY=true

Expand All @@ -78,7 +100,7 @@ SWARMS_API_KEY=your_api_key_here
```

3. Obtain your API key:
- Visit [swarms.ai dashboard](https://swarms.ai)
- Visit [swarms.ai](https://swarms.ai)
- Create an account or log in
- Navigate to the API section
- Generate your unique API key
Expand All @@ -100,22 +122,38 @@ SWARMS_API_KEY=your_api_key_here
- Consider privacy implications in production
- Review collected data periodically

4. **Auto-Update Management**:
- Test updates in development before enabling in production
- Keep backups before enabling auto-updates
- Monitor system resources during updates
- Schedule updates during low-traffic periods

## Examples

### Basic Development Setup
```bash
WORKSPACE_DIR=./dev_workspace
SWARMS_AUTOUPDATE_ON=true
USE_TELEMETRY=true
SWARMS_API_KEY=sk_test_xxxxxxxxxxxx
```

### Production Setup
```bash
WORKSPACE_DIR=/var/log/swarms/prod_workspace
SWARMS_AUTOUPDATE_ON=false
USE_TELEMETRY=true
SWARMS_API_KEY=sk_prod_xxxxxxxxxxxx
```

### Testing Environment
```bash
WORKSPACE_DIR=./test_workspace
SWARMS_AUTOUPDATE_ON=true
USE_TELEMETRY=false
SWARMS_API_KEY=sk_test_xxxxxxxxxxxx
```

## Troubleshooting

Common issues and solutions:
Expand All @@ -135,6 +173,12 @@ Common issues and solutions:
- Verify firewall settings
- Check for proper boolean values

4. **Auto-Update Issues**:
- Check internet connectivity
- Verify sufficient disk space
- Ensure proper permissions for updates
- Check system compatibility requirements

## Additional Resources

- [Swarms Framework Documentation](https://github.com/kyegomez/swarms)
Expand Down
8 changes: 4 additions & 4 deletions swarms/structs/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2286,9 +2286,9 @@ def run(
device_id = device_id or self.device_id
all_cores = all_cores or self.all_cores
all_gpus = all_gpus or self.all_gpus
do_not_use_cluster_ops = do_not_use_cluster_ops or self.do_not_use_cluster_ops


do_not_use_cluster_ops = (
do_not_use_cluster_ops or self.do_not_use_cluster_ops
)

if scheduled_run_date:
while datetime.now() < scheduled_run_date:
Expand All @@ -2314,7 +2314,7 @@ def run(
*args,
**kwargs,
)

except ValueError as e:
logger.error(f"Invalid device specified: {e}")
raise e
Expand Down
11 changes: 11 additions & 0 deletions swarms/telemetry/auto_upgrade_swarms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import subprocess

from swarms.utils.loguru_logger import initialize_logger
Expand All @@ -9,6 +10,16 @@
def auto_update():
"""auto update swarms"""
try:
# Check if auto-update is disabled
auto_update_enabled = os.getenv(
"SWARMS_AUTOUPDATE_ON", "true"
).lower()
if auto_update_enabled == "false":
logger.info(
"Auto-update is disabled via SWARMS_AUTOUPDATE_ON"
)
return

outcome = check_for_update()
if outcome is True:
logger.info(
Expand Down

0 comments on commit 9d471c2

Please sign in to comment.