Skip to content

Commit

Permalink
Release 2.1.0 (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Dec 16, 2024
1 parent 4901a51 commit 0c8abff
Show file tree
Hide file tree
Showing 12 changed files with 1,915 additions and 815 deletions.
39 changes: 32 additions & 7 deletions automation/roles/cloud-resources/tasks/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,54 @@
- name: Install Python dependencies
block:
- name: Ensure that 'python3-pip' package is present on controlling host
ansible.builtin.command: which pip3
register: pip3_check
failed_when: false
changed_when: false

- name: Clean dnf cache
ansible.builtin.command: dnf clean all
when:
- pip3_check.rc != 0
- ansible_os_family == "RedHat"

- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
register: apt_status
until: apt_status is success
delay: 5
retries: 3
when:
- pip3_check.rc != 0
- ansible_os_family == "Debian"

- name: Install 'python3-pip' package on controlling host
ansible.builtin.package:
name: python3-pip
state: present
register: package_status
until: package_status is success
delay: 10
retries: 3
delegate_to: 127.0.0.1
run_once: true
when: ansible_distribution != "MacOSX"
when:
- pip3_check.rc != 0
- ansible_distribution != "MacOSX"

- name: Ensure that 'boto3' dependency is present on controlling host
ansible.builtin.pip:
name: boto3
executable: pip3
extra_args: --user
delegate_to: 127.0.0.1
become: false
vars:
ansible_become: false
run_once: true
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
delegate_to: 127.0.0.1
run_once: true

# SSH key
- block:
Expand Down Expand Up @@ -209,8 +234,8 @@
security_groups: "{{ ([] if not cloud_firewall | bool else [patroni_cluster_name + '-security-group']) }}"
vpc_subnet_id: "{{ server_network }}"
network_interfaces:
assign_public_ip: true
delete_on_termination: true
- assign_public_ip: true
delete_on_termination: true
volumes:
- device_name: /dev/sda1
ebs:
Expand Down
28 changes: 27 additions & 1 deletion automation/roles/cloud-resources/tasks/azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,40 @@
- name: Install Python dependencies
block:
- name: Ensure that 'python3-pip' package is present on controlling host
ansible.builtin.command: which pip3
register: pip3_check
failed_when: false
changed_when: false

- name: Clean dnf cache
ansible.builtin.command: dnf clean all
when:
- pip3_check.rc != 0
- ansible_os_family == "RedHat"

- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
register: apt_status
until: apt_status is success
delay: 5
retries: 3
when:
- pip3_check.rc != 0
- ansible_os_family == "Debian"

- name: Install 'python3-pip' package on controlling host
ansible.builtin.package:
name: python3-pip
state: present
register: package_status
until: package_status is success
delay: 10
retries: 3
when: ansible_distribution != "MacOSX"
when:
- pip3_check.rc != 0
- ansible_distribution != "MacOSX"

- name: Ensure that Azure collection is installed on controlling host
ansible.builtin.command: ansible-galaxy collection list azure.azcollection
Expand Down
38 changes: 31 additions & 7 deletions automation/roles/cloud-resources/tasks/digitalocean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,69 @@
- name: Install Python dependencies
block:
- name: Ensure that 'python3-pip' package is present on controlling host
ansible.builtin.command: which pip3
register: pip3_check
failed_when: false
changed_when: false

- name: Clean dnf cache
ansible.builtin.command: dnf clean all
when:
- pip3_check.rc != 0
- ansible_os_family == "RedHat"

- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
register: apt_status
until: apt_status is success
delay: 5
retries: 3
when:
- pip3_check.rc != 0
- ansible_os_family == "Debian"

- name: Install 'python3-pip' package on controlling host
ansible.builtin.package:
name: python3-pip
state: present
register: package_status
until: package_status is success
delay: 10
retries: 3
delegate_to: 127.0.0.1
run_once: true
when: ansible_distribution != "MacOSX"
when:
- pip3_check.rc != 0
- ansible_distribution != "MacOSX"

- name: Ensure that 'dopy' dependency is present on controlling host
ansible.builtin.pip:
name: dopy
executable: pip3
extra_args: --user
delegate_to: 127.0.0.1
become: false
vars:
ansible_become: false
run_once: true
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"

- name: Ensure that 'boto3' dependency is present on controlling host
ansible.builtin.pip:
name: boto3
executable: pip3
extra_args: --user
delegate_to: 127.0.0.1
become: false
vars:
ansible_become: false
run_once: true
when:
- (pgbackrest_install | bool or wal_g_install | bool)
- digital_ocean_spaces_create | bool
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
delegate_to: 127.0.0.1
run_once: true

# SSH key
- block:
Expand Down
35 changes: 30 additions & 5 deletions automation/roles/cloud-resources/tasks/gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,54 @@
- name: Install Python dependencies
block:
- name: Ensure that 'python3-pip' package is present on controlling host
ansible.builtin.command: which pip3
register: pip3_check
failed_when: false
changed_when: false

- name: Clean dnf cache
ansible.builtin.command: dnf clean all
when:
- pip3_check.rc != 0
- ansible_os_family == "RedHat"

- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
register: apt_status
until: apt_status is success
delay: 5
retries: 3
when:
- pip3_check.rc != 0
- ansible_os_family == "Debian"

- name: Install 'python3-pip' package on controlling host
ansible.builtin.package:
name: python3-pip
state: present
register: package_status
until: package_status is success
delay: 10
retries: 3
delegate_to: 127.0.0.1
run_once: true
when: ansible_distribution != "MacOSX"
when:
- pip3_check.rc != 0
- ansible_distribution != "MacOSX"

- name: Ensure that 'google-auth' dependency is present on controlling host
ansible.builtin.pip:
name: google-auth
executable: pip3
extra_args: --user
delegate_to: 127.0.0.1
become: false
vars:
ansible_become: false
run_once: true
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
delegate_to: 127.0.0.1
run_once: true

# Check if GCP_SERVICE_ACCOUNT_CONTENTS is defined
- name: Lookup the GCP_SERVICE_ACCOUNT_CONTENTS environmental variable
Expand Down
36 changes: 31 additions & 5 deletions automation/roles/cloud-resources/tasks/hetzner.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
---
# Dependencies
- name: Install python dependencies
- name: Install Python dependencies
block:
- name: Ensure that 'python3-pip' package is present on controlling host
ansible.builtin.command: which pip3
register: pip3_check
failed_when: false
changed_when: false

- name: Clean dnf cache
ansible.builtin.command: dnf clean all
when:
- pip3_check.rc != 0
- ansible_os_family == "RedHat"

- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
register: apt_status
until: apt_status is success
delay: 5
retries: 3
when:
- pip3_check.rc != 0
- ansible_os_family == "Debian"

- name: Install 'python3-pip' package on controlling host
ansible.builtin.package:
name: python3-pip
state: present
register: package_status
until: package_status is success
delay: 10
retries: 3
delegate_to: 127.0.0.1
run_once: true
when: ansible_distribution != "MacOSX"
when:
- pip3_check.rc != 0
- ansible_distribution != "MacOSX"

- name: Ensure that 'hcloud' dependency is present on controlling host
ansible.builtin.pip:
name: hcloud
executable: pip3
extra_args: --user
delegate_to: 127.0.0.1
become: false
vars:
ansible_become: false
run_once: true
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/bin"
PIP_BREAK_SYSTEM_PACKAGES: "1"
delegate_to: 127.0.0.1
run_once: true

# SSH key
- block:
Expand Down
5 changes: 1 addition & 4 deletions console/db/migrations/20241205103951_2.1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_nam
('hetzner', 'Small Size', 'CPX31', 4, 8, 0.025 , 15.59, '$', '2024-12-10', true),
('hetzner', 'Medium Size', 'CPX41', 8, 16, 0.0464 , 28.09, '$', '2024-12-10', true),
('hetzner', 'Medium Size', 'CPX51', 16, 32, 0.0979 , 61.09, '$', '2024-12-10', true);


-- Update all existing Hetzner instances to use USD instead of EUR for easy comparison to other IaaS Providers.
-- cloud_instances
-- Update prices and other relevant fields for Hetzner cloud instances indludes an IPv4 address
UPDATE public.cloud_instances SET price_hourly = 0.0082, price_monthly = 5.09, currency = '$', updated_at = '2024-12-10', shared_cpu = true WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX11';
UPDATE public.cloud_instances SET price_hourly = 0.0138, price_monthly = 8.59, currency = '$', updated_at = '2024-12-10', shared_cpu = true WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX21';
Expand All @@ -74,5 +72,4 @@ UPDATE public.cloud_instances SET price_hourly = 0.5138, price_monthly = 320.59,
UPDATE public.cloud_volumes SET price_monthly = 0.05, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner';

-- +goose Down
DELETE FROM public.postgres_versions
WHERE major_version = 17;
DELETE FROM public.postgres_versions WHERE major_version = 17;
2 changes: 1 addition & 1 deletion console/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ PG_CONSOLE_DB_MIGRATIONDIR String /etc/db/migrations
PG_CONSOLE_ENCRYPTIONKEY String super_secret Encryption key for secret storage
PG_CONSOLE_DOCKER_HOST String unix:///var/run/docker.sock Docker host
PG_CONSOLE_DOCKER_LOGDIR String /tmp/ansible Directory inside docker container for ansible json log
PG_CONSOLE_DOCKER_IMAGE String autobase/automation:2.0.0 Docker image for autobase automation
PG_CONSOLE_DOCKER_IMAGE String autobase/automation:2.1.0 Docker image for autobase automation
PG_CONSOLE_LOGWATCHER_RUNEVERY Duration 1m LogWatcher run interval
PG_CONSOLE_LOGWATCHER_ANALYZEPAST Duration 48h LogWatcher gets operations to analyze which created_at > now() - AnalyzePast
PG_CONSOLE_CLUSTERWATCHER_RUNEVERY Duration 1m ClusterWatcher run interval
Expand Down
2 changes: 1 addition & 1 deletion console/service/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0
2 changes: 1 addition & 1 deletion console/service/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ swagger: '2.0'
info:
title: autobase console
description: API for autobase console
version: 2.0.0
version: 2.1.0
host: localhost:8080
schemes:
- http
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:"autobase/automation:2.0.0" desc:"Docker image for autobase automation"`
Image string `default:"autobase/automation:2.1.0" desc:"Docker image for autobase automation"`
}
LogWatcher struct {
RunEvery time.Duration `default:"1m" desc:"LogWatcher run interval"`
Expand Down
Loading

0 comments on commit 0c8abff

Please sign in to comment.