8000 chore: [SVLS-6279] parametrize and adjust max layer sizes · DataDog/datadog-lambda-extension@4afc16a · GitHub
[go: up one dir, main page]

Skip to content

Commit 4afc16a

Browse files
chore: [SVLS-6279] parametrize and adjust max layer sizes
1 parent a3f877d commit 4afc16a

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.gitlab/datasources/flavors.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ flavors:
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

.gitlab/scripts/check_layer_size.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99

1010
set -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+
1222
validate_size() {
1323
local max_size=$1
1424
local file_size=$2
@@ -23,8 +33,8 @@ if [ -z "$LAYER_FILE" ]; then
2333
exit 1
2434
fi
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

2939
FILE=".layers"/$LAYER_FILE
3040
FILE_SIZE=$(stat --printf="%s" "$FILE")

.gitlab/templates/pipeline.yaml.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)
0