Skip to content

Commit

Permalink
Merge pull request #205 from ICRAR/LIU-306
Browse files Browse the repository at this point in the history
Refactors reprodata to make storage consistent
  • Loading branch information
awicenec committed Oct 14, 2022
2 parents 2405183 + 1f93cef commit 8871be1
Show file tree
Hide file tree
Showing 15 changed files with 637 additions and 1,708 deletions.
501 changes: 195 additions & 306 deletions daliuge-common/dlg/common/reproducibility/reproducibility.py

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions daliuge-engine/test/deploy/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@

default_repro = {
"rmode": "1",
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
"RERUN":{
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
}
}
default_graph_repro = {
"rmode": "1",
"meta_data": {"repro_protocol": 0.1, "hashing_alg": "_sha3.sha3_256"},
"merkleroot": "a",
"signature": "b",
"RERUN": {
"signature": "b",
}
}


Expand Down
27 changes: 14 additions & 13 deletions daliuge-engine/test/manager/test_dim.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
from asyncio.log import logger
import codecs
import json
import os
import time
import unittest
from asyncio.log import logger

import pkg_resources

from dlg import runtime
from dlg import droputils
from dlg import utils
from dlg.common import tool, Categories
Expand All @@ -38,21 +37,23 @@
from dlg.testutils import ManagerStarter
from test.manager import testutils


hostname = "localhost"


default_repro = {
"rmode": "1",
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
"RERUN": {
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
}
}
default_graph_repro = {
"rmode": "1",
"meta_data": {"repro_protocol": 0.1, "hashing_alg": "_sha3.sha3_256"},
"merkleroot": "a",
"signature": "b",
"RERUN": {
"signature": "b",
}
}


Expand Down Expand Up @@ -384,7 +385,7 @@ def test_fullRound(self):
# we need to add it manually before submitting -- otherwise it will
# get rejected by the DIM.
with pkg_resources.resource_stream(
"test", "graphs/complex.js"
"test", "graphs/complex.js"
) as f: # @UndefinedVariable
complexGraphSpec = json.load(codecs.getreader("utf-8")(f))
logger.debug(f"Loaded graph: {f}")
Expand Down Expand Up @@ -425,10 +426,10 @@ def test_fullRound(self):
# Wait until the graph has finished its execution. We'll know
# it finished by polling the status of the session
while (
SessionStates.RUNNING
in testutils.get(
self, "/sessions/%s/status" % (sessionId), restPort
).values()
SessionStates.RUNNING
in testutils.get(
self, "/sessions/%s/status" % (sessionId), restPort
).values()
):
time.sleep(0.2)

Expand Down
12 changes: 8 additions & 4 deletions daliuge-engine/test/manager/test_dm.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@
hostname = "localhost"
default_repro = {
"rmode": "1",
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
"RERUN":{
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
}
}
default_graph_repro = {
"rmode": "1",
"meta_data": {"repro_protocol": 0.1, "hashing_alg": "_sha3.sha3_256"},
"merkleroot": "a",
"signature": "b",
"RERUN":{
"signature": "b",
}
}


Expand Down
12 changes: 8 additions & 4 deletions daliuge-engine/test/manager/test_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@

default_repro = {
"rmode": "1",
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
"RERUN": {
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
}
}
default_graph_repro = {
"rmode": "1",
"meta_data": {"repro_protocol": 0.1, "hashing_alg": "_sha3.sha3_256"},
"merkleroot": "a",
"signature": "b",
"RERUN": {
"signature": "b",
}
}


Expand Down
14 changes: 9 additions & 5 deletions daliuge-engine/test/manager/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@

default_repro = {
"rmode": "1",
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
"RERUN": {
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
}
}
default_graph_repro = {
"rmode": "1",
"meta_data": {"repro_protocol": 0.1, "hashing_alg": "_sha3.sha3_256"},
"merkleroot": "a",
"signature": "b",
"RERUN": {
"signature": "b",
}
}


Expand Down Expand Up @@ -221,7 +225,7 @@ def test_reprodata_get(self):
c.addGraphSpec(sid, graph_spec)
c.deploySession(sid, completed_uids=["a"])
response = c.session_repro_data(sid)
self.assertIsNotNone(response["graph"]["a"]["reprodata"]["rg_blockhash"])
self.assertIsNotNone(response["graph"]["a"]["reprodata"]["RERUN"]["rg_blockhash"])
self.assertIsNotNone(response["reprodata"])
c.destroySession(sid)
# Test without reprodata
Expand Down
12 changes: 8 additions & 4 deletions daliuge-engine/test/manager/test_scalability.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@

default_repro = {
"rmode": "1",
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
"RERUN": {
"lg_blockhash": "x",
"pgt_blockhash": "y",
"pg_blockhash": "z",
}
}
default_graph_repro = {
"rmode": "1",
"meta_data": {"repro_protocol": 0.1, "hashing_alg": "_sha3.sha3_256"},
"merkleroot": "a",
"signature": "b",
"RERUN": {
"signature": "b",
}
}


Expand Down

0 comments on commit 8871be1

Please sign in to comment.