Skip to content

Commit

Permalink
[BACKPORT] Include tileable property in detail api (#2493) (#2499)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjsi authored Oct 9, 2021
1 parent 485b3aa commit 1ac7a1f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/install-hadoop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sudo npm uninstall -g yarn || true

sudo apt-get install -yq ssh rsync

VERSION=3.3.0
VERSION=3.3.1
HADOOP_URL="https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=hadoop/common/hadoop-$VERSION/hadoop-$VERSION.tar.gz"

# download hadoop
Expand Down
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ jobs:
conda install -n test --quiet --yes -c pkgs/main python=$PYTHON certifi
if [[ "$(mars.test.module)" == "learn" ]]; then
# remove version limit when blue-yonder/tsfresh#897 is fixed.
pip install xgboost lightgbm tensorflow faiss-cpu torch torchvision \
statsmodels tsfresh
statsmodels\<0.13.0 tsfresh
fi
fi
conda list -n test
Expand Down
2 changes: 1 addition & 1 deletion mars/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
from typing import NamedTuple, Optional

version_info = (0, 7, 3)
version_info = (0, 7, 4)
_num_index = max(idx if isinstance(v, int) else 0
for idx, v in enumerate(version_info))
__version__ = '.'.join(map(str, version_info[:_num_index + 1])) + \
Expand Down
6 changes: 6 additions & 0 deletions mars/services/task/supervisor/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,17 @@ def get_tileable_details(self):
else:
status = SubtaskStatus.running

props = {slot: getattr(tileable, slot, None) for slot in tileable.__slots__}
props = {k: v for k, v in props.get('_FIELD_VALUES').items()
if k != 'key' and isinstance(v, (int, float, str))}

tileable_infos[tileable.key] = {
'progress': progress,
'subtaskCount': len(results),
'status': status.value,
'properties': props,
}

return tileable_infos

def get_tileable_subtasks(self, tileable_id: str, with_input_output: bool):
Expand Down
11 changes: 11 additions & 0 deletions mars/services/task/tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,17 @@ def _get_fields(details, field, wrapper=None):
details = await task_api.get_tileable_details(task_id)
assert details[r7.key]['status'] == SubtaskStatus.errored.value

contain_id_property = False
for tileable in details.keys():
for property_key, property_value in details.get(tileable).get('properties').items():
assert property_key != 'key'
assert isinstance(property_value, (int, float, str))

if property_key == 'id':
contain_id_property = True

assert contain_id_property == True


@pytest.mark.asyncio
@pytest.mark.parametrize('with_input_output', [False, True])
Expand Down

0 comments on commit 1ac7a1f

Please sign in to comment.