From e5ab505057a68506678be3c8e5a4a0d4fea93087 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Oct 2024 15:26:44 -0400 Subject: [PATCH 1/7] fix: needs git in buildInputs too --- nix/ext/wrappers/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 74b94f9f9..2295bfd57 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -29,7 +29,7 @@ buildPgrxExtension_0_12_6 rec { }; nativeBuildInputs = [ pkg-config cargo ]; - buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [ + buildInputs = [ openssl postgresql git ] ++ lib.optionals (stdenv.isDarwin) [ darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Security darwin.apple_sdk.frameworks.SystemConfiguration From 30c13f8b8a1cb81e4562b244c00b764dbf099a14 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Oct 2024 15:28:55 -0400 Subject: [PATCH 2/7] fix: git on inputs in func --- nix/ext/wrappers/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 2295bfd57..df44de35f 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -9,6 +9,7 @@ , darwin , jq , rust-bin +, git }: let rustVersion = "1.80.0"; From cee882ecd542c68af1f798e18c64816d3bc1c375 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Oct 2024 15:52:42 -0400 Subject: [PATCH 3/7] fix: should be remove git --- ansible/tasks/stage2-setup-postgres.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 3b8d9ad02..4e9003ace 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -43,12 +43,13 @@ sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install github:supabase/postgres/{{ git_commit_sha }}#{{postgresql_version}}_src" when: stage2_nix -- name: Install Git for Nix package management +- name: Remove Git after Nix package installations become: yes apt: name: git - state: present - update_cache: yes + state: absent + autoremove: yes + purge: yes when: stage2_nix - name: Set ownership and permissions for /etc/ssl/private From ebcb94bb5e6470f4dbbf2cc8a30e530197799c8b Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Oct 2024 16:00:57 -0400 Subject: [PATCH 4/7] fix: add git to dockerfile for clickhouse dep --- Dockerfile-15 | 1 + Dockerfile-16 | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile-15 b/Dockerfile-15 index ce83237f2..5606f9358 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -48,6 +48,7 @@ RUN apt update -y && apt install -y \ software-properties-common \ wget \ sudo \ + git \ && apt clean diff --git a/Dockerfile-16 b/Dockerfile-16 index db5772cee..756374004 100644 --- a/Dockerfile-16 +++ b/Dockerfile-16 @@ -48,6 +48,7 @@ RUN apt update -y && apt install -y \ software-properties-common \ wget \ sudo \ + git \ && apt clean From eda9665fc31f0c81d8cac7ce9a0674464f1ccd78 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Oct 2024 16:46:17 -0400 Subject: [PATCH 5/7] fix: non interactive tzdata --- Dockerfile-15 | 8 ++++---- Dockerfile-16 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 5606f9358..a4cfe53b7 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -103,11 +103,11 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata + apt-get install -y --no-install-recommends tzdata && \ + ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure -f noninteractive tzdata RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/Dockerfile-16 b/Dockerfile-16 index 756374004..1017fd443 100644 --- a/Dockerfile-16 +++ b/Dockerfile-16 @@ -103,11 +103,11 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata - -RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure --frontend noninteractive tzdata + apt-get install -y --no-install-recommends tzdata && \ + ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + dpkg-reconfigure -f noninteractive tzdata RUN apt-get update && \ apt-get install -y --no-install-recommends \ From 303a2c4e62fff8e4626e2bdd330d4fb0a70880ac Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Oct 2024 17:28:33 -0400 Subject: [PATCH 6/7] fix: try to make timezone intall noninteractive --- Dockerfile-16 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile-16 b/Dockerfile-16 index 1017fd443..98bce22e8 100644 --- a/Dockerfile-16 +++ b/Dockerfile-16 @@ -103,11 +103,18 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + TZ=Etc/UTC \ + TERM=linux + +RUN echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections && \ + echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections && \ + apt-get update && \ apt-get install -y --no-install-recommends tzdata && \ ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure -f noninteractive tzdata + dpkg-reconfigure -f noninteractive tzdata && \ + rm -rf /var/lib/apt/lists/* RUN apt-get update && \ apt-get install -y --no-install-recommends \ From 90b4d1583a991401083ef8d634ba2184fff23a84 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 28 Oct 2024 18:31:48 -0400 Subject: [PATCH 7/7] fix: cleanup package installs --- Dockerfile-15 | 21 +++++++++++++-------- Dockerfile-16 | 29 +++++++++++++---------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index a4cfe53b7..01895db39 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -41,7 +41,17 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base -RUN apt update -y && apt install -y \ + +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + TZ=Etc/UTC + +# Pre-configure tzdata before any installations +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone && \ + apt-get update && \ + apt-get install -y --no-install-recommends tzdata && \ + apt-get install -y \ curl \ gnupg \ lsb-release \ @@ -49,7 +59,8 @@ RUN apt update -y && apt install -y \ wget \ sudo \ git \ - && apt clean + && apt clean && \ + rm -rf /var/lib/apt/lists/* RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -103,12 +114,6 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && \ - apt-get install -y --no-install-recommends tzdata && \ - ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure -f noninteractive tzdata - RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ diff --git a/Dockerfile-16 b/Dockerfile-16 index 98bce22e8..c281ccd7f 100644 --- a/Dockerfile-16 +++ b/Dockerfile-16 @@ -41,7 +41,16 @@ ARG wal_g_release=2.0.1 FROM ubuntu:focal as base -RUN apt update -y && apt install -y \ +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + TZ=Etc/UTC + +# Pre-configure tzdata before any installations +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + echo $TZ > /etc/timezone && \ + apt-get update && \ + apt-get install -y --no-install-recommends tzdata && \ + apt-get install -y \ curl \ gnupg \ lsb-release \ @@ -49,7 +58,8 @@ RUN apt update -y && apt install -y \ wget \ sudo \ git \ - && apt clean + && apt clean && \ + rm -rf /var/lib/apt/lists/* RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres @@ -102,20 +112,7 @@ RUN chown -R postgres:postgres /usr/lib/postgresql RUN ln -sf /usr/lib/postgresql/share/postgresql/timezonesets /usr/share/postgresql/timezonesets - -ENV DEBIAN_FRONTEND=noninteractive \ - DEBCONF_NONINTERACTIVE_SEEN=true \ - TZ=Etc/UTC \ - TERM=linux - -RUN echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections && \ - echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections && \ - apt-get update && \ - apt-get install -y --no-install-recommends tzdata && \ - ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ - dpkg-reconfigure -f noninteractive tzdata && \ - rm -rf /var/lib/apt/lists/* - + RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \