Merge branch 'master' into 13937-keepstore-prometheus
[arvados.git] / sdk / cwl / tests / wf / check_mem.py
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 from __future__ import print_function
6 from __future__ import division
7
8 import arvados
9 import sys
10 import os
11
12 if "JOB_UUID" in os.environ:
13     requested = arvados.api().jobs().get(uuid=os.environ["JOB_UUID"]).execute()["runtime_constraints"]["min_ram_mb_per_node"]
14 else:
15     requested = arvados.api().containers().current().execute()["runtime_constraints"]["ram"] // (1024*1024)
16
17 print("Requested %d expected %d" % (requested, int(sys.argv[1])))
18
19 exit(0 if requested == int(sys.argv[1]) else 1)