fix: bound static build memory #3
|
|
@ -91,6 +91,13 @@ spec:
|
||||||
value: $(params.target-directory)
|
value: $(params.target-directory)
|
||||||
- name: BUILD_CONFIGURATION
|
- name: BUILD_CONFIGURATION
|
||||||
value: $(params.build-configuration)
|
value: $(params.build-configuration)
|
||||||
|
- name: NODE_OPTIONS
|
||||||
|
value: --max-old-space-size=384
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
memory: 512Mi
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
@ -111,6 +118,11 @@ spec:
|
||||||
mkdir -p "$layer_dir/$target_path"
|
mkdir -p "$layer_dir/$target_path"
|
||||||
cp -R "$OUTPUT_DIRECTORY"/. "$layer_dir/$target_path/"
|
cp -R "$OUTPUT_DIRECTORY"/. "$layer_dir/$target_path/"
|
||||||
tar -C "$layer_dir" -cf "$SOURCE_PATH/layer.tar" "$target_path"
|
tar -C "$layer_dir" -cf "$SOURCE_PATH/layer.tar" "$target_path"
|
||||||
|
for memory_peak_path in /sys/fs/cgroup/memory.peak /sys/fs/cgroup/memory/memory.max_usage_in_bytes; do
|
||||||
|
if [ -r "$memory_peak_path" ] && memory_peak=$(cat "$memory_peak_path"); then
|
||||||
|
case "$memory_peak" in ''|*[!0-9]*) ;; *) printf 'cgroup memory peak: %s\n' "$memory_peak"; break ;; esac
|
||||||
|
fi
|
||||||
|
done
|
||||||
---
|
---
|
||||||
apiVersion: tekton.dev/v1
|
apiVersion: tekton.dev/v1
|
||||||
kind: Task
|
kind: Task
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,12 @@ for name in maidn-git-clone maidn-node-static-build maidn-node-static-push; do
|
||||||
done
|
done
|
||||||
|
|
||||||
grep -qF 'git clone "$REPOSITORY_URL" "$SOURCE_PATH"' "$tmp/maidn-git-clone"
|
grep -qF 'git clone "$REPOSITORY_URL" "$SOURCE_PATH"' "$tmp/maidn-git-clone"
|
||||||
grep -qF 'tar -C "$layer_dir" -cf layer.tar "$target_path"' "$tmp/maidn-node-static-build"
|
grep -qF 'value: --max-old-space-size=384' "$tmp/maidn-node-static-build"
|
||||||
|
grep -qF 'memory: 256Mi' "$tmp/maidn-node-static-build"
|
||||||
|
grep -qF 'memory: 512Mi' "$tmp/maidn-node-static-build"
|
||||||
|
grep -qF 'tar -C "$layer_dir" -cf "$SOURCE_PATH/layer.tar" "$target_path"' "$tmp/maidn-node-static-build"
|
||||||
|
grep -qF 'for memory_peak_path in /sys/fs/cgroup/memory.peak /sys/fs/cgroup/memory/memory.max_usage_in_bytes; do' "$tmp/maidn-node-static-build"
|
||||||
|
grep -qF "if [ -r \"\$memory_peak_path\" ] && memory_peak=\$(cat \"\$memory_peak_path\"); then" "$tmp/maidn-node-static-build"
|
||||||
grep -qF 'image: gcr.io/go-containerregistry/crane:v0.21.7' "$tmp/maidn-node-static-push"
|
grep -qF 'image: gcr.io/go-containerregistry/crane:v0.21.7' "$tmp/maidn-node-static-push"
|
||||||
grep -qF ' - append' "$tmp/maidn-node-static-push"
|
grep -qF ' - append' "$tmp/maidn-node-static-push"
|
||||||
grep -qF 'mountPath: /tekton/home/.docker' "$tmp/maidn-node-static-push"
|
grep -qF 'mountPath: /tekton/home/.docker' "$tmp/maidn-node-static-push"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue