Checklist
- [x] I've prepended issue tag with type of change: [bug]
- [x] (If applicable) I've attached the script to reproduce the bug
- [x] (If applicable) I've documented below the DLC image/dockerfile this relates to
- [x] (If applicable) I've documented below the tests I've run on the DLC image
- [] I'm using an existing DLC image listed here: https://docs.aws.amazon.com/deep-learning-containers/latest/devguide/deep-learning-containers-images.html
- [x] I've built my own container based off DLC (and I've attached the code used to build my own image)
Concise Description:
When I try to build DLC in my account '027412998179', I see random failures. Diving in & printing error messages points that somewhere in the code, we are treading account id as an integer and hence the code remove the prefix zeros.
pre-push container image in the log: 27412998179.dkr.ecr.us-east-1.amazonaws.com/sagemaker-inference-pyt-debug:1.7.1-cpu-py36-ubuntu18.04-2022-06-15-04-46-49-pre-push
DLC image/dockerfile:
command: python src/main.py --buildspec pytorch/buildspec-1-7-1.yml --framework pytorch --image_types inference --device_types cpu --py_versions py3
Current behavior:
Failed at safety check
safety check command returned non-zero error code. This indicates that vulnerabilities might exist.
BuildCPUPTTrainPy3DockerImage..........Not Built BuildGPUPTTrainPy3DockerImage..........Not Built BuildCPUPTInferencePy3DockerImage
Traceback (most recent call last):
File "src/main.py", line 99, in
main()
File "src/main.py", line 95, in main
image_builder(buildspec_file)
File "/home/ec2-user/deep-learning-containers/src/image_builder.py", line 253, in image_builder
pushed_images += process_images(parent_images, "Parent/Independent")
File "/home/ec2-user/deep-learning-containers/src/image_builder.py", line 314, in process_images
build_images(common_stage_image_list, make_dummy_boto_client=True)
File "/home/ec2-user/deep-learning-containers/src/image_builder.py", line 450, in build_images
FORMATTER.progress(THREADS)
File "/home/ec2-user/deep-learning-containers/src/output.py", line 104, in progress
"." * 10 + constants.STATUS_MESSAGE[futures[image].result()]
File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 428, in result
return self.__get_result()
File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib64/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/ec2-user/deep-learning-containers/src/image.py", line 147, in build
self.update_pre_build_configuration()
File "/home/ec2-user/deep-learning-containers/src/common_stage_image.py", line 51, in update_pre_build_configuration
pre_push_stage_image_uri, image_info=self.info, storage_file_path=storage_file_path
File "/home/ec2-user/deep-learning-containers/src/utils.py", line 545, in generate_safety_report_for_image
safety_scan_output = SafetyReportGenerator(container_id, ignore_dict=ignore_dict).generate()
File "/home/ec2-user/deep-learning-containers/src/safety_report_generator.py", line 165, in generate
scanned_vulnerabilities = json.loads(self.safety_check_output)
File "/usr/lib64/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Expected behavior:
Image build should work even for prefix 0 accounts
Additional context: