diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 623c3d5c..bc78fd72 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -51,7 +51,8 @@ jobs: - name: Start Goth env: - GOTH_VERSION: 0.16.0 + GOTH_VERSION: 0.19.0 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_ACTOR: ${{ github.actor }} run: ./.github/workflows/start-goth.sh diff --git a/.github/workflows/start-goth.sh b/.github/workflows/start-goth.sh index eb6564f2..3f82ebf0 100755 --- a/.github/workflows/start-goth.sh +++ b/.github/workflows/start-goth.sh @@ -22,7 +22,7 @@ python -m pip install --upgrade pip python -m pip install --upgrade setuptools wheel echo INSTALLING DEPENDENCIES -python -m pip install --extra-index-url https://test.pypi.org/simple/ goth==$GOTH_VERSION +python -m pip install git+https://github.com/golemfactory/goth@$GOTH_VERSION python -m pip install pytest pytest-asyncio pexpect "requests<2.32.0" # Remove requests after fixed https://github.com/docker/docker-py/issues/3256 echo CREATING ASSETS diff --git a/pyproject.toml b/pyproject.toml index c4c06cae..67c05483 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ ray = {version = "~2.9.3", extras = ["default"]} #golem-core = {path = "../golem-core-python", develop = true} # golem-core = {git = "https://github.com/golemfactory/golem-core-python.git", branch = "main"} # golem-core = {version = "^0.7.0", source = "test-pypi"} -golem-core = "^0.7.3" +golem-core = "^0.7.5" aiohttp = "^3" requests = "^2" click = "^8" diff --git a/ray_on_golem/server/services/golem/golem.py b/ray_on_golem/server/services/golem/golem.py index 8e699afe..9ae8e8b1 100644 --- a/ray_on_golem/server/services/golem/golem.py +++ b/ray_on_golem/server/services/golem/golem.py @@ -27,23 +27,23 @@ class NoMatchingPlatform(AllocationException): # as until then there is no api call available to get driver lists and golem-core is api-only class DriverListAllocationPaymentManager(DefaultPaymentManager): @trace_span(show_arguments=True, show_results=True) - async def _create_allocation(self, budget: Decimal, network: str, driver: str) -> Allocation: + async def _create_allocation(self) -> Allocation: output = json.loads( await run_subprocess_output(YAGNA_PATH, "payment", "driver", "list", "--json") ) try: - network_output = output[driver]["networks"][network] + network_output = output[self._driver]["networks"][self._network] platform = network_output["tokens"][network_output["default_token"]] except KeyError: - raise NoMatchingPlatform(network, driver) + raise NoMatchingPlatform(self._network, self._driver) timestamp = datetime.now(timezone.utc) timeout = timestamp + timedelta(days=365 * 10) data = models.Allocation( payment_platform=platform, - total_amount=str(budget), + total_amount=str(Decimal(self._budget)), timestamp=timestamp, timeout=timeout, # This will probably be removed one day (consent-related thing)