Skip to content

Commit b431ed7

Browse files
committed
Feature: use settings aggregates instead of hardcoded crn version
1 parent b3d7128 commit b431ed7

File tree

1 file changed

+7
-6
lines changed
  • src/aleph/sdk/client/services

1 file changed

+7
-6
lines changed

src/aleph/sdk/client/services/crn.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def find_gpu_on_network(self):
9595
available_gpu_list=available_compatible_gpu,
9696
)
9797

98-
def filter_crn(
98+
async def filter_crn(
9999
self,
100100
latest_crn_version: bool = False,
101101
ipv6: bool = False,
@@ -113,15 +113,16 @@ def filter_crn(
113113
Returns:
114114
list[CRN]: List of compute resource nodes. (if no filter applied, return all)
115115
"""
116-
# current_crn_version = await fetch_latest_crn_version()
117-
# Relax current filter to allow use aleph-vm versions since 1.5.1.
118-
# TODO: Allow to specify that option on settings aggregate on maybe on GitHub
119-
current_crn_version = "1.5.1"
116+
if latest_crn_version:
117+
settings_aggregates = await self._client.settings.get_settings_aggregate()
120118

121119
filtered_crn: list[CRN] = []
122120
for crn_ in self.crns:
123121
# Check crn version
124-
if latest_crn_version and (crn_.version or "0.0.0") < current_crn_version:
122+
if (
123+
latest_crn_version
124+
and (crn_.version or "0.0.0") < settings_aggregates.last_crn_version
125+
):
125126
continue
126127

127128
# Filter with ipv6 check

0 commit comments

Comments
 (0)