DIRAC Distributed Computing Framework
DIRAC is an interware, a software framework for distributed computing, primarily used in scientific research for managing jobs, data, and resources across heterogeneous infrastructures like Grids and Clouds. As of version 9.1.6, it supports Python 3.11 and newer, with frequent patch releases addressing fixes and minor changes, and less frequent major updates introducing significant features and deployment considerations.
Warnings
- breaking Major database schema changes and Configuration Server updates are required for existing deployments upgrading to DIRAC 9.1.0 and 9.1.1. These changes include dropping and altering MySQL tables, and removing Configuration Server entries.
- breaking DIRAC 9.x requires Python 3.11 or newer. Attempting to install or run with older Python versions (e.g., Python 3.10 or earlier) will lead to dependency resolution failures or runtime errors.
- gotcha DIRAC is a comprehensive distributed computing *framework*, not just a Python library. `pip install dirac` only provides client-side functionality and core components. A full DIRAC deployment requires extensive setup, including services, databases (e.g., MySQL), web interfaces, and specific configuration, which is significantly more complex than simple package installation.
- gotcha Interacting with remote DIRAC services (e.g., submitting jobs, querying status) typically relies on X.509 VOMS proxies for user authentication and authorization. Expired or improperly initialized proxies (`voms-proxy-init`) are a frequent cause of 'permission denied' or authentication errors.
- breaking In version 9.1.3, the CLI flag `--diracx-dist-dir` was replaced by `--diracx-src-dir` for certain deployment and CI-related scripts. Scripts or automation relying on the old flag will fail.
Install
-
pip install dirac
Imports
- Dirac
from DIRAC.Interfaces.API.Dirac import Dirac
Quickstart
from DIRAC.Interfaces.API.Dirac import Dirac
import os
try:
# Initialize the main DIRAC client interface
dirac_client = Dirac()
# Get the framework version (this is a local check and does not require a DIRAC server)
version = dirac_client.getFrameworkVersion()
print(f"DIRAC client initialized successfully. Framework Version: {version}")
# For operations that require connecting to a DIRAC server (e.g., job submission, status checks),
# you would typically need:
# 1. A valid X.509 VOMS proxy initialized (e.g., `voms-proxy-init`)
# 2. The DIRAC Configuration Server (CS) URL configured, usually via an environment variable
# e.g., os.environ.get('DIRAC_CS_URL', 'https://example.com:8443/Configuration/Server')
# Without a running CS and proper authentication, remote calls will fail.
except Exception as e:
print(f"Error initializing DIRAC client or getting version: {e}")
print("Ensure 'dirac' package is installed and Python >= 3.11 is used.")