forked from MariaDB/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local storage for artifacts needs to be env var too
prod: /mnt/autofs/master_packages dev: /mnt/autofs/master_dev_packages
- Loading branch information
Showing
7 changed files
with
63 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,71 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import yaml | ||
import os | ||
import shutil | ||
import yaml | ||
|
||
base_path = "autogen/" | ||
BASE_PATH = "autogen/" | ||
config = {"private": {}} | ||
exec(open("master-private.cfg").read(), config, {}) | ||
|
||
with open('os_info.yaml', 'r') as f: | ||
os_info = yaml.safe_load(f) | ||
with open("os_info.yaml", mode="r", encoding="utf-8") as file: | ||
os_info = yaml.safe_load(file) | ||
|
||
platforms = {} | ||
|
||
for os_name in os_info: | ||
for arch in os_info[os_name]['arch']: | ||
builder_name = arch + '-' + os_name | ||
for arch in os_info[os_name]["arch"]: | ||
builder_name = arch + "-" + os_name | ||
if arch not in platforms: | ||
platforms[arch] = [] | ||
platforms[arch].append(builder_name) | ||
|
||
# Clear old configurations | ||
if os.path.exists(base_path): | ||
shutil.rmtree(base_path) | ||
if os.path.exists(BASE_PATH): | ||
shutil.rmtree(BASE_PATH) | ||
|
||
idx = 0 | ||
IDX = 0 | ||
for arch in platforms: | ||
# Create the directory for the architecture that is handled by each master | ||
# If for a given architecture there are more than "max_builds" builds, | ||
# create multiple masters | ||
# "max_builds" is defined is master-private.py | ||
num_masters = int(len(platforms[arch]) / config['private']['master-variables']['max_builds']) + 1 | ||
num_masters = ( | ||
int(len(platforms[arch]) / config["private"]["master-variables"]["max_builds"]) | ||
+ 1 | ||
) | ||
|
||
for master_id in range(num_masters): | ||
dir_path = base_path + arch + "-master-" + str(master_id) | ||
dir_path = BASE_PATH + arch + "-master-" + str(master_id) | ||
os.makedirs(dir_path) | ||
|
||
master_config = {} | ||
master_config['builders'] = platforms[arch] | ||
master_config['workers'] = config['private']['master-variables']['workers'][arch] | ||
master_config["builders"] = platforms[arch] | ||
master_config["workers"] = config["private"]["master-variables"]["workers"][ | ||
arch | ||
] | ||
|
||
starting_port = int(os.getenv('PORT', default=config['private']['master-variables']['starting_port'])) | ||
master_config['port'] = starting_port + idx | ||
master_config['log_name'] = "master-docker-" + arch + "-" + str(master_id) + '.log' | ||
starting_port = int( | ||
os.getenv( | ||
"PORT", default=config["private"]["master-variables"]["starting_port"] | ||
) | ||
) | ||
master_config["port"] = starting_port + IDX | ||
master_config["log_name"] = ( | ||
"master-docker-" + arch + "-" + str(master_id) + ".log" | ||
) | ||
|
||
with open(dir_path + '/master-config.yaml', 'w') as f: | ||
yaml.dump(master_config, f) | ||
with open(dir_path + "/master-config.yaml", mode="w", encoding="utf-8") as file: | ||
yaml.dump(master_config, file) | ||
|
||
shutil.copyfile('master.cfg', dir_path + '/master.cfg') | ||
shutil.copyfile('master-private.cfg', dir_path + '/master-private.cfg') | ||
shutil.copyfile("master.cfg", dir_path + "/master.cfg") | ||
shutil.copyfile("master-private.cfg", dir_path + "/master-private.cfg") | ||
|
||
buildbot_tac = open("buildbot.tac", "r").read() % master_config['log_name'] | ||
with open(dir_path + '/buildbot.tac', 'w') as f: | ||
buildbot_tac = ( | ||
open("buildbot.tac", mode="r", encoding="utf-8").read() | ||
% master_config["log_name"] | ||
) | ||
with open(dir_path + "/buildbot.tac", mode="w", encoding="utf-8") as f: | ||
f.write(buildbot_tac) | ||
idx += 1 | ||
print(arch, len(master_config['builders'])) | ||
IDX += 1 | ||
print(arch, len(master_config["builders"])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
TITLE="MariaDB CI (DEV)" | ||
TITLE="MariaDB CI" | ||
TITLE_URL=https://github.com/MariaDB/server | ||
BUILDMASTER_URL=https://buildbot.mariadb.org/ | ||
MQ_ROUTER_URL=ws://localhost:8085/ws | ||
MASTER_PACKAGES_DIR="/mnt/autofs/master_dev_packages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
TITLE="MariaDB CI" | ||
TITLE="MariaDB CI (DEV)" | ||
TITLE_URL=https://github.com/MariaDB/server | ||
BUILDMASTER_URL=https://buildbot.dev.mariadb.org/ | ||
BUILDMASTER_WG_IP=100.64.101.1 | ||
MQ_ROUTER_URL=ws://crossbar:8080/ws | ||
MASTER_PACKAGES_DIR="/mnt/autofs/master_dev_packages" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters