Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 44 additions & 0 deletions bin/update_upgrade_containers.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this to update_containers.py.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include the part that pulls the Docker containers in this Python script.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os
Copy link
Contributor

@nicomiguelino nicomiguelino Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a #!/usr/bin/env python3 at the beginning of the file:

Suggested change
import os
#!/usr/bin/env python
import os

import subprocess
from pathlib import Path


# Getting the local machine IP address
def get_ip():
try:
result = subprocess.run(
["ip", "-4", "route", "get", "8.8.8.8"],
capture_output=True,
text=True,
check=True
)
return result.stdout.split()[6].strip()
except Exception as e:
print(f"Error getting IP address: {e}")
return "0.0.0.0"

MY_IP = get_ip()
os.environ["MY_IP"] = MY_IP


# Getting total system memory in KB
def get_total_memory_kb():
try:
with open("/proc/meminfo") as f:
for line in f:
if line.startswith("MemTotal"):
return int(line.split()[1])
except Exception as e:
print(f"Error reading memory info: {e}")
return 0

TOTAL_MEMORY_KB = get_total_memory_kb()


# Calculating memory limits
VIEWER_MEMORY_LIMIT_KB = int(TOTAL_MEMORY_KB * 0.8)
SHM_SIZE_KB = int(TOTAL_MEMORY_KB * 0.3)

# Export to environment variables
os.environ["VIEWER_MEMORY_LIMIT_KB"] = str(VIEWER_MEMORY_LIMIT_KB)
os.environ["SHM_SIZE_KB"] = str(SHM_SIZE_KB)
90 changes: 0 additions & 90 deletions bin/upgrade_containers.sh

This file was deleted.