Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
227930d
align with REL24 and new planned version
mmols Feb 28, 2025
6dc5e51
Merge pull request #275 from pgEdge/build_issue_fix
mmols Mar 4, 2025
f0a1995
dir related issue in backrest(not solved)
moizpgedge Feb 26, 2025
6d1d52f
Create json updated with backrestpath
moizpgedge Feb 26, 2025
7498eea
Update cluster.py
moizpgedge Feb 26, 2025
00a0cb8
Update cluster.py
moizpgedge Mar 3, 2025
a2653d5
Update cluster.py
moizpgedge Mar 3, 2025
5172739
new update
moizpgedge Mar 3, 2025
605942d
backup command working
moizpgedge Mar 3, 2025
f609f7a
Update cluster.py
moizpgedge Mar 3, 2025
7511b97
backrest commands working on all nodes
moizpgedge Mar 4, 2025
dc8f45d
Add a wait loop in bp to ensure the Python HTTP server is up before c…
hayee-bhatti Mar 5, 2025
b3e999e
postgis build version bump to 3.5.0-2
hayee-bhatti Mar 5, 2025
4804ac8
Update LICENSE.md (#280)
susan-pgedge Mar 5, 2025
a55eff5
duplicate check dir function removed from util
moizpgedge Mar 6, 2025
49405b4
Merge pull request #282 from pgEdge/backrest-changes
mmols Mar 6, 2025
1e2c3cd
display default pg_ver in json-create input
mmols Mar 10, 2025
b86ad03
fix spock version parsing when revision is 2 digits
mmols Mar 10, 2025
fef9261
remove codename
mmols Mar 10, 2025
6ea1cf8
align display of defaults across options
mmols Mar 10, 2025
3a13fdc
align display with quotes
mmols Mar 10, 2025
09194c7
cleanup pgBackRest question
mmols Mar 10, 2025
2b78499
add better summary for json-create
mmols Mar 10, 2025
37c9bd0
fix indenting on json-create summary
mmols Mar 10, 2025
a5f07eb
second pass at summary
mmols Mar 10, 2025
eaae0c8
Ha removed from help
moizpgedge Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------
Copyright (c) 2021-2025, pgEdge, Inc.

Copyright (c) 2025, pgEdge, Inc.

--------------------------------------------------------------------------

## pgEdge Community License Agreement 1.1
Expand Down
9 changes: 8 additions & 1 deletion bp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ if [ -d $outp ]; then
fi

./devel/startHTTP.sh
./build.sh -X posix -R

echo "Waiting for Python HTTP server to start..."
while ! nc -z localhost 8000; do
sleep 1 # Check every second
done

echo "HTTP server is up!"

./build.sh -X posix -R
cd $outp

./$api set GLOBAL REPO http://localhost:8000
Expand Down
288 changes: 139 additions & 149 deletions cli/scripts/cluster.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cli/scripts/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import sys, os, tarfile, platform

VER = "24.12.1"
VER = "25.0.0"
REPO = os.getenv("REPO", "https://pgedge-upstream.s3.amazonaws.com/REPO")

if sys.version_info < (3, 9):
Expand Down
2 changes: 1 addition & 1 deletion cli/scripts/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def get_default_spock(pgv):
c.execute(sql)
data = c.fetchall()
for comp in data:
spock_ver_minor = comp[0][0:5]
spock_ver_minor = comp[0].split('-')[0]
avail_spock.append(spock_ver_minor)
if f"{default_spock[0]}.{default_spock[1]}" in spock_ver_minor:
default_spock = spock_ver_minor
Expand Down
63 changes: 51 additions & 12 deletions cli/scripts/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
import time

MY_VERSION = "24.12.1"
MY_CODENAME = "Constellation"
MY_VERSION = "25.0.0"
MY_CODENAME = ""

DEFAULT_PG = "16"
DEFAULT_SPOCK = "40"
Expand Down Expand Up @@ -37,7 +37,6 @@
import subprocess
import getpass
import filecmp

from subprocess import Popen, PIPE, STDOUT
from datetime import datetime, timedelta
from urllib import request as urllib2
Expand Down Expand Up @@ -255,7 +254,7 @@ def format_ver(p_ver):
message(f"'{p_ver}' is not a valid three part version string", "warning")
return(p_ver)

return(f"{v[0]}.{str(v[1]).rjust(2,'0')}-{v[2]}")
return(f"{v[0]}.{v[1]}-{v[2]}")


def autostart_verify_prereqs():
Expand Down Expand Up @@ -4154,36 +4153,59 @@ def echo_node(node):

print(bold_hashes)

def run_command(command_args, max_attempts=1, timeout=None, capture_output=True, env=None, cwd=None, verbose=False):

def run_command(command_args, max_attempts=1, timeout=None, capture_output=True,
env=None, cwd=None, verbose=False):
attempts = 0
output, error = "", ""


while attempts < max_attempts:
try:
attempts += 1
result = subprocess.run(command_args, check=True, text=True,
capture_output=capture_output, timeout=timeout,
env=env, cwd=cwd)
result = subprocess.run(
command_args,
check=True,
text=True,
capture_output=capture_output,
timeout=timeout,
env=env,
cwd=cwd,
# Added lines to handle invalid UTF-8 gracefully:
encoding="utf-8",
errors="replace" # or "ignore" if you prefer
)
if capture_output:
output = result.stdout
error = result.stderr

if verbose:
print(f"Command executed successfully.")
return {"success": True, "output": output, "error": error, "attempts": attempts}

return {
"success": True,
"output": output,
"error": error,
"attempts": attempts
}

except subprocess.CalledProcessError as e:
error = e.stderr if capture_output else str(e)
if verbose:
print(f"Error executing command: {error}")
time.sleep(1) # Simple backoff strategy
time.sleep(1) # Simple backoff before retry

except subprocess.TimeoutExpired as e:
error = f"Command timed out after {timeout} seconds."
if verbose:
print(f"Attempt {attempts}: {error}")
break # No retry after timeout

return {"success": False, "output": output, "error": error, "attempts": attempts}
return {
"success": False,
"output": output,
"error": error,
"attempts": attempts
}


def get_cluster_info(cluster_name):
Expand Down Expand Up @@ -4287,3 +4309,20 @@ def process_nodes(group, group_name):
REPO = get_value("GLOBAL", "REPO")



def check_directory_status(directory):
"""
Check if the directory exists and is writable.

Returns a dictionary with:
- 'exists': True if the directory exists, otherwise False.
- 'writable': True if the directory exists and is writable, otherwise False.
- 'message': A string describing the status.
"""
if os.path.isdir(directory):
writable = os.access(directory, os.W_OK)
message = f"Directory {directory} exists and is {'writable' if writable else 'not writable'}."
return {"exists": True, "writable": writable, "message": message}
else:
message = f"Directory {directory} does not exist."
return {"exists": False, "writable": False, "message": message}
6 changes: 3 additions & 3 deletions env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hubV=24.12.1
hubVV=24.12-1
hubV=25.0.0
hubVV=25.0.0

aceV=$hubV
kirkV=$hubV
Expand Down Expand Up @@ -56,7 +56,7 @@ audit15V=1.7.0-1
audit16V=16.0-1
audit17V=17.0-1

postgisV=3.5.0-1
postgisV=3.5.0-2

debuggerV=1.8-1
cronV=1.6.4-1
Expand Down
Loading