mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
I much preffer this organizational scheme
This commit is contained in:
7
.github/workflows/build_and_test.yml
vendored
7
.github/workflows/build_and_test.yml
vendored
@@ -964,11 +964,6 @@ jobs:
|
||||
# rm -rf ./extensions/share/extension/neon*
|
||||
# rm -rf ./extensions/lib/neon*
|
||||
|
||||
# # TODO: Delete leftovers from the extension build step
|
||||
# # (This step, if desired, should be moved to Dockerfile.compute-node before the files are zipped)
|
||||
# rm -rf ./extensions/lib/pgxs
|
||||
# rm -rf ./extensions/lib/pkgconfig
|
||||
|
||||
docker cp ${{ steps.create-container.outputs.EID }}:/ ./
|
||||
poetry run python3 ./scripts/combine_control_files.py
|
||||
|
||||
@@ -976,7 +971,7 @@ jobs:
|
||||
run: |
|
||||
for BUCKET in $(echo ${S3_BUCKETS}); do
|
||||
aws s3 cp --recursive --only-show-errors ./extensions s3://${BUCKET}/${{ needs.tag.outputs.build-tag }}/${{ matrix.version }}
|
||||
aws s3 cp --only-show-errors ./control_files/ext_index.json s3://${BUCKET}/${{ needs.tag.outputs.build-tag }}/${{ matrix.version }}
|
||||
aws s3 cp --only-show-errors ./ext_index.json s3://${BUCKET}/${{ needs.tag.outputs.build-tag }}/${{ matrix.version }}
|
||||
done
|
||||
|
||||
- name: Cleanup
|
||||
|
||||
@@ -535,10 +535,10 @@ RUN wget https://github.com/neondatabase/pg_embedding/archive/2465f831ea1f8d49c1
|
||||
make -j $(getconf _NPROCESSORS_ONLN) install && \
|
||||
echo 'trusted = true' >> /usr/local/pgsql/share/extension/embedding.control &&\
|
||||
find /usr/local/pgsql -type f | sort > /after_embedding.txt &&\
|
||||
/bin/bash -c 'for from in $(comm -13 /before_embedding.txt /after_embedding.txt); do to=/extensions/public/embedding/${from:17} && mkdir -p $(dirname ${to}) && cp -a ${from} ${to}; done' && \
|
||||
tar -zcvf /extensions/public/embedding.tar.gz /extensions/public/embedding && \
|
||||
mkdir -p /control_files/public &&\
|
||||
cp /usr/local/pgsql/share/extension/embedding.control /control_files/public/embedding.control
|
||||
/bin/bash -c 'for from in $(comm -13 /before_embedding.txt /after_embedding.txt); do to=/extensions/embedding/${from:17} && mkdir -p $(dirname ${to}) && cp -a ${from} ${to}; done' && \
|
||||
tar -zcvf /extensions/embedding.tar.gz /extensions/embedding && \
|
||||
mkdir -p /control_files &&\
|
||||
cp /usr/local/pgsql/share/extension/embedding.control /control_files/embedding.control
|
||||
|
||||
#########################################################################################
|
||||
#
|
||||
@@ -560,9 +560,13 @@ RUN wget https://gitlab.com/dalibo/postgresql_anonymizer/-/archive/1.1.0/postgre
|
||||
find /usr/local/pgsql -type f | sort > /after.txt && \
|
||||
/bin/bash -c 'for from in $(comm -13 /before.txt /after.txt); do to=/extensions/123454321/anon/${from:17} && mkdir -p $(dirname ${to}) && cp -a ${from} ${to}; done' && \
|
||||
mkdir /control_files &&\
|
||||
tar -zcvf /extensions/123454321/anon.tar.gz /extensions/123454321/anon && \
|
||||
mkdir -p /control_files/123454321 &&\
|
||||
cp /usr/local/pgsql/share/extension/anon.control /control_files/123454321/anon.control
|
||||
tar -zcvf /extensions/anon.tar.gz /extensions/anon && \
|
||||
mkdir -p /control_files &&\
|
||||
cp /usr/local/pgsql/share/extension/anon.control /control_files/anon.control
|
||||
|
||||
# # TODO: Delete leftovers from the extension build step
|
||||
# rm -rf ./extensions/lib/pgxs
|
||||
# rm -rf ./extensions/lib/pkgconfig
|
||||
|
||||
#########################################################################################
|
||||
#
|
||||
@@ -759,11 +763,11 @@ FROM scratch AS postgres-extensions
|
||||
# As for now, it's only for new custom ones
|
||||
#
|
||||
# extensions
|
||||
COPY --from=pg-anon-pg-build /extensions/123454321/anon.tar.gz /extensions/123454321/anon.tar.gz
|
||||
COPY --from=pg-anon-pg-build /control_files/123454321/anon.control /control_files/123454321/anon.control
|
||||
COPY --from=pg-anon-pg-build /extensions/anon.tar.gz /extensions/anon.tar.gz
|
||||
COPY --from=pg-anon-pg-build /control_files/anon.control /control_files/anon.control
|
||||
|
||||
COPY --from=pg-embedding-pg-build /extensions/public/embedding.tar.gz /extensions/public/embedding.tar.gz
|
||||
COPY --from=pg-embedding-pg-build /control_files/public/embedding.control /control_files/public/embedding.control
|
||||
COPY --from=pg-embedding-pg-build /extensions/embedding.tar.gz /extensions/embedding.tar.gz
|
||||
COPY --from=pg-embedding-pg-build /control_files/embedding.control /control_files/embedding.control
|
||||
|
||||
#########################################################################################
|
||||
#
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
ext_index = {}
|
||||
os.chdir("control_files")
|
||||
for prefix in os.listdir("."):
|
||||
ext_index[prefix] = {}
|
||||
for file in os.listdir(prefix):
|
||||
with open(os.path.join(prefix, file), "r") as f:
|
||||
ext_name = file.replace(".control", "")
|
||||
control = f.read()
|
||||
ext_index[prefix][ext_name] = {
|
||||
"path": f"extensions/{prefix}/{ext_name}.tar.gz",
|
||||
"control": control,
|
||||
}
|
||||
# enable custom extensions for specific tenants
|
||||
enabled_extensions = {
|
||||
"123454321": ["anon"]
|
||||
}
|
||||
|
||||
with open("../ext_index.json", "w") as f:
|
||||
control_data = {}
|
||||
for control_file in os.listdir("control_files"):
|
||||
ext_name = control_file.replace(".control", "")
|
||||
with open(control_file, "r") as f:
|
||||
control_data[ext_name] = f.read()
|
||||
|
||||
all_data = {
|
||||
"enabled_extensions": enabled_extensions,
|
||||
"control_data": control_data
|
||||
}
|
||||
|
||||
with open("ext_index.json", "w") as f:
|
||||
json.dump(ext_index, f)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user