File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 77 needs_layer_publish : true
88 suffix : amd64
99 layer_name_base_suffix : " "
10+ max_layer_compressed_size_mb : 20
11+ max_layer_uncompressed_size_mb : 54
1012
1113 - name : arm64
1214 arch : arm64
@@ -16,6 +18,8 @@ flavors:
1618 needs_layer_publish : true
1719 suffix : arm64
1820 layer_name_base_suffix : " -ARM"
21+ max_layer_compressed_size_mb : 18
22+ max_layer_uncompressed_size_mb : 50
1923
2024 - name : amd64, alpine
2125 arch : amd64
@@ -41,6 +45,8 @@ flavors:
4145 needs_layer_publish : true
4246 suffix : amd64-fips
4347 layer_name_base_suffix : " -FIPS"
48+ max_layer_compressed_size_mb : 21
49+ max_layer_uncompressed_size_mb : 55
4450
4551 - name : arm64, fips
4652 arch : arm64
@@ -50,6 +56,8 @@ flavors:
5056 needs_layer_publish : true
5157 suffix : arm64-fips
5258 layer_name_base_suffix : " -FIPS-ARM"
59+ max_layer_compressed_size_mb : 19
60+ max_layer_uncompressed_size_mb : 51
5361
5462 - name : amd64, fips, alpine
5563 arch : amd64
Original file line number Diff line number Diff line change 99
1010set -e
1111
12+ if [ -z " $MAX_LAYER_COMPRESSED_SIZE_MB " ]; then
13+ printf " [ERROR]: MAX_LAYER_COMPRESSED_SIZE_MB not specified\n"
14+ exit 1
15+ fi
16+
17+ if [ -z " $MAX_LAYER_UNCOMPRESSED_SIZE_MB " ]; then
18+ printf " [ERROR]: MAX_LAYER_UNCOMPRESSED_SIZE_MB not specified\n"
19+ exit 1
20+ fi
21+
1222validate_size () {
1323 local max_size=$1
1424 local file_size=$2
@@ -23,8 +33,8 @@ if [ -z "$LAYER_FILE" ]; then
2333 exit 1
2434fi
2535
26- MAX_LAYER_COMPRESSED_SIZE_KB=$(( 23 * 1024 )) # 23 MB, amd64 is 22, while arm64 is 20
27- MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(( 54 * 1024 )) # 53 MB, amd is 53, while arm64 is 47
36+ MAX_LAYER_COMPRESSED_SIZE_KB=$(( $MAX_LAYER_COMPRESSED_SIZE_MB * 1024 ))
37+ MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(( $MAX_LAYER_UNCOMPRESSED_SIZE_MB * 1024 ))
2838
2939FILE=" .layers" /$LAYER_FILE
3040FILE_SIZE=$( stat --printf=" %s" " $FILE " )
Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ check layer size ({{ $flavor.name }}):
121121 - layer ({{ $flavor.name }})
122122 variables:
123123 LAYER_FILE: datadog_extension-{{ $flavor.suffix }}.zip
124+ MAX_LAYER_COMPRESSED_SIZE_MB: {{ $flavor.max_layer_compressed_size_mb }}
125+ MAX_LAYER_UNCOMPRESSED_SIZE_MB: {{ $flavor.max_layer_uncompressed_size_mb }}
124126 script:
125127 - .gitlab/scripts/check_layer_size.sh
126128
You can’t perform that action at this time.
0 commit comments