Async and sync client + CLI for the gpu-lock service.
Reason this release was yanked:
incomplete release — use 0.2.1
Project description
gpu-lock-client
Python client + CLI for the gpu-lock service — a FIFO priority mutex that coordinates shared GPU access between processes and Docker containers.
pip install gpu-lock-client
Quick use — CLI
export GPU_LOCK_URL=http://192.168.10.13:8090
# Acquire GPU 0, run a command, release on exit (sets CUDA_VISIBLE_DEVICES).
gpu-lock run --gpu 0 -- python train.py
# Let the server pick the least-busy GPU.
gpu-lock run --gpu auto -- bash
# Interactive priorities run ahead of the normal queue.
gpu-lock run --gpu auto --priority high -- python infer.py
# Low-priority batch work yields to everyone else.
gpu-lock run --gpu 0 --priority low -- python nightly_job.py
# Inspection
gpu-lock status
gpu-lock queue --gpu 0
Quick use — Python
from gpu_lock_client import gpu_lock, gpu_lock_sync, Priority
# Async
async with gpu_lock("my-service", gpu=0, ttl=300, priority=Priority.HIGH) as lease:
if lease:
os.environ["CUDA_VISIBLE_DEVICES"] = str(lease.gpu)
...
# Sync
with gpu_lock_sync("my-service", gpu="auto", ttl=300) as lease:
...
The context manager automatically heart-beats the lease in the background, so long-running jobs don't need to pick a huge TTL.
Passthrough mode
If GPU_LOCK_URL is empty or unset, every client call is a no-op: functions return None, context managers yield None, the CLI's run just execs the command. This lets the same code run on single-GPU dev machines without a gpu-lock service.
Auth
Set GPU_LOCK_TOKEN — the client sends it as Authorization: Bearer.
See the project README for the full protocol, server setup, and priority semantics.
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 gpu_lock_client-0.2.0.tar.gz.
File metadata
- Download URL: gpu_lock_client-0.2.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b5db66328a952edc148feee84997b9c4d22a00acd0d4142a52573cd0a1dfbd6
|
|
| MD5 |
979cc01596c4c830a039b6450e57b2cb
|
|
| BLAKE2b-256 |
f0790c0a387096b155aade9469acfec25c21a418d4b9f1cfa61942ecd0f0e20f
|
Provenance
The following attestation bundles were made for gpu_lock_client-0.2.0.tar.gz:
Publisher:
publish.yml on ildar-idrisov/gpu-lock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpu_lock_client-0.2.0.tar.gz -
Subject digest:
6b5db66328a952edc148feee84997b9c4d22a00acd0d4142a52573cd0a1dfbd6 - Sigstore transparency entry: 1342042206
- Sigstore integration time:
-
Permalink:
ildar-idrisov/gpu-lock@02df99bd371355a0f2d23f3f590b49d1ef77216f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ildar-idrisov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@02df99bd371355a0f2d23f3f590b49d1ef77216f -
Trigger Event:
push
-
Statement type:
File details
Details for the file gpu_lock_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gpu_lock_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729464e03263075d379cf9ec1f3b9bbfcae4a57da14312d8c9a1fcfe37875eba
|
|
| MD5 |
eff8cd9dc8c501961faecc7e1a6166f6
|
|
| BLAKE2b-256 |
d8b31a0522e717ea6d9276eb50c230c070c7558e571f298e93faddccb42779c2
|
Provenance
The following attestation bundles were made for gpu_lock_client-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on ildar-idrisov/gpu-lock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpu_lock_client-0.2.0-py3-none-any.whl -
Subject digest:
729464e03263075d379cf9ec1f3b9bbfcae4a57da14312d8c9a1fcfe37875eba - Sigstore transparency entry: 1342042322
- Sigstore integration time:
-
Permalink:
ildar-idrisov/gpu-lock@02df99bd371355a0f2d23f3f590b49d1ef77216f -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ildar-idrisov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@02df99bd371355a0f2d23f3f590b49d1ef77216f -
Trigger Event:
push
-
Statement type: