Skip to content

Commit

Permalink
rename postgresql_cluster to autobase
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Nov 28, 2024
1 parent b335b4a commit 2aef285
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 72 deletions.
30 changes: 15 additions & 15 deletions .config/make/docker.mak
Original file line number Diff line number Diff line change
Expand Up @@ -35,56 +35,56 @@ docker-build: docker-build-automation docker-build-console-ui docker-build-conso

docker-build-automation: ## Build automation image
@echo "Build automation docker image with tag $(TAG)";
docker build --no-cache --platform linux/amd64 --tag postgresql_cluster:$(TAG) --file automation/Dockerfile .
docker build --no-cache --platform linux/amd64 --tag automation:$(TAG) --file automation/Dockerfile .

docker-build-console-ui: ## Build console ui image
@echo "Build console ui docker image with tag $(TAG)"
docker build --no-cache --platform linux/amd64 --tag postgresql_cluster_console_ui:$(TAG) --file console/ui/Dockerfile .
docker build --no-cache --platform linux/amd64 --tag console_ui:$(TAG) --file console/ui/Dockerfile .

docker-build-console-api: ## Build console api image
@echo "Build console api docker image with tag $(TAG)"
docker build --no-cache --platform linux/amd64 --tag postgresql_cluster_console_api:$(TAG) --file console/service/Dockerfile .
docker build --no-cache --platform linux/amd64 --tag console_api:$(TAG) --file console/service/Dockerfile .

docker-build-console-db: ## Build console db image
@echo "Build console db docker image with tag $(TAG)"
docker build --no-cache --platform linux/amd64 --tag postgresql_cluster_console_db:$(TAG) --file console/db/Dockerfile .
docker build --no-cache --platform linux/amd64 --tag console_db:$(TAG) --file console/db/Dockerfile .

docker-build-console: ## Build console image (all services)
@echo "Build console docker image with tag $(TAG)"
docker build --no-cache --platform linux/amd64 --tag postgresql_cluster_console:$(TAG) --file console/Dockerfile .
docker build --no-cache --platform linux/amd64 --tag console:$(TAG) --file console/Dockerfile .

.PHONY: docker-push docker-push-console-ui docker-push-console-api docker-push-console-db docker-push-console
docker-push: docker-push-automation docker-push-console-ui docker-push-console-api docker-push-console-db docker-push-console ## Push all images to Dockerhub (example: make docker-push TAG=my_tag DOCKER_REGISTRY=my_repo DOCKER_REGISTRY_USER="my_username" DOCKER_REGISTRY_PASSWORD="my_password")

docker-push-automation: ## Push automation to Dockerhub
@echo "Push automation docker image with tag $(TAG)";
echo "$(DOCKER_REGISTRY_PASSWORD)" | docker login --username "$(DOCKER_REGISTRY_USER)" --password-stdin
docker tag postgresql_cluster:$(TAG) $(DOCKER_REGISTRY)/postgresql_cluster:$(TAG)
docker push $(DOCKER_REGISTRY)/postgresql_cluster:$(TAG)
docker tag automation:$(TAG) $(DOCKER_REGISTRY)/automation:$(TAG)
docker push $(DOCKER_REGISTRY)/automation:$(TAG)

docker-push-console-ui: ## Push console ui image to Dockerhub
@echo "Push console ui docker image with tag $(TAG)"
echo "$(DOCKER_REGISTRY_PASSWORD)" | docker login --username "$(DOCKER_REGISTRY_USER)" --password-stdin
docker tag postgresql_cluster_console_ui:$(TAG) $(DOCKER_REGISTRY)/postgresql_cluster_console_ui:$(TAG)
docker push $(DOCKER_REGISTRY)/postgresql_cluster_console_ui:$(TAG)
docker tag console_ui:$(TAG) $(DOCKER_REGISTRY)/console_ui:$(TAG)
docker push $(DOCKER_REGISTRY)/console_ui:$(TAG)

docker-push-console-api: ## Push console api image to Dockerhub
@echo "Push console api docker image with tag $(TAG)"
echo "$(DOCKER_REGISTRY_PASSWORD)" | docker login --username "$(DOCKER_REGISTRY_USER)" --password-stdin
docker tag postgresql_cluster_console_api:$(TAG) $(DOCKER_REGISTRY)/postgresql_cluster_console_api:$(TAG)
docker push $(DOCKER_REGISTRY)/postgresql_cluster_console_api:$(TAG)
docker tag console_api:$(TAG) $(DOCKER_REGISTRY)/console_api:$(TAG)
docker push $(DOCKER_REGISTRY)/console_api:$(TAG)

