-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 arguments #8
base: main
Are you sure you want to change the base?
S3 arguments #8
Conversation
|
||
# Download the file from S3 | ||
download_path = f"/tmp/{os.path.basename(input_key)}" | ||
print(f"Downloading file: {input_key} from bucket: {input_bucket}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace all print
statements with self.logger.info(...)
"s3-file", help="Process a single JP2 file in S3" | ||
) | ||
s3_file_parser.add_argument( | ||
"input_bucket", help="Name of the AWS S3 bucket containing the JP2 file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change from:
"input_bucket", help="Name of the AWS S3 bucket containing the JP2 file"
to:
"--input_bucket", help="Name of the AWS S3 bucket containing the JP2 file", required=True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this still be required after adding the -- flag? and it will be --input-bucket instead of --input_bucket
s3_file_parser.add_argument( | ||
"--input-key", help="Key (path) of the JP2 file in the S3 bucket", required=True | ||
) | ||
s3_file_parser.add_argument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make required
s3_file_parser.add_argument( | ||
"--output-bucket", help="Name of the AWS S3 bucket to upload the modified file (optional)" | ||
) | ||
s3_file_parser.add_argument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to leave it as an option or remove completely? if it is optional but not used, it defaults to the input bucket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep this one, after discussion with andrew
s3_file_parser.add_argument( | ||
"--output-prefix", help="Prefix for the uploaded file in the output bucket (optional)", default="" | ||
) | ||
s3_file_parser.add_argument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now it is optional, is there a situation where you wouldn't want to use the --output-prefix option, such as if you wanted to just put it in the same input directory, or same bucket?
|
new arguments for you
Testing steps:
mkdir logs
5.
./bin/docker-build.sh
container has to be alive, e.g.
docker run --rm --mount type=bind,source=${PWD},target=/data -it --entrypoint /bin/bash artifactory.huit.harvard.edu/lts/jp2_remediator $@
./bin/docker-run.sh file /data/[your_test_images_folder]/[testfile.jp2]
./bin/docker-run.sh directory /data/[your_test_images_folder]
INPUT BUCKET/PREFIX > OUTPUT BUCKET/PREFIX
only input bucket name is required, other arguments are optional and would refer to the default input bucket as output
INPUT FILE > OUTPUT FILE
INPUT FILE > OUTPUT PREFIX
specifying output prefix instead of output key, appends _modified_yyyymmdd.jp2 to single file: