Skip to content

Conversation

@gurkanindibay
Copy link
Contributor

@gurkanindibay gurkanindibay commented Nov 5, 2021

Created the image for pg 14. I will need to create for each pg version.

I haven't added a user with the privileges you sent. I will add it after you first pre-review
you can create a new docker image in the docker repo with the command below
PG14
docker build -t hyperscale_image_14 -f hyperscale/pg-14/Dockerfile .

PG13
docker build -t hyperscale_image_13 -f hyperscale/pg-13/Dockerfile .

PG12
docker build -t hyperscale_image_12 -f hyperscale/pg-12/Dockerfile .

and run with the following command (replacing with the pg version you give above)

docker run --name test1 -p 5432:5432 -e CITUS_PASSWORD="Citus123" hyperscale_image_

I compared the plugins between the docker image I created and th list you've sent and the comparison excel is below
Hyperscale Image Extensions.xlsx

@gurkanindibay gurkanindibay changed the title Adds image for pg14 Adds hyperscale image for pg14 Nov 5, 2021
* Adds citus database
* Adds grants for extensions
* Adds extension functions
* Reorganizes sql script order
* Parameterizes citus user password
* Some format changes
Gürkan İndibay and others added 2 commits November 9, 2021 18:43
Co-authored-by: Hanefi Onaldi <Hanefi.Onaldi@microsoft.com>
@gurkanindibay gurkanindibay requested a review from hanefi November 9, 2021 16:07
Gürkan İndibay and others added 2 commits November 10, 2021 14:16
Co-authored-by: Hanefi Onaldi <Hanefi.Onaldi@microsoft.com>
@gurkanindibay gurkanindibay requested a review from hanefi November 12, 2021 09:35
Copy link

@marcocitus marcocitus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

I wonder whether there are any settings we should replicate, but from a quick look I did not see anything super important.

@gurkanindibay
Copy link
Contributor Author

[11/18/2021 1:42 PM] Marco Slot
well, that's if you want to allow anyone to connect from anywhere

[11/18/2021 1:42 PM] Marco Slot
to any database

[11/18/2021 1:42 PM] Marco Slot
we only want the citus user to connect to the citus database

[11/18/2021 1:42 PM] Marco Slot
so for that we could have: host citus citus all scram-sha-256

[11/18/2021 1:42 PM] Marco Slot
but there seems to be some background process (perhaps Citus?) that also connects as postgres user

[11/18/2021 1:43 PM] Marco Slot
which is being blocked by my pg_hba.conf

@gurkanindibay
Copy link
Contributor Author

[11/18/2021 1:42 PM] Marco Slot well, that's if you want to allow anyone to connect from anywhere

[11/18/2021 1:42 PM] Marco Slot to any database

[11/18/2021 1:42 PM] Marco Slot we only want the citus user to connect to the citus database

[11/18/2021 1:42 PM] Marco Slot so for that we could have: host citus citus all scram-sha-256

[11/18/2021 1:42 PM] Marco Slot but there seems to be some background process (perhaps Citus?) that also connects as postgres user

[11/18/2021 1:43 PM] Marco Slot which is being blocked by my pg_hba.conf

[11/18/2021 1:42 PM] Marco Slot
well, that's if you want to allow anyone to connect from anywhere

[11/18/2021 1:42 PM] Marco Slot
to any database

[11/18/2021 1:42 PM] Marco Slot
we only want the citus user to connect to the citus database

[11/18/2021 1:42 PM] Marco Slot
so for that we could have: host citus citus all scram-sha-256

[11/18/2021 1:42 PM] Marco Slot
but there seems to be some background process (perhaps Citus?) that also connects as postgres user

[11/18/2021 1:43 PM] Marco Slot
which is being blocked by my pg_hba.conf

I performed some configurations that prevent postgres user to connect into the image

First I added connection policies to prevent postgres user to connect locally.

host citus citus all scram-sha-256
local citus citus trust
host all postgres 0.0.0.0/0 scram-sha-256

Then I added random possword to prevent connecting using host
export POSTGRES_PASSWORD=$(echo $RANDOM | md5sum | head -c 20)

Copy link

@marcocitus marcocitus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem to be getting an error now:

$ docker run --name test1 -p 5432:5432 -e CITUS_PASSWORD=Citus123 hyperscale_image
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown.

@marcocitus
Copy link

Probably a file permissions problem. Adding RUN chmod 755 /usr/local/bin/docker-entrypoint.sh seems to fix it.

@gurkanindibay
Copy link
Contributor Author

Probably a file permissions problem. Adding RUN chmod 755 /usr/local/bin/docker-entrypoint.sh seems to fix it.

I was trying to replicate it in my local. You found the problem thanks. I added execute permission into the file in git repository. This will fix it. No need to add additional command on Dockerfile

* Fixes pg_cron connectivity problem
* Removes stale comments
* Adds comment for postgres random password set
Copy link
Member

@hanefi hanefi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a section on the README.md with some details on how to use the docker images we create for hyperscale.

This may be done on a separate PR, and possibly we can write some documentation for the docker images with pg12, pg13, alpine etc.

@gurkanindibay gurkanindibay merged commit be1a6a4 into master Jan 4, 2022
@ihalatci ihalatci deleted the hyperscale_docker branch September 4, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants