Aws batch hillshade - #2
Conversation
and increase job size to avoid too many requests exception
| RUN rm /bin/sh && ln -s /bin/bash /bin/sh | ||
|
|
||
| # install awscli | ||
| RUN apt update && apt install awscli -y |
There was a problem hiding this comment.
combine apt installs into one install apt install awscli jq -y
its also a good idea to clean up the packages after install, I cant remember the exact command but its something like && apt-cache-clean
| @@ -0,0 +1,32 @@ | |||
| #!/bin/bash | |||
| cd ./app | |||
| tmp_dir=$(mktemp -d -t hs-XXXXXXXXXX) | |||
There was a problem hiding this comment.
generally use long form arguments to make it easier to read -d vs --directory
| @@ -0,0 +1,63 @@ | |||
| import cdk = require('@aws-cdk/core'); | |||
There was a problem hiding this comment.
never use require
import * as cdk from '@aws-cdk/core| let string = '' | ||
| for await (let file_name of fsa.list(ReadFromFolder)) { | ||
| // let re = /\ /gi; | ||
| // file_name = file_name.replace(re, '\\ ') |
There was a problem hiding this comment.
would be a good idea to simplify this down
const goodExtension = new Set('tif', 'tiff', 'asc')
cosnt ext = extname(file_name)
if (ext in file_extensions) {
file_name.replace(ext, 'tiff')
}
| fileList = fileList.concat(string) | ||
| count++ | ||
| } | ||
| if (count == 25) { |
There was a problem hiding this comment.
const RecordsPerJob = 25
if (fileList.length >= RecordsPerJob)
| } | ||
| } | ||
| if (count > 0) { | ||
| submit(correlationId, "final-upload-" + upload_count, fileList) |
| let base = '' | ||
| let string = '' | ||
| for await (let file_name of fsa.list(ReadFromFolder)) { | ||
| // let re = /\ /gi; |
There was a problem hiding this comment.
The escaping is a problem in bash, I would leave these names alone
added await submit fix handling of file list convert to python script tidy up and delete temp_dir added logging
replaced by python script
paulfouquet
left a comment
There was a problem hiding this comment.
Does the script work with the bad indentation?
| os.environ["AWS_SECRET_ACCESS_KEY"]=credentials['SecretAccessKey'] | ||
| os.environ["AWS_SESSION_TOKEN"]=credentials['SessionToken'] | ||
|
|
||
| temp_dir = tempfile.mkdtemp() |
There was a problem hiding this comment.
The indentation is weird here?
batch process to create hillshades.
not included: