VM Allocator Service Package for Lablink
Project description
lablink-allocator-service
VM allocator service for the LabLink system.
This package provides the core Flask-based web application that manages VM allocation, assignment, and lifecycle for computational research workflows.
Features
- 🌐 Web Interface: Request and manage VMs via web dashboard
- 🔄 Dynamic Allocation: Automatically assign VMs to users based on availability
- 📊 PostgreSQL Database: Track VM status, assignments, and health
- 🔐 Authentication: Basic HTTP auth for admin endpoints
- ☁️ AWS Integration: Integrates with AWS EC2 via infrastructure templates
- 🐳 Docker Support: Run any containerized research software
- 🔍 Real-time Monitoring: Track VM health and status
- 🌐 Optional DNS: Support for custom domain configuration
Installation
From PyPI
pip install lablink-allocator-service
With uv (Recommended)
uv pip install lablink-allocator-service
Quick Start
Basic Usage
from lablink_allocator_service import main
# Run the Flask application
if __name__ == "__main__":
main.app.run(host="0.0.0.0", port=5000)
Configuration
Configuration is managed via Hydra with conf/config.yaml:
db:
dbname: "lablink"
user: "lablink"
password: "your_password"
host: "localhost"
port: 5432
app:
admin_user: "admin"
admin_password: "secure_password"
region: "us-west-2"
machine:
instance_type: "g4dn.xlarge"
docker_image: "your-registry/your-image:tag"
See the Configuration Guide for detailed options.
Development
Setup
# Clone the repository
git clone https://github.com/talmolab/lablink.git
cd lablink/lablink-allocator/lablink-allocator-service
# Install with development dependencies
uv sync --extra dev
# Run tests
uv run pytest
# Run with coverage
uv run pytest --cov=src/lablink_allocator_service
# Run linting
uv run ruff check src tests
Project Structure
lablink-allocator-service/
├── src/
│ └── lablink_allocator_service/
│ ├── main.py # Flask application
│ ├── database.py # Database operations
│ ├── conf/ # Configuration files
│ ├── templates/ # HTML templates
│ └── utils/ # Utility modules
├── tests/ # Test suite
├── pyproject.toml # Package configuration
└── README.md # This file
API Endpoints
Public Endpoints
GET /- Home pagePOST /request_vm- Request VM assignmentGET /admin- Admin dashboard (requires auth)
Internal Endpoints
POST /vm_startup- Client VM registrationPOST /vm_update- Client VM status updates
See the API Reference for complete documentation.
Deployment
This package is designed to be deployed as part of the LabLink infrastructure. For deployment instructions, see the LabLink Template Repository (coming soon).
Docker Deployment
The allocator service is containerized and published to GHCR. See lablink-allocator for the Docker image.
Documentation
- Full Documentation - Complete guide
- Configuration - Configuration options
- API Reference - API documentation
- Contributing - Development guide
Contributing
Contributions are welcome! Please see the Contributing Guide for details.
Quick Contribution Workflow
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make changes and add tests
- Run tests:
uv run pytest - Run linting:
uv run ruff check src tests - Commit:
git commit -m "feat(allocator): add my feature" - Push and open a Pull Request
Changelog
See the Allocator Changelog for release history.
License
BSD-3-Clause License. See LICENSE for details.
Links
- PyPI: https://pypi.org/project/lablink-allocator-service/
- Documentation: https://talmolab.github.io/lablink/
- Repository: https://github.com/talmolab/lablink
- Issues: https://github.com/talmolab/lablink/issues
- Discussions: https://github.com/talmolab/lablink/discussions
Project details
Release history Release notifications | RSS feed
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 lablink_allocator_service-0.0.2a0.tar.gz.
File metadata
- Download URL: lablink_allocator_service-0.0.2a0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ffcd23c19698a60b895066512e6c90e7165bd1655b7981ca48ca0ff968ac389
|
|
| MD5 |
4c3015d90f37f39d092f46bc272df76f
|
|
| BLAKE2b-256 |
114a210ae35699de3b125b70f90858e7ff1d2cfbe6608cb83b62310c210c213b
|
File details
Details for the file lablink_allocator_service-0.0.2a0-py3-none-any.whl.
File metadata
- Download URL: lablink_allocator_service-0.0.2a0-py3-none-any.whl
- Upload date:
- Size: 41.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e4cc17dd9fc1ef84898f29e31c248e3cf09911dbaa1e7c25602564f0e51bed8
|
|
| MD5 |
e95ac92144d7c6b90887f641aa839bb6
|
|
| BLAKE2b-256 |
4fc68c033fe2c6185528806bbb3888a0544a6304fe042dcefd4245ce9e0c5452
|