Skip to content

Commit

Permalink
Pull request update/241015
Browse files Browse the repository at this point in the history
4dd58a5 OS-5394. Renamed ali platform in arcee
0440e1a OS-2385. Custom exception on creating already existing env
81edafa OS-7901. Improve Plotly chart responsiveness
44f016c OS-7861. Added count/total_count to artifacts list api
  • Loading branch information
stanfra authored Oct 15, 2024
2 parents 6ebe9e9 + 4dd58a5 commit 99186a5
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 120 deletions.
2 changes: 1 addition & 1 deletion arcee/arcee_receiver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Leaderboard(LeaderboardPostIn):


class PlatformType(str, Enum):
ali = "ali"
alibaba = "alibaba"
aws = "aws"
azure = "azure"
gcp = "gcp"
Expand Down
6 changes: 4 additions & 2 deletions arcee/arcee_receiver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2442,6 +2442,7 @@ async def list_artifacts(request):
'artifacts': [],
'limit': query.limit,
'start_from': query.start_from,
'count': 0,
'total_count': 0
}
task_query = {'token': token}
Expand Down Expand Up @@ -2471,16 +2472,17 @@ async def list_artifacts(request):
res = _format_artifact(artifact, runs_map[artifact['run_id']], tasks)
result['artifacts'].append(res)
if len(result['artifacts']) != 0 and not query.limit:
result['total_count'] = len(result['artifacts']) + query.start_from
result['count'] = len(result['artifacts']) + query.start_from
else:
pipeline = _build_artifact_filter_pipeline(runs_ids, query)
pipeline.append({'$count': 'count'})
res = db.artifact.aggregate(pipeline)
try:
count = await res.next()
result['total_count'] = count['count']
result['count'] = count['count']
except StopAsyncIteration:
pass
result['total_count'] = await db.artifact.count_documents({'token': token})
return json(result)


Expand Down
21 changes: 14 additions & 7 deletions arcee/arcee_receiver/tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ async def test_list_artifacts_created_at(app):
assert response.status == 200
assert len(response.json['artifacts']) == 1
assert response.json['artifacts'][0]['_id'] == artifact['_id']
assert response.json['total_count'] == 1
assert response.json['count'] == 1
assert response.json['total_count'] == 3
assert response.json['limit'] == 0
assert response.json['start_from'] == 0

Expand All @@ -287,7 +288,8 @@ async def test_list_artifacts_run_id(app):
headers={"x-api-key": TOKEN1})
assert response.status == 200
assert len(response.json['artifacts']) == 2
assert response.json['total_count'] == 2
assert response.json['count'] == 2
assert response.json['total_count'] == 3
assert response.json['limit'] == 0
assert response.json['start_from'] == 0
for artifact in response.json['artifacts']:
Expand All @@ -310,7 +312,8 @@ async def test_list_artifacts_task_id(app):
headers={"x-api-key": TOKEN1})
assert response.status == 200
assert len(response.json['artifacts']) == 2
assert response.json['total_count'] == 2
assert response.json['count'] == 2
assert response.json['total_count'] == 3
assert response.json['limit'] == 0
assert response.json['start_from'] == 0
for artifact in response.json['artifacts']:
Expand All @@ -332,7 +335,8 @@ async def test_list_artifacts_text_like(app):
headers={"x-api-key": TOKEN1})
assert response.status == 200
assert len(response.json['artifacts']) == 1
assert response.json['total_count'] == 1
assert response.json['count'] == 1
assert response.json['total_count'] == 4
assert response.json['limit'] == 0
assert response.json['start_from'] == 0
assert response.json['artifacts'][0]['_id'] == artifact1['_id']
Expand All @@ -341,7 +345,8 @@ async def test_list_artifacts_text_like(app):
headers={"x-api-key": TOKEN1})
assert response.status == 200
assert len(response.json['artifacts']) == 1
assert response.json['total_count'] == 1
assert response.json['count'] == 1
assert response.json['total_count'] == 4
assert response.json['limit'] == 0
assert response.json['start_from'] == 0
assert response.json['artifacts'][0]['_id'] == artifact2['_id']
Expand All @@ -350,7 +355,8 @@ async def test_list_artifacts_text_like(app):
headers={"x-api-key": TOKEN1})
assert response.status == 200
assert len(response.json['artifacts']) == 1
assert response.json['total_count'] == 1
assert response.json['count'] == 1
assert response.json['total_count'] == 4
assert response.json['limit'] == 0
assert response.json['start_from'] == 0
assert response.json['artifacts'][0]['_id'] == artifact3['_id']
Expand All @@ -359,7 +365,8 @@ async def test_list_artifacts_text_like(app):
headers={"x-api-key": TOKEN1})
assert response.status == 200
assert len(response.json['artifacts']) == 1
assert response.json['total_count'] == 1
assert response.json['count'] == 1
assert response.json['total_count'] == 4
assert response.json['limit'] == 0
assert response.json['start_from'] == 0
assert response.json['artifacts'][0]['_id'] == artifact4['_id']
Expand Down
2 changes: 1 addition & 1 deletion arcee/arcee_receiver/tests/test_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def test_collect(app):
"loss": 99
},
"platform": {
"platform_type": "aws",
"platform_type": "alibaba",
"instance_id": str(uuid.uuid4()),
"account_id": str(uuid.uuid4()),
"local_ip": "1.1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion ngui/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"jspdf-autotable": "^3.5.28",
"localforage": "^1.10.0",
"node-macaroons": "^0.0.6",
"plotly.js-gl2d-dist-min": "^2.24.0",
"plotly.js-gl2d-dist-min": "^2.35.2",
"query-string": "^7.1.3",
"react": "^18.2.0",
"react-big-calendar": "^1.5.2",
Expand Down
8 changes: 4 additions & 4 deletions ngui/ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const useStyles = makeStyles()((theme) => ({
height: "100%",
width: "100%"
},
clearFiltersButton: {
marginLeft: theme.spacing(1)
},
wrapper: {
"& line.highlight": {
stroke: theme.palette.primary.light,
Expand Down
Loading

0 comments on commit 99186a5

Please sign in to comment.