Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Bump: Task API v0.24.0 (#4873)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranciszkiewicz authored Nov 12, 2019
1 parent 5f4d42e commit 689843d
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions golem/apps/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
name='golemfactory/blenderapp',
author='Golem Factory GmbH',
license='GPLv3',
version='0.6.0',
version='0.7.0',
description=(
'Rendering with Blender, the free and open source '
'3D creation suite'
),
requestor_env=DOCKER_CPU_ENV_ID,
requestor_prereq=dict(
image='golemfactory/blenderapp',
tag='0.6.0',
tag='0.7.0',
),
market_strategy=RequestorBrassMarketStrategy,
max_benchmark_score=10000.,
Expand Down
5 changes: 1 addition & 4 deletions golem/task/requestedtaskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class CreateTaskParams:
resources: List[Path]
max_subtasks: int
max_price_per_hour: int
min_memory: int # FIXME: refactor for Task API v0.24.0
concent_enabled: bool


Expand Down Expand Up @@ -152,8 +151,6 @@ def create_task(
start_time=None,
max_price_per_hour=golem_params.max_price_per_hour,
max_subtasks=golem_params.max_subtasks,
# FIXME: refactor for Task API v0.24.0
min_memory=golem_params.min_memory,
# Concent is explicitly disabled for task_api for now...
concent_enabled=False,
# mask = BlobField(null=False, default=masking.Mask().to_bytes()),
Expand Down Expand Up @@ -211,6 +208,7 @@ async def init_task(self, task_id: TaskId) -> None:
)
task.env_id = reply.env_id
task.prerequisites = reply.prerequisites
task.min_memory = reply.inf_requirements.min_memory_mib * (1024 ** 2)
task.save()
logger.debug('init_task(task_id=%r) after', task_id)

Expand Down Expand Up @@ -527,7 +525,6 @@ async def duplicate_task(self, task_id: TaskId, output_dir: Path) -> TaskId:
resources=resources,
max_subtasks=task.max_subtasks,
max_price_per_hour=task.max_price_per_hour,
min_memory=task.min_memory,
concent_enabled=task.concent_enabled,
)
app_params = task.app_params
Expand Down
2 changes: 0 additions & 2 deletions golem/task/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,6 @@ def _create_task_api_task(
output_directory=Path(golem_params['output_directory']),
max_price_per_hour=int(golem_params['max_price_per_hour']),
max_subtasks=int(golem_params['max_subtasks']),
# FIXME: refactor for Task API v0.24.0
min_memory=int(golem_params['min_memory']),
task_timeout=int(golem_params['task_timeout']),
subtask_timeout=int(golem_params['subtask_timeout']),
concent_enabled=bool(golem_params.get('concent_enabled', False)),
Expand Down
2 changes: 1 addition & 1 deletion golem/task/taskserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def _get_and_sign_headers(self):
deadline=int(db_task.deadline.timestamp()),
subtask_timeout=db_task.subtask_timeout,
subtasks_count=db_task.max_subtasks,
# estimated_memory=task_definition.estimated_memory,
estimated_memory=db_task.min_memory,
max_price=db_task.max_price_per_hour,
concent_enabled=db_task.concent_enabled,
timestamp=int(db_task.start_time.timestamp()),
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ eventlet==0.24.1
fs==2.4.4
Golem-Messages==3.14.0
Golem-Smart-Contracts-Interface==1.10.3
golem_task_api==0.23.0
Golem-Task-Api==0.24.0
greenlet==0.4.15
h2==3.0.1
hpack==3.0.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_to-freeze.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ eth-utils==1.0.3
ethereum==1.6.1
Golem-Messages==3.14.0
Golem-Smart-Contracts-Interface==1.10.3
golem_task_api==0.23.0
Golem-Task-Api==0.24.0
html2text==2018.1.9
humanize==0.5.1
incremental==17.5.0
Expand Down
1 change: 0 additions & 1 deletion scripts/node_integration_tests/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
'resources': [],
'max_price_per_hour': str(10 ** 18),
'max_subtasks': 1,
'min_memory': 0, # FIXME: refactor for Task API v0.24.0
'task_timeout': 600000, # 00:10:00
'subtask_timeout': 590000, # 00:09:50
},
Expand Down
5 changes: 3 additions & 2 deletions tests/golem/envs/test_localhost_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RequestorAppClient
)
from golem_task_api.enums import VerifyResult
from golem_task_api.structs import Subtask, Task
from golem_task_api.structs import Subtask, Task, Infrastructure
from grpclib.exceptions import StreamTerminatedError
from twisted.internet.defer import inlineCallbacks

Expand Down Expand Up @@ -96,7 +96,8 @@ async def run_benchmark():
def test_create_task(self):
task = Task(
env_id='test_env',
prerequisites={'key': 'value'}
prerequisites={'key': 'value'},
inf_requirements=Infrastructure(min_memory_mib=2000.),
)

async def create_task():
Expand Down
13 changes: 7 additions & 6 deletions tests/golem/task/test_requestedtaskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from freezegun import freeze_time
from golem_task_api.client import RequestorAppClient
from golem_task_api.enums import VerifyResult
from golem_task_api.structs import Subtask
from golem_task_api.structs import Subtask, Infrastructure
from mock import ANY, Mock
import pytest
from twisted.internet import defer
Expand Down Expand Up @@ -38,7 +38,8 @@ def mock_create(*_args, **_kwargs):

client_mock.create_task.return_value = Mock(
env_id='env_id',
prerequisites={}
prerequisites={},
inf_requirements=Infrastructure(min_memory_mib=2000.),
)
return client_mock

Expand Down Expand Up @@ -92,7 +93,8 @@ async def test_init_task(self, mock_client):
prerequisites = {'key': 'value'}
mock_client.create_task.return_value = Mock(
env_id=env_id,
prerequisites=prerequisites
prerequisites=prerequisites,
inf_requirements=Infrastructure(min_memory_mib=2000.),
)

# when
Expand Down Expand Up @@ -427,7 +429,7 @@ async def test_stop(self, mock_client):

def _build_golem_params(
self,
resources=[],
resources=None,
task_timeout=1,
subtask_timeout=1
) -> CreateTaskParams:
Expand All @@ -437,10 +439,9 @@ def _build_golem_params(
task_timeout=task_timeout,
subtask_timeout=subtask_timeout,
output_directory=self.tmp_path / 'output',
resources=resources,
resources=resources or [],
max_subtasks=1,
max_price_per_hour=1,
min_memory=0,
concent_enabled=False,
)

Expand Down
1 change: 0 additions & 1 deletion tests/golem/task/test_rpc_task_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def get_golem_params():
],
'max_price_per_hour': 123,
'max_subtasks': 4,
'min_memory': 0,
'task_timeout': 60,
'subtask_timeout': 60,
}
Expand Down

0 comments on commit 689843d

Please # to comment.