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:
388
388
retry-attempts: 5
389
389
# check store if metatile already exists, and if so skip processing
390
390
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):
1895
1895
assert job_queue , 'Missing batch job-queue config'
1896
1896
1897
1897
retry_attempts = batch_yaml .get ('retry-attempts' )
1898
+ memory = batch_yaml .get ('memory' )
1898
1899
1899
1900
dim = 2 ** queue_zoom
1900
1901
z = queue_zoom
@@ -1911,22 +1912,23 @@ def tilequeue_batch_enqueue(cfg, peripherals):
1911
1912
'--config' , '/etc/tilequeue/config.yaml' ,
1912
1913
'--tile' , coord_str ,
1913
1914
]
1915
+ container_overrides = dict (command = job_cmd )
1914
1916
job_opts = dict (
1915
1917
jobDefinition = job_def ,
1916
1918
jobQueue = job_queue ,
1917
1919
jobName = job_name ,
1918
- containerOverrides = {
1919
- 'command' : job_cmd ,
1920
- },
1920
+ containerOverrides = container_overrides ,
1921
1921
)
1922
1922
if retry_attempts is not None :
1923
1923
job_opts ['retryStrategy' ] = dict (attempts = retry_attempts )
1924
+ if memory :
1925
+ container_overrides ['memory' ] = memory
1924
1926
resp = client .submit_job (** job_opts )
1925
1927
assert resp ['ResponseMetadata' ]['HTTPStatusCode' ] == 200 , \
1926
1928
'Failed to submit job: %s' % 'JobName'
1927
1929
i += 1
1928
- if i % 10000 == 0 :
1929
- print i
1930
+ if i % 1000 == 0 :
1931
+ print '%d jobs submitted' % i
1930
1932
1931
1933
logger .info ('Batch enqueue ... done' )
1932
1934
You can’t perform that action at this time.
0 commit comments