[bugfix] add-resource-quotas-for-pg-jobs-and-fix-install-generate (#1051)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added default resource specifications for PostgreSQL jobs to ensure
consistent CPU and memory allocation.
- **Chores**
  - Updated the chart version for the PostgreSQL application.
  - Refreshed version mapping to reflect the latest release.
- Improved Node.js setup and package installation in the pre-commit
workflow.
- **Tests**
- Increased memory allocation for QEMU virtual machines in end-to-end
tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
klinch0
2025-06-12 10:10:26 +03:00
committed by GitHub
7 changed files with 21 additions and 6 deletions

View File

@@ -30,12 +30,13 @@ jobs:
run: |
sudo apt update
sudo apt install curl -y
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install nodejs -y
git clone https://github.com/bitnami/readme-generator-for-helm
sudo apt install npm -y
git clone --branch 2.7.0 --depth 1 https://github.com/bitnami/readme-generator-for-helm.git
cd ./readme-generator-for-helm
npm install
npm install -g pkg
npm install -g @yao-pkg/pkg
pkg . -o /usr/local/bin/readme-generator
- name: Run pre-commit hooks

View File

@@ -102,7 +102,7 @@ EOF
@test "Boot QEMU VMs" {
for i in 1 2 3; do
qemu-system-x86_64 -machine type=pc,accel=kvm -cpu host -smp 8 -m 16384 \
qemu-system-x86_64 -machine type=pc,accel=kvm -cpu host -smp 8 -m 24576 \
-device virtio-net,netdev=net0,mac=52:54:00:12:34:5${i} \
-netdev tap,id=net0,ifname=cozy-srv${i},script=no,downscript=no \
-drive file=srv${i}/system.img,if=virtio,format=raw \

View File

@@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.12.1
version: 0.13.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to

View File

@@ -0,0 +1,11 @@
{{/*
Generate resource requirements based on ResourceQuota named as the namespace.
*/}}
{{- define "postgresjobs.defaultResources" }}
cpu: "1"
memory: 512Mi
{{- end }}
{{- define "postgresjobs.resources" }}
resources:
{{ include "cozy-lib.resources.sanitize" (list (include "postgresjobs.defaultResources" $ | fromYaml) $) | nindent 2 }}
{{- end }}

View File

@@ -81,6 +81,7 @@ spec:
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
{{- include "postgresjobs.resources" . | nindent 12 }}
volumes:
- name: scripts
secret:

View File

@@ -50,6 +50,7 @@ spec:
name: secret
- mountPath: /scripts
name: scripts
{{- include "postgresjobs.resources" . | nindent 8 }}
securityContext:
fsGroup: 26
runAsGroup: 26

View File

@@ -110,7 +110,8 @@ postgres 0.10.0 721c12a7
postgres 0.10.1 93bdf411
postgres 0.11.0 f9f8bb2f
postgres 0.12.0 6130f43d
postgres 0.12.1 HEAD
postgres 0.12.1 632224a3
postgres 0.13.0 HEAD
rabbitmq 0.1.0 263e47be
rabbitmq 0.2.0 53f2365e
rabbitmq 0.3.0 6c5cf5bf