docker-push-console-db: ## Push console db image to Dockerhub
@echo "Push console db docker image with tag $(TAG)"
echo "$(DOCKER_REGISTRY_PASSWORD)" | docker login --username "$(DOCKER_REGISTRY_USER)" --password-stdin
docker tag postgresql_cluster_console_db:$(TAG) $(DOCKER_REGISTRY)/postgresql_cluster_console_db:$(TAG)
docker push $(DOCKER_REGISTRY)/postgresql_cluster_console_db:$(TAG)
docker tag console_db:$(TAG) $(DOCKER_REGISTRY)/console_db:$(TAG)
docker push $(DOCKER_REGISTRY)/console_db:$(TAG)

docker-push-console: ## Push console image to Dockerhub (all services)
@echo "Push console docker image with tag $(TAG)"
echo "$(DOCKER_REGISTRY_PASSWORD)" | docker login --username "$(DOCKER_REGISTRY_USER)" --password-stdin
docker tag postgresql_cluster_console:$(TAG) $(DOCKER_REGISTRY)/postgresql_cluster_console:$(TAG)
docker push $(DOCKER_REGISTRY)/postgresql_cluster_console:$(TAG)
docker tag console:$(TAG) $(DOCKER_REGISTRY)/console:$(TAG)
docker push $(DOCKER_REGISTRY)/console:$(TAG)

.PHONY: docker-tests
docker-tests: ## Run tests for docker
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Your contributions are appreciated and will be taken seriously.

### 1. Create an issue

