Skip to content

Commit 10d0172

Browse files
committed
func_tests
1 parent ceb3720 commit 10d0172

3 files changed

Lines changed: 66 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ env:
77
ARTIFACTS_PATH: artifacts
88
PROJECT_NAME: exordos_core
99
REPO_ENDPOINT_PUT: http://10.20.0.1:8082
10+
PACKER_VERSION: "latest"
11+
PYTHON_VERSION: "3.12"
12+
CORE_BRANCH: "master"
13+
CORE_ENDPOINT_URL: http://10.20.0.2:11010
14+
CORE_USERNAME: "admin"
15+
CORE_PASSWORD: "admin"
1016

1117
jobs:
1218
Build:
@@ -47,4 +53,54 @@ jobs:
4753
with:
4854
name: build_artifacts
4955
path: artifacts/
50-
56+
FuncTests:
57+
# needs: Build
58+
if : ${{ github.actor != 'dependabot[bot]' }}
59+
runs-on: ubuntu-24.04
60+
steps:
61+
- uses: actions/checkout@v6
62+
- name: Setup `packer`
63+
uses: hashicorp/setup-packer@main
64+
with:
65+
version: ${{ env.PACKER_VERSION }}
66+
- name: Install exordos
67+
run: curl -fsSL https://repository.genesis-core.tech/install.sh | sudo sh
68+
- name: set exordos config
69+
run: |
70+
exordos settings set-realm default --endpoint $CORE_ENDPOINT_URL
71+
exordos settings set-context default --name default --user $CORE_USERNAME --password $CORE_PASSWORD
72+
# - name: Install dependencies
73+
# run: sudo apt update && sudo apt install --yes libev-dev
74+
- name: Install hypervisor
75+
run: sudo exordos compute hypervisors init
76+
# - name: Download build artifacts
77+
# uses: actions/download-artifact@v4
78+
# with:
79+
# name: build_artifacts
80+
# path: artifacts/
81+
- name: bootstrap exordos core
82+
run: |
83+
# VERSION=$(cat artifacts/version.txt)
84+
VERSION=0.0.8
85+
exordos bootstrap -i $VERSION -f -m core --admin-password $CORE_PASSWORD --cidr 10.20.0.0/22
86+
- name: sleep
87+
run: |
88+
sleep 10
89+
- name: check exordos core
90+
run: |
91+
set -eux
92+
93+
for i in {1..10}; do
94+
exordos e e list
95+
96+
sleep 1
97+
done
98+
exordos e e show core
99+
exordos compute nodes list
100+
exordos compute hypervisors list
101+
- name: Setup tmate session
102+
# if: ${{ failure() }}
103+
uses: mxschmitt/action-tmate@v3
104+
timeout-minutes: 10
105+
with:
106+
limit-access-to-actor: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,5 @@ docs/source/*.png
137137

138138
# postgres
139139
pgdata/
140+
141+
.tasks

exordos_core/cmd/elements_inventory.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def merge_inventories(inventory_files):
4343
"""Merge all found inventory files into one list."""
4444
result_inventory = {"elements": {}}
4545

46+
latest_version = None
4647
for file_path in inventory_files:
4748
try:
4849
with open(file_path, "r") as f:
@@ -51,6 +52,11 @@ def merge_inventories(inventory_files):
5152
result_inventory["elements"][data["name"]] = {}
5253

5354
result_inventory["elements"][data["name"]][data["version"]] = data
55+
56+
if latest_version is None or data["version"] > latest_version:
57+
latest_version = data["version"]
58+
result_inventory["elements"][data["name"]]["latest"] = data
59+
5460
except Exception as e:
5561
print(f"Error reading {file_path}: {e}")
5662

@@ -74,7 +80,7 @@ def main():
7480
root_dir = os.path.join(REPOSITORY_DIR, elements_dir)
7581
output_file = os.path.join(root_dir, "inventory.json")
7682

77-
print("Searching for inventory.json files...")
83+
print(f"Searching for inventory.json files in {root_dir}...")
7884
inventory_files = find_inventory_files(root_dir)
7985

8086
if not inventory_files:

0 commit comments

Comments
 (0)