diff --git a/.devcontainer/.vscode/c_cpp_properties.json b/.devcontainer/.vscode/c_cpp_properties.json index 22596949a..d38a3c15e 100644 --- a/.devcontainer/.vscode/c_cpp_properties.json +++ b/.devcontainer/.vscode/c_cpp_properties.json @@ -1,16 +1,55 @@ { - "configurations": [ - { - "name": "Citus Development Configuration", - "includePath": [ - "/usr/local/include", - "${workspaceFolder}/**", - "/home/citus/.pgenv/src/postgresql-14.2/src/", - "/home/citus/.pgenv/src/postgresql-14.2/src/include/", - "/home/citus/.pgenv/src/postgresql-14.2/src/interfaces/libpq/", - "${workspaceFolder}/src/include/", - ] - } - ], - "version": 4 -} + "configurations": [ + { + "name": "Citus Development Configuration - Postgres 15.3", + "includePath": [ + "/usr/local/include", + "/home/citus/.pgenv/src/postgresql-15.3/src/**", + "${workspaceFolder}/**", + "${workspaceFolder}/src/include/", + ], + "configurationProvider": "ms-vscode.makefile-tools" + }, + { + "name": "Citus Development Configuration - Postgres 14.8", + "includePath": [ + "/usr/local/include", + "/home/citus/.pgenv/src/postgresql-14.8/src/**", + "${workspaceFolder}/**", + "${workspaceFolder}/src/include/", + ], + "configurationProvider": "ms-vscode.makefile-tools" + }, + { + "name": "Citus Development Configuration - Postgres 13.11", + "includePath": [ + "/usr/local/include", + "/home/citus/.pgenv/src/postgresql-13.11/src/**", + "${workspaceFolder}/**", + "${workspaceFolder}/src/include/", + ], + "configurationProvider": "ms-vscode.makefile-tools" + }, + { + "name": "Citus Development Configuration - Postgres 12.15", + "includePath": [ + "/usr/local/include", + "/home/citus/.pgenv/src/postgresql-12.15/src/**", + "${workspaceFolder}/**", + "${workspaceFolder}/src/include/", + ], + "configurationProvider": "ms-vscode.makefile-tools" + }, + { + "name": "Citus Development Configuration - Postgres 16beta2", + "includePath": [ + "/usr/local/include", + "/home/citus/.pgenv/src/postgresql-16beta2/src/**", + "${workspaceFolder}/**", + "${workspaceFolder}/src/include/", + ], + "configurationProvider": "ms-vscode.makefile-tools" + }, + ], + "version": 4 +} \ No newline at end of file diff --git a/.devcontainer/.vscode/settings.json b/.devcontainer/.vscode/settings.json new file mode 100644 index 000000000..9f7b8468e --- /dev/null +++ b/.devcontainer/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.exclude": { + "**/*.o": true, + "**/.deps/": true + } +} diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ce94b36e3..17d9f0d2d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -52,11 +52,9 @@ USER citus # build postgres versions separately for effective parrallelism and caching of already built versions when changing only certain versions FROM base AS pg12 -RUN pgenv build 12.10 +RUN pgenv build 12.15 RUN rm .pgenv/src/*.tar* -# TODO remove excessive artifacts for smaller images -RUN find .pgenv/src/ -name "*.o" | xargs rm -#RUN #make -C .pgenv/src/postgresql-*/ clean +RUN make -C .pgenv/src/postgresql-*/ clean # create a staging directory with all files we want to copy from our pgenv build # we will copy the contents of the staged folder into the final image at once @@ -65,11 +63,9 @@ RUN cp -r .pgenv/src .pgenv/pgsql-* .pgenv/config .pgenv-staging/ RUN rm .pgenv-staging/config/default.conf FROM base AS pg13 -RUN pgenv build 13.6 +RUN pgenv build 13.11 RUN rm .pgenv/src/*.tar* -# TODO remove excessive artifacts for smaller images -RUN find .pgenv/src/ -name "*.o" | xargs rm -#RUN make -C .pgenv/src/postgresql-*/ clean +RUN make -C .pgenv/src/postgresql-*/ clean # create a staging directory with all files we want to copy from our pgenv build # we will copy the contents of the staged folder into the final image at once @@ -78,11 +74,31 @@ RUN cp -r .pgenv/src .pgenv/pgsql-* .pgenv/config .pgenv-staging/ RUN rm .pgenv-staging/config/default.conf FROM base AS pg14 -RUN pgenv build 14.2 +RUN pgenv build 14.8 RUN rm .pgenv/src/*.tar* -RUN find .pgenv/src/ -name "*.o" | xargs rm -# TODO remove excessive artifacts for smaller images -#RUN make -C .pgenv/src/postgresql-*/ clean +RUN make -C .pgenv/src/postgresql-*/ clean + +# create a staging directory with all files we want to copy from our pgenv build +# we will copy the contents of the staged folder into the final image at once +RUN mkdir .pgenv-staging/ +RUN cp -r .pgenv/src .pgenv/pgsql-* .pgenv/config .pgenv-staging/ +RUN rm .pgenv-staging/config/default.conf + +FROM base AS pg15 +RUN pgenv build 15.3 +RUN rm .pgenv/src/*.tar* +RUN make -C .pgenv/src/postgresql-*/ clean + +# create a staging directory with all files we want to copy from our pgenv build +# we will copy the contents of the staged folder into the final image at once +RUN mkdir .pgenv-staging/ +RUN cp -r .pgenv/src .pgenv/pgsql-* .pgenv/config .pgenv-staging/ +RUN rm .pgenv-staging/config/default.conf + +FROM base AS pg16 +RUN pgenv build 16beta2 +RUN rm .pgenv/src/*.tar* +RUN make -C .pgenv/src/postgresql-*/ clean # create a staging directory with all files we want to copy from our pgenv build # we will copy the contents of the staged folder into the final image at once @@ -112,7 +128,7 @@ RUN yes | sudo unminimize # install developer productivity tools RUN sudo apt update \ && sudo apt install -y \ - autoconf \ + autoconf2.69 \ bash-completion \ gdb \ htop \ @@ -121,12 +137,6 @@ RUN sudo apt update \ vim \ && sudo apt clean -COPY --from=pg12 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ -COPY --from=pg13 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ -COPY --from=pg14 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ - -COPY --from=uncrustify-builder /uncrustify/usr/ /usr/ - # add some common tools to the final container # bin directory for user tools RUN mkdir .bin @@ -144,6 +154,14 @@ RUN git clone https://github.com/so-fancy/diff-so-fancy.git \ && git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX" \ && git config --global interactive.diffFilter "diff-so-fancy --patch" +COPY --from=uncrustify-builder /uncrustify/usr/ /usr/ + +COPY --from=pg12 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ +COPY --from=pg13 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ +COPY --from=pg14 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ +COPY --from=pg15 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ +COPY --from=pg16 /home/citus/.pgenv-staging/ /home/citus/.pgenv/ + # place to run your cluster with citus_dev VOLUME /data RUN sudo mkdir /data \ @@ -152,4 +170,4 @@ RUN sudo mkdir /data \ COPY --chown=citus:citus .psqlrc . # sets default pg version -RUN pgenv switch latest 14 +RUN pgenv switch latest 15 diff --git a/.devcontainer/Makefile b/.devcontainer/Makefile index b105d9172..fd6a1aea0 100644 --- a/.devcontainer/Makefile +++ b/.devcontainer/Makefile @@ -1,5 +1,5 @@ -init: ../.vscode/c_cpp_properties.json ../.vscode/launch.json +init: ../.vscode/c_cpp_properties.json ../.vscode/launch.json ../.vscode/settings.json ../.vscode: mkdir ../.vscode @@ -9,3 +9,6 @@ init: ../.vscode/c_cpp_properties.json ../.vscode/launch.json ../.vscode/c_cpp_properties.json: ../.vscode cp .vscode/c_cpp_properties.json ../.vscode/c_cpp_properties.json + +../.vscode/settings.json: ../.vscode + cp .vscode/settings.json ../.vscode/settings.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bac0748d0..00e8ef6f4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "image": "citus/devcontainer:dev-20220513", + "image": "citus/devcontainer:dev-20230705", "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt",