From 5922da03d1159163e718de293a837af01aab2b17 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 13 Aug 2024 12:55:22 +0200 Subject: [PATCH 1/5] remove duplicated registry name --- .github/workflows/push-docker.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-docker.yaml b/.github/workflows/push-docker.yaml index 83e3fe8..2be0146 100644 --- a/.github/workflows/push-docker.yaml +++ b/.github/workflows/push-docker.yaml @@ -12,7 +12,7 @@ on: env: REGISTRY: ghcr.io ACTOR: OliverWoolland - IMAGE_NAME: ghcr.io/uomresearchit/workflowhub-graph + IMAGE_NAME: uomresearchit/workflowhub-graph jobs: build: From ac7e4af036e9060f4082d70d28a53e174ef63bd8 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 13 Aug 2024 13:27:36 +0200 Subject: [PATCH 2/5] add double-context test --- tests/test_absolutize.py | 6 +- tests/test_data/1046_ro-crate-metadata.json | 491 ++++++++++++++++++++ 2 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 tests/test_data/1046_ro-crate-metadata.json diff --git a/tests/test_absolutize.py b/tests/test_absolutize.py index 17b9ac9..962691d 100644 --- a/tests/test_absolutize.py +++ b/tests/test_absolutize.py @@ -19,13 +19,17 @@ def get_test_data_file(filename=""): class TestAbsolutizePaths: # (unittest.TestCase): # NOTE: ids can not be found, like 634, or forbidden, like 678 - @pytest.mark.parametrize("workflow_id", [41, 31, 552, 883]) + @pytest.mark.parametrize("workflow_id", [41, 31, 552, 883, 1046]) def test_make_paths_absolute(self, workflow_id): with patch_rdflib_urlopen(get_test_data_file(), write_cache=False): with open( get_test_data_file(f"{workflow_id}_ro-crate-metadata.json"), "r" ) as f: json_data = json.load(f) + + if workflow_id == 1046: + # this is a special case where ther are two contexts + assert len(json_data["@context"]) == 2 assert not is_all_absolute( rdflib.Graph().parse(data=json.dumps(json_data), format="json-ld") diff --git a/tests/test_data/1046_ro-crate-metadata.json b/tests/test_data/1046_ro-crate-metadata.json new file mode 100644 index 0000000..4757f93 --- /dev/null +++ b/tests/test_data/1046_ro-crate-metadata.json @@ -0,0 +1,491 @@ +{ + "@context": [ + "https://w3id.org/ro/crate/1.1/context", + "https://w3id.org/ro/terms/workflow-run" + ], + "@graph": [ + { + "@id": "ro-crate-metadata.json", + "@type": "CreativeWork", + "about": { + "@id": "./" + }, + "conformsTo": [ + { + "@id": "https://w3id.org/ro/crate/1.1" + }, + { + "@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.0" + } + ] + }, + { + "@id": "ro-crate-preview.html", + "@type": "CreativeWork", + "about": { + "@id": "./" + } + }, + { + "@id": "./", + "@type": "Dataset", + "conformsTo": [ + { + "@id": "https://w3id.org/ro/wfrun/process/0.4" + }, + { + "@id": "https://w3id.org/ro/wfrun/workflow/0.4" + }, + { + "@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.0" + } + ], + "creator": [ + { + "@id": "https://orcid.org/0000-0003-0606-2512" + } + ], + "datePublished": "2024-06-18T13:37:29+00:00", + "description": "COMPSs Matrix Multiplication, out-of-core using files. Hypermatrix size used 2x2 blocks (MSIZE=2), block size used 2x2 elements (BSIZE=2)", + "hasPart": [ + { + "@id": "application_sources/matmul_directory.py" + }, + { + "@id": "complete_graph.svg" + }, + { + "@id": "App_Profile.json" + }, + { + "@id": "compss_submission_command_line.txt" + }, + { + "@id": "DIRECTORY_example.yaml" + }, + { + "@id": "application_sources/matmul_tasks.py" + }, + { + "@id": "dataset/C/C.0.0" + }, + { + "@id": "dataset/C/C.0.1" + }, + { + "@id": "dataset/C/C.1.0" + }, + { + "@id": "dataset/C/C.1.1" + }, + { + "@id": "dataset/C/" + }, + { + "@id": "dataset/A/A.0.0" + }, + { + "@id": "dataset/A/A.0.1" + }, + { + "@id": "dataset/A/A.1.0" + }, + { + "@id": "dataset/A/A.1.1" + }, + { + "@id": "dataset/A/" + }, + { + "@id": "dataset/B/B.0.0" + }, + { + "@id": "dataset/B/B.0.1" + }, + { + "@id": "dataset/B/B.1.0" + }, + { + "@id": "dataset/B/B.1.1" + }, + { + "@id": "dataset/B/" + } + ], + "license": "Apache-2.0", + "mainEntity": { + "@id": "application_sources/matmul_directory.py" + }, + "mentions": { + "@id": "#COMPSs_Workflow_Run_Crate_MacBook-Pro-Raul-2018.local_1b5384e5-3b3a-49b4-8d4b-48300b5ef928" + }, + "name": "PyCOMPSs Matrix Multiplication, out-of-core using files. Example using DIRECTORY parameters executed at laptop, data persistence True.", + "publisher": [ + { + "@id": "https://ror.org/05sd8tv96" + } + ] + }, + { + "@id": "application_sources/matmul_directory.py", + "@type": [ + "File", + "SoftwareSourceCode", + "ComputationalWorkflow" + ], + "contentSize": 2312, + "description": "Main file of the COMPSs workflow source files", + "encodingFormat": "text/plain", + "image": { + "@id": "complete_graph.svg" + }, + "name": "matmul_directory.py", + "programmingLanguage": { + "@id": "#compss" + } + }, + { + "@id": "complete_graph.svg", + "@type": [ + "File", + "ImageObject", + "WorkflowSketch" + ], + "about": { + "@id": "application_sources/matmul_directory.py" + }, + "contentSize": 6396, + "description": "The graph diagram of the workflow, automatically generated by COMPSs runtime", + "encodingFormat": [ + [ + "image/svg+xml", + { + "@id": "https://www.nationalarchives.gov.uk/PRONOM/fmt/92" + } + ] + ], + "name": "complete_graph.svg", + "sha256": "e4b1f8c595f86af4ce5cc7c68b91f21de350bc50324e92dec31a2dfae918b77f" + }, + { + "@id": "App_Profile.json", + "@type": "File", + "contentSize": 244, + "description": "COMPSs application Tasks profile", + "encodingFormat": [ + "application/json", + { + "@id": "https://www.nationalarchives.gov.uk/PRONOM/fmt/817" + } + ], + "name": "App_Profile.json", + "sha256": "045b5baf53b6657fae65b6966725464aaa47c3fb6f62738e7c23a2ee8d777f46" + }, + { + "@id": "compss_submission_command_line.txt", + "@type": "File", + "contentSize": 152, + "description": "COMPSs submission command line (runcompss / enqueue_compss), including flags and parameters passed to the application", + "encodingFormat": "text/plain", + "name": "compss_submission_command_line.txt", + "sha256": "8798fe75a102c3b2a7af0ebebb1450ab3f7bef7b3267cf9c99ed4d8eaa31e26c" + }, + { + "@id": "DIRECTORY_example.yaml", + "@type": "File", + "contentSize": 628, + "description": "COMPSs Workflow Provenance YAML configuration file", + "encodingFormat": [ + "YAML", + { + "@id": "https://www.nationalarchives.gov.uk/PRONOM/fmt/818" + } + ], + "name": "DIRECTORY_example.yaml", + "sha256": "4174bd167c348231b7fedd25c5a4c307ad105db5660ee926e8308ddfa18a7947" + }, + { + "@id": "application_sources/matmul_tasks.py", + "@type": [ + "File", + "SoftwareSourceCode" + ], + "contentSize": 1966, + "description": "Auxiliary File", + "encodingFormat": "text/plain", + "name": "matmul_tasks.py" + }, + { + "@id": "dataset/C/C.0.0", + "@type": "File", + "contentSize": 20, + "dateModified": "2024-06-18T13:37:24+00:00", + "name": "C.0.0", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/C/C.0.1", + "@type": "File", + "contentSize": 20, + "dateModified": "2024-06-18T13:37:24+00:00", + "name": "C.0.1", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/C/C.1.0", + "@type": "File", + "contentSize": 20, + "dateModified": "2024-06-18T13:37:24+00:00", + "name": "C.1.0", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/C/C.1.1", + "@type": "File", + "contentSize": 20, + "dateModified": "2024-06-18T13:37:24+00:00", + "name": "C.1.1", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/C/", + "@type": "Dataset", + "dateModified": "2024-06-18T13:37:24+00:00", + "hasPart": [ + { + "@id": "dataset/C/C.0.0" + }, + { + "@id": "dataset/C/C.0.1" + }, + { + "@id": "dataset/C/C.1.0" + }, + { + "@id": "dataset/C/C.1.1" + } + ], + "name": "C", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/A/A.0.0", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "A.0.0", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/A/A.0.1", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "A.0.1", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/A/A.1.0", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "A.1.0", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/A/A.1.1", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "A.1.1", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/A/", + "@type": "Dataset", + "dateModified": "2024-05-29T10:05:27+00:00", + "hasPart": [ + { + "@id": "dataset/A//A.0.0" + }, + { + "@id": "dataset/A//A.0.1" + }, + { + "@id": "dataset/A//A.1.0" + }, + { + "@id": "dataset/A//A.1.1" + } + ], + "name": "A", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/B/B.0.0", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "B.0.0", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/B/B.0.1", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "B.0.1", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/B/B.1.0", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "B.1.0", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/B/B.1.1", + "@type": "File", + "contentSize": 16, + "dateModified": "2024-06-18T13:37:20+00:00", + "name": "B.1.1", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "dataset/B/", + "@type": "Dataset", + "dateModified": "2022-05-09T10:23:59+00:00", + "hasPart": [ + { + "@id": "dataset/B/B.0.0" + }, + { + "@id": "dataset/B/B.0.1" + }, + { + "@id": "dataset/B/B.1.0" + }, + { + "@id": "dataset/B/B.1.1" + } + ], + "name": "B", + "sdDatePublished": "2024-06-18T13:37:29+00:00" + }, + { + "@id": "mailto:Raul.Sirvent@bsc.es", + "@type": "ContactPoint", + "contactType": "Author", + "email": "Raul.Sirvent@bsc.es", + "identifier": "Raul.Sirvent@bsc.es", + "url": "https://orcid.org/0000-0003-0606-2512" + }, + { + "@id": "https://ror.org/05sd8tv96", + "@type": "Organization", + "name": "Barcelona Supercomputing Center" + }, + { + "@id": "https://orcid.org/0000-0003-0606-2512", + "@type": "Person", + "affiliation": { + "@id": "https://ror.org/05sd8tv96" + }, + "contactPoint": { + "@id": "mailto:Raul.Sirvent@bsc.es" + }, + "name": "RaĆ¼l Sirvent" + }, + { + "@id": "#compss", + "@type": "ComputerLanguage", + "alternateName": "COMPSs", + "citation": "https://doi.org/10.1007/s10723-013-9272-5", + "name": "COMPSs Programming Model", + "url": "http://compss.bsc.es/", + "version": "3.3.rc2402" + }, + { + "@id": "https://www.nationalarchives.gov.uk/PRONOM/fmt/92", + "@type": "WebSite", + "name": "Scalable Vector Graphics" + }, + { + "@id": "https://www.nationalarchives.gov.uk/PRONOM/fmt/817", + "@type": "WebSite", + "name": "JSON Data Interchange Format" + }, + { + "@id": "https://www.nationalarchives.gov.uk/PRONOM/fmt/818", + "@type": "WebSite", + "name": "YAML" + }, + { + "@id": "#compss_home", + "@type": "PropertyValue", + "name": "COMPSS_HOME", + "value": "/Users/rsirvent/opt/COMPSs/" + }, + { + "@id": "#COMPSs_Workflow_Run_Crate_MacBook-Pro-Raul-2018.local_1b5384e5-3b3a-49b4-8d4b-48300b5ef928", + "@type": "CreateAction", + "actionStatus": { + "@id": "http://schema.org/CompletedActionStatus" + }, + "agent": { + "@id": "https://orcid.org/0000-0003-0606-2512" + }, + "description": "Darwin MacBook-Pro-Raul-2018.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64", + "endTime": "2024-06-18T13:37:29+00:00", + "environment": [ + { + "@id": "#compss_home" + } + ], + "instrument": { + "@id": "application_sources/matmul_directory.py" + }, + "name": "COMPSs matmul_directory.py execution at MacBook-Pro-Raul-2018.local", + "object": [ + { + "@id": "dataset/C/" + }, + { + "@id": "dataset/A/" + }, + { + "@id": "dataset/B/" + } + ], + "result": [ + { + "@id": "dataset/C/" + }, + { + "@id": "./" + } + ], + "startTime": "2024-06-18T13:37:20+00:00" + }, + { + "@id": "https://w3id.org/ro/wfrun/process/0.4", + "@type": "CreativeWork", + "name": "Process Run Crate", + "version": "0.4" + }, + { + "@id": "https://w3id.org/ro/wfrun/workflow/0.4", + "@type": "CreativeWork", + "name": "Workflow Run Crate", + "version": "0.4" + }, + { + "@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.0", + "@type": "CreativeWork", + "name": "Workflow RO-Crate", + "version": "1.0" + } + ] +} \ No newline at end of file From af844314f3300080d7825bb4a91bb00f510a7986 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 13 Aug 2024 13:29:47 +0200 Subject: [PATCH 3/5] always test and lint --- .github/workflows/lint-and-test.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-test.yaml b/.github/workflows/lint-and-test.yaml index ec7f8c9..b74f4f2 100644 --- a/.github/workflows/lint-and-test.yaml +++ b/.github/workflows/lint-and-test.yaml @@ -2,7 +2,15 @@ # TODO: settle on style standards and enforce them name: Lint and Test -on: [push] +on: + push: + branches: [ "develop" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "develop" ] + workflow_dispatch: + jobs: build: From 88fc027c89666d4f4d275b136ab780aa0a5c3fb7 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 13 Aug 2024 13:34:57 +0200 Subject: [PATCH 4/5] cleanup --- .github/workflows/lint-and-test.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/lint-and-test.yaml b/.github/workflows/lint-and-test.yaml index b74f4f2..0d9eea8 100644 --- a/.github/workflows/lint-and-test.yaml +++ b/.github/workflows/lint-and-test.yaml @@ -1,5 +1,3 @@ - -# TODO: settle on style standards and enforce them name: Lint and Test on: From 0ea48ed1ec4bb153ef993bc2801d4b99184170ea Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 13 Aug 2024 13:39:47 +0200 Subject: [PATCH 5/5] simplify ci --- .github/workflows/lint-and-test.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/lint-and-test.yaml b/.github/workflows/lint-and-test.yaml index 0d9eea8..4c05974 100644 --- a/.github/workflows/lint-and-test.yaml +++ b/.github/workflows/lint-and-test.yaml @@ -3,11 +3,8 @@ name: Lint and Test on: push: branches: [ "develop" ] - # Publish semver tags as releases. - tags: [ 'v*.*.*' ] pull_request: branches: [ "develop" ] - workflow_dispatch: jobs: