Skip to content

Commit c43492d

Browse files
authored
publish_release.py: check number of cpus (#107)
1 parent 40a1dbe commit c43492d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

0

Whitespace-only changes.

publish_release.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,25 @@ def git_tags():
306306
def preflight():
307307
load_dotenv()
308308

309+
result = subprocess.run("nproc", shell=True, text=True, capture_output=True)
310+
if result.stdout:
311+
cpus = int(result.stdout.strip())
312+
else:
313+
cpus = 0
314+
if cpus > 0 and cpus < 3:
315+
print(
316+
f"The number of cpus detected was {cpus}. It is recommended\
317+
to resize this machine."
318+
)
319+
print(
320+
"admin-server.boost.cpp.al may be resized by going to the release-tools\
321+
GitHub Actions page and manually triggering 'Resize Deployment Server'."
322+
)
323+
answer = input("Do you want to continue: [y/n]")
324+
if not answer or answer[0].lower() != "y":
325+
print("Exiting.")
326+
exit(1)
327+
309328
print(
310329
"Testing /etc/mime.types. The file should exist and contain hpp, but please ensure it's a full copy from Linux."
311330
)

0 commit comments

Comments
 (0)