Report problems or suggest improvements by [creating an issue](https://github.com/vitabaks/postgresql_cluster/issues).
Report problems or suggest improvements by [creating an issue](https://github.com/vitabaks/autobase/issues).

### 2. Fork the project

[Fork the repository](https://github.com/vitabaks/postgresql_cluster) to your GitHub account.
[Fork the repository](https://github.com/vitabaks/autobase) to your GitHub account.

### 3. Make changes

Clone your fork locally and make the necessary changes:

```bash
git clone git@github.com:YOURNAMESPACE/postgresql_cluster.git
git clone git@github.com:YOURNAMESPACE/autobase.git
```

### 4. Test your changes (Optional)
Expand All @@ -32,8 +32,8 @@ git clone git@github.com:YOURNAMESPACE/postgresql_cluster.git
Use Gitpod for a cloud-based development environment:

1. Sign up for Gitpod: https://gitpod.io
2. Fork the `postgresql_cluster` repository
3. Open your fork in Gitpod: `https://gitpod.io/#https://github.com/username/postgresql_cluster`
2. Fork the `autobase` repository
3. Open your fork in Gitpod: `https://gitpod.io/#https://github.com/username/autobase`
4. Create a new branch: `git checkout -b my-feature-branch`
5. Make your changes and commit: `git add .` and `git commit -m "Description of changes"`
6. Test with Molecule: `make tests` or `make tests-fast`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ You can find a version of this documentation that is searchable and also easier

### Supported setups of Postgres Cluster

![pg_cluster_scheme](images/postgresql_cluster.png#gh-light-mode-only)
![pg_cluster_scheme](images/postgresql_cluster.dark_mode.png#gh-dark-mode-only)
![pg_cluster_scheme](images/pg_cluster_scheme.png#gh-light-mode-only)
![pg_cluster_scheme](images/pg_cluster_scheme.dark_mode.png#gh-dark-mode-only)

You have three schemes available for deployment:

Expand Down
14 changes: 7 additions & 7 deletions automation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ USER root
# Set SHELL to Bash to ensure pipefail is supported
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Copy postgresql_cluster repository
COPY automation /postgresql_cluster/automation
# Copy autobase repository
COPY automation /autobase/automation

# Install required packages, Python dependencies, Ansible requirements, and perform cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
Expand All @@ -16,11 +16,11 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
ca-certificates gnupg git python3 python3-dev python3-pip keychain ssh-client sshpass\
gcc g++ cmake make libssl-dev curl apt-transport-https lsb-release gnupg \
&& pip3 install --break-system-packages --no-cache-dir -r \
/postgresql_cluster/automation/requirements.txt \
/autobase/automation/requirements.txt \
&& ansible-galaxy install --force -r \
/postgresql_cluster/automation/requirements.yml \
/autobase/automation/requirements.yml \
&& ansible-galaxy install --force -r \
/postgresql_cluster/automation/roles/consul/requirements.yml \
/autobase/automation/roles/consul/requirements.yml \
&& ansible-galaxy collection list \
&& pip3 install --break-system-packages --no-cache-dir -r \
/root/.ansible/collections/ansible_collections/azure/azcollection/requirements.txt \
Expand All @@ -30,12 +30,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
&& apt-get autoremove -y --purge gnupg git python3-dev gcc g++ cmake make libssl-dev \
&& apt-get clean -y autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* \
&& chmod +x /postgresql_cluster/automation/entrypoint.sh
&& chmod +x /autobase/automation/entrypoint.sh

# Set environment variable for Ansible collections paths
ENV ANSIBLE_COLLECTIONS_PATH=/root/.ansible/collections/ansible_collections:/usr/local/lib/python3.11/dist-packages/ansible_collections
ENV USER=root

WORKDIR /postgresql_cluster/automation
WORKDIR /autobase/automation

ENTRYPOINT ["./entrypoint.sh"]
6 changes: 3 additions & 3 deletions automation/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ is_base64() {
if [[ -n "${ANSIBLE_INVENTORY_JSON}" ]]; then
if is_base64 "${ANSIBLE_INVENTORY_JSON}"; then
echo "Creating inventory.json with the (base64 decoded) content of ANSIBLE_INVENTORY_JSON"
echo "${ANSIBLE_INVENTORY_JSON}" | base64 -d > /postgresql_cluster/inventory.json
echo "${ANSIBLE_INVENTORY_JSON}" | base64 -d > /autobase/inventory.json
else
echo "Creating inventory.json with the content of ANSIBLE_INVENTORY_JSON"
echo "${ANSIBLE_INVENTORY_JSON}" > /postgresql_cluster/inventory.json
echo "${ANSIBLE_INVENTORY_JSON}" > /autobase/inventory.json
fi
# Set ANSIBLE_INVENTORY environment variable
export ANSIBLE_INVENTORY=/postgresql_cluster/inventory.json
export ANSIBLE_INVENTORY=/autobase/inventory.json
# Set ANSIBLE_SSH_ARGS environment variable
export ANSIBLE_SSH_ARGS="-o StrictHostKeyChecking=no"
fi
Expand Down
1 change: 0 additions & 1 deletion automation/roles/upgrade/tasks/update_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
dest: "{{ patroni_config_file }}.bkp"
remote_src: true

# https://github.com/vitabaks/postgresql_cluster/issues/666
- name: Remove patroni.dynamic.json file
ansible.builtin.file:
path: "{{ pg_old_datadir }}/patroni.dynamic.json"
Expand Down
2 changes: 1 addition & 1 deletion automation/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ haproxy_compile_requirements:
# ================================================================================================= #
# Offline installation (if installation_method: "file")
#
# You can also download the necessary packages into postgresql_cluster/files/ directory.
# You can also download the necessary packages into /autobase/automation/files/ directory.
# Packages from this directory will be used for installation.

# if installation_method: "file" and patroni_installation_method: "deb"
Expand Down
2 changes: 1 addition & 1 deletion automation/vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ haproxy_compile_requirements:
# ================================================================================================= #
# Offline installation (if installation_method: "file")
#
# You can also download the necessary packages into postgresql_cluster/files/ directory.
# You can also download the necessary packages into /autobase/automation/files/ directory.
# Packages from this directory will be used for installation.

# if installation_method: "file" and patroni_installation_method: "rpm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ CREATE TABLE public.postgres_versions (
end_of_life date
);

COMMENT ON TABLE public.postgres_versions IS 'Table containing the major PostgreSQL versions supported by the postgresql_cluster';
COMMENT ON TABLE public.postgres_versions IS 'Table containing the major PostgreSQL versions supported by the autobase';
COMMENT ON COLUMN public.postgres_versions.major_version IS 'The major version of PostgreSQL';
COMMENT ON COLUMN public.postgres_versions.release_date IS 'The release date of the PostgreSQL version';
COMMENT ON COLUMN public.postgres_versions.end_of_life IS 'The end of life date for the PostgreSQL version';
Expand Down
2 changes: 1 addition & 1 deletion console/service/internal/configuration/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Config struct {
Docker struct {
Host string `default:"unix:///var/run/docker.sock" desc:"Docker host"`
LogDir string `default:"/tmp/ansible" desc:"Directory inside docker container for ansible json log"`
Image string `default:"vitabaks/postgresql_cluster:2.0.0" desc:"Docker image for postgresql_cluster"`
Image string `default:"autobase/automation:2.0.0" desc:"Docker image for autobase automation"`
}
LogWatcher struct {
RunEvery time.Duration `default:"1m" desc:"LogWatcher run interval"`
Expand Down
File renamed without changes
File renamed without changes
33 changes: 0 additions & 33 deletions meta/main.yml

This file was deleted.

2 changes: 0 additions & 2 deletions meta/runtime.yml

This file was deleted.

0 comments on commit 2aef285

Please sign in to comment.