Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Release History
upcoming
++++++
* 'az containerapp env dapr-component resiliency': Add support for Dapr Component Resiliency Circuit Breakers
* 'az containerapp create/update/up': Don't compress jar/war/zip file before upload source code
* 'az containerapp create/update/up': Update source to cloud builder to 20240124.1

0.3.47
++++++
Expand Down
30 changes: 18 additions & 12 deletions src/containerapp/azext_containerapp/_cloud_build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,28 +129,34 @@ def spin():
thread.join()

# Source code compression
done_spinner = False
thread = display_spinner(f"Compressing data: {font_bold}{source}{font_default}")
tar_file_path = os.path.join(tempfile.gettempdir(), f"{build_name}.tar.gz")
archive_source_code(tar_file_path, source)
done_spinner = True
thread.join()
data_file_path = source
source_is_folder = os.path.isdir(source)
if source_is_folder:
done_spinner = False
thread = display_spinner(f"Compressing data: {font_bold}{source}{font_default}")
data_file_path = os.path.join(tempfile.gettempdir(), f"{build_name}.tar.gz")
archive_source_code(data_file_path, source)
done_spinner = True
thread.join()

# File upload
done_spinner = False
thread = display_spinner("Uploading compressed data")
thread = display_spinner("Uploading data")
headers = {'Authorization': 'Bearer ' + token}
try:
tar_file = open(tar_file_path, "rb")
files = [("file", ("build_data.tar.gz", tar_file, "application/x-tar"))]
data_file = open(data_file_path, "rb")
file_name = os.path.basename(data_file_path)
files = [("file", (file_name, data_file))]
Comment thread
KaiqianYang marked this conversation as resolved.
response_file_upload = requests.post(
upload_endpoint,
files=files,
headers=headers)
finally:
# Close and delete the file now that it was uploaded.
tar_file.close()
os.unlink(tar_file_path)
# Close the file now that it was uploaded.
data_file.close()
# if customer uploaded source file is a folder, delete the temp compressed file
if source_is_folder:
os.unlink(data_file_path)
if not response_file_upload.ok:
raise ValidationError(f"Error when uploading the file, request exited with {response_file_upload.status_code}")
done_spinner = True
Expand Down
4 changes: 2 additions & 2 deletions src/containerapp/azext_containerapp/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
timeout: 1800
"""

ACA_BUILDER_BULLSEYE_IMAGE = "mcr.microsoft.com/oryx/builder:debian-bullseye-20231107.2"
ACA_BUILDER_BOOKWORM_IMAGE = "mcr.microsoft.com/oryx/builder:debian-bookworm-20231107.2"
ACA_BUILDER_BULLSEYE_IMAGE = "mcr.microsoft.com/oryx/builder:debian-bullseye-20240124.1"
Comment thread
KaiqianYang marked this conversation as resolved.
ACA_BUILDER_BOOKWORM_IMAGE = "mcr.microsoft.com/oryx/builder:debian-bookworm-20240124.1"

DEFAULT_PORT = 8080 # used for no dockerfile scenario; not the hello world image

Expand Down
Loading