Swarms Installation Guide¶
You can install swarms
with pip in a
Python>=3.10 environment.
Prerequisites¶
Before you begin, ensure you have the following installed:
- Python 3.10 or higher: Download Python
- pip (specific version recommended):
pip >= 21.0
- git (for cloning the repository): Download Git
Installation Options¶
Headless Installation¶
The headless installation of swarms
is designed for environments where graphical user interfaces (GUI) are not needed, making it more lightweight and suitable for server-side applications.
-
Clone the repository and navigate to the root directory:
-
Setup Python environment and activate it:
-
Install Swarms:
-
Headless install:
-
Desktop install:
-
-
Create and activate an Anaconda environment:
-
Clone the repository and navigate to the root directory:
-
Install Swarms:
-
Headless install:
-
Desktop install:
-
Docker is an excellent option for creating isolated and reproducible environments, suitable for both development and production.
Kubernetes provides an automated way to deploy, scale, and manage containerized applications.
-
Create a Deployment YAML file:
-
Apply the Deployment:
-
Expose the Deployment:
Integrating Swarms into your CI/CD pipeline ensures automated testing and deployment.
Using GitHub Actions¶
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.10
- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -e .
- name: Run tests
run: |
source venv/bin/activate
pytest
Using Jenkins¶
pipeline {
agent any
stages {
stage('Clone repository') {
steps {
git 'https://github.com/kyegomez/swarms.git'
}
}
stage('Setup Python') {
steps {
sh 'python3 -m venv venv'
sh 'source venv/bin/activate && pip install --upgrade pip'
}
}
stage('Install dependencies') {
steps {
sh 'source venv/bin/activate && pip install -e .'
}
}
stage('Run tests') {
steps {
sh 'source venv/bin/activate && pytest'
}
}
}
}