Heiheihaha17's picture
Add files using upload-large-folder tool
347d9a3 verified
Raw History Blame Contribute Delete
418 Bytes
"""Compute guard: allocated cluster jobs or explicitly enabled local reproduction."""
import os,socket
def ensure_compute():
if os.environ.get('DISH_ALLOW_LOCAL_RENDER')=='1':return
if 'debug' not in socket.gethostname().lower() and os.environ.get('KUBERNETES_SERVICE_HOST'):return
raise RuntimeError('Use an allocated CPU job; on your own reproduction machine explicitly set DISH_ALLOW_LOCAL_RENDER=1')