-
Notifications
You must be signed in to change notification settings - Fork 108
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
Implement pg_autoctl do azure commands. #544
Conversation
a067f4d
to
91e7618
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I skimmed the code in this PR and it looked reasonable. Since this is essentially just dev helpers I think it's fine to merge this without me doing a very thorough review. I ran make azcluster
and make azdrop
. They worked, but there's some pg_hba lines that we probably want to add. I think it's fine to do that in a later PR though.
The following commands allow to easily deploy a testing or QA environment for pg_auto_failover using Azure VMs, which looks more like what typical users and customers are using than our default `make cluster` approach where all the nodes are running on localhost. In particular we can test system integration and packages based provisioning, so that's better for end-to-end QA. Here's the list of new commands provided: pg_autoctl do azure + create create azure resources for a pg_auto_failover demo + show show azure resources for a pg_auto_failover demo ls List resources in a given azure region ssh Runs ssh -l ha-admin <public ip address> for a given VM name sync Rsync pg_auto_failover sources on all the target region VMs pg_autoctl do azure create region Create an azure region: resource group, network, VMs nodes Create and provision our VM nodes in an azure region pg_autoctl do azure show ips Show public and private IP addresses for selected VMs state Connect to the monitor node to show the current state
Store the --prefix, --region, --location, and derivative information in a configuration file in XDG_CONFIG/$(pwd)/azure.cfg so that we can avoid passing options to most commands. $ pg_autoctl do azure create region --prefix ha-demo-dim --region paris --location francecentral --monitor $ pg_autoctl do azure ls $ pg_autoctl do azure show ips $ pg_autoctl do azure create nodes
Review commands so that the main entry point for azure QA setup creates all the VMs, provision them with our selected software, and then create a tmux session with interactive control over the setup. The tmux session is primed with commands that deploy pg_autoctl on each node, including integration in the systemd setup.
We use the 3 following environment variables to control the version of parget packages installed on Azure: - AZ_PG_VERSION defaults to "13" - AZ_PGAF_VERSION default to "1.4.1" - AZ_PGAF_DEB_VERSION default to "1.4"
It turns out we need the debian revision to be able to select a target version with precision in debian. - * sudo apt-get install -q -y postgresql-13-auto-failover-1.4=1.4.1 + * sudo apt-get install -q -y postgresql-13-auto-failover-1.4=1.4.1-1
…sion. That's needed because tmux sessions are where we call pg_autoctl do azure deploy
91e7618
to
452ed2a
Compare
The following commands allow to easily deploy a testing or QA environment
for pg_auto_failover using Azure VMs, which looks more like what typical
users and customers are using than our default
make cluster
approach whereall the nodes are running on localhost.
In particular we can test system integration and packages based
provisioning, so that's better for end-to-end QA.
Here's the list of new commands provided:
And there's the new top-level commands:
Contrary to
make cluster
when exiting the tmux session the resources are not dropped, and it's possible to connect again to the same tmux session with eithermake azcluster
orpg_autoctl do azure tmux session
.