From 3dfbe2bea87c52367a1400f74bffc9faccb82e86 Mon Sep 17 00:00:00 2001 From: Tarun Pothulapati Date: Tue, 7 Jun 2022 10:38:35 +0000 Subject: [PATCH] add 4 cores and 6 GB Ram min requirements Signed-off-by: Tarun Pothulapati --- entrypoint.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index e0fd2f2..81a679f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,21 @@ set -eux -o pipefile +# check for minimum requirements +REQUIRED_MEM_KB=$((6 * 1024 * 1024)) +total_mem_kb=$(cat /proc/meminfo | awk '/MemTotal:/ {print $2}') +if [ $total_mem_kb -lt $((REQUIRED_MEM_KB)) ]; then + echo "Preview installation of Gitpod requires a system with at least 6GB of memory" + exit 1 +fi + +REQUIRED_CORES=4 +total_cores=$(nproc) +if [ $total_cores -lt $((REQUIRED_CORES)) ]; then + echo "Preview installation of Gitpod requires a system with at least 4 CPU Cores" + exit 1 +fi + # Get container's IP address NODE_IP=$(hostname -i) DOMAIN_STRING=${NODE_IP//[.]/-}