Each Valohai job includes a set of environment variables and configuration files that contain details about the execution in which your code is running.
You can find the list of environment variables on our docs page.
Access these environment variables like you'd access any other environment variable: project_id = os.getenv('VH_PROJECT_ID')
Each execution will also include files like /valohai/config/execution.json
that you can parse inside your code and get details like the execution number, project name, tags, etc.
import json
with open('/valohai/config/execution.json') as f:
data = json.load(f)
project = data['valohai.project-name']
print(f'Project name: {project}')
Comments
0 comments
Please sign in to leave a comment.