Skip to content

Commit ca0e238

Browse files
authored
elements inventory for exordos (#324)
1 parent 21accbd commit ca0e238

5 files changed

Lines changed: 28 additions & 24 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ jobs:
2424
mkdir -p ${ARTIFACTS_PATH}
2525
2626
source ~/.profile
27-
VERSION="$(genesis get-version .)"
27+
VERSION="$(exordos get-version .)"
2828
2929
# Build Exordos Core
30-
genesis build $(pwd) --inventory
30+
exordos build $(pwd) --inventory
3131
3232
# Decode and write the push configuration
33-
echo "$PUSH_CFG" | base64 -d > genesis/genesis.push.yaml
34-
genesis push -c genesis/genesis.push.yaml -t local -f --latest
33+
echo "$PUSH_CFG" | base64 -d > genesis/exordos.push.yaml
34+
exordos push -c genesis/exordos.push.yaml -t local -f --latest
3535
3636
# Upload the VM image
37-
gzip -k output/exordos-core.raw -c | \
38-
curl -X PUT -T - "$REPO_ENDPOINT_PUT/${PROJECT_NAME}/${VERSION}/exordos-core.raw.gz"
37+
# gzip -k output/exordos-core.raw -c | \
38+
# curl -X PUT -T - "$REPO_ENDPOINT_PUT/${PROJECT_NAME}/${VERSION}/exordos-core.raw.gz"
3939
4040
# Temporary upload step is done in the build script
4141
echo "${VERSION}" > "${ARTIFACTS_PATH}/version.txt"

.github/workflows/inventory.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
Build:
13-
runs-on: self-hosted
13+
runs-on: hard
1414
strategy:
1515
fail-fast: true
1616
steps:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ help:
1111
@echo "bootstrap - bootstrap exordos core"
1212

1313
build_core:
14-
genesis build -i $(SSH_KEY) -f . --inventory --manifest-var repository=https://repository.genesis-core.tech
14+
exordos build -i $(SSH_KEY) -f . --inventory --manifest-var repository=https://repository.genesis-core.tech
1515

1616
bootstrap:
17-
genesis bootstrap -i output/inventory.json -f -m core --admin-password admin --cidr 10.20.0.0/22
17+
exordos bootstrap -i output/inventory.json -f -m core --admin-password admin --cidr 10.20.0.0/22

exordos_core/cmd/bootstrap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _ensure_gctl_config(spec: dict[str, tp.Any]):
240240
gid = grp.getgrnam(USER).gr_gid
241241
os.chown(GCTL_CFG_DIR, uid, gid)
242242

243-
config_path = os.path.join(GCTL_CFG_DIR, "genesisctl.yaml")
243+
config_path = os.path.join(GCTL_CFG_DIR, "exordosctl.yaml")
244244
with open(config_path, "w") as f:
245245
yaml.safe_dump(
246246
{
@@ -263,7 +263,7 @@ def _ensure_gctl_config(spec: dict[str, tp.Any]):
263263
f,
264264
)
265265
os.chown(config_path, uid, gid)
266-
os.system("genesis autocomplete")
266+
os.system("exordos autocomplete")
267267

268268

269269
def _install_element_manifest(
@@ -284,7 +284,7 @@ def _install_element_manifest(
284284
return
285285

286286
os.system(
287-
f"genesis --config {GCTL_CFG_DIR}/genesisctl.yaml elements install {manifest_path}"
287+
f"exordos --config {GCTL_CFG_DIR}/exordosctl.yaml elements install {manifest_path}"
288288
)
289289

290290

exordos_core/cmd/elements_inventory.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
import time
2222

2323
REPOSITORY_DIR = "/var/lib/repository"
24-
ELEMENTS_DIR = "genesis-elements"
24+
ELEMENTS_DIRS = [
25+
"genesis-elements",
26+
"exordos-elements",
27+
]
2528
INVENTORY = "*/inventory.json"
2629

2730

@@ -67,22 +70,23 @@ def write_merged_inventory(merged_data, output_path):
6770

6871

6972
def main():
70-
root_dir = os.path.join(REPOSITORY_DIR, ELEMENTS_DIR)
71-
output_file = os.path.join(root_dir, "inventory.json")
73+
for elements_dir in ELEMENTS_DIRS:
74+
root_dir = os.path.join(REPOSITORY_DIR, elements_dir)
75+
output_file = os.path.join(root_dir, "inventory.json")
7276

73-
print("Searching for inventory.json files...")
74-
inventory_files = find_inventory_files(root_dir)
77+
print("Searching for inventory.json files...")
78+
inventory_files = find_inventory_files(root_dir)
7579

76-
if not inventory_files:
77-
print("No inventory.json files found.")
78-
return
80+
if not inventory_files:
81+
print("No inventory.json files found.")
82+
return
7983

80-
print(f"Found {len(inventory_files)} inventory.json files.")
84+
print(f"Found {len(inventory_files)} inventory.json files.")
8185

82-
merged_data = merge_inventories(inventory_files)
83-
print(f"Merged {len(merged_data['elements'])} items.")
86+
merged_data = merge_inventories(inventory_files)
87+
print(f"Merged {len(merged_data['elements'])} items.")
8488

85-
write_merged_inventory(merged_data, output_file)
89+
write_merged_inventory(merged_data, output_file)
8690

8791

8892
if __name__ == "__main__":

0 commit comments

Comments
 (0)