Documentation for nk2dl (aka Nuke to Deadline).
[!NOTE] Documentation is auto-generated with claude-3.7, may not be current or accurate and is subject to change.
The nk2dl
package provides utilities for connecting to Deadline render management systems through both command-line and web service interfaces.
There are two ways to connect to Deadline:
Connection settings can be configured via:
Environment Variable | Description | Default |
---|---|---|
NK2DL_DEADLINE_USE__WEB__SERVICE |
Use web service instead of command line | False |
NK2DL_DEADLINE_HOST |
Hostname for Deadline Web Service | localhost |
NK2DL_DEADLINE_PORT |
Port for Deadline Web Service | 8081 |
NK2DL_DEADLINE_SSL |
Enable SSL connection | False |
NK2DL_DEADLINE_SSL__CERT |
Path to SSL certificate file | None |
NK2DL_DEADLINE_COMMANDLINE__ON__FAIL |
Fall back to command line if web service fails | True |
Note on double underscores: Notice that some environment variables contain double underscores (__
). This is a special convention used in nk2dl
where single underscores in configuration keys are replaced with double underscores in environment variables. For example, use_web_service
becomes USE__WEB__SERVICE
. This allows the configuration system to distinguish between underscores that separate parts of the variable name (prefix, section, key) and underscores that are part of the actual configuration key. See the Config Documentation for more details.
The command-line connection requires:
deadlinecommand
executable in your system PATHThe web service connection requires:
For best performance, it’s recommended to use the Deadline Web Service.
The nk2dl
package includes a test script to verify connectivity to your Deadline server.
This script tests both command-line and web service connectivity to ensure your Deadline setup is working correctly.
# Basic usage
python tests/test_deadline_connection.py
# With virtual environment
./.venv/Scripts/python tests/test_deadline_connection.py
Set these environment variables before running the test:
# Windows PowerShell
$env:PYTHONPATH = "C:\path\to\nk2dl" # Location of the nk2dl package
$env:DEADLINE_PATH = "C:\Program Files\Thinkbox\Deadline10\bin" # Deadline installation directory
# Linux/macOS
export PYTHONPATH=/path/to/nk2dl
export DEADLINE_PATH=/path/to/deadline/bin
To test web service connectivity:
# Windows PowerShell
$env:NK2DL_DEADLINE_USE__WEB__SERVICE = "True"
$env:NK2DL_DEADLINE_HOST = "deadline-server"
$env:NK2DL_DEADLINE_PORT = "8081"
$env:NK2DL_DEADLINE_SSL = "False"
python tests/test_deadline_connection.py
# Linux/macOS
export NK2DL_DEADLINE_USE__WEB__SERVICE=True
export NK2DL_DEADLINE_HOST=deadline-server
export NK2DL_DEADLINE_PORT=8081
export NK2DL_DEADLINE_SSL=False
python tests/test_deadline_connection.py
[!WARNING] SSL support appears to be currently broken
For secure connections with SSL:
# Windows PowerShell
$env:NK2DL_DEADLINE_USE__WEB__SERVICE = "True"
$env:NK2DL_DEADLINE_HOST = "deadline-server"
$env:NK2DL_DEADLINE_PORT = "4434" # Typical SSL port
$env:NK2DL_DEADLINE_SSL = "True"
$env:NK2DL_DEADLINE_SSL__CERT = "C:\path\to\certificate.pxf"
python tests/test_deadline_connection.py
# Linux/macOS
export NK2DL_DEADLINE_USE__WEB__SERVICE=True
export NK2DL_DEADLINE_HOST=deadline-server
export NK2DL_DEADLINE_PORT=4434
export NK2DL_DEADLINE_SSL=True
export NK2DL_DEADLINE_SSL__CERT=/path/to/certificate.pxf
python tests/test_deadline_connection.py
The test script will:
If all tests pass, the script will exit with code 0. If any test fails, it will exit with code 1.
```python from nk2dl.deadline.connection import DeadlineConnection from nk2dl.common.errors import DeadlineError
try: # Create connection (uses configuration from config files/environment) conn = DeadlineConnection()
# Ensure connection is established
conn.ensure_connected()
# Get available groups
groups = conn.get_groups()
print(f"Available groups: {groups}")
# Submit a job
job_info = {
'BatchName': 'Test Batch',
'Name': 'Test Job',
'Plugin': 'Python',
# ... other job parameters
}
plugin_info = {
'Version': '3.7',
# ... plugin-specific parameters
}
job_id = conn.submit_job(job_info, plugin_info)
print(f"Submitted job with ID: {job_id}")
except DeadlineError as e: print(f”Deadline error: {e}”)