Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/docker run make cluster #556

Merged
merged 8 commits into from
Dec 18, 2020
Merged

Conversation

DimCitus
Copy link
Collaborator

@DimCitus DimCitus commented Dec 15, 2020

Make it possible to run the following scenario:

$ docker build -t pg_auto_failover .
$ docker run --name pg_auto_failover --rm -ti pg_auto_failover

We split the Dockerfile in two separate builds, one that is used to run our test suite, and the other where we only prepare an interactive test environment, and that we should be able to share on dockerhub or other places.

Ideally we will then push our docker image to dockerhub or someplace, and users who just want to see how pg_auto_failover works easily will be able to:

$ docker run --rm -ti citusdata/pg_auto_failover

In passing, update to newer Docker requirements with respect to privileges, fixing #491.

@DimCitus DimCitus added user experience Size: S Effort Estimate: Small Developer productivity Enhancements to ability to ship quality code labels Dec 15, 2020
@DimCitus DimCitus requested a review from JelteF December 15, 2020 18:52
@DimCitus DimCitus self-assigned this Dec 15, 2020
@DimCitus DimCitus added this to the Sprint 2020 W50 W51 milestone Dec 15, 2020
Use tmux set-environment in the top-level tmux script, and then eval $(tmux
show-environment -s) in each window that we create with split-window.
Update to current debian testing package list, which now uses Postgres 13
instead of the previous Postgres 12.

Make it possible to run the following scenario:

  $ docker build -t pg_auto_failover .
  $ docker run --name pg_auto_failover -ti --rm pg_auto_failover pg_autoctl do tmux session
In debian testing the Python pyroute2 librairy has changed in ways that are
not compatible with our test suite module for network abstractions:

  https://docs.pyroute2.org/ipdb_toc.html

  Warning The IPDB module is deprecated and obsoleted by NDB. Please
  consider using NDB instead.

At the moment, though, documentation is sparse and I failed to find any
guide to help with the code migration from IPDB to NDB.
The run container is expected to be public and shared with developpers who
want to try pg_auto_failover without having to install anything. We copy
files from the build-test environment where we build the full image we need
to run our unit test suite.
Trouble is, when using libpq-dev, we then have /usr/bin/pg_config that
matches the installed Postgres version (in our controled case, might not be
true in general), though we don't have /usr/lib/postgresql/bin/11/pg_config
where we would expect it from /usr/lib/postgresql/bin/11/pg_ctl.

So we introduce some code that goes from the path to pg_ctl and figures out
where the pg_config might well be. When postgresql-server-dev-11 is
installed, this is not needed.

Most production environment will only install libpq-dev though, and that's
what we do also in our Dockerfile, so that we skip the whole build chain.
@DimCitus DimCitus force-pushed the feature/docker-run-make-cluster branch from 380f46b to 85f58c2 Compare December 18, 2020 15:25
The newer Docker version seems to require that setting to work with our
requirements.

See #491.
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
src/bin/pg_autoctl/cli_do_tmux.c Outdated Show resolved Hide resolved
@DimCitus DimCitus merged commit da853e9 into master Dec 18, 2020
@DimCitus DimCitus deleted the feature/docker-run-make-cluster branch December 18, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer productivity Enhancements to ability to ship quality code Size: S Effort Estimate: Small user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants