File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -388,3 +388,7 @@ batch:
388388 retry-attempts: 5
389389 # check store if metatile already exists, and if so skip processing
390390 check-metatile-exists: true
391+ # optional override memory reserved for container when submiting job
392+ # NOTE: in megabytes
393+ # https://docs.aws.amazon.com/batch/latest/APIReference/API_ContainerOverrides.html
394+ memory:
Original file line number Diff line number Diff line change @@ -1895,6 +1895,7 @@ def tilequeue_batch_enqueue(cfg, peripherals):
18951895 assert job_queue , 'Missing batch job-queue config'
18961896
18971897 retry_attempts = batch_yaml .get ('retry-attempts' )
1898+ memory = batch_yaml .get ('memory' )
18981899
18991900 dim = 2 ** queue_zoom
19001901 z = queue_zoom
@@ -1911,22 +1912,23 @@ def tilequeue_batch_enqueue(cfg, peripherals):
19111912 '--config' , '/etc/tilequeue/config.yaml' ,
19121913 '--tile' , coord_str ,
19131914 ]
1915+ container_overrides = dict (command = job_cmd )
19141916 job_opts = dict (
19151917 jobDefinition = job_def ,
19161918 jobQueue = job_queue ,
19171919 jobName = job_name ,
1918- containerOverrides = {
1919- 'command' : job_cmd ,
1920- },
1920+ containerOverrides = container_overrides ,
19211921 )
19221922 if retry_attempts is not None :
19231923 job_opts ['retryStrategy' ] = dict (attempts = retry_attempts )
1924+ if memory :
1925+ container_overrides ['memory' ] = memory
19241926 resp = client .submit_job (** job_opts )
19251927 assert resp ['ResponseMetadata' ]['HTTPStatusCode' ] == 200 , \
19261928 'Failed to submit job: %s' % 'JobName'
19271929 i += 1
1928- if i % 10000 == 0 :
1929- print i
1930+ if i % 1000 == 0 :
1931+ print '%d jobs submitted' % i
19301932
19311933 logger .info ('Batch enqueue ... done' )
19321934
You can’t perform that action at this time.
0 commit comments