Skip to content

Commit

Permalink
fix(frontend): fix parsing large workflow graph. Fixes #4179 (#4180)
Browse files Browse the repository at this point in the history
* frontend: add large pipeline example to mocked data

* add util function decodeCompressedNodes

* decode compressedNodes in workflow if node is empty and compressedNodes exit

* fix decodeCompressedNodes

* prettify code

* Frontend:test Utils decodeCompressedNodes

* test RunDetails page render compressed grah

* add util function decodeCompressedNodes

* Frontend:test Utils decodeCompressedNodes

* test RunDetails page render compressed grah

* reformat code

* update jest snapshot to add compressed node case

* fix tests

* reformat code

* update RunDetails snapshot

* remove dupplicate test code

* RunDetails: remove compressedNodes after decoding it

* reformat decodeCompressedNodes + add failure case test

* decodeCompressedNodes returns undefined on error

* RunDetails decodeCompressedNodes test: snapshot same as single node graph

* do not wait for decodeCompressedNodes + debug print workflow

* fix Run load + refresh snapshot

* format code

* Fix one-node compressed workflow graph + update snapshot

* reformat code

* rename large pipeline name

* fix decompressNodes to work in browser

* fix test

* fix tests

* remove some of the console.log

* clean code

* address comments

* address comments: wait for zlib instead of mocking decodeCompressedNodes

* address comments: decodeCompressedNodes reject in case of error + catch error on run load

* address comments
  • Loading branch information
radcheb committed Oct 16, 2020
1 parent 5742991 commit 02b0899
Show file tree
Hide file tree
Showing 6 changed files with 12,788 additions and 4 deletions.
27 changes: 27 additions & 0 deletions frontend/mock-backend/fixed-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import jsonRun from './json-runtime';
import coinflipRun from './mock-coinflip-runtime';
import errorRun from './mock-error-runtime';
import xgboostRun from './mock-xgboost-runtime';
import largeGraph from './large-graph-runtime';
import retryRun from './mock-retry-runtime';

function padStartTwoZeroes(str: string): string {
Expand Down Expand Up @@ -641,6 +642,32 @@ const runs: ApiRunDetail[] = [
status: 'Succeeded',
},
},
{
pipeline_runtime: {
workflow_manifest: JSON.stringify(largeGraph),
},
run: {
created_at: new Date('2020-07-08T10:03:37.000Z'),
description: 'large pipelien with a lot of nodes.',
finished_at: new Date('2020-07-08T10:39:43.000Z'),
id: '808ecf03-ee3b-48c6-9fa1-5f14ad11a3f8',
name: 'Very large graph',
pipeline_spec: {
workflow_manifest: JSON.stringify(largeGraph),
},
resource_references: [
{
key: {
id: 'a4d4f8c6-ce9c-4200-a92e-c48ec759b733',
type: ApiResourceType.EXPERIMENT,
},
relationship: ApiRelationship.OWNER,
},
],
scheduled_at: new Date('1970-01-01T00:00:00.000Z'),
status: 'Succeeded',
},
},
{
pipeline_runtime: {
workflow_manifest: JSON.stringify(retryRun),
Expand Down
Loading

0 comments on commit 02b0899

Please sign in to comment.