diff --git a/.github/workflows/bresci-images.yml b/.github/workflows/bresci-images.yml new file mode 100644 index 0000000..1d0686a --- /dev/null +++ b/.github/workflows/bresci-images.yml @@ -0,0 +1,74 @@ +name: Publish exact BreSci images to GHCR +on: + push: + branches: [AKO-46] + paths: + - .github/workflows/bresci-images.yml + - bresci-registry-images.json + workflow_dispatch: +permissions: + contents: read + packages: write +jobs: + matrix: + runs-on: ubuntu-latest + outputs: + images: ${{ steps.images.outputs.value }} + steps: + - uses: actions/checkout@v4 + - id: images + run: echo "value=$(jq -c '{include:.images}' bresci-registry-images.json)" >> "$GITHUB_OUTPUT" + publish: + permissions: + contents: write + packages: write + needs: matrix + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.matrix.outputs.images) }} + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + ARCHIVE: ${{ matrix.archive }} + ARCHIVE_SHA256: ${{ matrix.sha256 }} + IMAGE_DIGEST: ${{ matrix.imageId }} + IMAGE_SOURCE_TAG: ${{ matrix.sourceTag }} + IMAGE_REPOSITORY: ${{ matrix.repository }} + IMAGE_TAG: ${{ matrix.tag }} + steps: + - name: Acquire exact measured OCI archive + shell: bash + run: | + set -euo pipefail + mkdir -p "$RUNNER_TEMP/bresci" + for attempt in $(seq 1 60); do + if gh release download bresci-workflows-v1 --pattern "$ARCHIVE" --dir "$RUNNER_TEMP/bresci"; then + break + fi + if [ "$attempt" = 60 ]; then exit 1; fi + sleep 15 + done + cd "$RUNNER_TEMP/bresci" + echo "$ARCHIVE_SHA256 $ARCHIVE" | sha256sum --check + gzip -dc "$ARCHIVE" > image.tar + - name: Install OCI copy tool + run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends skopeo + - name: Push original manifest and blobs without rebuilding + shell: bash + run: | + set -euo pipefail + export REGISTRY_AUTH_FILE="$RUNNER_TEMP/registry-auth.json" + printf '%s' "$GH_TOKEN" | skopeo login --username "$GITHUB_ACTOR" --password-stdin ghcr.io + skopeo copy --all --preserve-digests "oci-archive:$RUNNER_TEMP/bresci/image.tar:$IMAGE_SOURCE_TAG" "docker://$IMAGE_REPOSITORY:$IMAGE_TAG" + skopeo inspect --raw "docker://$IMAGE_REPOSITORY:$IMAGE_TAG" > "$RUNNER_TEMP/bresci/remote-manifest.json" + echo "${IMAGE_DIGEST#sha256:} $RUNNER_TEMP/bresci/remote-manifest.json" | sha256sum --check + printf '{"auths":{}}' > "$RUNNER_TEMP/anonymous-auth.json" + skopeo inspect --authfile "$RUNNER_TEMP/anonymous-auth.json" --raw "docker://$IMAGE_REPOSITORY@$IMAGE_DIGEST" > "$RUNNER_TEMP/bresci/public-manifest.json" + echo "${IMAGE_DIGEST#sha256:} $RUNNER_TEMP/bresci/public-manifest.json" | sha256sum --check + jq -n --arg slug '${{ matrix.slug }}' --arg image "$IMAGE_REPOSITORY@$IMAGE_DIGEST" --arg archiveSha256 "$ARCHIVE_SHA256" '{slug:$slug,image:$image,archiveSha256:$archiveSha256,originalManifestPreserved:true,anonymousPullVerified:true}' > "$RUNNER_TEMP/bresci/registry-receipt.json" + - uses: actions/upload-artifact@v4 + with: + name: ghcr-${{ matrix.slug }} + path: ${{ runner.temp }}/bresci/registry-receipt.json diff --git a/README.md b/README.md index c684c6b..09bc892 100644 --- a/README.md +++ b/README.md @@ -119,3 +119,23 @@ notifies the AkôFlow documentation workflow. Configure the repository secret `UFFeScience/akoflow`. If the secret is temporarily unavailable, the daily documentation reconciliation still checks out this repository and validates all referenced example files. + +## BreSci scientific reproducibility studies + +These seven examples adapt studies from the **Brazilian e-Science Workshop (BreSci), 2024–2026**, co-located with SBBD. Each README credits the original authors, links the paper and original data/code, describes the exact reproduced scope and protocol adaptations, and embeds actual result figures plus an observed native execution timeline. Input SHA-256 receipts, completed daemon evidence and independent artifact validators accompany each bundle. + +| Workflow | Original conference / paper | Native activities | Visual results | +| --- | --- | --- | --- | +| [UniTED — labeled time-series event detection](scientific-workflows/united/README.md) | [BreSci 2025](https://sol.sbc.org.br/index.php/bresci/article/view/36901) | 10 | [Figures](scientific-workflows/united/screenshots/current/) | +| [Estrada Real — informed search on a curated historical graph](scientific-workflows/estrada-real/README.md) | [BreSci 2026](https://sol.sbc.org.br/index.php/bresci/article/view/44084) | 11 | [Figures](scientific-workflows/estrada-real/screenshots/current/) | +| [SQLSIM — analytical similarity queries in PostgreSQL](scientific-workflows/sqlsim/README.md) | [BreSci 2024](https://sol.sbc.org.br/index.php/bresci/article/view/30580) | 4 | [Figures](scientific-workflows/sqlsim/screenshots/current/) | +| [Eidolon — reproducible scientific data collections](scientific-workflows/eidolon/README.md) | [BreSci 2026](https://sol.sbc.org.br/index.php/bresci/article/view/44071) | 8 | [Figures](scientific-workflows/eidolon/screenshots/current/) | +| [INMET — São Paulo meteorological observations, 2013–2022](scientific-workflows/inmet/README.md) | [BreSci 2025](https://sol.sbc.org.br/index.php/bresci/article/view/36912) | 16 | [Figures](scientific-workflows/inmet/screenshots/current/) | +| [MAFAULDA — rotating-machinery faults and TinyML quantization](scientific-workflows/mafaulda-tinyml/README.md) | [BreSci 2026](https://sol.sbc.org.br/index.php/bresci/article/view/44074) | 22 | [Figures](scientific-workflows/mafaulda-tinyml/screenshots/current/) | +| [TPC-H Q1 — MongoDB embedding versus PostgreSQL reproducibility audit](scientific-workflows/tpch-databases/README.md) | [BreSci 2024](https://sol.sbc.org.br/index.php/bresci/article/view/30582) | 10 | [Figures](scientific-workflows/tpch-databases/screenshots/current/) | + +Start from any linked bundle and run `./prepare.sh && ./run.sh`. Preparation acquires original inputs; computation executes offline. Native daemon execution instructions are in each README. Complete original inputs are used within each explicitly selected scope; the MAFAULDA portable profile and TPC-H Q1 audit do not claim whole-paper reproduction. Measured overlap demonstrates actual parallel execution, without assuming a speedup over a sequential baseline. + +The Estrada Real search stage reproduces all **3,715** reported Greedy divergences; Eidolon's three rebuilt full R collections match the pinned published references. The database example preserves and exposes the different Q1 date cutoffs in the original code before testing an explicitly aligned variant. + +BreSci Hub discovery tags: `bresci`, `bresci-2024`, `bresci-2025`, and `bresci-2026`. Each publication retains its original conference/year and scientific author attribution. diff --git a/bresci-ghcr-push-status.json b/bresci-ghcr-push-status.json new file mode 100644 index 0000000..3bd17b2 --- /dev/null +++ b/bresci-ghcr-push-status.json @@ -0,0 +1,56 @@ +{ + "status": "awaiting-public-package-visibility", + "registry": "ghcr.io", + "workflowRun": "https://github.com/UFFeScience/akoflow-examples/actions/runs/44136396326", + "pushedImages": 7, + "originalManifestChecksPassed": 7, + "anonymousPullChecksPassed": 0, + "anonymousPullHttpStatus": 401, + "hubPublicationCompleted": false, + "sourceAndResultArchivesVerifiedByGitHubSha256": 21, + "releaseDraft": true, + "images": [ + { + "slug": "united", + "image": "ghcr.io/uffescience/akoflow-examples/united@sha256:3ccc239aea4aedf2578d9f3895d5cda97472eff8bc6c51a456798070a0ed8192", + "originalManifestPreserved": true, + "publicPullVerified": false + }, + { + "slug": "estrada-real", + "image": "ghcr.io/uffescience/akoflow-examples/estrada-real@sha256:22c0fa0da9d734498b20ddcb09f7765cfa1e4fab04e595c5401a3fcf2a238fd7", + "originalManifestPreserved": true, + "publicPullVerified": false + }, + { + "slug": "sqlsim", + "image": "ghcr.io/uffescience/akoflow-examples/sqlsim@sha256:fdf6a614d119ddf5b9b712ea9f4a7d61fbf280fe0ae80d5be6dbf55c742d573a", + "originalManifestPreserved": true, + "publicPullVerified": false + }, + { + "slug": "eidolon", + "image": "ghcr.io/uffescience/akoflow-examples/eidolon@sha256:4016e0bd5b954fdbb436736a69c96e0e260ddc562df56273db1501136a9a9939", + "originalManifestPreserved": true, + "publicPullVerified": false + }, + { + "slug": "inmet", + "image": "ghcr.io/uffescience/akoflow-examples/inmet@sha256:5c61428db82753d20bb9ae9c3dea95d1e77e055afb4b5af80e2d5242fa643823", + "originalManifestPreserved": true, + "publicPullVerified": false + }, + { + "slug": "mafaulda-tinyml", + "image": "ghcr.io/uffescience/akoflow-examples/mafaulda-tinyml@sha256:36dd0df262eb3cb373ef1cba2e824423aabf516e56e70b75ca62c1922978cc9e", + "originalManifestPreserved": true, + "publicPullVerified": false + }, + { + "slug": "tpch-databases", + "image": "ghcr.io/uffescience/akoflow-examples/tpch-databases@sha256:9bfa73e297c7e7ddbec9dfec7493e7c5373d8342392599374d0a37d59ad9459d", + "originalManifestPreserved": true, + "publicPullVerified": false + } + ] +} diff --git a/bresci-registry-images.json b/bresci-registry-images.json new file mode 100644 index 0000000..f266832 --- /dev/null +++ b/bresci-registry-images.json @@ -0,0 +1,68 @@ +{ + "release": "bresci-workflows-v1", + "images": [ + { + "slug": "united", + "archive": "united-executed-image.tar.gz", + "sha256": "e40ba70a49acbe104f7a31c13371c14189e295d0988aa777e4f243dd9e9ad971", + "imageId": "sha256:3ccc239aea4aedf2578d9f3895d5cda97472eff8bc6c51a456798070a0ed8192", + "sourceTag": "local-3ccc239aea4aedf2", + "repository": "ghcr.io/uffescience/akoflow-examples/united", + "tag": "bresci-3ccc239aea4aedf2" + }, + { + "slug": "estrada-real", + "archive": "estrada-real-executed-image.tar.gz", + "sha256": "103b486ec3e4058b1225efd051e9b6b069d0b11f0e310a94c8f9dc810e7e910c", + "imageId": "sha256:22c0fa0da9d734498b20ddcb09f7765cfa1e4fab04e595c5401a3fcf2a238fd7", + "sourceTag": "local-22c0fa0da9d73449", + "repository": "ghcr.io/uffescience/akoflow-examples/estrada-real", + "tag": "bresci-22c0fa0da9d73449" + }, + { + "slug": "sqlsim", + "archive": "sqlsim-executed-image.tar.gz", + "sha256": "d21c29e6ee51f8d2e78375f8a675719a0cd0d607ab1fd47a829873ee764a8fcd", + "imageId": "sha256:fdf6a614d119ddf5b9b712ea9f4a7d61fbf280fe0ae80d5be6dbf55c742d573a", + "sourceTag": "local-fdf6a614d119ddf5", + "repository": "ghcr.io/uffescience/akoflow-examples/sqlsim", + "tag": "bresci-fdf6a614d119ddf5" + }, + { + "slug": "eidolon", + "archive": "eidolon-executed-image.tar.gz", + "sha256": "032337ed3e8390ae53c08ec4c12d3bf0c9cfe0896647fb72b54a3a06a96d4203", + "imageId": "sha256:4016e0bd5b954fdbb436736a69c96e0e260ddc562df56273db1501136a9a9939", + "sourceTag": "local-4016e0bd5b954fdb", + "repository": "ghcr.io/uffescience/akoflow-examples/eidolon", + "tag": "bresci-4016e0bd5b954fdb" + }, + { + "slug": "inmet", + "archive": "inmet-executed-image.tar.gz", + "sha256": "b98adc205f08a78f77c83c80a4726a8a87b2180d004ad1d7480304a174109bf4", + "imageId": "sha256:5c61428db82753d20bb9ae9c3dea95d1e77e055afb4b5af80e2d5242fa643823", + "sourceTag": "local-5c61428db82753d2", + "repository": "ghcr.io/uffescience/akoflow-examples/inmet", + "tag": "bresci-5c61428db82753d2" + }, + { + "slug": "mafaulda-tinyml", + "archive": "mafaulda-tinyml-executed-image.tar.gz", + "sha256": "bc7194d7375215a641851d05a7270879e9e5b311ab761d8224db8611ade2e9ed", + "imageId": "sha256:36dd0df262eb3cb373ef1cba2e824423aabf516e56e70b75ca62c1922978cc9e", + "sourceTag": "local-36dd0df262eb3cb3", + "repository": "ghcr.io/uffescience/akoflow-examples/mafaulda-tinyml", + "tag": "bresci-36dd0df262eb3cb3" + }, + { + "slug": "tpch-databases", + "archive": "tpch-databases-executed-image.tar.gz", + "sha256": "9890c5323914f27a41904450ca6e7ae2a74ecc2b822373420c53d0c99551ceb5", + "imageId": "sha256:9bfa73e297c7e7ddbec9dfec7493e7c5373d8342392599374d0a37d59ad9459d", + "sourceTag": "local-9bfa73e297c7e7dd", + "repository": "ghcr.io/uffescience/akoflow-examples/tpch-databases", + "tag": "bresci-9bfa73e297c7e7dd" + } + ] +} diff --git a/bresci-reproduction-campaign.json b/bresci-reproduction-campaign.json new file mode 100644 index 0000000..ebb905b --- /dev/null +++ b/bresci-reproduction-campaign.json @@ -0,0 +1,217 @@ +{ + "issue": "https://github.com/UFFeScience/akoflow-examples/issues/46", + "conference": "Brazilian e-Science Workshop (BreSci), 2024–2026", + "executionPolicy": "Sequential workflow execution; activities within each workflow run with bounded native parallelism. Local isolated trial runs precede native daemon runs.", + "totalCompletedActivities": 81, + "totalFigures": 22, + "fullPaperReproductionClaimed": false, + "workflows": [ + { + "slug": "united", + "conference": "XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD", + "authors": [ + "Janio Lima", + "Hélio Castro", + "Luiz Oliveira", + "Ellen Paixão", + "Lais Baroni", + "Rebecca Salles", + "Ricardo Vargas", + "Eduardo Ogasawara" + ], + "paper": "https://sol.sbc.org.br/index.php/bresci/article/view/36901", + "originalSource": "https://github.com/cefet-rj-dal/united", + "scope": "Four complete labeled NAB artificialWithAnomaly source series curated by UniTED, with no point subsampling. ARIMA(2,0,2) and a causal rolling-residual baseline are Python adapters; they are not the original R/Harbinger implementation and do not claim paper-metric equivalence. Detectors fit thresholds on the first 25% and are scored on the remaining observations with point-wise labels; no temporal-tolerance NAB score is claimed. These artificial signals are original benchmark inputs, not locally generated substitutes. Original upstream benchmark: https://github.com/numenta/NAB. UniTED code: MIT; upstream dataset conditions remain applicable.", + "status": "completed-and-independently-validated", + "activityCount": 10, + "runId": "united-local-e796844aa5-run-20261117t145730.223156114", + "image": "akoflow-local/united:local-3ccc239aea4aedf2", + "imageId": "sha256:3ccc239aea4aedf2578d9f3895d5cda97472eff8bc6c51a456798070a0ed8192", + "observedMakespanSeconds": 16.608977794647217, + "peakOverlappingActivities": 3, + "evidence": "scientific-workflows/united/evidence/daemon-run.json", + "readme": "scientific-workflows/united/README.md", + "figureCount": 3, + "tags": [ + "bresci", + "bresci-2025", + "scientific-reproducibility", + "scientific-workflows" + ] + }, + { + "slug": "estrada-real", + "conference": "XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD", + "authors": [ + "Davi Machado da Rocha" + ], + "paper": "https://sol.sbc.org.br/index.php/bresci/article/view/44084", + "originalSource": "https://zenodo.org/records/20867698", + "scope": "Re-execute the original UCS, Greedy and A* notebook functions over the complete frozen curated graph: 108 nodes, 226 directed edges, all 11,556 distinct ordered origin–destination pairs for each of three original cost profiles. Nine independent search activities produce 104,004 searches. This reproduces the search stage, not the upstream geographic source reconstruction. The paper reports 3,715 Greedy divergences; the workflow measures and reports actual agreement. Original data deposit: https://doi.org/10.5281/zenodo.20867698. Deposit metadata states CC BY 4.0; its README contains provisional code-license wording, so no broader code redistribution license is inferred.", + "status": "completed-and-independently-validated", + "activityCount": 11, + "runId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "image": "akoflow-local/estrada-real:local-22c0fa0da9d73449", + "imageId": "sha256:22c0fa0da9d734498b20ddcb09f7765cfa1e4fab04e595c5401a3fcf2a238fd7", + "observedMakespanSeconds": 24.28536081314087, + "peakOverlappingActivities": 3, + "evidence": "scientific-workflows/estrada-real/evidence/daemon-run.json", + "readme": "scientific-workflows/estrada-real/README.md", + "figureCount": 3, + "tags": [ + "bresci", + "bresci-2026", + "scientific-reproducibility", + "scientific-workflows" + ] + }, + { + "slug": "sqlsim", + "conference": "XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD", + "authors": [ + "Antônio Lívio C. de Mendonça", + "Maria Camila N. Barioni", + "Humberto Razente" + ], + "paper": "https://sol.sbc.org.br/index.php/bresci/article/view/30580", + "originalSource": "https://github.com/liviomendonca/sqlsim", + "scope": "Execute the original PL/pgSQL functions and both original 2D/3D CUBE queries on all 569 original Wisconsin Diagnostic Breast Cancer observations supplied by the authors. Each query gets an isolated PostgreSQL/PostGIS instance, so parallel activities do not mutate one another’s clustering state. Transport path is adapted and PostgreSQL random seed is fixed to 0.42 for the authors’ generated hospital/date dimensions. Hospital locations and dates are illustrative generated dimensions, not clinical provenance. Runtime uses PostgreSQL 15/PostGIS 3 on Debian Bookworm rather than the paper’s PostgreSQL 16.3; result semantics, not timing equivalence, are checked. Original dataset: https://archive.ics.uci.edu/dataset/17/breast+cancer+wisconsin+diagnostic . Upstream repository has no explicit code license; no redistribution grant is inferred.", + "status": "completed-and-independently-validated", + "activityCount": 4, + "runId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "image": "akoflow-local/sqlsim:local-fdf6a614d119ddf5", + "imageId": "sha256:fdf6a614d119ddf5b9b712ea9f4a7d61fbf280fe0ae80d5be6dbf55c742d573a", + "observedMakespanSeconds": 15.898435115814209, + "peakOverlappingActivities": 2, + "evidence": "scientific-workflows/sqlsim/evidence/daemon-run.json", + "readme": "scientific-workflows/sqlsim/README.md", + "figureCount": 3, + "tags": [ + "bresci", + "bresci-2024", + "scientific-reproducibility", + "scientific-workflows" + ] + }, + { + "slug": "eidolon", + "conference": "XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD", + "authors": [ + "Lucas Calmon", + "Marcus Junior", + "Lucas Santos", + "Fernando Alexandrino", + "Rafaelli Coutinho", + "Gustavo Guedes", + "Diego Carvalho", + "Eduardo Ogasawara" + ], + "paper": "https://sol.sbc.org.br/index.php/bresci/article/view/44071", + "originalSource": "https://github.com/cefet-rj-dal/tspredbench", + "scope": "Run the original R ETLs for the complete climate, bioenergy and emissions source tables, followed by the original miniature-generation script. Each newly generated complete R object is compared semantically with the authors’ published full object at the same commit; published objects are references only, never substituted for ETL output. This is a three-collection instantiation of Eidolon, not every collection or remote publication. Origin: FAOSTAT https://www.fao.org/faostat/en/#data/ET , https://www.fao.org/faostat/en/#data/BE and https://www.fao.org/faostat/en/#data/GT . Code is MIT; source data retain FAO terms. Three independent ETL branches and three dependent miniaturization activities expose real parallelism.", + "status": "completed-and-independently-validated", + "activityCount": 8, + "runId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "image": "akoflow-local/eidolon:local-4016e0bd5b954fdb", + "imageId": "sha256:4016e0bd5b954fdbb436736a69c96e0e260ddc562df56273db1501136a9a9939", + "observedMakespanSeconds": 23.972549200057983, + "peakOverlappingActivities": 2, + "evidence": "scientific-workflows/eidolon/evidence/daemon-run.json", + "readme": "scientific-workflows/eidolon/README.md", + "figureCount": 3, + "tags": [ + "bresci", + "bresci-2026", + "scientific-reproducibility", + "scientific-workflows" + ] + }, + { + "slug": "inmet", + "conference": "XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD", + "authors": [ + "Rosa Virginia Encinas Quille", + "Felipe Valencia de Almeida", + "Danielle Monteiro", + "Pedro Luiz Pizzigatti Corrêa" + ], + "paper": "https://sol.sbc.org.br/index.php/bresci/article/view/36912", + "originalSource": "https://zenodo.org/records/16864784", + "scope": "Process all original hourly CSVs for São Paulo–Mirante station A701 from 2013 through 2022, the station and period illustrated by the paper. Execute the original notebook ingestion/normalization and cleaning definitions (cells 16 and 20), then generate noninteractive temperature, precipitation and humidity analyses. Yearly ingestion activities are independent; the original cleaning runs once after concatenation, preserving cross-year filling. Raw inputs come from the nested dataset.zip in the original Zenodo deposit, acquired by verified ZIP members through HTTP byte ranges. The entire 1.92 GB parent archive is not downloaded or claimed to have a newly verified global hash; extracted member CRC and SHA-256 are checked. Original notebook and data: CC BY 4.0. INMET source portal: https://portal.inmet.gov.br/dadoshistoricos . No processed author outputs are used as computation inputs.", + "status": "completed-and-independently-validated", + "activityCount": 16, + "runId": "inmet-local-1514940793-run-20261117t151423.285983342", + "image": "akoflow-local/inmet:local-5c61428db82753d2", + "imageId": "sha256:5c61428db82753d20bb9ae9c3dea95d1e77e055afb4b5af80e2d5242fa643823", + "observedMakespanSeconds": 36.5455048084259, + "peakOverlappingActivities": 3, + "evidence": "scientific-workflows/inmet/evidence/daemon-run.json", + "readme": "scientific-workflows/inmet/README.md", + "figureCount": 4, + "tags": [ + "bresci", + "bresci-2025", + "scientific-reproducibility", + "scientific-workflows" + ] + }, + { + "slug": "mafaulda-tinyml", + "conference": "XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD", + "authors": [ + "Cândido Alfredo Carvalho de Lucena Filho", + "Felipe Valencia de Almeida" + ], + "paper": "https://sol.sbc.org.br/index.php/bresci/article/view/44074", + "originalSource": "https://github.com/candidoalfilho/MAFAULDA_TINY_ML_ANALYSIS", + "scope": "Portable reproduction profile: five complete original UFRJ recordings from each of six fault classes (30 recordings, selected deterministically across each archive). Execute the original notebook’s 132-feature extraction and neural architecture definitions; retain its 2,048-sample window, 1,024 hop and maximum 50 windows per recording. Run five-fold group-aware evaluation with complete relative recording paths as group IDs. Default training is shortened to 10 epochs (LSTM 5); AKOFLOW_PROFILE=standard uses 50 (LSTM 15). Quantization uses the final fold model, calibrates only on its training recordings and evaluates only on held-out recordings. These explicit protocol adaptations avoid mixing training observations into quantization evaluation; results do not claim to reproduce the paper’s F1=0.98 or on-device memory/latency. No physical microcontroller is tested. Original data creators: Signals, Multimedia and Telecommunications Laboratory, COPPE/Poli/UFRJ; source https://www02.smt.ufrj.br/~offshore/mfs/page_01.html . The original notebook and data remain attributed to their authors; no license is inferred from public availability.", + "status": "completed-and-independently-validated", + "activityCount": 22, + "runId": "mafaulda-tinyml-local-351678315d-run-20261117t152055.178793114", + "image": "akoflow-local/mafaulda-tinyml:local-36dd0df262eb3cb3", + "imageId": "sha256:36dd0df262eb3cb373ef1cba2e824423aabf516e56e70b75ca62c1922978cc9e", + "observedMakespanSeconds": 140.40111374855042, + "peakOverlappingActivities": 3, + "evidence": "scientific-workflows/mafaulda-tinyml/evidence/daemon-run.json", + "readme": "scientific-workflows/mafaulda-tinyml/README.md", + "figureCount": 3, + "tags": [ + "bresci", + "bresci-2026", + "scientific-reproducibility", + "scientific-workflows" + ] + }, + { + "slug": "tpch-databases", + "conference": "XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD", + "authors": [ + "André Merlo", + "Jorge N. S. Pavão", + "Luiz C. de Freitas", + "Jorge Soares", + "Diego Brandão", + "Kele Belloze" + ], + "paper": "https://sol.sbc.org.br/index.php/bresci/article/view/30582", + "originalSource": "https://github.com/jnpavao/tpch_mongodb", + "scope": "Portable audit of Q1 from the published repository, using genuine TPC-H dbgen 2.13.0 at scale factor 0.01 (complete generated lineitem table). The original MongoDB pipeline filters through 1998-12-01 while the original PostgreSQL query filters through 1998-09-02. Run both unchanged, then an explicitly named aligned variant that changes only MongoDB’s cutoff to 1998-09-02. Execute each engine/mode with and without an index in isolated database instances. Validate numerical equivalence only for aligned semantics and record original-source disagreement. This is a Q1 audit, not reproduction of all 22 queries, the paper’s hardware, scale or performance ranking. Timings under concurrent execution are observations, not a controlled database benchmark. Original data generator and specification: https://www.tpc.org/tpch/ and https://github.com/electrum/tpch-dbgen/tree/32f1c1b92d1664dba542e927d23d86ffa57aa253. TPC-H data are generated by definition; no hand-built fixture replaces them. Original code authors retain attribution; upstream has no explicit license declaration. MongoDB binary is obtained from its official distribution; respective upstream terms apply.", + "status": "completed-and-independently-validated", + "activityCount": 10, + "runId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "image": "akoflow-local/tpch-databases:local-9bfa73e297c7e7dd", + "imageId": "sha256:9bfa73e297c7e7ddbec9dfec7493e7c5373d8342392599374d0a37d59ad9459d", + "observedMakespanSeconds": 32.59038686752319, + "peakOverlappingActivities": 3, + "evidence": "scientific-workflows/tpch-databases/evidence/daemon-run.json", + "readme": "scientific-workflows/tpch-databases/README.md", + "figureCount": 3, + "tags": [ + "bresci", + "bresci-2024", + "scientific-reproducibility", + "scientific-workflows" + ] + } + ] +} diff --git a/scientific-workflows/eidolon/.dockerignore b/scientific-workflows/eidolon/.dockerignore new file mode 100644 index 0000000..f7c11d3 --- /dev/null +++ b/scientific-workflows/eidolon/.dockerignore @@ -0,0 +1,5 @@ +outputs +screenshots +evidence +.venv +**/__pycache__ diff --git a/scientific-workflows/eidolon/.gitignore b/scientific-workflows/eidolon/.gitignore new file mode 100644 index 0000000..4547b53 --- /dev/null +++ b/scientific-workflows/eidolon/.gitignore @@ -0,0 +1,4 @@ +data/inputs/ +outputs/ +outputs-daemon/ +outputs-daemon/ diff --git a/scientific-workflows/eidolon/README.md b/scientific-workflows/eidolon/README.md new file mode 100644 index 0000000..8b02366 --- /dev/null +++ b/scientific-workflows/eidolon/README.md @@ -0,0 +1,92 @@ +# Eidolon — reproducible scientific data collections + +Conference tags: `bresci`, `bresci-2026`. [Browse BreSci on the Hub](https://hub.akoflow.com/categories/bresci). + +Adapted from **XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD**. Original authors: **Lucas Calmon, Marcus Junior, Lucas Santos, Fernando Alexandrino, Rafaelli Coutinho, Gustavo Guedes, Diego Carvalho, Eduardo Ogasawara**. + +[Original paper](https://sol.sbc.org.br/index.php/bresci/article/view/44071) · [Original code and data](https://github.com/cefet-rj-dal/tspredbench) + +## Scientific scope + +Run the original R ETLs for the complete climate, bioenergy and emissions source tables, followed by the original miniature-generation script. Each newly generated complete R object is compared semantically with the authors’ published full object at the same commit; published objects are references only, never substituted for ETL output. This is a three-collection instantiation of Eidolon, not every collection or remote publication. Origin: FAOSTAT https://www.fao.org/faostat/en/#data/ET , https://www.fao.org/faostat/en/#data/BE and https://www.fao.org/faostat/en/#data/GT . Code is MIT; source data retain FAO terms. Three independent ETL branches and three dependent miniaturization activities expose real parallelism. + +This is an adaptation of the cited scientific application to native AkôFlow activities. It is not a claim of exact agreement with the paper. Source URLs, immutable revisions and input SHA-256 hashes are recorded in `data/sources.json` and `data/acquisition.json`. Original authors retain authorship of the scientific methods and artifacts; the AkôFlow contribution is orchestration, packaging and validation. + +Bioenergy values are in **TJ**; emissions are in **kt of the gas named in each series**. Temperature change is in °C, as recorded by FAOSTAT. + +## Execute + +[Original input URL manifest](data/sources.json) · [Verified input SHA-256 receipts](data/acquisition.json) · [Scientific provenance](data/provenance.json) + +```sh +./prepare.sh +./run.sh +``` + +Preparation acquires original inputs and builds the image. All computation then executes with networking disabled. No synthetic fallback replaces unavailable original data. `AKOFLOW_PARALLEL` controls standalone concurrency. + +To register and execute in Desktop through the local daemon, from the repository root: + +```sh +go run ./tools/daemon-local -example scientific-workflows/eidolon -env-file /path/to/installation.env -api-url http://YOUR_DAEMON:8080/akoflow-api -lanes 3 +``` + +Tracking item: [AKO-46](https://github.com/UFFeScience/akoflow-examples/issues/46). + +The daemon records the exact image and execution identity in `evidence/daemon-run.json`. `workflow.yaml` declares dependencies and explicit artifact transfers. `outputs/scientific-validation.json` contains semantic checks and findings. A successful exit alone is not a scientific validation. + +## Results + +Native daemon run `eidolon-local-ba2593ae8f-run-20261117t150749.138605490` completed **8/8 activities**. Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results. + +Findings: + +```json +{ + "collections": [ + { + "collection": "climate", + "fullSeries": 10, + "observations": 630, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 2729, + "miniBytes": 770 + }, + { + "collection": "bioenergy", + "fullSeries": 20, + "observations": 660, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 3070, + "miniBytes": 468 + }, + { + "collection": "emissions", + "fullSeries": 20, + "observations": 1220, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 7941, + "miniBytes": 870 + } + ], + "originalRCodeExecuted": true, + "allFullObjectsMatchPinnedPublishedReferences": true +} +``` + +![collections](screenshots/current/collections.png) + +![miniature comparison](screenshots/current/miniature-comparison.png) + +## Observed parallel execution + +The native run completed 8 activities in **23.97 seconds**, with **2 overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline. + +![Measured execution timeline](screenshots/current/execution-timeline.png) + +Python dependency versions from the measured image are retained in [`evidence/python-packages.txt`](evidence/python-packages.txt). Independent post-run validation is recorded in [`evidence/independent-validation.json`](evidence/independent-validation.json). + +To regenerate the execution timeline from an observed run, mount this bundle at `/bundle` in its measured image and run `python /bundle/expected/render_execution.py`. The renderer uses `evidence/daemon-run.json`; predicted schedule times are excluded. diff --git a/scientific-workflows/eidolon/data/acquisition.json b/scientific-workflows/eidolon/data/acquisition.json new file mode 100644 index 0000000..87bcc83 --- /dev/null +++ b/scientific-workflows/eidolon/data/acquisition.json @@ -0,0 +1,82 @@ +{ + "files": [ + { + "path": "etl/climate/01-extract_transform_load-climate.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/01-extract_transform_load-climate.R", + "sha256": "718e1e4333bc03e41116e48c254411200040822d200de78ac704c6097520a413", + "bytes": 1784 + }, + { + "path": "etl/climate/source/Environment_Temperature_change_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/source/Environment_Temperature_change_E_All_Data_NOFLAG.csv", + "sha256": "e88a744eba9e9b6d912e54f026e625efc3c6c703339504f7cd2ad62c2e00ba57", + "bytes": 6814488 + }, + { + "path": "tspredit/climate.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/climate.RData", + "sha256": "028b4bbed60dbdb35e0543565803c59eab499875251cceb146b681254c2232f7", + "bytes": 2730 + }, + { + "path": "etl/climate/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/README.md", + "sha256": "166748d1d2081ddad59955b9de5efb4f926ec284056c8238aab473f831571956", + "bytes": 1689 + }, + { + "path": "etl/bioenergy/01-extract_transform_load-bioenergy.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/01-extract_transform_load-bioenergy.R", + "sha256": "f40ea00a8d33ef6f7b3f3dff13fda6c635f360d9ec96540162927dc62fb813a9", + "bytes": 1903 + }, + { + "path": "etl/bioenergy/source/Environment_Bioenergy_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/source/Environment_Bioenergy_E_All_Data_NOFLAG.csv", + "sha256": "4e79fd1f15987ff1c4d0d985a564a173ae79a19e48117920fdb685c484117e3b", + "bytes": 1859528 + }, + { + "path": "tspredit/bioenergy.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/bioenergy.RData", + "sha256": "c5e6bd0edee21ccdc77ef25a79443d36459fe5fa609ef92628164eada851a622", + "bytes": 3071 + }, + { + "path": "etl/bioenergy/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/README.md", + "sha256": "ea9de46c0b56c2501c867347d430e07b35b93c2ec06f693e18a312fe48559b76", + "bytes": 1897 + }, + { + "path": "etl/emissions/01-extract_transform_load-emissions.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/01-extract_transform_load-emissions.R", + "sha256": "2e022c058363de4293103c077f24fda9673be012c25d6094160f4c5ff311a0cf", + "bytes": 2337 + }, + { + "path": "etl/emissions/source/Emissions_Totals_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/source/Emissions_Totals_E_All_Data_NOFLAG.csv", + "sha256": "b71684f9b64e2fc091279af49cd00ad04c54122d2c25adca74066e51d86cd973", + "bytes": 39900443 + }, + { + "path": "tspredit/emissions.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/emissions.RData", + "sha256": "a6c00a7b9166f665fb7d9b9ce1a63d660fe11f1fda00961f33a7bbe583f4f86b", + "bytes": 7942 + }, + { + "path": "etl/emissions/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/README.md", + "sha256": "3a8298c72d7d4e083a3f98f1a259432f135825b1461e0d17e92e9f13f02c7486", + "bytes": 1731 + }, + { + "path": "etl/02-build-minidata.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/02-build-minidata.R", + "sha256": "9db010c83957de4f7192bb92373037348dc67777c545b543eb6f83ea5f563d1e", + "bytes": 2317 + } + ] +} diff --git a/scientific-workflows/eidolon/data/dag.json b/scientific-workflows/eidolon/data/dag.json new file mode 100644 index 0000000..95ebc28 --- /dev/null +++ b/scientific-workflows/eidolon/data/dag.json @@ -0,0 +1,235 @@ +{ + "name": "eidolon", + "spec": { + "namespace": "akoflow-examples", + "image": "akoflow-local/eidolon:workload", + "activities": [ + { + "name": "validate-inputs", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "validate-inputs", + "--output", + "." + ] + } + }, + { + "name": "etl-climate", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "etl-climate", + "--output", + "." + ] + } + }, + { + "name": "mini-climate", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "etl-climate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "mini-climate", + "--output", + "." + ] + } + }, + { + "name": "etl-bioenergy", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "etl-bioenergy", + "--output", + "." + ] + } + }, + { + "name": "mini-bioenergy", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "etl-bioenergy" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "mini-bioenergy", + "--output", + "." + ] + } + }, + { + "name": "etl-emissions", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "etl-emissions", + "--output", + "." + ] + } + }, + { + "name": "mini-emissions", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "etl-emissions" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "mini-emissions", + "--output", + "." + ] + } + }, + { + "name": "compare", + "runtime": "eidolon-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "mini-climate", + "mini-bioenergy", + "mini-emissions" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "compare", + "--output", + "." + ] + } + } + ], + "dataDependencies": [ + { + "producerActivity": "validate-inputs", + "consumerActivity": "etl-climate", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "etl-climate", + "consumerActivity": "mini-climate", + "logicalName": "climate.RData", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "etl-bioenergy", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "etl-bioenergy", + "consumerActivity": "mini-bioenergy", + "logicalName": "bioenergy.RData", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "etl-emissions", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "etl-emissions", + "consumerActivity": "mini-emissions", + "logicalName": "emissions.RData", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mini-climate", + "consumerActivity": "compare", + "logicalName": "climate.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mini-climate", + "consumerActivity": "compare", + "logicalName": "climate-validation.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mini-bioenergy", + "consumerActivity": "compare", + "logicalName": "bioenergy.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mini-bioenergy", + "consumerActivity": "compare", + "logicalName": "bioenergy-validation.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mini-emissions", + "consumerActivity": "compare", + "logicalName": "emissions.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mini-emissions", + "consumerActivity": "compare", + "logicalName": "emissions-validation.json", + "sizeBytes": 10000000 + } + ] + } +} diff --git a/scientific-workflows/eidolon/data/provenance.json b/scientific-workflows/eidolon/data/provenance.json new file mode 100644 index 0000000..0e6c990 --- /dev/null +++ b/scientific-workflows/eidolon/data/provenance.json @@ -0,0 +1,25 @@ +{ + "slug": "eidolon", + "title": "Eidolon — reproducible scientific data collections", + "authors": [ + "Lucas Calmon", + "Marcus Junior", + "Lucas Santos", + "Fernando Alexandrino", + "Rafaelli Coutinho", + "Gustavo Guedes", + "Diego Carvalho", + "Eduardo Ogasawara" + ], + "conference": "XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/44071", + "source": "https://github.com/cefet-rj-dal/tspredbench", + "scope": "Run the original R ETLs for the complete climate, bioenergy and emissions source tables, followed by the original miniature-generation script. Each newly generated complete R object is compared semantically with the authors’ published full object at the same commit; published objects are references only, never substituted for ETL output. This is a three-collection instantiation of Eidolon, not every collection or remote publication. Origin: FAOSTAT https://www.fao.org/faostat/en/#data/ET , https://www.fao.org/faostat/en/#data/BE and https://www.fao.org/faostat/en/#data/GT . Code is MIT; source data retain FAO terms. Three independent ETL branches and three dependent miniaturization activities expose real parallelism.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence.", + "tags": [ + "bresci", + "bresci-2026", + "scientific-reproducibility", + "scientific-workflows" + ] +} diff --git a/scientific-workflows/eidolon/data/sources.json b/scientific-workflows/eidolon/data/sources.json new file mode 100644 index 0000000..dd342c2 --- /dev/null +++ b/scientific-workflows/eidolon/data/sources.json @@ -0,0 +1,56 @@ +{ + "files": [ + { + "path": "etl/climate/01-extract_transform_load-climate.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/01-extract_transform_load-climate.R" + }, + { + "path": "etl/climate/source/Environment_Temperature_change_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/source/Environment_Temperature_change_E_All_Data_NOFLAG.csv" + }, + { + "path": "tspredit/climate.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/climate.RData" + }, + { + "path": "etl/climate/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/README.md" + }, + { + "path": "etl/bioenergy/01-extract_transform_load-bioenergy.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/01-extract_transform_load-bioenergy.R" + }, + { + "path": "etl/bioenergy/source/Environment_Bioenergy_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/source/Environment_Bioenergy_E_All_Data_NOFLAG.csv" + }, + { + "path": "tspredit/bioenergy.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/bioenergy.RData" + }, + { + "path": "etl/bioenergy/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/README.md" + }, + { + "path": "etl/emissions/01-extract_transform_load-emissions.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/01-extract_transform_load-emissions.R" + }, + { + "path": "etl/emissions/source/Emissions_Totals_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/source/Emissions_Totals_E_All_Data_NOFLAG.csv" + }, + { + "path": "tspredit/emissions.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/emissions.RData" + }, + { + "path": "etl/emissions/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/README.md" + }, + { + "path": "etl/02-build-minidata.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/02-build-minidata.R" + } + ] +} diff --git a/scientific-workflows/eidolon/docker/Dockerfile b/scientific-workflows/eidolon/docker/Dockerfile new file mode 100644 index 0000000..010f8c0 --- /dev/null +++ b/scientific-workflows/eidolon/docker/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.11.13-slim-bookworm@sha256:86adf8dbadc3d6e82ee5dd2c74bec2e1c2467cdad47886280501df722372d2e1 +ENV MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 PYTHONDONTWRITEBYTECODE=1 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +RUN apt-get update && apt-get install -y --no-install-recommends r-base-core r-cran-dplyr r-cran-stringr && rm -rf /var/lib/apt/lists/* +COPY scripts /app/scripts +COPY data /app/data diff --git a/scientific-workflows/eidolon/environment.yaml b/scientific-workflows/eidolon/environment.yaml new file mode 100644 index 0000000..dc92ad3 --- /dev/null +++ b/scientific-workflows/eidolon/environment.yaml @@ -0,0 +1,42 @@ +environment: + id: eidolon-local + name: eidolon-local local Docker + description: CPU-only local execution; no remote capacity is provisioned + status: ready +version: + id: eidolon-local-v1 + environmentId: eidolon-local + version: 1 + status: published + networkModel: local + interferenceModel: none + costModel: free + configurationHash: eidolon-local-v1 +runtimes: + - environmentVersionId: eidolon-local-v1 + id: eidolon-local-local + name: Local Docker host + driver: local + mode: execution + role: compute + capabilities: {batch: true, container: true} +resources: + - id: eidolon-local-local-docker + environmentVersionId: eidolon-local-v1 + type: machine + name: Local Docker host + providerId: local-docker + cpuCores: 4 + cpuCapacity: 4 + memoryBytes: 8589934592 + storageBytes: 21474836480 + computeSpeedup: 1 + pricePerSecond: 0 + bootOverheadSeconds: 0 + containerOverheadSeconds: 0 + schedulable: true +storages: [] +connections: [] +activityResourceProfiles: [] +resourceRuntimeBindings: + - {resourceId: eidolon-local-local-docker, runtimeId: eidolon-local-local, enabled: true} diff --git a/scientific-workflows/eidolon/evidence/daemon-run.json b/scientific-workflows/eidolon/evidence/daemon-run.json new file mode 100644 index 0000000..f219965 --- /dev/null +++ b/scientific-workflows/eidolon/evidence/daemon-run.json @@ -0,0 +1,303 @@ +{ + "activityCount": 8, + "completedActivityCount": 8, + "image": "akoflow-local/eidolon:local-4016e0bd5b954fdb", + "imageId": "sha256:4016e0bd5b954fdbb436736a69c96e0e260ddc562df56273db1501136a9a9939", + "observedAt": "2026-11-17T15:08:16Z", + "planId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252", + "projection": { + "run": { + "activityCount": 8, + "breakdown": { + "computeSeconds": 15.163303852081299, + "interferenceSeconds": 0, + "overheadSeconds": 0, + "queueSeconds": 0, + "transferSeconds": 2.809767723083496 + }, + "completedActivityCount": 8, + "cost": 0, + "environmentNames": [ + "eidolon-local local Docker" + ], + "finishedAt": "2026-11-17T15:08:16Z", + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "kind": "workflow", + "makespanSeconds": 23.972549200057983, + "mode": "real", + "schedulePlanId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252", + "seed": 0, + "startedAt": "2026-11-17T15:07:49Z", + "status": "completed", + "title": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "transferredBytes": 97327969, + "workflowId": "eidolon-local-ba2593ae8f", + "workflowName": "eidolon-local-ba2593ae8f", + "workflowVersionId": "eidolon-local-ba2593ae8f-v1" + }, + "activities": [ + { + "activityId": "eidolon-local-ba2593ae8f-validate-inputs", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928072.5543737, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-validate-inputs", + "interferenceSeconds": 0, + "metadata": { + "pricePerSecond": 0, + "runtimeId": "eidolon-local-local" + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-validate-inputs", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928069.700844, + "readyAt": 1794928069.700844, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 1.0450387001037598, + "startedAt": 1794928071.509335, + "status": "completed", + "transferBytes": 0, + "transferSeconds": 0 + }, + { + "activityId": "eidolon-local-ba2593ae8f-etl-climate", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928076.6028311, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-etl-climate", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.48604369163513184, + "preparationFinishedAt": 1794928074.4544923, + "preparationStartedAt": 1794928074.2776778, + "pricePerSecond": 0, + "readyWaitSeconds": 0.056571006774902344, + "runtimeId": "eidolon-local-local", + "transferElapsedSeconds": 0.17681455612182617, + "transferWorkSeconds": 0.17681455612182617 + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-etl-climate", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928074.197886, + "readyAt": 1794928074.197886, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 1.6622951030731201, + "startedAt": 1794928074.940536, + "status": "completed", + "transferBytes": 18, + "transferSeconds": 0.17681455612182617 + }, + { + "activityId": "eidolon-local-ba2593ae8f-etl-bioenergy", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928076.5157137, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-etl-bioenergy", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5101189613342285, + "preparationFinishedAt": 1794928074.447863, + "preparationStartedAt": 1794928074.260455, + "pricePerSecond": 0, + "readyWaitSeconds": 0.028058290481567383, + "runtimeId": "eidolon-local-local", + "transferElapsedSeconds": 0.1874082088470459, + "transferWorkSeconds": 0.1874082088470459 + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-etl-bioenergy", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928074.1856468, + "readyAt": 1794928074.1856468, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 1.5577316284179688, + "startedAt": 1794928074.957982, + "status": "completed", + "transferBytes": 18, + "transferSeconds": 0.1874082088470459 + }, + { + "activityId": "eidolon-local-ba2593ae8f-mini-bioenergy", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928080.3105395, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-mini-bioenergy", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5432674884796143, + "preparationFinishedAt": 1794928078.054149, + "preparationStartedAt": 1794928077.8710113, + "pricePerSecond": 0, + "readyWaitSeconds": 0.022923946380615234, + "runtimeId": "eidolon-local-local", + "transferElapsedSeconds": 0.1831376552581787, + "transferWorkSeconds": 0.1831376552581787 + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-mini-bioenergy", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928077.7912452, + "readyAt": 1794928077.7912452, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 1.713123083114624, + "startedAt": 1794928078.5974164, + "status": "completed", + "transferBytes": 1869486, + "transferSeconds": 0.1831376552581787 + }, + { + "activityId": "eidolon-local-ba2593ae8f-mini-climate", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928080.4041286, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-mini-climate", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5633819103240967, + "preparationFinishedAt": 1794928078.0589938, + "preparationStartedAt": 1794928077.859269, + "pricePerSecond": 0, + "readyWaitSeconds": 0.02368903160095215, + "runtimeId": "eidolon-local-local", + "transferElapsedSeconds": 0.19972491264343262, + "transferWorkSeconds": 0.19972491264343262 + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-mini-climate", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928077.811298, + "readyAt": 1794928077.811298, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 1.7817528247833252, + "startedAt": 1794928078.6223757, + "status": "completed", + "transferBytes": 6823437, + "transferSeconds": 0.19972491264343262 + }, + { + "activityId": "eidolon-local-ba2593ae8f-etl-emissions", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928086.512094, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-etl-emissions", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.38515257835388184, + "preparationFinishedAt": 1794928081.74361, + "preparationStartedAt": 1794928081.5561674, + "pricePerSecond": 0, + "readyWaitSeconds": 0.02361917495727539, + "runtimeId": "eidolon-local-local", + "transferElapsedSeconds": 0.18744254112243652, + "transferWorkSeconds": 0.18744254112243652 + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-etl-emissions", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928081.509832, + "readyAt": 1794928081.509832, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 4.383331537246704, + "startedAt": 1794928082.1287625, + "status": "completed", + "transferBytes": 18, + "transferSeconds": 0.18744254112243652 + }, + { + "activityId": "eidolon-local-ba2593ae8f-mini-emissions", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928091.675646, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-mini-emissions", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 2.9637694358825684, + "preparationFinishedAt": 1794928087.4364278, + "preparationStartedAt": 1794928087.155361, + "pricePerSecond": 0, + "readyWaitSeconds": 0.014564275741577148, + "runtimeId": "eidolon-local-local", + "transferElapsedSeconds": 0.28106689453125, + "transferWorkSeconds": 0.28106689453125 + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-mini-emissions", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928087.1111841, + "readyAt": 1794928087.1111841, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 1.2754487991333008, + "startedAt": 1794928090.4001973, + "status": "completed", + "transferBytes": 39920411, + "transferSeconds": 0.28106689453125 + }, + { + "activityId": "eidolon-local-ba2593ae8f-compare", + "allocatedResourceId": "eidolon-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "finishedAt": 1794928095.4818842, + "id": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490:eidolon-local-ba2593ae8f-compare", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.674220085144043, + "preparationFinishedAt": 1794928093.063082, + "preparationStartedAt": 1794928092.3642263, + "pricePerSecond": 0, + "readyWaitSeconds": 0.036618947982788086, + "runtimeId": "eidolon-local-local", + "transferElapsedSeconds": 0.6988556385040283, + "transferWorkSeconds": 1.5941729545593262 + }, + "overheadSeconds": 0, + "planAssignmentId": "eidolon-local-ba2593ae8f-manual-plan-20261117t150749.077503252-eidolon-local-ba2593ae8f-compare", + "plannedResourceId": "eidolon-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928092.29965, + "readyAt": 1794928092.29965, + "runtimeId": "eidolon-local-local", + "runtimeSeconds": 1.744582176208496, + "startedAt": 1794928093.737302, + "status": "completed", + "transferBytes": 48714581, + "transferSeconds": 1.5941729545593262 + } + ] + }, + "runId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "status": "completed", + "workflowId": "eidolon-local-ba2593ae8f", + "projectionScope": "Observed terminal run and activity timing records; complete event and transfer history remains available from the daemon execution API." +} diff --git a/scientific-workflows/eidolon/evidence/execution-summary.json b/scientific-workflows/eidolon/evidence/execution-summary.json new file mode 100644 index 0000000..44a67b8 --- /dev/null +++ b/scientific-workflows/eidolon/evidence/execution-summary.json @@ -0,0 +1,8 @@ +{ + "runId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "imageId": "sha256:4016e0bd5b954fdbb436736a69c96e0e260ddc562df56273db1501136a9a9939", + "completedActivities": 8, + "observedMakespanSeconds": 23.972549200057983, + "peakOverlappingActivities": 2, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" +} diff --git a/scientific-workflows/eidolon/evidence/independent-validation.json b/scientific-workflows/eidolon/evidence/independent-validation.json new file mode 100644 index 0000000..011de24 --- /dev/null +++ b/scientific-workflows/eidolon/evidence/independent-validation.json @@ -0,0 +1 @@ +{"status": "passed", "validator": "independent artifact semantics, SHA-256 and scientific figure pixels", "showcase": "eidolon", "artifacts": 5} diff --git a/scientific-workflows/eidolon/evidence/manifest.json b/scientific-workflows/eidolon/evidence/manifest.json new file mode 100644 index 0000000..388da6e --- /dev/null +++ b/scientific-workflows/eidolon/evidence/manifest.json @@ -0,0 +1,18 @@ +{ + "showcase": "eidolon", + "status": "success", + "artifacts": [ + "collections.png", + "miniature-comparison.png", + "summary.csv", + "computed-collections.zip", + "scientific-validation.json" + ], + "sha256": { + "collections.png": "f17c2b126dc352c34a903394daf3c2f3ea2c66cb40063c2fa8eeaae02af7424a", + "miniature-comparison.png": "98e99f4a2e22901194587329317b3748e7dc4a00c4be028f6975e32878b5fcb0", + "summary.csv": "37d13a4c453060a711c087670673001b5b9f027d5d0f0d7991ddc187f4d545e3", + "computed-collections.zip": "b068761991d499501d41304a096138417cc0cd6260ef946f03d706c8681abd41", + "scientific-validation.json": "901546d0918a4c35c9cbf05450939a5ca6e8a14ff209e2b13e2b756123e7d995" + } +} diff --git a/scientific-workflows/eidolon/evidence/python-packages.txt b/scientific-workflows/eidolon/evidence/python-packages.txt new file mode 100644 index 0000000..2fc187b --- /dev/null +++ b/scientific-workflows/eidolon/evidence/python-packages.txt @@ -0,0 +1,23 @@ +cloudpickle==3.1.2 +contourpy==1.3.3 +cycler==0.12.1 +fonttools==4.68.0 +joblib==1.6.0 +kiwisolver==1.5.1 +matplotlib==3.9.2 +networkx==3.4.2 +numpy==1.26.4 +packaging==26.3 +pandas==2.2.3 +patsy==1.0.3 +pillow==13.0.0 +pyparsing==3.3.3 +pyreadr==0.5.2 +python-dateutil==4.0.0 +pytz==2026.6 +PyYAML==6.0.2 +scikit-learn==1.5.2 +scipy==1.14.1 +statsmodels==0.14.4 +threadpoolctl==3.8.0 +tzdata==2026.6 diff --git a/scientific-workflows/eidolon/evidence/scientific-validation.json b/scientific-workflows/eidolon/evidence/scientific-validation.json new file mode 100644 index 0000000..0c167e2 --- /dev/null +++ b/scientific-workflows/eidolon/evidence/scientific-validation.json @@ -0,0 +1,137 @@ +{ + "status": "passed", + "findings": { + "collections": [ + { + "collection": "climate", + "fullSeries": 10, + "observations": 630, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 2729, + "miniBytes": 770 + }, + { + "collection": "bioenergy", + "fullSeries": 20, + "observations": 660, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 3070, + "miniBytes": 468 + }, + { + "collection": "emissions", + "fullSeries": 20, + "observations": 1220, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 7941, + "miniBytes": 870 + } + ], + "originalRCodeExecuted": true, + "allFullObjectsMatchPinnedPublishedReferences": true + }, + "provenance": { + "slug": "eidolon", + "title": "Eidolon — reproducible scientific data collections", + "authors": [ + "Lucas Calmon", + "Marcus Junior", + "Lucas Santos", + "Fernando Alexandrino", + "Rafaelli Coutinho", + "Gustavo Guedes", + "Diego Carvalho", + "Eduardo Ogasawara" + ], + "conference": "XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/44071", + "source": "https://github.com/cefet-rj-dal/tspredbench", + "scope": "Run the original R ETLs for the complete climate, bioenergy and emissions source tables, followed by the original miniature-generation script. Each newly generated complete R object is compared semantically with the authors’ published full object at the same commit; published objects are references only, never substituted for ETL output. This is a three-collection instantiation of Eidolon, not every collection or remote publication. Origin: FAOSTAT https://www.fao.org/faostat/en/#data/ET , https://www.fao.org/faostat/en/#data/BE and https://www.fao.org/faostat/en/#data/GT . Code is MIT; source data retain FAO terms. Three independent ETL branches and three dependent miniaturization activities expose real parallelism.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence." + }, + "acquisition": { + "files": [ + { + "path": "etl/climate/01-extract_transform_load-climate.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/01-extract_transform_load-climate.R", + "sha256": "718e1e4333bc03e41116e48c254411200040822d200de78ac704c6097520a413", + "bytes": 1784 + }, + { + "path": "etl/climate/source/Environment_Temperature_change_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/source/Environment_Temperature_change_E_All_Data_NOFLAG.csv", + "sha256": "e88a744eba9e9b6d912e54f026e625efc3c6c703339504f7cd2ad62c2e00ba57", + "bytes": 6814488 + }, + { + "path": "tspredit/climate.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/climate.RData", + "sha256": "028b4bbed60dbdb35e0543565803c59eab499875251cceb146b681254c2232f7", + "bytes": 2730 + }, + { + "path": "etl/climate/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/climate/README.md", + "sha256": "166748d1d2081ddad59955b9de5efb4f926ec284056c8238aab473f831571956", + "bytes": 1689 + }, + { + "path": "etl/bioenergy/01-extract_transform_load-bioenergy.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/01-extract_transform_load-bioenergy.R", + "sha256": "f40ea00a8d33ef6f7b3f3dff13fda6c635f360d9ec96540162927dc62fb813a9", + "bytes": 1903 + }, + { + "path": "etl/bioenergy/source/Environment_Bioenergy_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/source/Environment_Bioenergy_E_All_Data_NOFLAG.csv", + "sha256": "4e79fd1f15987ff1c4d0d985a564a173ae79a19e48117920fdb685c484117e3b", + "bytes": 1859528 + }, + { + "path": "tspredit/bioenergy.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/bioenergy.RData", + "sha256": "c5e6bd0edee21ccdc77ef25a79443d36459fe5fa609ef92628164eada851a622", + "bytes": 3071 + }, + { + "path": "etl/bioenergy/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/bioenergy/README.md", + "sha256": "ea9de46c0b56c2501c867347d430e07b35b93c2ec06f693e18a312fe48559b76", + "bytes": 1897 + }, + { + "path": "etl/emissions/01-extract_transform_load-emissions.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/01-extract_transform_load-emissions.R", + "sha256": "2e022c058363de4293103c077f24fda9673be012c25d6094160f4c5ff311a0cf", + "bytes": 2337 + }, + { + "path": "etl/emissions/source/Emissions_Totals_E_All_Data_NOFLAG.csv", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/source/Emissions_Totals_E_All_Data_NOFLAG.csv", + "sha256": "b71684f9b64e2fc091279af49cd00ad04c54122d2c25adca74066e51d86cd973", + "bytes": 39900443 + }, + { + "path": "tspredit/emissions.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/tspredit/emissions.RData", + "sha256": "a6c00a7b9166f665fb7d9b9ce1a63d660fe11f1fda00961f33a7bbe583f4f86b", + "bytes": 7942 + }, + { + "path": "etl/emissions/README.md", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/emissions/README.md", + "sha256": "3a8298c72d7d4e083a3f98f1a259432f135825b1461e0d17e92e9f13f02c7486", + "bytes": 1731 + }, + { + "path": "etl/02-build-minidata.R", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/tspredbench/b5f7ed830784c24807e8ec37b8fe9759baaf922f/etl/02-build-minidata.R", + "sha256": "9db010c83957de4f7192bb92373037348dc67777c545b543eb6f83ea5f563d1e", + "bytes": 2317 + } + ] + } +} diff --git a/scientific-workflows/eidolon/evidence/summary.csv b/scientific-workflows/eidolon/evidence/summary.csv new file mode 100644 index 0000000..63ac4d7 --- /dev/null +++ b/scientific-workflows/eidolon/evidence/summary.csv @@ -0,0 +1,4 @@ +collection,fullSeries,observations,referenceAgreement,miniSeries,completeBytes,miniBytes +climate,10,630,True,1,2729,770 +bioenergy,20,660,True,1,3070,468 +emissions,20,1220,True,1,7941,870 diff --git a/scientific-workflows/eidolon/expected/render_execution.py b/scientific-workflows/eidolon/expected/render_execution.py new file mode 100644 index 0000000..fd9861b --- /dev/null +++ b/scientific-workflows/eidolon/expected/render_execution.py @@ -0,0 +1,28 @@ +from pathlib import Path +import hashlib,json +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +root=Path('/bundle') +r=json.loads((root/'evidence/daemon-run.json').read_text()) +a=r['projection']['activities'];assert len(a)==r['activityCount'] and all(x['status']=='completed' for x in a) +a=sorted(a,key=lambda x:x['startedAt']);start=min(x['startedAt'] for x in a) +fig,ax=plt.subplots(figsize=(12,max(4,len(a)*.3)),constrained_layout=True) +colors=plt.get_cmap('tab20') +for i,x in enumerate(a): + ax.barh(i,x['finishedAt']-x['startedAt'],left=x['startedAt']-start,color=colors(i%20),height=.7) +ax.set_yticks(range(len(a)),[x['activityId'].removeprefix(r['workflowId']+'-') for x in a],fontsize=8) +ax.invert_yaxis();ax.set_xlabel('Observed seconds from first activity start');ax.set_title(root.name+' — measured native daemon execution') +ax.spines[['top','right']].set_visible(False);ax.grid(axis='x',alpha=.2) +fig.savefig(root/'screenshots/current/execution-timeline.png',dpi=150) +current=0;peak=0 +for _,delta in sorted([(x['startedAt'],1) for x in a]+[(x['finishedAt'],-1) for x in a]):current+=delta;peak=max(peak,current) +summary={'runId':r['runId'],'imageId':r['imageId'],'completedActivities':len(a),'observedMakespanSeconds':r['projection']['run']['makespanSeconds'],'peakOverlappingActivities':peak,'timingSource':'observed native startedAt/finishedAt; imported predicted times excluded'} +(root/'evidence/execution-summary.json').write_text(json.dumps(summary,indent=2)+'\n') +p=root/'screenshots/current/manifest.json';m=json.loads(p.read_text());m['source']='scientific figures copied from completed daemon outputs; timeline derived from observed native activity times' +m['figures']['execution-timeline.png']=hashlib.sha256((root/'screenshots/current/execution-timeline.png').read_bytes()).hexdigest();m['executionSummary']=summary;p.write_text(json.dumps(m,indent=2,ensure_ascii=False)+'\n') +p=root/'README.md';s=p.read_text().split('\n## Observed parallel execution\n')[0];s=s.replace('Figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. They show actual computed results, not interface mockups.', 'Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results.') +s+='\n## Observed parallel execution\n\n'+f"The native run completed {len(a)} activities in **{summary['observedMakespanSeconds']:.2f} seconds**, with **{peak} overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline.\n\n![Measured execution timeline](screenshots/current/execution-timeline.png)\n" +p.write_text(s) +print(json.dumps(summary)) diff --git a/scientific-workflows/eidolon/expected/validate.py b/scientific-workflows/eidolon/expected/validate.py new file mode 100644 index 0000000..18f0e4c --- /dev/null +++ b/scientific-workflows/eidolon/expected/validate.py @@ -0,0 +1,29 @@ +import hashlib +import io +import json +from pathlib import Path +import zipfile +import numpy as np +import pandas as pd +from PIL import Image + +out=Path('/outputs') +m=json.loads((out/'manifest.json').read_text()) +v=json.loads((out/'scientific-validation.json').read_text()) +assert m['status']=='success' and v['status']=='passed' +for name in m['artifacts']: + p=out/name + assert hashlib.sha256(p.read_bytes()).hexdigest()==m['sha256'][name],name + if p.suffix=='.png': + with Image.open(p) as image: + assert min(image.size)>100 and np.asarray(image).std()>1 + +with zipfile.ZipFile(out/'computed-collections.zip') as z: + for name,series,points in [('climate',10,630),('bioenergy',20,660),('emissions',20,1220)]: + df=pd.read_csv(io.BytesIO(z.read(name+'.csv'))) + assert df.series.nunique()==series and len(df)==points + assert df.groupby('series').year.nunique().min()>20 + assert df.value.notna().any() +assert all(r['referenceAgreement'] for r in v['findings']['collections']) + +print(json.dumps({'status':'passed','validator':'independent artifact semantics, SHA-256 and scientific figure pixels','showcase':m['showcase'],'artifacts':len(m['artifacts'])})) diff --git a/scientific-workflows/eidolon/prepare.sh b/scientific-workflows/eidolon/prepare.sh new file mode 100755 index 0000000..03d1796 --- /dev/null +++ b/scientific-workflows/eidolon/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +python3 "$root/scripts/acquire.py" +go run "$root/../../tools/showcase/main.go" -root "$root" -prepare-container diff --git a/scientific-workflows/eidolon/requirements.txt b/scientific-workflows/eidolon/requirements.txt new file mode 100644 index 0000000..fc39612 --- /dev/null +++ b/scientific-workflows/eidolon/requirements.txt @@ -0,0 +1,9 @@ +numpy==1.26.4 +pandas==2.2.3 +scipy==1.14.1 +scikit-learn==1.5.2 +statsmodels==0.14.4 +matplotlib==3.9.2 +networkx==3.4.2 +pyreadr==0.5.2 +PyYAML==6.0.2 diff --git a/scientific-workflows/eidolon/run.sh b/scientific-workflows/eidolon/run.sh new file mode 100755 index 0000000..b487925 --- /dev/null +++ b/scientific-workflows/eidolon/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +go run "$root/../../tools/showcase/main.go" -root "$root" -container -parallel "${AKOFLOW_PARALLEL:-3}" +if ! "$root/validate.sh"; then + rm -f "$root/outputs/manifest.json" + exit 1 +fi diff --git a/scientific-workflows/eidolon/scope.yaml b/scientific-workflows/eidolon/scope.yaml new file mode 100644 index 0000000..8e562b1 --- /dev/null +++ b/scientific-workflows/eidolon/scope.yaml @@ -0,0 +1,3 @@ +id: eidolon-local-scope +name: eidolon-local local scope +environmentVersionIds: [eidolon-local-v1] diff --git a/scientific-workflows/eidolon/screenshots/current/collections.png b/scientific-workflows/eidolon/screenshots/current/collections.png new file mode 100644 index 0000000..dcb3b43 Binary files /dev/null and b/scientific-workflows/eidolon/screenshots/current/collections.png differ diff --git a/scientific-workflows/eidolon/screenshots/current/execution-timeline.png b/scientific-workflows/eidolon/screenshots/current/execution-timeline.png new file mode 100644 index 0000000..132c83d Binary files /dev/null and b/scientific-workflows/eidolon/screenshots/current/execution-timeline.png differ diff --git a/scientific-workflows/eidolon/screenshots/current/manifest.json b/scientific-workflows/eidolon/screenshots/current/manifest.json new file mode 100644 index 0000000..c0d5251 --- /dev/null +++ b/scientific-workflows/eidolon/screenshots/current/manifest.json @@ -0,0 +1,52 @@ +{ + "runId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "image": "akoflow-local/eidolon:local-4016e0bd5b954fdb", + "imageId": "sha256:4016e0bd5b954fdbb436736a69c96e0e260ddc562df56273db1501136a9a9939", + "source": "scientific figures copied from completed daemon outputs; timeline derived from observed native activity times", + "figures": { + "collections.png": "f17c2b126dc352c34a903394daf3c2f3ea2c66cb40063c2fa8eeaae02af7424a", + "miniature-comparison.png": "98e99f4a2e22901194587329317b3748e7dc4a00c4be028f6975e32878b5fcb0", + "execution-timeline.png": "194b2a7af49b8197c8ab42e7c46fc05dd26baaed254d54dde1c3ee97115e2b68" + }, + "findings": { + "collections": [ + { + "collection": "climate", + "fullSeries": 10, + "observations": 630, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 2729, + "miniBytes": 770 + }, + { + "collection": "bioenergy", + "fullSeries": 20, + "observations": 660, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 3070, + "miniBytes": 468 + }, + { + "collection": "emissions", + "fullSeries": 20, + "observations": 1220, + "referenceAgreement": true, + "miniSeries": 1, + "completeBytes": 7941, + "miniBytes": 870 + } + ], + "originalRCodeExecuted": true, + "allFullObjectsMatchPinnedPublishedReferences": true + }, + "executionSummary": { + "runId": "eidolon-local-ba2593ae8f-run-20261117t150749.138605490", + "imageId": "sha256:4016e0bd5b954fdbb436736a69c96e0e260ddc562df56273db1501136a9a9939", + "completedActivities": 8, + "observedMakespanSeconds": 23.972549200057983, + "peakOverlappingActivities": 2, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" + } +} diff --git a/scientific-workflows/eidolon/screenshots/current/miniature-comparison.png b/scientific-workflows/eidolon/screenshots/current/miniature-comparison.png new file mode 100644 index 0000000..729164d Binary files /dev/null and b/scientific-workflows/eidolon/screenshots/current/miniature-comparison.png differ diff --git a/scientific-workflows/eidolon/scripts/acquire.py b/scientific-workflows/eidolon/scripts/acquire.py new file mode 100644 index 0000000..2ec5a91 --- /dev/null +++ b/scientific-workflows/eidolon/scripts/acquire.py @@ -0,0 +1,48 @@ +import hashlib +import json +from pathlib import Path +import urllib.request +import time + +root = Path(__file__).resolve().parents[1] +data = root / 'data' +config = json.loads((data / 'sources.json').read_text()) +previous = {} +if (data / 'acquisition.json').exists(): + previous = {f['path']: f for f in json.loads((data / 'acquisition.json').read_text())['files']} +receipts = [] +for item in config['files']: + target = data / 'inputs' / item['path'] + target.parent.mkdir(parents=True, exist_ok=True) + old = previous.get(item['path'], {}) + pinned = item.get('sha256') or (old.get('sha256') if old.get('url') == item['url'] else None) + if target.exists() and old.get('url') == item['url']: + expected = item.get('sha256', old.get('sha256')) + observed = hashlib.sha256(target.read_bytes()).hexdigest() + if expected == observed: + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + continue + temp = target.with_suffix(target.suffix + '.partial') + for attempt in range(4): + try: + request = urllib.request.Request(item['url'], headers={'User-Agent': 'Akoflow-scientific-reproduction/1.0'}) + with urllib.request.urlopen(request, timeout=120) as src, temp.open('wb') as dst: + while chunk := src.read(1024 * 1024): + dst.write(chunk) + observed = hashlib.sha256(temp.read_bytes()).hexdigest() + if pinned and pinned != observed: + raise RuntimeError('Pinned SHA256 mismatch: ' + item['path']) + if item.get('md5') and hashlib.md5(temp.read_bytes()).hexdigest() != item['md5']: + raise RuntimeError('Vendor MD5 mismatch: ' + item['path']) + if item.get('bytes') and temp.stat().st_size != item['bytes']: + raise RuntimeError('Length mismatch: ' + item['path']) + temp.replace(target) + break + except Exception: + temp.unlink(missing_ok=True) + if attempt == 3: + raise + time.sleep(2 ** attempt) + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + print('Verified', item['path'], target.stat().st_size, flush=True) +(data / 'acquisition.json').write_text(json.dumps({'files': receipts}, indent=2) + '\n') diff --git a/scientific-workflows/eidolon/scripts/common.py b/scientific-workflows/eidolon/scripts/common.py new file mode 100644 index 0000000..35a6f20 --- /dev/null +++ b/scientific-workflows/eidolon/scripts/common.py @@ -0,0 +1,50 @@ +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import numpy as np +import pandas as pd +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +ROOT = Path(__file__).resolve().parents[1] +DATA = ROOT / 'data' +plt.rcParams.update({'figure.dpi': 150, 'axes.spines.top': False, 'axes.spines.right': False}) + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + +def write(path, value): + Path(path).write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') + +def inputs(): + receipt = json.loads((DATA / 'acquisition.json').read_text()) + for item in receipt['files']: + p = DATA / 'inputs' / item['path'] + if digest(p) != item['sha256']: + raise RuntimeError('Input checksum mismatch: ' + str(p)) + return receipt + +def finish(output, artifacts, findings): + provenance = json.loads((DATA / 'provenance.json').read_text()) + write(output / 'scientific-validation.json', {'status': 'passed', 'findings': findings, 'provenance': provenance, 'acquisition': inputs()}) + artifacts = artifacts + ['scientific-validation.json'] + for name in artifacts: + if not (output / name).is_file() or (output / name).stat().st_size == 0: + raise RuntimeError('Missing artifact: ' + name) + write(output / 'manifest.json', {'showcase': provenance['slug'], 'status': 'success', 'artifacts': artifacts, 'sha256': {n: digest(output / n) for n in artifacts}}) + +def arguments(): + parser = argparse.ArgumentParser() + parser.add_argument('--stage', required=True) + parser.add_argument('--output', required=True) + a = parser.parse_args() + out = Path(a.output).resolve() + out.mkdir(parents=True, exist_ok=True) + return a.stage, out diff --git a/scientific-workflows/eidolon/scripts/run_stage.py b/scientific-workflows/eidolon/scripts/run_stage.py new file mode 100644 index 0000000..fb846f1 --- /dev/null +++ b/scientific-workflows/eidolon/scripts/run_stage.py @@ -0,0 +1,57 @@ +from common import * +import subprocess + +stage, out = arguments() +NAMES=['climate','bioenergy','emissions'] +def rscript(code, cwd): + subprocess.run(['Rscript','--vanilla','-e',code],cwd=cwd,check=True) + +if stage=='validate-inputs': + receipt=inputs() + write(out/'inputs-validated.json',{'files':len(receipt['files'])}) +elif stage.startswith('etl-'): + name=stage[4:];work=out/('project-'+name) + shutil.copytree(DATA/'inputs/etl'/name,work/'etl'/name) + script=work/'etl'/name/('01-extract_transform_load-'+name+'.R') + subprocess.run(['Rscript','--vanilla',str(script)],cwd=script.parent,check=True) + shutil.copyfile(work/'tspredit'/(name+'.RData'),out/(name+'.RData')) +elif stage.startswith('mini-'): + name=stage[5:];work=out/('mini-project-'+name) + (work/'etl').mkdir(parents=True);(work/'tspredit').mkdir() + shutil.copyfile(out/(name+'.RData'),work/'tspredit'/(name+'.RData')) + shutil.copyfile(DATA/'inputs/etl/02-build-minidata.R',work/'etl/02-build-minidata.R') + subprocess.run(['Rscript','--vanilla','etl/02-build-minidata.R'],cwd=work,check=True) + code = """ + e <- new.env(); load('tspredit/NAME.RData', envir=e); x <- e[['NAME']] + ref <- new.env(); load('/app/data/inputs/tspredit/NAME.RData', envir=ref) + comparison <- all.equal(x,ref[['NAME']],tolerance=1e-10) + if (!isTRUE(comparison)) stop(paste(comparison, collapse='; ')) + m <- new.env(); load('data/NAME.RData',envir=m); mini <- m[['NAME']] + stopifnot(length(mini)==1, identical(unname(mini[[1]]),unname(x[[1]])), !is.null(attr(mini,'url'))) + frame <- do.call(rbind,lapply(names(x), function(n) data.frame(series=n,year=names(x[[n]]),value=as.numeric(x[[n]])))) + write.csv(frame,'../NAME.csv',row.names=FALSE) + """.replace('NAME',name) + rscript(code,work) + df=pd.read_csv(out/(name+'.csv')) + assert df.series.nunique()>1 and df.value.notna().any() + write(out/(name+'-validation.json'),{'collection':name,'fullSeries':int(df.series.nunique()),'observations':len(df),'referenceAgreement':True,'miniSeries':1,'completeBytes':(work/'tspredit'/(name+'.RData')).stat().st_size,'miniBytes':(work/'data'/(name+'.RData')).stat().st_size}) +else: + rows=[json.loads((out/(n+'-validation.json')).read_text()) for n in NAMES] + fig,axes=plt.subplots(3,1,figsize=(11,11),constrained_layout=True) + labels={'climate':'Annual temperature change (°C)','bioenergy':'Original FAOSTAT energy units','emissions':'Original FAOSTAT emissions units'} + for ax,name in zip(axes,NAMES): + df=pd.read_csv(out/(name+'.csv')) + for series,g in df.groupby('series',sort=False): + ax.plot(g.year,g.value,label=series,lw=1) + ax.set_title(name+' — freshly computed original ETL output');ax.set_ylabel(labels[name]);ax.legend(fontsize=5,ncol=3) + fig.savefig(out/'collections.png');plt.close(fig) + summary=pd.DataFrame(rows);summary.to_csv(out/'summary.csv',index=False) + fig,ax=plt.subplots(figsize=(8,4),constrained_layout=True) + summary.set_index('collection')[['completeBytes','miniBytes']].plot.bar(ax=ax,rot=0) + ax.set_ylabel('Serialized bytes');ax.set_title('Original Eidolon full objects versus local miniatures') + fig.savefig(out/'miniature-comparison.png');plt.close(fig) + assert all(r['referenceAgreement'] and r['miniSeries']==1 for r in rows) + import zipfile + with zipfile.ZipFile(out/'computed-collections.zip','w',zipfile.ZIP_DEFLATED) as archive: + for n in NAMES:archive.write(out/(n+'.csv'),n+'.csv') + finish(out,['collections.png','miniature-comparison.png','summary.csv','computed-collections.zip'],{'collections':rows,'originalRCodeExecuted':True,'allFullObjectsMatchPinnedPublishedReferences':True}) diff --git a/scientific-workflows/eidolon/scripts/validate.py b/scientific-workflows/eidolon/scripts/validate.py new file mode 100644 index 0000000..1a846f9 --- /dev/null +++ b/scientific-workflows/eidolon/scripts/validate.py @@ -0,0 +1,11 @@ +import json +from pathlib import Path +from common import digest +root = Path(__file__).resolve().parents[1] +out = root / 'outputs' +m = json.loads((out / 'manifest.json').read_text()) +v = json.loads((out / 'scientific-validation.json').read_text()) +assert m['status'] == 'success' and v['status'] == 'passed' +for name in m['artifacts']: + assert digest(out / name) == m['sha256'][name], name +print(json.dumps(v['findings'], ensure_ascii=False)) diff --git a/scientific-workflows/eidolon/topology.yaml b/scientific-workflows/eidolon/topology.yaml new file mode 100644 index 0000000..29534f4 --- /dev/null +++ b/scientific-workflows/eidolon/topology.yaml @@ -0,0 +1,5 @@ +id: eidolon-local-topology +name: eidolon-local local topology +version: 1 +executionScopeId: eidolon-local-scope +links: [] diff --git a/scientific-workflows/eidolon/validate.sh b/scientific-workflows/eidolon/validate.sh new file mode 100755 index 0000000..5a4756b --- /dev/null +++ b/scientific-workflows/eidolon/validate.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +result="${AKOFLOW_RESULT_DIR:-$root/outputs}" +docker run --rm --network none --mount "type=bind,src=$result,dst=/outputs,readonly" --mount "type=bind,src=$root/expected,dst=/verification,readonly" --entrypoint python akoflow-local/eidolon:workload /verification/validate.py diff --git a/scientific-workflows/eidolon/workflow.yaml b/scientific-workflows/eidolon/workflow.yaml new file mode 100644 index 0000000..c9e7a86 --- /dev/null +++ b/scientific-workflows/eidolon/workflow.yaml @@ -0,0 +1,167 @@ +name: eidolon +spec: + namespace: akoflow-examples + image: akoflow-local/eidolon:workload + activities: + - name: validate-inputs + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: [] + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - validate-inputs + - --output + - . + - name: etl-climate + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - etl-climate + - --output + - . + - name: mini-climate + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - etl-climate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mini-climate + - --output + - . + - name: etl-bioenergy + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - etl-bioenergy + - --output + - . + - name: mini-bioenergy + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - etl-bioenergy + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mini-bioenergy + - --output + - . + - name: etl-emissions + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - etl-emissions + - --output + - . + - name: mini-emissions + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - etl-emissions + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mini-emissions + - --output + - . + - name: compare + runtime: eidolon-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - mini-climate + - mini-bioenergy + - mini-emissions + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - compare + - --output + - . + dataDependencies: + - producerActivity: validate-inputs + consumerActivity: etl-climate + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: etl-climate + consumerActivity: mini-climate + logicalName: climate.RData + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: etl-bioenergy + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: etl-bioenergy + consumerActivity: mini-bioenergy + logicalName: bioenergy.RData + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: etl-emissions + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: etl-emissions + consumerActivity: mini-emissions + logicalName: emissions.RData + sizeBytes: 10000000 + - producerActivity: mini-climate + consumerActivity: compare + logicalName: climate.csv + sizeBytes: 10000000 + - producerActivity: mini-climate + consumerActivity: compare + logicalName: climate-validation.json + sizeBytes: 10000000 + - producerActivity: mini-bioenergy + consumerActivity: compare + logicalName: bioenergy.csv + sizeBytes: 10000000 + - producerActivity: mini-bioenergy + consumerActivity: compare + logicalName: bioenergy-validation.json + sizeBytes: 10000000 + - producerActivity: mini-emissions + consumerActivity: compare + logicalName: emissions.csv + sizeBytes: 10000000 + - producerActivity: mini-emissions + consumerActivity: compare + logicalName: emissions-validation.json + sizeBytes: 10000000 diff --git a/scientific-workflows/estrada-real/.dockerignore b/scientific-workflows/estrada-real/.dockerignore new file mode 100644 index 0000000..f7c11d3 --- /dev/null +++ b/scientific-workflows/estrada-real/.dockerignore @@ -0,0 +1,5 @@ +outputs +screenshots +evidence +.venv +**/__pycache__ diff --git a/scientific-workflows/estrada-real/.gitignore b/scientific-workflows/estrada-real/.gitignore new file mode 100644 index 0000000..194ed53 --- /dev/null +++ b/scientific-workflows/estrada-real/.gitignore @@ -0,0 +1,3 @@ +data/inputs/ +outputs/ +outputs-daemon/ diff --git a/scientific-workflows/estrada-real/README.md b/scientific-workflows/estrada-real/README.md new file mode 100644 index 0000000..be28d80 --- /dev/null +++ b/scientific-workflows/estrada-real/README.md @@ -0,0 +1,73 @@ +# Estrada Real — informed search on a curated historical graph + +Conference tags: `bresci`, `bresci-2026`. [Browse BreSci on the Hub](https://hub.akoflow.com/categories/bresci). + +Adapted from **XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD**. Original authors: **Davi Machado da Rocha**. + +[Original paper](https://sol.sbc.org.br/index.php/bresci/article/view/44084) · [Original code and data](https://zenodo.org/records/20867698) + +## Scientific scope + +Re-execute the original UCS, Greedy and A* notebook functions over the complete frozen curated graph: 108 nodes, 226 directed edges, all 11,556 distinct ordered origin–destination pairs for each of three original cost profiles. Nine independent search activities produce 104,004 searches. This reproduces the search stage, not the upstream geographic source reconstruction. The paper reports 3,715 Greedy divergences; the workflow measures and reports actual agreement. Original data deposit: https://doi.org/10.5281/zenodo.20867698. Deposit metadata states CC BY 4.0; its README contains provisional code-license wording, so no broader code redistribution license is inferred. + +This is an adaptation of the cited scientific application to native AkôFlow activities. It is not a claim of exact agreement with the paper. Source URLs, immutable revisions and input SHA-256 hashes are recorded in `data/sources.json` and `data/acquisition.json`. Original authors retain authorship of the scientific methods and artifacts; the AkôFlow contribution is orchestration, packaging and validation. + +## Execute + +[Original input URL manifest](data/sources.json) · [Verified input SHA-256 receipts](data/acquisition.json) · [Scientific provenance](data/provenance.json) + +```sh +./prepare.sh +./run.sh +``` + +Preparation acquires original inputs and builds the image. All computation then executes with networking disabled. No synthetic fallback replaces unavailable original data. `AKOFLOW_PARALLEL` controls standalone concurrency. + +To register and execute in Desktop through the local daemon, from the repository root: + +```sh +go run ./tools/daemon-local -example scientific-workflows/estrada-real -env-file /path/to/installation.env -api-url http://YOUR_DAEMON:8080/akoflow-api -lanes 3 +``` + +Tracking item: [AKO-46](https://github.com/UFFeScience/akoflow-examples/issues/46). + +The daemon records the exact image and execution identity in `evidence/daemon-run.json`. `workflow.yaml` declares dependencies and explicit artifact transfers. `outputs/scientific-validation.json` contains semantic checks and findings. A successful exit alone is not a scientific validation. + +## Results + +Native daemon run `estrada-real-local-0c3426a638-run-20261117t145937.986646313` completed **11/11 activities**. Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results. + +Findings: + +```json +{ + "nodes": 108, + "directedEdges": 226, + "searches": 104004, + "greedyDivergences": 3715, + "paperGreedyDivergences": 3715, + "paperCountMatches": true, + "astarUcsAgreementPairs": 34668, + "originalNotebookCells": [ + 19, + 34, + 36 + ] +} +``` + +![graph map](screenshots/current/graph-map.png) + +![search comparison](screenshots/current/search-comparison.png) + +## Observed parallel execution + +The native run completed 11 activities in **24.29 seconds**, with **3 overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline. + +![Measured execution timeline](screenshots/current/execution-timeline.png) + +Python dependency versions from the measured image are retained in [`evidence/python-packages.txt`](evidence/python-packages.txt). Independent post-run validation is recorded in [`evidence/independent-validation.json`](evidence/independent-validation.json). + +To regenerate the execution timeline from an observed run, mount this bundle at `/bundle` in its measured image and run `python /bundle/expected/render_execution.py`. The renderer uses `evidence/daemon-run.json`; predicted schedule times are excluded. + +The full 104,004-row measured search table is retained as [`evidence/comparison.csv.gz`](evidence/comparison.csv.gz), with original and compressed SHA-256 hashes in [`evidence/results-index.json`](evidence/results-index.json). diff --git a/scientific-workflows/estrada-real/data/acquisition.json b/scientific-workflows/estrada-real/data/acquisition.json new file mode 100644 index 0000000..8ff7885 --- /dev/null +++ b/scientific-workflows/estrada-real/data/acquisition.json @@ -0,0 +1,11 @@ +{ + "files": [ + { + "path": "artifacts.zip", + "url": "https://zenodo.org/records/20867698/files/zenodo_artefatos_20867698.zip?download=1", + "md5": "9af578d2d7d571fd6c38c5eeacd8e0ca", + "bytes": 3923709, + "sha256": "1ad4ed84b04f99665a5bed0122de19368dad093f8b0b93d2adb6fbd7cd5243ac" + } + ] +} diff --git a/scientific-workflows/estrada-real/data/dag.json b/scientific-workflows/estrada-real/data/dag.json new file mode 100644 index 0000000..ccde0a3 --- /dev/null +++ b/scientific-workflows/estrada-real/data/dag.json @@ -0,0 +1,334 @@ +{ + "name": "estrada-real", + "spec": { + "namespace": "akoflow-examples", + "image": "akoflow-local/estrada-real:workload", + "activities": [ + { + "name": "validate-graph", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "validate-graph", + "--output", + "." + ] + } + }, + { + "name": "tropeiro-ucs", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "tropeiro-ucs", + "--output", + "." + ] + } + }, + { + "name": "tropeiro-greedy", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "tropeiro-greedy", + "--output", + "." + ] + } + }, + { + "name": "tropeiro-astar", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "tropeiro-astar", + "--output", + "." + ] + } + }, + { + "name": "contrabandista-ucs", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "contrabandista-ucs", + "--output", + "." + ] + } + }, + { + "name": "contrabandista-greedy", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "contrabandista-greedy", + "--output", + "." + ] + } + }, + { + "name": "contrabandista-astar", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "contrabandista-astar", + "--output", + "." + ] + } + }, + { + "name": "tropa-oficial-ucs", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "tropa-oficial-ucs", + "--output", + "." + ] + } + }, + { + "name": "tropa-oficial-greedy", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "tropa-oficial-greedy", + "--output", + "." + ] + } + }, + { + "name": "tropa-oficial-astar", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-graph" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "tropa-oficial-astar", + "--output", + "." + ] + } + }, + { + "name": "compare", + "runtime": "estrada-real-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "tropeiro-ucs", + "tropeiro-greedy", + "tropeiro-astar", + "contrabandista-ucs", + "contrabandista-greedy", + "contrabandista-astar", + "tropa-oficial-ucs", + "tropa-oficial-greedy", + "tropa-oficial-astar" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "compare", + "--output", + "." + ] + } + } + ], + "dataDependencies": [ + { + "producerActivity": "validate-graph", + "consumerActivity": "tropeiro-ucs", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "tropeiro-greedy", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "tropeiro-astar", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "contrabandista-ucs", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "contrabandista-greedy", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "contrabandista-astar", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "tropa-oficial-ucs", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "tropa-oficial-greedy", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-graph", + "consumerActivity": "tropa-oficial-astar", + "logicalName": "graph.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "tropeiro-ucs", + "consumerActivity": "compare", + "logicalName": "tropeiro-ucs.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "tropeiro-greedy", + "consumerActivity": "compare", + "logicalName": "tropeiro-greedy.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "tropeiro-astar", + "consumerActivity": "compare", + "logicalName": "tropeiro-astar.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "contrabandista-ucs", + "consumerActivity": "compare", + "logicalName": "contrabandista-ucs.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "contrabandista-greedy", + "consumerActivity": "compare", + "logicalName": "contrabandista-greedy.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "contrabandista-astar", + "consumerActivity": "compare", + "logicalName": "contrabandista-astar.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "tropa-oficial-ucs", + "consumerActivity": "compare", + "logicalName": "tropa-oficial-ucs.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "tropa-oficial-greedy", + "consumerActivity": "compare", + "logicalName": "tropa-oficial-greedy.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "tropa-oficial-astar", + "consumerActivity": "compare", + "logicalName": "tropa-oficial-astar.csv", + "sizeBytes": 10000000 + } + ] + } +} diff --git a/scientific-workflows/estrada-real/data/provenance.json b/scientific-workflows/estrada-real/data/provenance.json new file mode 100644 index 0000000..d8da645 --- /dev/null +++ b/scientific-workflows/estrada-real/data/provenance.json @@ -0,0 +1,18 @@ +{ + "slug": "estrada-real", + "title": "Estrada Real — informed search on a curated historical graph", + "authors": [ + "Davi Machado da Rocha" + ], + "conference": "XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/44084", + "source": "https://zenodo.org/records/20867698", + "scope": "Re-execute the original UCS, Greedy and A* notebook functions over the complete frozen curated graph: 108 nodes, 226 directed edges, all 11,556 distinct ordered origin–destination pairs for each of three original cost profiles. Nine independent search activities produce 104,004 searches. This reproduces the search stage, not the upstream geographic source reconstruction. The paper reports 3,715 Greedy divergences; the workflow measures and reports actual agreement. Original data deposit: https://doi.org/10.5281/zenodo.20867698. Deposit metadata states CC BY 4.0; its README contains provisional code-license wording, so no broader code redistribution license is inferred.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence.", + "tags": [ + "bresci", + "bresci-2026", + "scientific-reproducibility", + "scientific-workflows" + ] +} diff --git a/scientific-workflows/estrada-real/data/sources.json b/scientific-workflows/estrada-real/data/sources.json new file mode 100644 index 0000000..28ae9b3 --- /dev/null +++ b/scientific-workflows/estrada-real/data/sources.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "artifacts.zip", + "url": "https://zenodo.org/records/20867698/files/zenodo_artefatos_20867698.zip?download=1", + "md5": "9af578d2d7d571fd6c38c5eeacd8e0ca", + "bytes": 3923709 + } + ] +} diff --git a/scientific-workflows/estrada-real/docker/Dockerfile b/scientific-workflows/estrada-real/docker/Dockerfile new file mode 100644 index 0000000..4269c68 --- /dev/null +++ b/scientific-workflows/estrada-real/docker/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.11.13-slim-bookworm@sha256:86adf8dbadc3d6e82ee5dd2c74bec2e1c2467cdad47886280501df722372d2e1 +ENV MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 PYTHONDONTWRITEBYTECODE=1 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY scripts /app/scripts +COPY data /app/data diff --git a/scientific-workflows/estrada-real/environment.yaml b/scientific-workflows/estrada-real/environment.yaml new file mode 100644 index 0000000..07a419b --- /dev/null +++ b/scientific-workflows/estrada-real/environment.yaml @@ -0,0 +1,42 @@ +environment: + id: estrada-real-local + name: estrada-real-local local Docker + description: CPU-only local execution; no remote capacity is provisioned + status: ready +version: + id: estrada-real-local-v1 + environmentId: estrada-real-local + version: 1 + status: published + networkModel: local + interferenceModel: none + costModel: free + configurationHash: estrada-real-local-v1 +runtimes: + - environmentVersionId: estrada-real-local-v1 + id: estrada-real-local-local + name: Local Docker host + driver: local + mode: execution + role: compute + capabilities: {batch: true, container: true} +resources: + - id: estrada-real-local-local-docker + environmentVersionId: estrada-real-local-v1 + type: machine + name: Local Docker host + providerId: local-docker + cpuCores: 4 + cpuCapacity: 4 + memoryBytes: 8589934592 + storageBytes: 21474836480 + computeSpeedup: 1 + pricePerSecond: 0 + bootOverheadSeconds: 0 + containerOverheadSeconds: 0 + schedulable: true +storages: [] +connections: [] +activityResourceProfiles: [] +resourceRuntimeBindings: + - {resourceId: estrada-real-local-local-docker, runtimeId: estrada-real-local-local, enabled: true} diff --git a/scientific-workflows/estrada-real/evidence/comparison.csv.gz b/scientific-workflows/estrada-real/evidence/comparison.csv.gz new file mode 100644 index 0000000..ee2d236 Binary files /dev/null and b/scientific-workflows/estrada-real/evidence/comparison.csv.gz differ diff --git a/scientific-workflows/estrada-real/evidence/daemon-run.json b/scientific-workflows/estrada-real/evidence/daemon-run.json new file mode 100644 index 0000000..db3f038 --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/daemon-run.json @@ -0,0 +1,402 @@ +{ + "activityCount": 11, + "completedActivityCount": 11, + "image": "akoflow-local/estrada-real:local-22c0fa0da9d73449", + "imageId": "sha256:22c0fa0da9d734498b20ddcb09f7765cfa1e4fab04e595c5401a3fcf2a238fd7", + "observedAt": "2026-11-17T15:00:04Z", + "planId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291", + "projection": { + "run": { + "activityCount": 11, + "breakdown": { + "computeSeconds": 23.94981026649475, + "interferenceSeconds": 0, + "overheadSeconds": 0, + "queueSeconds": 0, + "transferSeconds": 13.15582275390625 + }, + "completedActivityCount": 11, + "cost": 0, + "environmentNames": [ + "estrada-real-local local Docker" + ], + "finishedAt": "2026-11-17T15:00:04Z", + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "kind": "workflow", + "makespanSeconds": 24.28536081314087, + "mode": "real", + "schedulePlanId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291", + "seed": 0, + "startedAt": "2026-11-17T14:59:38Z", + "status": "completed", + "title": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "transferredBytes": 88234820, + "workflowId": "estrada-real-local-0c3426a638", + "workflowName": "estrada-real-local-0c3426a638", + "workflowVersionId": "estrada-real-local-0c3426a638-v1" + }, + "activities": [ + { + "activityId": "estrada-real-local-0c3426a638-validate-graph", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927580.6302812, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-validate-graph", + "interferenceSeconds": 0, + "metadata": { + "pricePerSecond": 0, + "runtimeId": "estrada-real-local-local" + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-validate-graph", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927578.8339462, + "readyAt": 1794927578.8339462, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 1.4476768970489502, + "startedAt": 1794927579.1826043, + "status": "completed", + "transferBytes": 0, + "transferSeconds": 0 + }, + { + "activityId": "estrada-real-local-0c3426a638-tropeiro-greedy", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927583.60589, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-tropeiro-greedy", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5372085571289062, + "preparationFinishedAt": 1794927581.2791355, + "preparationStartedAt": 1794927581.0809882, + "pricePerSecond": 0, + "readyWaitSeconds": 0.037270545959472656, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.19814729690551758, + "transferWorkSeconds": 0.19814729690551758 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-tropeiro-greedy", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927580.9234984, + "readyAt": 1794927580.9234984, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 1.789546012878418, + "startedAt": 1794927581.816344, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.19814729690551758 + }, + { + "activityId": "estrada-real-local-0c3426a638-tropeiro-astar", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927584.068064, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-tropeiro-astar", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5208392143249512, + "preparationFinishedAt": 1794927581.3209646, + "preparationStartedAt": 1794927581.1084244, + "pricePerSecond": 0, + "readyWaitSeconds": 0.04331088066101074, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.2125401496887207, + "transferWorkSeconds": 0.2125401496887207 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-tropeiro-astar", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927580.9110093, + "readyAt": 1794927580.9110093, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 2.226260185241699, + "startedAt": 1794927581.8418038, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.2125401496887207 + }, + { + "activityId": "estrada-real-local-0c3426a638-tropeiro-ucs", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927584.3283622, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-tropeiro-ucs", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5604937076568604, + "preparationFinishedAt": 1794927581.2903843, + "preparationStartedAt": 1794927581.0924258, + "pricePerSecond": 0, + "readyWaitSeconds": 0.07159852981567383, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.19795846939086914, + "transferWorkSeconds": 0.19795846939086914 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-tropeiro-ucs", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927580.9472523, + "readyAt": 1794927580.9472523, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 2.4774842262268066, + "startedAt": 1794927581.850878, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.19795846939086914 + }, + { + "activityId": "estrada-real-local-0c3426a638-contrabandista-greedy", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927590.7953777, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-contrabandista-greedy", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.43088531494140625, + "preparationFinishedAt": 1794927588.571093, + "preparationStartedAt": 1794927588.3300414, + "pricePerSecond": 0, + "readyWaitSeconds": 0.09577727317810059, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.24105167388916016, + "transferWorkSeconds": 0.24105167388916016 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-contrabandista-greedy", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927588.2097044, + "readyAt": 1794927588.2097044, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 1.7933993339538574, + "startedAt": 1794927589.0019784, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.24105167388916016 + }, + { + "activityId": "estrada-real-local-0c3426a638-contrabandista-ucs", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927593.619284, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-contrabandista-ucs", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.4860861301422119, + "preparationFinishedAt": 1794927590.5003226, + "preparationStartedAt": 1794927590.2899911, + "pricePerSecond": 0, + "readyWaitSeconds": 0.022080421447753906, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.21033143997192383, + "transferWorkSeconds": 0.21033143997192383 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-contrabandista-ucs", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927590.24648, + "readyAt": 1794927590.24648, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 2.6328752040863037, + "startedAt": 1794927590.9864087, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.21033143997192383 + }, + { + "activityId": "estrada-real-local-0c3426a638-contrabandista-astar", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927593.4122643, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-contrabandista-astar", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.4948306083679199, + "preparationFinishedAt": 1794927590.509194, + "preparationStartedAt": 1794927590.3013256, + "pricePerSecond": 0, + "readyWaitSeconds": 0.022289037704467773, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.20786833763122559, + "transferWorkSeconds": 0.20786833763122559 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-contrabandista-astar", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927590.2356892, + "readyAt": 1794927590.2356892, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 2.4082398414611816, + "startedAt": 1794927591.0040245, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.20786833763122559 + }, + { + "activityId": "estrada-real-local-0c3426a638-tropa-oficial-greedy", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927593.8045402, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-tropa-oficial-greedy", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.3084228038787842, + "preparationFinishedAt": 1794927591.5081987, + "preparationStartedAt": 1794927591.3073907, + "pricePerSecond": 0, + "readyWaitSeconds": 0.025877952575683594, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.20080804824829102, + "transferWorkSeconds": 0.20080804824829102 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-tropa-oficial-greedy", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927591.2567053, + "readyAt": 1794927591.2567053, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 1.9879186153411865, + "startedAt": 1794927591.8166215, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.20080804824829102 + }, + { + "activityId": "estrada-real-local-0c3426a638-tropa-oficial-astar", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927597.814587, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-tropa-oficial-astar", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5604705810546875, + "preparationFinishedAt": 1794927594.7793548, + "preparationStartedAt": 1794927594.570265, + "pricePerSecond": 0, + "readyWaitSeconds": 0.044548749923706055, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.2090897560119629, + "transferWorkSeconds": 0.2090897560119629 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-tropa-oficial-astar", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927594.4347029, + "readyAt": 1794927594.4347029, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 2.474761724472046, + "startedAt": 1794927595.3398254, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.2090897560119629 + }, + { + "activityId": "estrada-real-local-0c3426a638-tropa-oficial-ucs", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927598.1009665, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-tropa-oficial-ucs", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.603032112121582, + "preparationFinishedAt": 1794927594.7564125, + "preparationStartedAt": 1794927594.5593038, + "pricePerSecond": 0, + "readyWaitSeconds": 0.0480656623840332, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 0.19710874557495117, + "transferWorkSeconds": 0.19710874557495117 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-tropa-oficial-ucs", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927594.47777, + "readyAt": 1794927594.47777, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 2.7415218353271484, + "startedAt": 1794927595.3594446, + "status": "completed", + "transferBytes": 7918944, + "transferSeconds": 0.19710874557495117 + }, + { + "activityId": "estrada-real-local-0c3426a638-compare", + "allocatedResourceId": "estrada-real-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "finishedAt": 1794927603.4679651, + "id": "estrada-real-local-0c3426a638-run-20261117t145937.986646313:estrada-real-local-0c3426a638-compare", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 1.0274670124053955, + "preparationFinishedAt": 1794927600.4703717, + "preparationStartedAt": 1794927598.652093, + "pricePerSecond": 0, + "readyWaitSeconds": 0.1379835605621338, + "runtimeId": "estrada-real-local-local", + "transferElapsedSeconds": 1.8182787895202637, + "transferWorkSeconds": 11.280918836593628 + }, + "overheadSeconds": 0, + "planAssignmentId": "estrada-real-local-0c3426a638-manual-plan-20261117t145937.916813291-estrada-real-local-0c3426a638-compare", + "plannedResourceId": "estrada-real-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927598.4891162, + "readyAt": 1794927598.4891162, + "runtimeId": "estrada-real-local-local", + "runtimeSeconds": 1.9701263904571533, + "startedAt": 1794927601.4978387, + "status": "completed", + "transferBytes": 16964324, + "transferSeconds": 11.280918836593628 + } + ] + }, + "runId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "status": "completed", + "workflowId": "estrada-real-local-0c3426a638", + "projectionScope": "Observed terminal run and activity timing records; complete event and transfer history remains available from the daemon execution API." +} diff --git a/scientific-workflows/estrada-real/evidence/execution-summary.json b/scientific-workflows/estrada-real/evidence/execution-summary.json new file mode 100644 index 0000000..cf42a5a --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/execution-summary.json @@ -0,0 +1,8 @@ +{ + "runId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "imageId": "sha256:22c0fa0da9d734498b20ddcb09f7765cfa1e4fab04e595c5401a3fcf2a238fd7", + "completedActivities": 11, + "observedMakespanSeconds": 24.28536081314087, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" +} diff --git a/scientific-workflows/estrada-real/evidence/independent-validation.json b/scientific-workflows/estrada-real/evidence/independent-validation.json new file mode 100644 index 0000000..59fdf61 --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/independent-validation.json @@ -0,0 +1 @@ +{"status": "passed", "validator": "independent artifact semantics, SHA-256 and scientific figure pixels", "showcase": "estrada-real", "artifacts": 5} diff --git a/scientific-workflows/estrada-real/evidence/manifest.json b/scientific-workflows/estrada-real/evidence/manifest.json new file mode 100644 index 0000000..ed4f18f --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/manifest.json @@ -0,0 +1,18 @@ +{ + "showcase": "estrada-real", + "status": "success", + "artifacts": [ + "comparison.csv", + "summary.csv", + "search-comparison.png", + "graph-map.png", + "scientific-validation.json" + ], + "sha256": { + "comparison.csv": "6084e3bc01c1fffb7f7e0fb25f2cb47ee6b73ec85af0150a2370b97c7f71838a", + "summary.csv": "a5cecb3474d9022c7cdbcc4a52426b17cd711354fd9f138beb59a8285690025f", + "search-comparison.png": "64e91c94004842e0cea0fe78c97ba148ec61756d2ef0f0f9a1903be1440ff3ac", + "graph-map.png": "30085db4b270b388a15b1fdb24f85e562602465e86813b6037dbafb06a6c53b2", + "scientific-validation.json": "4e2db6d398bb245c7fde47e4db839aba4a22c0246a0e1036cba6f1cbedff3610" + } +} diff --git a/scientific-workflows/estrada-real/evidence/python-packages.txt b/scientific-workflows/estrada-real/evidence/python-packages.txt new file mode 100644 index 0000000..2fc187b --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/python-packages.txt @@ -0,0 +1,23 @@ +cloudpickle==3.1.2 +contourpy==1.3.3 +cycler==0.12.1 +fonttools==4.68.0 +joblib==1.6.0 +kiwisolver==1.5.1 +matplotlib==3.9.2 +networkx==3.4.2 +numpy==1.26.4 +packaging==26.3 +pandas==2.2.3 +patsy==1.0.3 +pillow==13.0.0 +pyparsing==3.3.3 +pyreadr==0.5.2 +python-dateutil==4.0.0 +pytz==2026.6 +PyYAML==6.0.2 +scikit-learn==1.5.2 +scipy==1.14.1 +statsmodels==0.14.4 +threadpoolctl==3.8.0 +tzdata==2026.6 diff --git a/scientific-workflows/estrada-real/evidence/results-index.json b/scientific-workflows/estrada-real/evidence/results-index.json new file mode 100644 index 0000000..122ef6f --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/results-index.json @@ -0,0 +1,7 @@ +{ + "artifact": "comparison.csv", + "storedAs": "comparison.csv.gz", + "rows": 104004, + "uncompressedSha256": "6084e3bc01c1fffb7f7e0fb25f2cb47ee6b73ec85af0150a2370b97c7f71838a", + "storedSha256": "a304acf25b678066cc62914562dd57671c69b08177e5e690ceba7f4fbdd88d36" +} diff --git a/scientific-workflows/estrada-real/evidence/scientific-validation.json b/scientific-workflows/estrada-real/evidence/scientific-validation.json new file mode 100644 index 0000000..7be25c6 --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/scientific-validation.json @@ -0,0 +1,40 @@ +{ + "status": "passed", + "findings": { + "nodes": 108, + "directedEdges": 226, + "searches": 104004, + "greedyDivergences": 3715, + "paperGreedyDivergences": 3715, + "paperCountMatches": true, + "astarUcsAgreementPairs": 34668, + "originalNotebookCells": [ + 19, + 34, + 36 + ] + }, + "provenance": { + "slug": "estrada-real", + "title": "Estrada Real — informed search on a curated historical graph", + "authors": [ + "Davi Machado da Rocha" + ], + "conference": "XX Brazilian e-Science Workshop (BreSci 2026), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/44084", + "source": "https://zenodo.org/records/20867698", + "scope": "Re-execute the original UCS, Greedy and A* notebook functions over the complete frozen curated graph: 108 nodes, 226 directed edges, all 11,556 distinct ordered origin–destination pairs for each of three original cost profiles. Nine independent search activities produce 104,004 searches. This reproduces the search stage, not the upstream geographic source reconstruction. The paper reports 3,715 Greedy divergences; the workflow measures and reports actual agreement. Original data deposit: https://doi.org/10.5281/zenodo.20867698. Deposit metadata states CC BY 4.0; its README contains provisional code-license wording, so no broader code redistribution license is inferred.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence." + }, + "acquisition": { + "files": [ + { + "path": "artifacts.zip", + "url": "https://zenodo.org/records/20867698/files/zenodo_artefatos_20867698.zip?download=1", + "md5": "9af578d2d7d571fd6c38c5eeacd8e0ca", + "bytes": 3923709, + "sha256": "1ad4ed84b04f99665a5bed0122de19368dad093f8b0b93d2adb6fbd7cd5243ac" + } + ] + } +} diff --git a/scientific-workflows/estrada-real/evidence/summary.csv b/scientific-workflows/estrada-real/evidence/summary.csv new file mode 100644 index 0000000..7cf063d --- /dev/null +++ b/scientific-workflows/estrada-real/evidence/summary.csv @@ -0,0 +1,10 @@ +profile,algorithm,searches,mean_expanded,mean_cost +contrabandista,astar,11556,34.103669089650396,391.3196488682159 +contrabandista,greedy,11556,18.050536517826238,394.36158612639565 +contrabandista,ucs,11556,55.0,391.3196488682159 +tropa_oficial,astar,11556,36.42696434752509,517.8484408798755 +tropa_oficial,greedy,11556,18.050536517826238,521.5253979511324 +tropa_oficial,ucs,11556,55.0,517.8484408798755 +tropeiro,astar,11556,31.714866735894773,468.903249723913 +tropeiro,greedy,11556,18.050536517826238,472.0410330037655 +tropeiro,ucs,11556,55.0,468.903249723913 diff --git a/scientific-workflows/estrada-real/expected/render_execution.py b/scientific-workflows/estrada-real/expected/render_execution.py new file mode 100644 index 0000000..fd9861b --- /dev/null +++ b/scientific-workflows/estrada-real/expected/render_execution.py @@ -0,0 +1,28 @@ +from pathlib import Path +import hashlib,json +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +root=Path('/bundle') +r=json.loads((root/'evidence/daemon-run.json').read_text()) +a=r['projection']['activities'];assert len(a)==r['activityCount'] and all(x['status']=='completed' for x in a) +a=sorted(a,key=lambda x:x['startedAt']);start=min(x['startedAt'] for x in a) +fig,ax=plt.subplots(figsize=(12,max(4,len(a)*.3)),constrained_layout=True) +colors=plt.get_cmap('tab20') +for i,x in enumerate(a): + ax.barh(i,x['finishedAt']-x['startedAt'],left=x['startedAt']-start,color=colors(i%20),height=.7) +ax.set_yticks(range(len(a)),[x['activityId'].removeprefix(r['workflowId']+'-') for x in a],fontsize=8) +ax.invert_yaxis();ax.set_xlabel('Observed seconds from first activity start');ax.set_title(root.name+' — measured native daemon execution') +ax.spines[['top','right']].set_visible(False);ax.grid(axis='x',alpha=.2) +fig.savefig(root/'screenshots/current/execution-timeline.png',dpi=150) +current=0;peak=0 +for _,delta in sorted([(x['startedAt'],1) for x in a]+[(x['finishedAt'],-1) for x in a]):current+=delta;peak=max(peak,current) +summary={'runId':r['runId'],'imageId':r['imageId'],'completedActivities':len(a),'observedMakespanSeconds':r['projection']['run']['makespanSeconds'],'peakOverlappingActivities':peak,'timingSource':'observed native startedAt/finishedAt; imported predicted times excluded'} +(root/'evidence/execution-summary.json').write_text(json.dumps(summary,indent=2)+'\n') +p=root/'screenshots/current/manifest.json';m=json.loads(p.read_text());m['source']='scientific figures copied from completed daemon outputs; timeline derived from observed native activity times' +m['figures']['execution-timeline.png']=hashlib.sha256((root/'screenshots/current/execution-timeline.png').read_bytes()).hexdigest();m['executionSummary']=summary;p.write_text(json.dumps(m,indent=2,ensure_ascii=False)+'\n') +p=root/'README.md';s=p.read_text().split('\n## Observed parallel execution\n')[0];s=s.replace('Figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. They show actual computed results, not interface mockups.', 'Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results.') +s+='\n## Observed parallel execution\n\n'+f"The native run completed {len(a)} activities in **{summary['observedMakespanSeconds']:.2f} seconds**, with **{peak} overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline.\n\n![Measured execution timeline](screenshots/current/execution-timeline.png)\n" +p.write_text(s) +print(json.dumps(summary)) diff --git a/scientific-workflows/estrada-real/expected/validate.py b/scientific-workflows/estrada-real/expected/validate.py new file mode 100644 index 0000000..5b71f03 --- /dev/null +++ b/scientific-workflows/estrada-real/expected/validate.py @@ -0,0 +1,27 @@ +import hashlib +import io +import json +from pathlib import Path +import zipfile +import numpy as np +import pandas as pd +from PIL import Image + +out=Path('/outputs') +m=json.loads((out/'manifest.json').read_text()) +v=json.loads((out/'scientific-validation.json').read_text()) +assert m['status']=='success' and v['status']=='passed' +for name in m['artifacts']: + p=out/name + assert hashlib.sha256(p.read_bytes()).hexdigest()==m['sha256'][name],name + if p.suffix=='.png': + with Image.open(p) as image: + assert min(image.size)>100 and np.asarray(image).std()>1 + +df=pd.read_csv(out/'comparison.csv') +assert len(df)==104004 and (df.cost>0).all() +p=df.pivot(index=['profile','origin','destination'],columns='algorithm',values='cost') +assert len(p)==34668 and np.allclose(p.ucs,p.astar,atol=1e-6,rtol=0) +assert int((p.greedy-p.ucs>1e-6).sum())==3715 + +print(json.dumps({'status':'passed','validator':'independent artifact semantics, SHA-256 and scientific figure pixels','showcase':m['showcase'],'artifacts':len(m['artifacts'])})) diff --git a/scientific-workflows/estrada-real/prepare.sh b/scientific-workflows/estrada-real/prepare.sh new file mode 100755 index 0000000..03d1796 --- /dev/null +++ b/scientific-workflows/estrada-real/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +python3 "$root/scripts/acquire.py" +go run "$root/../../tools/showcase/main.go" -root "$root" -prepare-container diff --git a/scientific-workflows/estrada-real/requirements.txt b/scientific-workflows/estrada-real/requirements.txt new file mode 100644 index 0000000..fc39612 --- /dev/null +++ b/scientific-workflows/estrada-real/requirements.txt @@ -0,0 +1,9 @@ +numpy==1.26.4 +pandas==2.2.3 +scipy==1.14.1 +scikit-learn==1.5.2 +statsmodels==0.14.4 +matplotlib==3.9.2 +networkx==3.4.2 +pyreadr==0.5.2 +PyYAML==6.0.2 diff --git a/scientific-workflows/estrada-real/run.sh b/scientific-workflows/estrada-real/run.sh new file mode 100755 index 0000000..b487925 --- /dev/null +++ b/scientific-workflows/estrada-real/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +go run "$root/../../tools/showcase/main.go" -root "$root" -container -parallel "${AKOFLOW_PARALLEL:-3}" +if ! "$root/validate.sh"; then + rm -f "$root/outputs/manifest.json" + exit 1 +fi diff --git a/scientific-workflows/estrada-real/scope.yaml b/scientific-workflows/estrada-real/scope.yaml new file mode 100644 index 0000000..524cd2c --- /dev/null +++ b/scientific-workflows/estrada-real/scope.yaml @@ -0,0 +1,3 @@ +id: estrada-real-local-scope +name: estrada-real-local local scope +environmentVersionIds: [estrada-real-local-v1] diff --git a/scientific-workflows/estrada-real/screenshots/current/execution-timeline.png b/scientific-workflows/estrada-real/screenshots/current/execution-timeline.png new file mode 100644 index 0000000..ea15fc2 Binary files /dev/null and b/scientific-workflows/estrada-real/screenshots/current/execution-timeline.png differ diff --git a/scientific-workflows/estrada-real/screenshots/current/graph-map.png b/scientific-workflows/estrada-real/screenshots/current/graph-map.png new file mode 100644 index 0000000..73cff0f Binary files /dev/null and b/scientific-workflows/estrada-real/screenshots/current/graph-map.png differ diff --git a/scientific-workflows/estrada-real/screenshots/current/manifest.json b/scientific-workflows/estrada-real/screenshots/current/manifest.json new file mode 100644 index 0000000..40dc9f9 --- /dev/null +++ b/scientific-workflows/estrada-real/screenshots/current/manifest.json @@ -0,0 +1,33 @@ +{ + "runId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "image": "akoflow-local/estrada-real:local-22c0fa0da9d73449", + "imageId": "sha256:22c0fa0da9d734498b20ddcb09f7765cfa1e4fab04e595c5401a3fcf2a238fd7", + "source": "scientific figures copied from completed daemon outputs; timeline derived from observed native activity times", + "figures": { + "graph-map.png": "30085db4b270b388a15b1fdb24f85e562602465e86813b6037dbafb06a6c53b2", + "search-comparison.png": "64e91c94004842e0cea0fe78c97ba148ec61756d2ef0f0f9a1903be1440ff3ac", + "execution-timeline.png": "6893c353083743338c3ae0cf69dcc83469805d64a202bf08526130c36259aa47" + }, + "findings": { + "nodes": 108, + "directedEdges": 226, + "searches": 104004, + "greedyDivergences": 3715, + "paperGreedyDivergences": 3715, + "paperCountMatches": true, + "astarUcsAgreementPairs": 34668, + "originalNotebookCells": [ + 19, + 34, + 36 + ] + }, + "executionSummary": { + "runId": "estrada-real-local-0c3426a638-run-20261117t145937.986646313", + "imageId": "sha256:22c0fa0da9d734498b20ddcb09f7765cfa1e4fab04e595c5401a3fcf2a238fd7", + "completedActivities": 11, + "observedMakespanSeconds": 24.28536081314087, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" + } +} diff --git a/scientific-workflows/estrada-real/screenshots/current/search-comparison.png b/scientific-workflows/estrada-real/screenshots/current/search-comparison.png new file mode 100644 index 0000000..12e4446 Binary files /dev/null and b/scientific-workflows/estrada-real/screenshots/current/search-comparison.png differ diff --git a/scientific-workflows/estrada-real/scripts/acquire.py b/scientific-workflows/estrada-real/scripts/acquire.py new file mode 100644 index 0000000..2ec5a91 --- /dev/null +++ b/scientific-workflows/estrada-real/scripts/acquire.py @@ -0,0 +1,48 @@ +import hashlib +import json +from pathlib import Path +import urllib.request +import time + +root = Path(__file__).resolve().parents[1] +data = root / 'data' +config = json.loads((data / 'sources.json').read_text()) +previous = {} +if (data / 'acquisition.json').exists(): + previous = {f['path']: f for f in json.loads((data / 'acquisition.json').read_text())['files']} +receipts = [] +for item in config['files']: + target = data / 'inputs' / item['path'] + target.parent.mkdir(parents=True, exist_ok=True) + old = previous.get(item['path'], {}) + pinned = item.get('sha256') or (old.get('sha256') if old.get('url') == item['url'] else None) + if target.exists() and old.get('url') == item['url']: + expected = item.get('sha256', old.get('sha256')) + observed = hashlib.sha256(target.read_bytes()).hexdigest() + if expected == observed: + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + continue + temp = target.with_suffix(target.suffix + '.partial') + for attempt in range(4): + try: + request = urllib.request.Request(item['url'], headers={'User-Agent': 'Akoflow-scientific-reproduction/1.0'}) + with urllib.request.urlopen(request, timeout=120) as src, temp.open('wb') as dst: + while chunk := src.read(1024 * 1024): + dst.write(chunk) + observed = hashlib.sha256(temp.read_bytes()).hexdigest() + if pinned and pinned != observed: + raise RuntimeError('Pinned SHA256 mismatch: ' + item['path']) + if item.get('md5') and hashlib.md5(temp.read_bytes()).hexdigest() != item['md5']: + raise RuntimeError('Vendor MD5 mismatch: ' + item['path']) + if item.get('bytes') and temp.stat().st_size != item['bytes']: + raise RuntimeError('Length mismatch: ' + item['path']) + temp.replace(target) + break + except Exception: + temp.unlink(missing_ok=True) + if attempt == 3: + raise + time.sleep(2 ** attempt) + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + print('Verified', item['path'], target.stat().st_size, flush=True) +(data / 'acquisition.json').write_text(json.dumps({'files': receipts}, indent=2) + '\n') diff --git a/scientific-workflows/estrada-real/scripts/common.py b/scientific-workflows/estrada-real/scripts/common.py new file mode 100644 index 0000000..35a6f20 --- /dev/null +++ b/scientific-workflows/estrada-real/scripts/common.py @@ -0,0 +1,50 @@ +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import numpy as np +import pandas as pd +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +ROOT = Path(__file__).resolve().parents[1] +DATA = ROOT / 'data' +plt.rcParams.update({'figure.dpi': 150, 'axes.spines.top': False, 'axes.spines.right': False}) + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + +def write(path, value): + Path(path).write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') + +def inputs(): + receipt = json.loads((DATA / 'acquisition.json').read_text()) + for item in receipt['files']: + p = DATA / 'inputs' / item['path'] + if digest(p) != item['sha256']: + raise RuntimeError('Input checksum mismatch: ' + str(p)) + return receipt + +def finish(output, artifacts, findings): + provenance = json.loads((DATA / 'provenance.json').read_text()) + write(output / 'scientific-validation.json', {'status': 'passed', 'findings': findings, 'provenance': provenance, 'acquisition': inputs()}) + artifacts = artifacts + ['scientific-validation.json'] + for name in artifacts: + if not (output / name).is_file() or (output / name).stat().st_size == 0: + raise RuntimeError('Missing artifact: ' + name) + write(output / 'manifest.json', {'showcase': provenance['slug'], 'status': 'success', 'artifacts': artifacts, 'sha256': {n: digest(output / n) for n in artifacts}}) + +def arguments(): + parser = argparse.ArgumentParser() + parser.add_argument('--stage', required=True) + parser.add_argument('--output', required=True) + a = parser.parse_args() + out = Path(a.output).resolve() + out.mkdir(parents=True, exist_ok=True) + return a.stage, out diff --git a/scientific-workflows/estrada-real/scripts/run_stage.py b/scientific-workflows/estrada-real/scripts/run_stage.py new file mode 100644 index 0000000..ceec8c5 --- /dev/null +++ b/scientific-workflows/estrada-real/scripts/run_stage.py @@ -0,0 +1,65 @@ +from common import * +import zipfile +import networkx as nx + +stage, out = arguments() +with zipfile.ZipFile(DATA / 'inputs/artifacts.zip') as z: + graph = json.loads(z.read('grafo\\estrada_real_graph_unified.json')) + notebook = json.loads(z.read('Estrada_real_final.ipynb')) +if stage == 'validate-graph': + inputs() + ids = {n['node_id'] for n in graph['nodes']} + assert len(ids) == 108 and len(graph['edges']) == 226 + assert all(e['source'] in ids and e['target'] in ids and e['distance_km'] > 0 for e in graph['edges']) + write(out / 'graph.json', graph) +elif stage == 'compare': + cfg=json.loads((DATA / 'dag.json').read_text()) + frames=[] + for a in cfg['spec']['activities']: + if a['name'] not in ['validate-graph','compare']: + frames.append(pd.read_csv(out / (a['name']+'.csv'))) + df=pd.concat(frames,ignore_index=True) + assert len(df) == 104004 + keys=['profile','origin','destination'] + pivot=df.pivot(index=keys,columns='algorithm',values='cost') + assert np.allclose(pivot.ucs,pivot.astar,rtol=0,atol=1e-6) + divergences=int((pivot.greedy-pivot.ucs>1e-6).sum()) + assert (pivot.greedy>=pivot.ucs-1e-6).all() + df.to_csv(out/'comparison.csv',index=False) + summary=df.groupby(['profile','algorithm']).agg(searches=('cost','size'),mean_expanded=('expanded','mean'),mean_cost=('cost','mean')).reset_index() + summary.to_csv(out/'summary.csv',index=False) + fig,axes=plt.subplots(1,2,figsize=(13,5),constrained_layout=True) + for algo in ['ucs','greedy','astar']: + s=summary[summary.algorithm==algo] + axes[0].plot(s.profile,s.mean_expanded,marker='o',label=algo) + axes[0].set_ylabel('Mean expanded nodes');axes[0].legend();axes[0].set_title('All ordered origin–destination pairs') + ratios=pivot.greedy/pivot.ucs + axes[1].hist(ratios,bins=40,color='#486a93');axes[1].set_xlabel('Greedy cost / optimal cost');axes[1].set_ylabel('Pairs × profiles');axes[1].set_title(f'{divergences:,} Greedy divergences; A* = UCS for all pairs') + fig.savefig(out/'search-comparison.png');plt.close(fig) + G=nx.DiGraph() + positions={n['node_id']:(n['lon'],n['lat']) for n in graph['nodes']} + for e in graph['edges']:G.add_edge(e['source'],e['target']) + fig,ax=plt.subplots(figsize=(9,10),constrained_layout=True) + nx.draw_networkx_edges(G,positions,ax=ax,arrows=False,alpha=.4,width=.6) + nx.draw_networkx_nodes(G,positions,ax=ax,node_size=12,node_color='#253f67') + ax.set_axis_on();ax.set_xlabel('Longitude');ax.set_ylabel('Latitude');ax.set_title('Estrada Real — original curated graph: 108 nodes / 226 directed edges') + fig.savefig(out/'graph-map.png');plt.close(fig) + finish(out,['comparison.csv','summary.csv','search-comparison.png','graph-map.png'],{'nodes':108,'directedEdges':226,'searches':len(df),'greedyDivergences':divergences,'paperGreedyDivergences':3715,'paperCountMatches':divergences==3715,'astarUcsAgreementPairs':len(pivot),'originalNotebookCells':[19,34,36]}) +else: + graph=json.loads((out/'graph.json').read_text()) + env={'graph':graph} + for index in [19,34,36]: + exec(compile(''.join(notebook['cells'][index]['source']),'original-notebook-cell-'+str(index),'exec'),env) + char,algo=stage.rsplit('-',1);char=char.replace('-','_') + fn=env[{'ucs':'search_ucs','greedy':'search_greedy','astar':'search_astar'}[algo]] + rows=[];G=env['G'] + for origin in G: + for destination in G: + if origin==destination:continue + r=fn(G,origin,destination,char) + assert r is not None + assert r['path'][0]==origin and r['path'][-1]==destination + independent=sum(env['edge_cost'](G.edges[a,b],char) for a,b in zip(r['path'],r['path'][1:])) + assert abs(independent-r['cost'])<1e-6 + rows.append({'profile':char,'algorithm':algo,'origin':origin,'destination':destination,'cost':r['cost'],'expanded':r['expanded'],'time_ms':r['time_ms']}) + pd.DataFrame(rows).to_csv(out/(stage+'.csv'),index=False) diff --git a/scientific-workflows/estrada-real/scripts/validate.py b/scientific-workflows/estrada-real/scripts/validate.py new file mode 100644 index 0000000..1a846f9 --- /dev/null +++ b/scientific-workflows/estrada-real/scripts/validate.py @@ -0,0 +1,11 @@ +import json +from pathlib import Path +from common import digest +root = Path(__file__).resolve().parents[1] +out = root / 'outputs' +m = json.loads((out / 'manifest.json').read_text()) +v = json.loads((out / 'scientific-validation.json').read_text()) +assert m['status'] == 'success' and v['status'] == 'passed' +for name in m['artifacts']: + assert digest(out / name) == m['sha256'][name], name +print(json.dumps(v['findings'], ensure_ascii=False)) diff --git a/scientific-workflows/estrada-real/topology.yaml b/scientific-workflows/estrada-real/topology.yaml new file mode 100644 index 0000000..280b776 --- /dev/null +++ b/scientific-workflows/estrada-real/topology.yaml @@ -0,0 +1,5 @@ +id: estrada-real-local-topology +name: estrada-real-local local topology +version: 1 +executionScopeId: estrada-real-local-scope +links: [] diff --git a/scientific-workflows/estrada-real/validate.sh b/scientific-workflows/estrada-real/validate.sh new file mode 100755 index 0000000..8822ed5 --- /dev/null +++ b/scientific-workflows/estrada-real/validate.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +result="${AKOFLOW_RESULT_DIR:-$root/outputs}" +docker run --rm --network none --mount "type=bind,src=$result,dst=/outputs,readonly" --mount "type=bind,src=$root/expected,dst=/verification,readonly" --entrypoint python akoflow-local/estrada-real:workload /verification/validate.py diff --git a/scientific-workflows/estrada-real/workflow.yaml b/scientific-workflows/estrada-real/workflow.yaml new file mode 100644 index 0000000..a8f2fb9 --- /dev/null +++ b/scientific-workflows/estrada-real/workflow.yaml @@ -0,0 +1,239 @@ +name: estrada-real +spec: + namespace: akoflow-examples + image: akoflow-local/estrada-real:workload + activities: + - name: validate-graph + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: [] + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - validate-graph + - --output + - . + - name: tropeiro-ucs + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - tropeiro-ucs + - --output + - . + - name: tropeiro-greedy + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - tropeiro-greedy + - --output + - . + - name: tropeiro-astar + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - tropeiro-astar + - --output + - . + - name: contrabandista-ucs + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - contrabandista-ucs + - --output + - . + - name: contrabandista-greedy + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - contrabandista-greedy + - --output + - . + - name: contrabandista-astar + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - contrabandista-astar + - --output + - . + - name: tropa-oficial-ucs + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - tropa-oficial-ucs + - --output + - . + - name: tropa-oficial-greedy + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - tropa-oficial-greedy + - --output + - . + - name: tropa-oficial-astar + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-graph + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - tropa-oficial-astar + - --output + - . + - name: compare + runtime: estrada-real-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - tropeiro-ucs + - tropeiro-greedy + - tropeiro-astar + - contrabandista-ucs + - contrabandista-greedy + - contrabandista-astar + - tropa-oficial-ucs + - tropa-oficial-greedy + - tropa-oficial-astar + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - compare + - --output + - . + dataDependencies: + - producerActivity: validate-graph + consumerActivity: tropeiro-ucs + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: tropeiro-greedy + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: tropeiro-astar + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: contrabandista-ucs + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: contrabandista-greedy + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: contrabandista-astar + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: tropa-oficial-ucs + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: tropa-oficial-greedy + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: validate-graph + consumerActivity: tropa-oficial-astar + logicalName: graph.json + sizeBytes: 10000000 + - producerActivity: tropeiro-ucs + consumerActivity: compare + logicalName: tropeiro-ucs.csv + sizeBytes: 10000000 + - producerActivity: tropeiro-greedy + consumerActivity: compare + logicalName: tropeiro-greedy.csv + sizeBytes: 10000000 + - producerActivity: tropeiro-astar + consumerActivity: compare + logicalName: tropeiro-astar.csv + sizeBytes: 10000000 + - producerActivity: contrabandista-ucs + consumerActivity: compare + logicalName: contrabandista-ucs.csv + sizeBytes: 10000000 + - producerActivity: contrabandista-greedy + consumerActivity: compare + logicalName: contrabandista-greedy.csv + sizeBytes: 10000000 + - producerActivity: contrabandista-astar + consumerActivity: compare + logicalName: contrabandista-astar.csv + sizeBytes: 10000000 + - producerActivity: tropa-oficial-ucs + consumerActivity: compare + logicalName: tropa-oficial-ucs.csv + sizeBytes: 10000000 + - producerActivity: tropa-oficial-greedy + consumerActivity: compare + logicalName: tropa-oficial-greedy.csv + sizeBytes: 10000000 + - producerActivity: tropa-oficial-astar + consumerActivity: compare + logicalName: tropa-oficial-astar.csv + sizeBytes: 10000000 diff --git a/scientific-workflows/inmet/.dockerignore b/scientific-workflows/inmet/.dockerignore new file mode 100644 index 0000000..f7c11d3 --- /dev/null +++ b/scientific-workflows/inmet/.dockerignore @@ -0,0 +1,5 @@ +outputs +screenshots +evidence +.venv +**/__pycache__ diff --git a/scientific-workflows/inmet/.gitignore b/scientific-workflows/inmet/.gitignore new file mode 100644 index 0000000..194ed53 --- /dev/null +++ b/scientific-workflows/inmet/.gitignore @@ -0,0 +1,3 @@ +data/inputs/ +outputs/ +outputs-daemon/ diff --git a/scientific-workflows/inmet/README.md b/scientific-workflows/inmet/README.md new file mode 100644 index 0000000..0c25498 --- /dev/null +++ b/scientific-workflows/inmet/README.md @@ -0,0 +1,91 @@ +# INMET — São Paulo meteorological observations, 2013–2022 + +Conference tags: `bresci`, `bresci-2025`. [Browse BreSci on the Hub](https://hub.akoflow.com/categories/bresci). + +Adapted from **XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD**. Original authors: **Rosa Virginia Encinas Quille, Felipe Valencia de Almeida, Danielle Monteiro, Pedro Luiz Pizzigatti Corrêa**. + +[Original paper](https://sol.sbc.org.br/index.php/bresci/article/view/36912) · [Original code and data](https://zenodo.org/records/16864784) + +## Scientific scope + +Process all original hourly CSVs for São Paulo–Mirante station A701 from 2013 through 2022, the station and period illustrated by the paper. Execute the original notebook ingestion/normalization and cleaning definitions (cells 16 and 20), then generate noninteractive temperature, precipitation and humidity analyses. Yearly ingestion activities are independent; the original cleaning runs once after concatenation, preserving cross-year filling. Raw inputs come from the nested dataset.zip in the original Zenodo deposit, acquired by verified ZIP members through HTTP byte ranges. The entire 1.92 GB parent archive is not downloaded or claimed to have a newly verified global hash; extracted member CRC and SHA-256 are checked. Original notebook and data: CC BY 4.0. INMET source portal: https://portal.inmet.gov.br/dadoshistoricos . No processed author outputs are used as computation inputs. + +This is an adaptation of the cited scientific application to native AkôFlow activities. It is not a claim of exact agreement with the paper. Source URLs, immutable revisions and input SHA-256 hashes are recorded in `data/sources.json` and `data/acquisition.json`. Original authors retain authorship of the scientific methods and artifacts; the AkôFlow contribution is orchestration, packaging and validation. + +## Execute + +[Original input URL manifest](data/sources.json) · [Verified input SHA-256 receipts](data/acquisition.json) · [Scientific provenance](data/provenance.json) + +```sh +./prepare.sh +./run.sh +``` + +Preparation acquires original inputs and builds the image. All computation then executes with networking disabled. No synthetic fallback replaces unavailable original data. `AKOFLOW_PARALLEL` controls standalone concurrency. + +To register and execute in Desktop through the local daemon, from the repository root: + +```sh +go run ./tools/daemon-local -example scientific-workflows/inmet -env-file /path/to/installation.env -api-url http://YOUR_DAEMON:8080/akoflow-api -lanes 3 +``` + +Tracking item: [AKO-46](https://github.com/UFFeScience/akoflow-examples/issues/46). + +The daemon records the exact image and execution identity in `evidence/daemon-run.json`. `workflow.yaml` declares dependencies and explicit artifact transfers. `outputs/scientific-validation.json` contains semantic checks and findings. A successful exit alone is not a scientific validation. + +## Results + +Native daemon run `inmet-local-1514940793-run-20261117t151423.285983342` completed **16/16 activities**. Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results. + +Findings: + +```json +{ + "rawRows": 87648, + "cleanedRows": 87252, + "removedRows": 396, + "station": "A701", + "start": "2013-01-01 00:00:00", + "end": "2022-12-31 23:00:00", + "originalNotebookCells": [ + 16, + 20 + ], + "variables": { + "temperature": { + "observations": 87252, + "minimum": 4.1, + "maximum": 37.3, + "mean": 20.490728006234818 + }, + "precipitation": { + "observations": 87252, + "minimum": 0.0, + "maximum": 77.8, + "mean": 0.1712808875441251 + }, + "humidity": { + "observations": 87252, + "minimum": 12.0, + "maximum": 98.0, + "mean": 68.80686975656718 + } + } +} +``` + +![result humidity](screenshots/current/result-humidity.png) + +![result precipitation](screenshots/current/result-precipitation.png) + +![result temperature](screenshots/current/result-temperature.png) + +## Observed parallel execution + +The native run completed 16 activities in **36.55 seconds**, with **3 overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline. + +![Measured execution timeline](screenshots/current/execution-timeline.png) + +Python dependency versions from the measured image are retained in [`evidence/python-packages.txt`](evidence/python-packages.txt). Independent post-run validation is recorded in [`evidence/independent-validation.json`](evidence/independent-validation.json). + +To regenerate the execution timeline from an observed run, mount this bundle at `/bundle` in its measured image and run `python /bundle/expected/render_execution.py`. The renderer uses `evidence/daemon-run.json`; predicted schedule times are excluded. diff --git a/scientific-workflows/inmet/data/acquisition.json b/scientific-workflows/inmet/data/acquisition.json new file mode 100644 index 0000000..7acb2e3 --- /dev/null +++ b/scientific-workflows/inmet/data/acquisition.json @@ -0,0 +1,80 @@ +{ + "files": [ + { + "path": "original.ipynb", + "url": "https://zenodo.org/records/16864784/files/INMETDataTool_v4.0.ipynb?download=1", + "sha256": "63bb2e19e30ec28fa766269155a8b18a05b1b1921a38e477cfdf24f7e8d44315", + "bytes": 235769 + }, + { + "path": "raw/2013/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2013_A_31-12-2013.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "5f2a45f7be8129d373f937418de8b00f46e4ae6fc27fd7518ff772fcef13d8ba", + "bytes": 805357, + "archiveMember": "dataset/dataset.zip!/2013/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2013_A_31-12-2013.CSV" + }, + { + "path": "raw/2014/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2014_A_31-12-2014.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "6690c2d8364def66d5df1daecdbd7ca408e4f3ea2d681a2ed8e0696a94d4ab55", + "bytes": 811595, + "archiveMember": "dataset/dataset.zip!/2014/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2014_A_31-12-2014.CSV" + }, + { + "path": "raw/2015/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2015_A_31-12-2015.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "a0c96324f7c0d534f9e690f2a5178616281339d6de73647ada97e5f102eb78d2", + "bytes": 806900, + "archiveMember": "dataset/dataset.zip!/2015/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2015_A_31-12-2015.CSV" + }, + { + "path": "raw/2016/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2016_A_31-12-2016.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "9989f6f158c83059b0a54d35842f66f159f2b5049952dff6986ba515517816fc", + "bytes": 809609, + "archiveMember": "dataset/dataset.zip!/2016/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2016_A_31-12-2016.CSV" + }, + { + "path": "raw/2017/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2017_A_31-12-2017.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "1bac9171eb8660d5a282dc724913f7efeba52afdde7b93e6c6387b7f6465912f", + "bytes": 808768, + "archiveMember": "dataset/dataset.zip!/2017/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2017_A_31-12-2017.CSV" + }, + { + "path": "raw/2018/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2018_A_31-12-2018.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "1bec33fd03bd0179a0e0a4b194578727468baac0af6bf524bf2d820a01d447d4", + "bytes": 807097, + "archiveMember": "dataset/dataset.zip!/2018/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2018_A_31-12-2018.CSV" + }, + { + "path": "raw/2019/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2019_A_31-12-2019.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "51527c56c4ff94d005f69bd2d5d1d167a478d7882e398f6e059ee989522a5b6c", + "bytes": 811521, + "archiveMember": "dataset/dataset.zip!/2019/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2019_A_31-12-2019.CSV" + }, + { + "path": "raw/2020/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2020_A_31-12-2020.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "aec112b14d90797dcd905c8a5932fb4eb09015582f459edbf3b7a4a8cdafed12", + "bytes": 813664, + "archiveMember": "dataset/dataset.zip!/2020/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2020_A_31-12-2020.CSV" + }, + { + "path": "raw/2021/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2021_A_31-12-2021.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "815c01daf4a6da98d26517b0214932a0754fa5cf997a79ce726516b50192fef1", + "bytes": 802037, + "archiveMember": "dataset/dataset.zip!/2021/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2021_A_31-12-2021.CSV" + }, + { + "path": "raw/2022/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2022_A_31-12-2022.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "ceb3a4cde159602228959b96c32eb46134f37b9b3b84c90126d8cbf169d8d088", + "bytes": 811830, + "archiveMember": "dataset/dataset.zip!/2022/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2022_A_31-12-2022.CSV" + } + ] +} diff --git a/scientific-workflows/inmet/data/dag.json b/scientific-workflows/inmet/data/dag.json new file mode 100644 index 0000000..4aa0a58 --- /dev/null +++ b/scientific-workflows/inmet/data/dag.json @@ -0,0 +1,511 @@ +{ + "name": "inmet", + "spec": { + "namespace": "akoflow-examples", + "image": "akoflow-local/inmet:workload", + "activities": [ + { + "name": "validate-inputs", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "validate-inputs", + "--output", + "." + ] + } + }, + { + "name": "ingest-2013", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2013", + "--output", + "." + ] + } + }, + { + "name": "ingest-2014", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2014", + "--output", + "." + ] + } + }, + { + "name": "ingest-2015", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2015", + "--output", + "." + ] + } + }, + { + "name": "ingest-2016", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2016", + "--output", + "." + ] + } + }, + { + "name": "ingest-2017", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2017", + "--output", + "." + ] + } + }, + { + "name": "ingest-2018", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2018", + "--output", + "." + ] + } + }, + { + "name": "ingest-2019", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2019", + "--output", + "." + ] + } + }, + { + "name": "ingest-2020", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2020", + "--output", + "." + ] + } + }, + { + "name": "ingest-2021", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2021", + "--output", + "." + ] + } + }, + { + "name": "ingest-2022", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "ingest-2022", + "--output", + "." + ] + } + }, + { + "name": "clean", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "ingest-2013", + "ingest-2014", + "ingest-2015", + "ingest-2016", + "ingest-2017", + "ingest-2018", + "ingest-2019", + "ingest-2020", + "ingest-2021", + "ingest-2022" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "clean", + "--output", + "." + ] + } + }, + { + "name": "temperature", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "clean" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "temperature", + "--output", + "." + ] + } + }, + { + "name": "precipitation", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "clean" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "precipitation", + "--output", + "." + ] + } + }, + { + "name": "humidity", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "clean" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "humidity", + "--output", + "." + ] + } + }, + { + "name": "compare", + "runtime": "inmet-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "temperature", + "precipitation", + "humidity", + "clean" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "compare", + "--output", + "." + ] + } + } + ], + "dataDependencies": [ + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2013", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2014", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2015", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2016", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2017", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2018", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2019", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2020", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2021", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "ingest-2022", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2013", + "consumerActivity": "clean", + "logicalName": "raw-2013.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2014", + "consumerActivity": "clean", + "logicalName": "raw-2014.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2015", + "consumerActivity": "clean", + "logicalName": "raw-2015.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2016", + "consumerActivity": "clean", + "logicalName": "raw-2016.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2017", + "consumerActivity": "clean", + "logicalName": "raw-2017.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2018", + "consumerActivity": "clean", + "logicalName": "raw-2018.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2019", + "consumerActivity": "clean", + "logicalName": "raw-2019.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2020", + "consumerActivity": "clean", + "logicalName": "raw-2020.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2021", + "consumerActivity": "clean", + "logicalName": "raw-2021.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "ingest-2022", + "consumerActivity": "clean", + "logicalName": "raw-2022.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "clean", + "consumerActivity": "temperature", + "logicalName": "cleaned.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "clean", + "consumerActivity": "precipitation", + "logicalName": "cleaned.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "clean", + "consumerActivity": "humidity", + "logicalName": "cleaned.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "temperature", + "consumerActivity": "compare", + "logicalName": "temperature.png", + "sizeBytes": 10000000 + }, + { + "producerActivity": "temperature", + "consumerActivity": "compare", + "logicalName": "temperature.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "precipitation", + "consumerActivity": "compare", + "logicalName": "precipitation.png", + "sizeBytes": 10000000 + }, + { + "producerActivity": "precipitation", + "consumerActivity": "compare", + "logicalName": "precipitation.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "humidity", + "consumerActivity": "compare", + "logicalName": "humidity.png", + "sizeBytes": 10000000 + }, + { + "producerActivity": "humidity", + "consumerActivity": "compare", + "logicalName": "humidity.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "clean", + "consumerActivity": "compare", + "logicalName": "cleaned.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "clean", + "consumerActivity": "compare", + "logicalName": "cleaning.json", + "sizeBytes": 10000000 + } + ] + } +} diff --git a/scientific-workflows/inmet/data/members.json b/scientific-workflows/inmet/data/members.json new file mode 100644 index 0000000..62fdfec --- /dev/null +++ b/scientific-workflows/inmet/data/members.json @@ -0,0 +1,16 @@ +{ + "offset": 15207, + "length": 1818600755, + "names": [ + "2013/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2013_A_31-12-2013.CSV", + "2014/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2014_A_31-12-2014.CSV", + "2015/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2015_A_31-12-2015.CSV", + "2016/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2016_A_31-12-2016.CSV", + "2017/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2017_A_31-12-2017.CSV", + "2018/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2018_A_31-12-2018.CSV", + "2019/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2019_A_31-12-2019.CSV", + "2020/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2020_A_31-12-2020.CSV", + "2021/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2021_A_31-12-2021.CSV", + "2022/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2022_A_31-12-2022.CSV" + ] +} diff --git a/scientific-workflows/inmet/data/provenance.json b/scientific-workflows/inmet/data/provenance.json new file mode 100644 index 0000000..bee05d2 --- /dev/null +++ b/scientific-workflows/inmet/data/provenance.json @@ -0,0 +1,21 @@ +{ + "slug": "inmet", + "title": "INMET — São Paulo meteorological observations, 2013–2022", + "authors": [ + "Rosa Virginia Encinas Quille", + "Felipe Valencia de Almeida", + "Danielle Monteiro", + "Pedro Luiz Pizzigatti Corrêa" + ], + "conference": "XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/36912", + "source": "https://zenodo.org/records/16864784", + "scope": "Process all original hourly CSVs for São Paulo–Mirante station A701 from 2013 through 2022, the station and period illustrated by the paper. Execute the original notebook ingestion/normalization and cleaning definitions (cells 16 and 20), then generate noninteractive temperature, precipitation and humidity analyses. Yearly ingestion activities are independent; the original cleaning runs once after concatenation, preserving cross-year filling. Raw inputs come from the nested dataset.zip in the original Zenodo deposit, acquired by verified ZIP members through HTTP byte ranges. The entire 1.92 GB parent archive is not downloaded or claimed to have a newly verified global hash; extracted member CRC and SHA-256 are checked. Original notebook and data: CC BY 4.0. INMET source portal: https://portal.inmet.gov.br/dadoshistoricos . No processed author outputs are used as computation inputs.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence.", + "tags": [ + "bresci", + "bresci-2025", + "scientific-reproducibility", + "scientific-workflows" + ] +} diff --git a/scientific-workflows/inmet/data/sources.json b/scientific-workflows/inmet/data/sources.json new file mode 100644 index 0000000..36f3470 --- /dev/null +++ b/scientific-workflows/inmet/data/sources.json @@ -0,0 +1,17 @@ +{ + "notebook": "https://zenodo.org/records/16864784/files/INMETDataTool_v4.0.ipynb?download=1", + "archive": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "members": [ + "2013/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2013_A_31-12-2013.CSV", + "2014/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2014_A_31-12-2014.CSV", + "2015/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2015_A_31-12-2015.CSV", + "2016/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2016_A_31-12-2016.CSV", + "2017/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2017_A_31-12-2017.CSV", + "2018/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2018_A_31-12-2018.CSV", + "2019/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2019_A_31-12-2019.CSV", + "2020/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2020_A_31-12-2020.CSV", + "2021/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2021_A_31-12-2021.CSV", + "2022/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2022_A_31-12-2022.CSV" + ], + "record": "https://doi.org/10.5281/zenodo.16864784" +} diff --git a/scientific-workflows/inmet/docker/Dockerfile b/scientific-workflows/inmet/docker/Dockerfile new file mode 100644 index 0000000..4269c68 --- /dev/null +++ b/scientific-workflows/inmet/docker/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.11.13-slim-bookworm@sha256:86adf8dbadc3d6e82ee5dd2c74bec2e1c2467cdad47886280501df722372d2e1 +ENV MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 PYTHONDONTWRITEBYTECODE=1 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY scripts /app/scripts +COPY data /app/data diff --git a/scientific-workflows/inmet/environment.yaml b/scientific-workflows/inmet/environment.yaml new file mode 100644 index 0000000..6715c1f --- /dev/null +++ b/scientific-workflows/inmet/environment.yaml @@ -0,0 +1,42 @@ +environment: + id: inmet-local + name: inmet-local local Docker + description: CPU-only local execution; no remote capacity is provisioned + status: ready +version: + id: inmet-local-v1 + environmentId: inmet-local + version: 1 + status: published + networkModel: local + interferenceModel: none + costModel: free + configurationHash: inmet-local-v1 +runtimes: + - environmentVersionId: inmet-local-v1 + id: inmet-local-local + name: Local Docker host + driver: local + mode: execution + role: compute + capabilities: {batch: true, container: true} +resources: + - id: inmet-local-local-docker + environmentVersionId: inmet-local-v1 + type: machine + name: Local Docker host + providerId: local-docker + cpuCores: 4 + cpuCapacity: 4 + memoryBytes: 8589934592 + storageBytes: 21474836480 + computeSpeedup: 1 + pricePerSecond: 0 + bootOverheadSeconds: 0 + containerOverheadSeconds: 0 + schedulable: true +storages: [] +connections: [] +activityResourceProfiles: [] +resourceRuntimeBindings: + - {resourceId: inmet-local-local-docker, runtimeId: inmet-local-local, enabled: true} diff --git a/scientific-workflows/inmet/evidence/daemon-run.json b/scientific-workflows/inmet/evidence/daemon-run.json new file mode 100644 index 0000000..3e8d753 --- /dev/null +++ b/scientific-workflows/inmet/evidence/daemon-run.json @@ -0,0 +1,567 @@ +{ + "activityCount": 16, + "completedActivityCount": 16, + "image": "akoflow-local/inmet:local-5c61428db82753d2", + "imageId": "sha256:5c61428db82753d20bb9ae9c3dea95d1e77e055afb4b5af80e2d5242fa643823", + "observedAt": "2026-11-17T15:15:03Z", + "planId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016", + "projection": { + "run": { + "activityCount": 16, + "breakdown": { + "computeSeconds": 24.53056263923645, + "interferenceSeconds": 0, + "overheadSeconds": 0, + "queueSeconds": 0, + "transferSeconds": 18.421331644058228 + }, + "completedActivityCount": 16, + "cost": 0, + "environmentNames": [ + "inmet-local local Docker" + ], + "finishedAt": "2026-11-17T15:15:02Z", + "id": "inmet-local-1514940793-run-20261117t151423.285983342", + "kind": "workflow", + "makespanSeconds": 36.5455048084259, + "mode": "real", + "schedulePlanId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016", + "seed": 0, + "startedAt": "2026-11-17T15:14:23Z", + "status": "completed", + "title": "inmet-local-1514940793-run-20261117t151423.285983342", + "transferredBytes": 138644103, + "workflowId": "inmet-local-1514940793", + "workflowName": "inmet-local-1514940793", + "workflowVersionId": "inmet-local-1514940793-v1" + }, + "activities": [ + { + "activityId": "inmet-local-1514940793-validate-inputs", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928465.8016505, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-validate-inputs", + "interferenceSeconds": 0, + "metadata": { + "pricePerSecond": 0, + "runtimeId": "inmet-local-local" + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-validate-inputs", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928464.2439463, + "readyAt": 1794928464.2439463, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 0.9057202339172363, + "startedAt": 1794928464.8959303, + "status": "completed", + "transferBytes": 0, + "transferSeconds": 0 + }, + { + "activityId": "inmet-local-1514940793-ingest-2015", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928468.8994417, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2015", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5672743320465088, + "preparationFinishedAt": 1794928466.9747908, + "preparationStartedAt": 1794928466.7961388, + "pricePerSecond": 0, + "readyWaitSeconds": 0.026819229125976562, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.17865204811096191, + "transferWorkSeconds": 0.17865204811096191 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2015", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928466.7252696, + "readyAt": 1794928466.7252696, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.3573765754699707, + "startedAt": 1794928467.5420651, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.17865204811096191 + }, + { + "activityId": "inmet-local-1514940793-ingest-2014", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928468.8990383, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2014", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5852375030517578, + "preparationFinishedAt": 1794928466.9877594, + "preparationStartedAt": 1794928466.8104913, + "pricePerSecond": 0, + "readyWaitSeconds": 0.05211663246154785, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.17726802825927734, + "transferWorkSeconds": 0.17726802825927734 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2014", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928466.7143898, + "readyAt": 1794928466.7143898, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.3260414600372314, + "startedAt": 1794928467.5729969, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.17726802825927734 + }, + { + "activityId": "inmet-local-1514940793-ingest-2013", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928468.9881024, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2013", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.6259393692016602, + "preparationFinishedAt": 1794928466.9675288, + "preparationStartedAt": 1794928466.7808447, + "pricePerSecond": 0, + "readyWaitSeconds": 0.03403449058532715, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.18668413162231445, + "transferWorkSeconds": 0.18668413162231445 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2013", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928466.7031698, + "readyAt": 1794928466.7031698, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.3946342468261719, + "startedAt": 1794928467.5934682, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.18668413162231445 + }, + { + "activityId": "inmet-local-1514940793-ingest-2018", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928471.5413587, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2018", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.37866640090942383, + "preparationFinishedAt": 1794928469.6710458, + "preparationStartedAt": 1794928469.4906247, + "pricePerSecond": 0, + "readyWaitSeconds": 0.04816627502441406, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.1804211139678955, + "transferWorkSeconds": 0.1804211139678955 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2018", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928469.418699, + "readyAt": 1794928469.418699, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.4916465282440186, + "startedAt": 1794928470.0497122, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.1804211139678955 + }, + { + "activityId": "inmet-local-1514940793-ingest-2017", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928472.8835173, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2017", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.4144561290740967, + "preparationFinishedAt": 1794928470.838374, + "preparationStartedAt": 1794928470.6622806, + "pricePerSecond": 0, + "readyWaitSeconds": 0.03769373893737793, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.17609333992004395, + "transferWorkSeconds": 0.17609333992004395 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2017", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928470.5480435, + "readyAt": 1794928470.5480435, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.6306872367858887, + "startedAt": 1794928471.25283, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.17609333992004395 + }, + { + "activityId": "inmet-local-1514940793-ingest-2016", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928472.909606, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2016", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.4642043113708496, + "preparationFinishedAt": 1794928470.823954, + "preparationStartedAt": 1794928470.646534, + "pricePerSecond": 0, + "readyWaitSeconds": 0.03805041313171387, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.17742013931274414, + "transferWorkSeconds": 0.17742013931274414 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2016", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928470.5214367, + "readyAt": 1794928470.5214367, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.6214475631713867, + "startedAt": 1794928471.2881584, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.17742013931274414 + }, + { + "activityId": "inmet-local-1514940793-ingest-2021", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928474.707819, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2021", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5571672916412354, + "preparationFinishedAt": 1794928472.7096264, + "preparationStartedAt": 1794928472.528565, + "pricePerSecond": 0, + "readyWaitSeconds": 0.011492490768432617, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.1810615062713623, + "transferWorkSeconds": 0.1810615062713623 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2021", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928472.4811919, + "readyAt": 1794928472.4811919, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.4410252571105957, + "startedAt": 1794928473.2667937, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.1810615062713623 + }, + { + "activityId": "inmet-local-1514940793-ingest-2020", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928476.042678, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2020", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5068254470825195, + "preparationFinishedAt": 1794928474.0577435, + "preparationStartedAt": 1794928473.8799815, + "pricePerSecond": 0, + "readyWaitSeconds": 0.03105449676513672, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.17776203155517578, + "transferWorkSeconds": 0.17776203155517578 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2020", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928473.8033657, + "readyAt": 1794928473.8033657, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.4781091213226318, + "startedAt": 1794928474.564569, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.17776203155517578 + }, + { + "activityId": "inmet-local-1514940793-ingest-2019", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928476.0481582, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2019", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5437221527099609, + "preparationFinishedAt": 1794928474.040321, + "preparationStartedAt": 1794928473.8638334, + "pricePerSecond": 0, + "readyWaitSeconds": 0.0294034481048584, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.17648768424987793, + "transferWorkSeconds": 0.17648768424987793 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2019", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928473.7885087, + "readyAt": 1794928473.7885087, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.4641149044036865, + "startedAt": 1794928474.5840433, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.17648768424987793 + }, + { + "activityId": "inmet-local-1514940793-ingest-2022", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928478.8747897, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-ingest-2022", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.3402721881866455, + "preparationFinishedAt": 1794928477.2032385, + "preparationStartedAt": 1794928477.027327, + "pricePerSecond": 0, + "readyWaitSeconds": 0.04335212707519531, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.17591142654418945, + "transferWorkSeconds": 0.17591142654418945 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-ingest-2022", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928476.9141107, + "readyAt": 1794928476.9141107, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.3312790393829346, + "startedAt": 1794928477.5435107, + "status": "completed", + "transferBytes": 156, + "transferSeconds": 0.17591142654418945 + }, + { + "activityId": "inmet-local-1514940793-clean", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928486.0838892, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-clean", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 1.723191261291504, + "preparationFinishedAt": 1794928481.3389907, + "preparationStartedAt": 1794928479.4729526, + "pricePerSecond": 0, + "readyWaitSeconds": 0.14452362060546875, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 1.8660380840301514, + "transferWorkSeconds": 12.477578163146973 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-clean", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928479.3006194, + "readyAt": 1794928479.3006194, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 3.02170729637146, + "startedAt": 1794928483.062182, + "status": "completed", + "transferBytes": 14626420, + "transferSeconds": 12.477578163146973 + }, + { + "activityId": "inmet-local-1514940793-temperature", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928489.7702758, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-temperature", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.8764793872833252, + "preparationFinishedAt": 1794928487.4635637, + "preparationStartedAt": 1794928487.185137, + "pricePerSecond": 0, + "readyWaitSeconds": 0.031206130981445312, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.2784266471862793, + "transferWorkSeconds": 0.2784266471862793 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-temperature", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928487.123104, + "readyAt": 1794928487.123104, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.4302327632904053, + "startedAt": 1794928488.340043, + "status": "completed", + "transferBytes": 30932832, + "transferSeconds": 0.2784266471862793 + }, + { + "activityId": "inmet-local-1514940793-precipitation", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928489.8122633, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-precipitation", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.8319101333618164, + "preparationFinishedAt": 1794928487.530259, + "preparationStartedAt": 1794928487.232439, + "pricePerSecond": 0, + "readyWaitSeconds": 0.06277155876159668, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.2978198528289795, + "transferWorkSeconds": 0.2978198528289795 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-precipitation", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928487.1113389, + "readyAt": 1794928487.1113389, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.450094223022461, + "startedAt": 1794928488.362169, + "status": "completed", + "transferBytes": 30932832, + "transferSeconds": 0.2978198528289795 + }, + { + "activityId": "inmet-local-1514940793-humidity", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928494.7801778, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-humidity", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 5.818319320678711, + "preparationFinishedAt": 1794928487.5402899, + "preparationStartedAt": 1794928487.259066, + "pricePerSecond": 0, + "readyWaitSeconds": 0.05769705772399902, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 0.28122377395629883, + "transferWorkSeconds": 0.28122377395629883 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-humidity", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928487.0909226, + "readyAt": 1794928487.0909226, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.4215686321258545, + "startedAt": 1794928493.3586092, + "status": "completed", + "transferBytes": 30932832, + "transferSeconds": 0.28122377395629883 + }, + { + "activityId": "inmet-local-1514940793-compare", + "allocatedResourceId": "inmet-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "inmet-local-1514940793-run-20261117t151423.285983342", + "finishedAt": 1794928501.441435, + "id": "inmet-local-1514940793-run-20261117t151423.285983342:inmet-local-1514940793-compare", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 2.024932622909546, + "preparationFinishedAt": 1794928497.651625, + "preparationStartedAt": 1794928496.5984879, + "pricePerSecond": 0, + "readyWaitSeconds": 0.7110025882720947, + "runtimeId": "inmet-local-local", + "transferElapsedSeconds": 1.0531370639801025, + "transferWorkSeconds": 3.2985217571258545 + }, + "overheadSeconds": 0, + "planAssignmentId": "inmet-local-1514940793-manual-plan-20261117t151423.222042016-inmet-local-1514940793-compare", + "plannedResourceId": "inmet-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928495.7024748, + "readyAt": 1794928495.7024748, + "runtimeId": "inmet-local-local", + "runtimeSeconds": 1.7648775577545166, + "startedAt": 1794928499.6765575, + "status": "completed", + "transferBytes": 31217627, + "transferSeconds": 3.2985217571258545 + } + ] + }, + "runId": "inmet-local-1514940793-run-20261117t151423.285983342", + "status": "completed", + "workflowId": "inmet-local-1514940793", + "projectionScope": "Observed terminal run and activity timing records; complete event and transfer history remains available from the daemon execution API." +} diff --git a/scientific-workflows/inmet/evidence/execution-summary.json b/scientific-workflows/inmet/evidence/execution-summary.json new file mode 100644 index 0000000..504fdb1 --- /dev/null +++ b/scientific-workflows/inmet/evidence/execution-summary.json @@ -0,0 +1,8 @@ +{ + "runId": "inmet-local-1514940793-run-20261117t151423.285983342", + "imageId": "sha256:5c61428db82753d20bb9ae9c3dea95d1e77e055afb4b5af80e2d5242fa643823", + "completedActivities": 16, + "observedMakespanSeconds": 36.5455048084259, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" +} diff --git a/scientific-workflows/inmet/evidence/independent-validation.json b/scientific-workflows/inmet/evidence/independent-validation.json new file mode 100644 index 0000000..b1a9fec --- /dev/null +++ b/scientific-workflows/inmet/evidence/independent-validation.json @@ -0,0 +1 @@ +{"status": "passed", "validator": "independent artifact semantics, SHA-256 and scientific figure pixels", "showcase": "inmet", "artifacts": 5} diff --git a/scientific-workflows/inmet/evidence/manifest.json b/scientific-workflows/inmet/evidence/manifest.json new file mode 100644 index 0000000..6df8edb --- /dev/null +++ b/scientific-workflows/inmet/evidence/manifest.json @@ -0,0 +1,18 @@ +{ + "showcase": "inmet", + "status": "success", + "artifacts": [ + "observations.zip", + "result-temperature.png", + "result-precipitation.png", + "result-humidity.png", + "scientific-validation.json" + ], + "sha256": { + "observations.zip": "d3531dec3ca664f426bcfec1ab2f29d53d1b56e033ff44f0d10c3179f4efa2f2", + "result-temperature.png": "f0c5416979d81e6c0b949e96c5b94a96b45d334f2ea81286be9b1f55f284862e", + "result-precipitation.png": "e77aa2eaa2564d4cd1f21c166cc13f29ce2e5a044152f5c7167cc95b771870d4", + "result-humidity.png": "08f47d310971270fc0fe7876499a1f83fc5fd4811c52afd0a2094d3dd429f4e7", + "scientific-validation.json": "e441a0beda9140a9729ca5b1c7b85ea53b610d4be75ce7252c775741c828806c" + } +} diff --git a/scientific-workflows/inmet/evidence/python-packages.txt b/scientific-workflows/inmet/evidence/python-packages.txt new file mode 100644 index 0000000..2fc187b --- /dev/null +++ b/scientific-workflows/inmet/evidence/python-packages.txt @@ -0,0 +1,23 @@ +cloudpickle==3.1.2 +contourpy==1.3.3 +cycler==0.12.1 +fonttools==4.68.0 +joblib==1.6.0 +kiwisolver==1.5.1 +matplotlib==3.9.2 +networkx==3.4.2 +numpy==1.26.4 +packaging==26.3 +pandas==2.2.3 +patsy==1.0.3 +pillow==13.0.0 +pyparsing==3.3.3 +pyreadr==0.5.2 +python-dateutil==4.0.0 +pytz==2026.6 +PyYAML==6.0.2 +scikit-learn==1.5.2 +scipy==1.14.1 +statsmodels==0.14.4 +threadpoolctl==3.8.0 +tzdata==2026.6 diff --git a/scientific-workflows/inmet/evidence/scientific-validation.json b/scientific-workflows/inmet/evidence/scientific-validation.json new file mode 100644 index 0000000..150d8b7 --- /dev/null +++ b/scientific-workflows/inmet/evidence/scientific-validation.json @@ -0,0 +1,130 @@ +{ + "status": "passed", + "findings": { + "rawRows": 87648, + "cleanedRows": 87252, + "removedRows": 396, + "station": "A701", + "start": "2013-01-01 00:00:00", + "end": "2022-12-31 23:00:00", + "originalNotebookCells": [ + 16, + 20 + ], + "variables": { + "temperature": { + "observations": 87252, + "minimum": 4.1, + "maximum": 37.3, + "mean": 20.490728006234818 + }, + "precipitation": { + "observations": 87252, + "minimum": 0.0, + "maximum": 77.8, + "mean": 0.1712808875441251 + }, + "humidity": { + "observations": 87252, + "minimum": 12.0, + "maximum": 98.0, + "mean": 68.80686975656718 + } + } + }, + "provenance": { + "slug": "inmet", + "title": "INMET — São Paulo meteorological observations, 2013–2022", + "authors": [ + "Rosa Virginia Encinas Quille", + "Felipe Valencia de Almeida", + "Danielle Monteiro", + "Pedro Luiz Pizzigatti Corrêa" + ], + "conference": "XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/36912", + "source": "https://zenodo.org/records/16864784", + "scope": "Process all original hourly CSVs for São Paulo–Mirante station A701 from 2013 through 2022, the station and period illustrated by the paper. Execute the original notebook ingestion/normalization and cleaning definitions (cells 16 and 20), then generate noninteractive temperature, precipitation and humidity analyses. Yearly ingestion activities are independent; the original cleaning runs once after concatenation, preserving cross-year filling. Raw inputs come from the nested dataset.zip in the original Zenodo deposit, acquired by verified ZIP members through HTTP byte ranges. The entire 1.92 GB parent archive is not downloaded or claimed to have a newly verified global hash; extracted member CRC and SHA-256 are checked. Original notebook and data: CC BY 4.0. INMET source portal: https://portal.inmet.gov.br/dadoshistoricos . No processed author outputs are used as computation inputs.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence." + }, + "acquisition": { + "files": [ + { + "path": "original.ipynb", + "url": "https://zenodo.org/records/16864784/files/INMETDataTool_v4.0.ipynb?download=1", + "sha256": "63bb2e19e30ec28fa766269155a8b18a05b1b1921a38e477cfdf24f7e8d44315", + "bytes": 235769 + }, + { + "path": "raw/2013/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2013_A_31-12-2013.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "5f2a45f7be8129d373f937418de8b00f46e4ae6fc27fd7518ff772fcef13d8ba", + "bytes": 805357, + "archiveMember": "dataset/dataset.zip!/2013/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2013_A_31-12-2013.CSV" + }, + { + "path": "raw/2014/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2014_A_31-12-2014.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "6690c2d8364def66d5df1daecdbd7ca408e4f3ea2d681a2ed8e0696a94d4ab55", + "bytes": 811595, + "archiveMember": "dataset/dataset.zip!/2014/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2014_A_31-12-2014.CSV" + }, + { + "path": "raw/2015/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2015_A_31-12-2015.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "a0c96324f7c0d534f9e690f2a5178616281339d6de73647ada97e5f102eb78d2", + "bytes": 806900, + "archiveMember": "dataset/dataset.zip!/2015/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2015_A_31-12-2015.CSV" + }, + { + "path": "raw/2016/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2016_A_31-12-2016.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "9989f6f158c83059b0a54d35842f66f159f2b5049952dff6986ba515517816fc", + "bytes": 809609, + "archiveMember": "dataset/dataset.zip!/2016/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2016_A_31-12-2016.CSV" + }, + { + "path": "raw/2017/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2017_A_31-12-2017.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "1bac9171eb8660d5a282dc724913f7efeba52afdde7b93e6c6387b7f6465912f", + "bytes": 808768, + "archiveMember": "dataset/dataset.zip!/2017/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2017_A_31-12-2017.CSV" + }, + { + "path": "raw/2018/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2018_A_31-12-2018.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "1bec33fd03bd0179a0e0a4b194578727468baac0af6bf524bf2d820a01d447d4", + "bytes": 807097, + "archiveMember": "dataset/dataset.zip!/2018/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2018_A_31-12-2018.CSV" + }, + { + "path": "raw/2019/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2019_A_31-12-2019.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "51527c56c4ff94d005f69bd2d5d1d167a478d7882e398f6e059ee989522a5b6c", + "bytes": 811521, + "archiveMember": "dataset/dataset.zip!/2019/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2019_A_31-12-2019.CSV" + }, + { + "path": "raw/2020/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2020_A_31-12-2020.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "aec112b14d90797dcd905c8a5932fb4eb09015582f459edbf3b7a4a8cdafed12", + "bytes": 813664, + "archiveMember": "dataset/dataset.zip!/2020/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2020_A_31-12-2020.CSV" + }, + { + "path": "raw/2021/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2021_A_31-12-2021.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "815c01daf4a6da98d26517b0214932a0754fa5cf997a79ce726516b50192fef1", + "bytes": 802037, + "archiveMember": "dataset/dataset.zip!/2021/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2021_A_31-12-2021.CSV" + }, + { + "path": "raw/2022/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2022_A_31-12-2022.CSV", + "url": "https://zenodo.org/records/16864784/files/dataset.zip?download=1", + "sha256": "ceb3a4cde159602228959b96c32eb46134f37b9b3b84c90126d8cbf169d8d088", + "bytes": 811830, + "archiveMember": "dataset/dataset.zip!/2022/INMET_SE_SP_A701_SAO PAULO - MIRANTE_01-01-2022_A_31-12-2022.CSV" + } + ] + } +} diff --git a/scientific-workflows/inmet/expected/render_execution.py b/scientific-workflows/inmet/expected/render_execution.py new file mode 100644 index 0000000..fd9861b --- /dev/null +++ b/scientific-workflows/inmet/expected/render_execution.py @@ -0,0 +1,28 @@ +from pathlib import Path +import hashlib,json +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +root=Path('/bundle') +r=json.loads((root/'evidence/daemon-run.json').read_text()) +a=r['projection']['activities'];assert len(a)==r['activityCount'] and all(x['status']=='completed' for x in a) +a=sorted(a,key=lambda x:x['startedAt']);start=min(x['startedAt'] for x in a) +fig,ax=plt.subplots(figsize=(12,max(4,len(a)*.3)),constrained_layout=True) +colors=plt.get_cmap('tab20') +for i,x in enumerate(a): + ax.barh(i,x['finishedAt']-x['startedAt'],left=x['startedAt']-start,color=colors(i%20),height=.7) +ax.set_yticks(range(len(a)),[x['activityId'].removeprefix(r['workflowId']+'-') for x in a],fontsize=8) +ax.invert_yaxis();ax.set_xlabel('Observed seconds from first activity start');ax.set_title(root.name+' — measured native daemon execution') +ax.spines[['top','right']].set_visible(False);ax.grid(axis='x',alpha=.2) +fig.savefig(root/'screenshots/current/execution-timeline.png',dpi=150) +current=0;peak=0 +for _,delta in sorted([(x['startedAt'],1) for x in a]+[(x['finishedAt'],-1) for x in a]):current+=delta;peak=max(peak,current) +summary={'runId':r['runId'],'imageId':r['imageId'],'completedActivities':len(a),'observedMakespanSeconds':r['projection']['run']['makespanSeconds'],'peakOverlappingActivities':peak,'timingSource':'observed native startedAt/finishedAt; imported predicted times excluded'} +(root/'evidence/execution-summary.json').write_text(json.dumps(summary,indent=2)+'\n') +p=root/'screenshots/current/manifest.json';m=json.loads(p.read_text());m['source']='scientific figures copied from completed daemon outputs; timeline derived from observed native activity times' +m['figures']['execution-timeline.png']=hashlib.sha256((root/'screenshots/current/execution-timeline.png').read_bytes()).hexdigest();m['executionSummary']=summary;p.write_text(json.dumps(m,indent=2,ensure_ascii=False)+'\n') +p=root/'README.md';s=p.read_text().split('\n## Observed parallel execution\n')[0];s=s.replace('Figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. They show actual computed results, not interface mockups.', 'Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results.') +s+='\n## Observed parallel execution\n\n'+f"The native run completed {len(a)} activities in **{summary['observedMakespanSeconds']:.2f} seconds**, with **{peak} overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline.\n\n![Measured execution timeline](screenshots/current/execution-timeline.png)\n" +p.write_text(s) +print(json.dumps(summary)) diff --git a/scientific-workflows/inmet/expected/validate.py b/scientific-workflows/inmet/expected/validate.py new file mode 100644 index 0000000..4145354 --- /dev/null +++ b/scientific-workflows/inmet/expected/validate.py @@ -0,0 +1,30 @@ +import hashlib +import io +import json +from pathlib import Path +import zipfile +import numpy as np +import pandas as pd +from PIL import Image + +out=Path('/outputs') +m=json.loads((out/'manifest.json').read_text()) +v=json.loads((out/'scientific-validation.json').read_text()) +assert m['status']=='success' and v['status']=='passed' +for name in m['artifacts']: + p=out/name + assert hashlib.sha256(p.read_bytes()).hexdigest()==m['sha256'][name],name + if p.suffix=='.png': + with Image.open(p) as image: + assert min(image.size)>100 and np.asarray(image).std()>1 + +with zipfile.ZipFile(out/'observations.zip') as z: + df=pd.read_csv(io.BytesIO(z.read('cleaned.csv')),parse_dates=['datetime']) +assert len(df)==87252 and df.datetime.nunique()==len(df) +assert df.datetime.min()==pd.Timestamp('2013-01-01') +assert df.datetime.max()==pd.Timestamp('2022-12-31 23:00:00') +assert set(df['WMO_Code'])=={'A701'} +assert df.Precip.notna().all() and (df.Precip>=0).all() +assert df.Temp.between(-20,60).all() and df.RH.between(0,100).all() + +print(json.dumps({'status':'passed','validator':'independent artifact semantics, SHA-256 and scientific figure pixels','showcase':m['showcase'],'artifacts':len(m['artifacts'])})) diff --git a/scientific-workflows/inmet/prepare.sh b/scientific-workflows/inmet/prepare.sh new file mode 100755 index 0000000..03d1796 --- /dev/null +++ b/scientific-workflows/inmet/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +python3 "$root/scripts/acquire.py" +go run "$root/../../tools/showcase/main.go" -root "$root" -prepare-container diff --git a/scientific-workflows/inmet/requirements.txt b/scientific-workflows/inmet/requirements.txt new file mode 100644 index 0000000..fc39612 --- /dev/null +++ b/scientific-workflows/inmet/requirements.txt @@ -0,0 +1,9 @@ +numpy==1.26.4 +pandas==2.2.3 +scipy==1.14.1 +scikit-learn==1.5.2 +statsmodels==0.14.4 +matplotlib==3.9.2 +networkx==3.4.2 +pyreadr==0.5.2 +PyYAML==6.0.2 diff --git a/scientific-workflows/inmet/run.sh b/scientific-workflows/inmet/run.sh new file mode 100755 index 0000000..b487925 --- /dev/null +++ b/scientific-workflows/inmet/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +go run "$root/../../tools/showcase/main.go" -root "$root" -container -parallel "${AKOFLOW_PARALLEL:-3}" +if ! "$root/validate.sh"; then + rm -f "$root/outputs/manifest.json" + exit 1 +fi diff --git a/scientific-workflows/inmet/scope.yaml b/scientific-workflows/inmet/scope.yaml new file mode 100644 index 0000000..085495d --- /dev/null +++ b/scientific-workflows/inmet/scope.yaml @@ -0,0 +1,3 @@ +id: inmet-local-scope +name: inmet-local local scope +environmentVersionIds: [inmet-local-v1] diff --git a/scientific-workflows/inmet/screenshots/current/execution-timeline.png b/scientific-workflows/inmet/screenshots/current/execution-timeline.png new file mode 100644 index 0000000..610021e Binary files /dev/null and b/scientific-workflows/inmet/screenshots/current/execution-timeline.png differ diff --git a/scientific-workflows/inmet/screenshots/current/manifest.json b/scientific-workflows/inmet/screenshots/current/manifest.json new file mode 100644 index 0000000..4e0c04e --- /dev/null +++ b/scientific-workflows/inmet/screenshots/current/manifest.json @@ -0,0 +1,52 @@ +{ + "runId": "inmet-local-1514940793-run-20261117t151423.285983342", + "image": "akoflow-local/inmet:local-5c61428db82753d2", + "imageId": "sha256:5c61428db82753d20bb9ae9c3dea95d1e77e055afb4b5af80e2d5242fa643823", + "source": "scientific figures copied from completed daemon outputs; timeline derived from observed native activity times", + "figures": { + "result-humidity.png": "08f47d310971270fc0fe7876499a1f83fc5fd4811c52afd0a2094d3dd429f4e7", + "result-precipitation.png": "e77aa2eaa2564d4cd1f21c166cc13f29ce2e5a044152f5c7167cc95b771870d4", + "result-temperature.png": "f0c5416979d81e6c0b949e96c5b94a96b45d334f2ea81286be9b1f55f284862e", + "execution-timeline.png": "ea12c4f69b24b39bbd07979e6a64b18e04874268de2d65e780c8caa1d6e47416" + }, + "findings": { + "rawRows": 87648, + "cleanedRows": 87252, + "removedRows": 396, + "station": "A701", + "start": "2013-01-01 00:00:00", + "end": "2022-12-31 23:00:00", + "originalNotebookCells": [ + 16, + 20 + ], + "variables": { + "temperature": { + "observations": 87252, + "minimum": 4.1, + "maximum": 37.3, + "mean": 20.490728006234818 + }, + "precipitation": { + "observations": 87252, + "minimum": 0.0, + "maximum": 77.8, + "mean": 0.1712808875441251 + }, + "humidity": { + "observations": 87252, + "minimum": 12.0, + "maximum": 98.0, + "mean": 68.80686975656718 + } + } + }, + "executionSummary": { + "runId": "inmet-local-1514940793-run-20261117t151423.285983342", + "imageId": "sha256:5c61428db82753d20bb9ae9c3dea95d1e77e055afb4b5af80e2d5242fa643823", + "completedActivities": 16, + "observedMakespanSeconds": 36.5455048084259, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" + } +} diff --git a/scientific-workflows/inmet/screenshots/current/result-humidity.png b/scientific-workflows/inmet/screenshots/current/result-humidity.png new file mode 100644 index 0000000..f921bc1 Binary files /dev/null and b/scientific-workflows/inmet/screenshots/current/result-humidity.png differ diff --git a/scientific-workflows/inmet/screenshots/current/result-precipitation.png b/scientific-workflows/inmet/screenshots/current/result-precipitation.png new file mode 100644 index 0000000..0fada02 Binary files /dev/null and b/scientific-workflows/inmet/screenshots/current/result-precipitation.png differ diff --git a/scientific-workflows/inmet/screenshots/current/result-temperature.png b/scientific-workflows/inmet/screenshots/current/result-temperature.png new file mode 100644 index 0000000..7ab7b5e Binary files /dev/null and b/scientific-workflows/inmet/screenshots/current/result-temperature.png differ diff --git a/scientific-workflows/inmet/scripts/acquire.py b/scientific-workflows/inmet/scripts/acquire.py new file mode 100644 index 0000000..dce4ff5 --- /dev/null +++ b/scientific-workflows/inmet/scripts/acquire.py @@ -0,0 +1,33 @@ +import hashlib +import json +from pathlib import Path +import urllib.request +import zipfile +from remotezip import RemoteZip + +root=Path(__file__).resolve().parents[1];data=root/'data';dest=data/'inputs';dest.mkdir(exist_ok=True) +cfg=json.loads((data/'sources.json').read_text());members=json.loads((data/'members.json').read_text()) +old={} +if (data/'acquisition.json').exists():old={v['path']:v for v in json.loads((data/'acquisition.json').read_text())['files']} +receipts=[] +def save(path,b,url,extra=None): + h=hashlib.sha256(b).hexdigest() + if path in old and old[path]['sha256']!=h:raise RuntimeError('Frozen source changed: '+path) + p=dest/path;p.parent.mkdir(parents=True,exist_ok=True);p.write_bytes(b) + receipts.append(dict(path=path,url=url,sha256=h,bytes=len(b),**(extra or {}))) +notebook=dest/'original.ipynb' +if notebook.exists():b=notebook.read_bytes() +else:b=urllib.request.urlopen(cfg['notebook'],timeout=60).read() +assert hashlib.md5(b).hexdigest()=='5af1378b16fae429866cc4a204cc5b50' +save('original.ipynb',b,cfg['notebook']) +missing=[n for n in members['names'] if not (dest/'raw'/n).exists()] +if missing: + with zipfile.ZipFile(RemoteZip(cfg['archive'],members['length'],members['offset'])) as archive: + for name in members['names']: + p=dest/'raw'/name + b=p.read_bytes() if p.exists() else archive.read(name) + save('raw/'+name,b,cfg['archive'],{'archiveMember':'dataset/dataset.zip!/'+name}) + print('Verified',name,len(b),flush=True) +else: + for name in members['names']:save('raw/'+name,(dest/'raw'/name).read_bytes(),cfg['archive'],{'archiveMember':'dataset/dataset.zip!/'+name}) +(data/'acquisition.json').write_text(json.dumps({'files':receipts},indent=2)+'\n') diff --git a/scientific-workflows/inmet/scripts/common.py b/scientific-workflows/inmet/scripts/common.py new file mode 100644 index 0000000..35a6f20 --- /dev/null +++ b/scientific-workflows/inmet/scripts/common.py @@ -0,0 +1,50 @@ +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import numpy as np +import pandas as pd +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +ROOT = Path(__file__).resolve().parents[1] +DATA = ROOT / 'data' +plt.rcParams.update({'figure.dpi': 150, 'axes.spines.top': False, 'axes.spines.right': False}) + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + +def write(path, value): + Path(path).write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') + +def inputs(): + receipt = json.loads((DATA / 'acquisition.json').read_text()) + for item in receipt['files']: + p = DATA / 'inputs' / item['path'] + if digest(p) != item['sha256']: + raise RuntimeError('Input checksum mismatch: ' + str(p)) + return receipt + +def finish(output, artifacts, findings): + provenance = json.loads((DATA / 'provenance.json').read_text()) + write(output / 'scientific-validation.json', {'status': 'passed', 'findings': findings, 'provenance': provenance, 'acquisition': inputs()}) + artifacts = artifacts + ['scientific-validation.json'] + for name in artifacts: + if not (output / name).is_file() or (output / name).stat().st_size == 0: + raise RuntimeError('Missing artifact: ' + name) + write(output / 'manifest.json', {'showcase': provenance['slug'], 'status': 'success', 'artifacts': artifacts, 'sha256': {n: digest(output / n) for n in artifacts}}) + +def arguments(): + parser = argparse.ArgumentParser() + parser.add_argument('--stage', required=True) + parser.add_argument('--output', required=True) + a = parser.parse_args() + out = Path(a.output).resolve() + out.mkdir(parents=True, exist_ok=True) + return a.stage, out diff --git a/scientific-workflows/inmet/scripts/remotezip.py b/scientific-workflows/inmet/scripts/remotezip.py new file mode 100644 index 0000000..8d6cef3 --- /dev/null +++ b/scientific-workflows/inmet/scripts/remotezip.py @@ -0,0 +1,39 @@ +import io +import urllib.request +import time + +class RemoteZip(io.IOBase): + def __init__(self, url, length=None, offset=0): + self.url=url + self.offset=offset + if length is None: + with urllib.request.urlopen(urllib.request.Request(url,method='HEAD'),timeout=60) as r: + length=int(r.headers['Content-Length']) + self.length=length + self.position=0 + def seekable(self): + return True + def seek(self, offset, whence=0): + self.position=offset if whence==0 else self.position+offset if whence==1 else self.length+offset + return self.position + def tell(self): + return self.position + def read(self, size=-1): + if size<0:size=self.length-self.position + size=min(size,self.length-self.position) + if size<=0:return b'' + start=self.position+self.offset;end=start+size-1 + for attempt in range(4): + try: + req=urllib.request.Request(self.url,headers={'Range':f'bytes={start}-{end}','User-Agent':'Akoflow-scientific-reproduction/1.0'}) + with urllib.request.urlopen(req,timeout=120) as r: + if r.status!=206:raise RuntimeError('Server did not honor byte range') + if not r.headers.get('Content-Range','').startswith(f'bytes {start}-{end}/'): + raise RuntimeError('Unexpected content range') + data=r.read() + if len(data)!=size:raise RuntimeError('Incomplete byte range') + self.position+=size + return data + except Exception: + if attempt==3:raise + time.sleep(2**attempt) diff --git a/scientific-workflows/inmet/scripts/run_stage.py b/scientific-workflows/inmet/scripts/run_stage.py new file mode 100644 index 0000000..202e184 --- /dev/null +++ b/scientific-workflows/inmet/scripts/run_stage.py @@ -0,0 +1,55 @@ +from common import * +import csv +import datetime +from datetime import datetime +from statistics import median +import glob +import os +import re +import time +import unicodedata +import zipfile + +stage,out=arguments() +def original(): + notebook=json.loads((DATA/'inputs/original.ipynb').read_text()) + env=dict(globals()) + for index in [16,20]:exec(compile(''.join(notebook['cells'][index]['source']),'original-notebook-cell-'+str(index),'exec'),env) + return env +if stage=='validate-inputs': + receipt=inputs();assert len(receipt['files'])==11 + write(out/'inputs-validated.json',{'station':'A701','years':list(range(2013,2023)),'files':len(receipt['files'])}) +elif stage.startswith('ingest-'): + year=int(stage[7:]);env=original() + df,meta=env['process_inmet_data'](folder=str(DATA/'inputs/raw'),selected_years=[year],station_codes=['A701'],save_csv=False) + assert len(df)>=8760 and df.WMO_Code.nunique()==1 + df.to_csv(out/f'raw-{year}.csv',index=False) +elif stage=='clean': + raw=pd.concat([pd.read_csv(out/f'raw-{y}.csv') for y in range(2013,2023)],ignore_index=True) + env=original();clean=env['data_cleaning'](raw,verbose=True) + assert clean.datetime.notna().all() and clean.datetime.nunique()==len(clean) + assert clean.Precip.notna().all() and (clean.Precip>=0).all() + assert 0100 and np.asarray(image).std()>1 + +df=pd.read_csv(out/'metrics.csv') +assert len(df)==9 and df.f1.between(0,1).all() and (df.sizeKiB>0).all() +assert (df.calibrationTestOverlap==0).all() +with zipfile.ZipFile(out/'quantized-models.zip') as z: + assert len(z.namelist())==9 + for name in z.namelist(): + b=z.read(name);assert b[4:8]==b'TFL3' + r=df[(df.model==name.split('-')[0])&(df.quantization==name.split('-')[1].split('.')[0])].iloc[0] + assert len(b)/1024==r.sizeKiB +for r in v['findings']['baselineModels']: + assert len(r['folds'])==5 and all(f['testRecordings']==6 for f in r['folds']) + assert np.asarray(r['lastFoldConfusion']).sum()==300 + +print(json.dumps({'status':'passed','validator':'independent artifact semantics, SHA-256 and scientific figure pixels','showcase':m['showcase'],'artifacts':len(m['artifacts'])})) diff --git a/scientific-workflows/mafaulda-tinyml/prepare.sh b/scientific-workflows/mafaulda-tinyml/prepare.sh new file mode 100755 index 0000000..03d1796 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +python3 "$root/scripts/acquire.py" +go run "$root/../../tools/showcase/main.go" -root "$root" -prepare-container diff --git a/scientific-workflows/mafaulda-tinyml/requirements.txt b/scientific-workflows/mafaulda-tinyml/requirements.txt new file mode 100644 index 0000000..6484abb --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/requirements.txt @@ -0,0 +1,10 @@ +numpy==1.26.4 +pandas==2.2.3 +scipy==1.14.1 +scikit-learn==1.5.2 +statsmodels==0.14.4 +matplotlib==3.9.2 +networkx==3.4.2 +pyreadr==0.5.2 +PyYAML==6.0.2 +tensorflow-cpu==2.15.1 diff --git a/scientific-workflows/mafaulda-tinyml/run.sh b/scientific-workflows/mafaulda-tinyml/run.sh new file mode 100755 index 0000000..b487925 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +go run "$root/../../tools/showcase/main.go" -root "$root" -container -parallel "${AKOFLOW_PARALLEL:-3}" +if ! "$root/validate.sh"; then + rm -f "$root/outputs/manifest.json" + exit 1 +fi diff --git a/scientific-workflows/mafaulda-tinyml/scope.yaml b/scientific-workflows/mafaulda-tinyml/scope.yaml new file mode 100644 index 0000000..7f4cfce --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/scope.yaml @@ -0,0 +1,3 @@ +id: mafaulda-tinyml-local-scope +name: mafaulda-tinyml-local local scope +environmentVersionIds: [mafaulda-tinyml-local-v1] diff --git a/scientific-workflows/mafaulda-tinyml/screenshots/current/confusion-matrices.png b/scientific-workflows/mafaulda-tinyml/screenshots/current/confusion-matrices.png new file mode 100644 index 0000000..14ee8ef Binary files /dev/null and b/scientific-workflows/mafaulda-tinyml/screenshots/current/confusion-matrices.png differ diff --git a/scientific-workflows/mafaulda-tinyml/screenshots/current/execution-timeline.png b/scientific-workflows/mafaulda-tinyml/screenshots/current/execution-timeline.png new file mode 100644 index 0000000..fcefcaa Binary files /dev/null and b/scientific-workflows/mafaulda-tinyml/screenshots/current/execution-timeline.png differ diff --git a/scientific-workflows/mafaulda-tinyml/screenshots/current/manifest.json b/scientific-workflows/mafaulda-tinyml/screenshots/current/manifest.json new file mode 100644 index 0000000..e0ecd26 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/screenshots/current/manifest.json @@ -0,0 +1,382 @@ +{ + "runId": "mafaulda-tinyml-local-351678315d-run-20261117t152055.178793114", + "image": "akoflow-local/mafaulda-tinyml:local-36dd0df262eb3cb3", + "imageId": "sha256:36dd0df262eb3cb373ef1cba2e824423aabf516e56e70b75ca62c1922978cc9e", + "source": "scientific figures copied from completed daemon outputs; timeline derived from observed native activity times", + "figures": { + "confusion-matrices.png": "84286eecd0f1202c66e82c397921e83a5aa5d9c374e587542b638f150354a682", + "quantization-comparison.png": "b8475963c7969d8d4d77b17bcc96efbcd7772672cd6d408dae9664280fd3620e", + "execution-timeline.png": "bfb4f29587740160d00f7d2b4a081a7b703fc5b23c4f66c8c5398ac0f69130bc" + }, + "findings": { + "recordings": 30, + "classes": 6, + "windows": 1500, + "features": 132, + "baselineModels": [ + { + "model": "mlp", + "folds": [ + { + "fold": 0, + "f1": 0.25924250041897096, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 1, + "f1": 0.9832915622389308, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 2, + "f1": 0.4748495989840349, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 3, + "f1": 0.7766713577023013, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 4, + "f1": 0.3125652223042002, + "testWindows": 300, + "testRecordings": 6 + } + ], + "meanF1": 0.5613240483296876, + "lastFoldConfusion": [ + [ + 0, + 0, + 50, + 0, + 0, + 0 + ], + [ + 0, + 0, + 50, + 0, + 0, + 0 + ], + [ + 0, + 0, + 50, + 0, + 0, + 0 + ], + [ + 2, + 0, + 35, + 13, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 50, + 0 + ], + [ + 5, + 6, + 0, + 34, + 0, + 5 + ] + ], + "epochs": 10, + "recordingGroupsDisjoint": true + }, + { + "model": "cnn", + "folds": [ + { + "fold": 0, + "f1": 0.07076611365844117, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 1, + "f1": 0.08603468163527944, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 2, + "f1": 0.08589470192765504, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 3, + "f1": 0.047619047619047616, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 4, + "f1": 0.048875855327468236, + "testWindows": 300, + "testRecordings": 6 + } + ], + "meanF1": 0.0678380800335783, + "lastFoldConfusion": [ + [ + 0, + 50, + 0, + 0, + 0, + 0 + ], + [ + 0, + 50, + 0, + 0, + 0, + 0 + ], + [ + 0, + 50, + 0, + 0, + 0, + 0 + ], + [ + 0, + 49, + 0, + 0, + 1, + 0 + ], + [ + 0, + 50, + 0, + 0, + 0, + 0 + ], + [ + 0, + 42, + 0, + 0, + 8, + 0 + ] + ], + "epochs": 10, + "recordingGroupsDisjoint": true + }, + { + "model": "lstm", + "folds": [ + { + "fold": 0, + "f1": 0.38889901074989064, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 1, + "f1": 0.04775549188156638, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 2, + "f1": 0.2242416688661447, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 3, + "f1": 0.05611672278338945, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 4, + "f1": 0.15202363773792346, + "testWindows": 300, + "testRecordings": 6 + } + ], + "meanF1": 0.17380730640378292, + "lastFoldConfusion": [ + [ + 0, + 0, + 5, + 0, + 37, + 8 + ], + [ + 0, + 0, + 0, + 0, + 50, + 0 + ], + [ + 15, + 0, + 1, + 20, + 0, + 14 + ], + [ + 0, + 0, + 21, + 0, + 11, + 18 + ], + [ + 0, + 0, + 0, + 0, + 32, + 18 + ], + [ + 11, + 0, + 0, + 0, + 0, + 39 + ] + ], + "epochs": 5, + "recordingGroupsDisjoint": true + }, + { + "model": "rf", + "folds": [ + { + "fold": 0, + "f1": 0.12848867825171142, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 1, + "f1": 0.6321322723318853, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 2, + "f1": 0.3635254528293146, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 3, + "f1": 0.7859265993044486, + "testWindows": 300, + "testRecordings": 6 + }, + { + "fold": 4, + "f1": 0.3124308900630487, + "testWindows": 300, + "testRecordings": 6 + } + ], + "meanF1": 0.44450077855608167, + "lastFoldConfusion": [ + [ + 0, + 0, + 50, + 0, + 0, + 0 + ], + [ + 0, + 0, + 50, + 0, + 0, + 0 + ], + [ + 0, + 0, + 50, + 0, + 0, + 0 + ], + [ + 0, + 0, + 22, + 28, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 50, + 0 + ], + [ + 5, + 0, + 1, + 38, + 6, + 0 + ] + ], + "epochs": 0, + "recordingGroupsDisjoint": true + } + ], + "quantizedModels": 9, + "evaluation": "recording-disjoint 5-fold; quantization calibration=train, evaluation=test", + "paperScoreAgreementClaimed": false + }, + "executionSummary": { + "runId": "mafaulda-tinyml-local-351678315d-run-20261117t152055.178793114", + "imageId": "sha256:36dd0df262eb3cb373ef1cba2e824423aabf516e56e70b75ca62c1922978cc9e", + "completedActivities": 22, + "observedMakespanSeconds": 140.40111374855042, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" + } +} diff --git a/scientific-workflows/mafaulda-tinyml/screenshots/current/quantization-comparison.png b/scientific-workflows/mafaulda-tinyml/screenshots/current/quantization-comparison.png new file mode 100644 index 0000000..dd6b6a6 Binary files /dev/null and b/scientific-workflows/mafaulda-tinyml/screenshots/current/quantization-comparison.png differ diff --git a/scientific-workflows/mafaulda-tinyml/scripts/acquire.py b/scientific-workflows/mafaulda-tinyml/scripts/acquire.py new file mode 100644 index 0000000..fba0f5e --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/scripts/acquire.py @@ -0,0 +1,38 @@ +import concurrent.futures +import hashlib +import json +from pathlib import Path +import urllib.request +import zipfile +from remotezip import RemoteZip + +root=Path(__file__).resolve().parents[1];data=root/'data';dest=data/'inputs';dest.mkdir(exist_ok=True) +cfg=json.loads((data/'sources.json').read_text());old={} +if (data/'acquisition.json').exists():old={v['path']:v for v in json.loads((data/'acquisition.json').read_text())['files']} +def save(path,b,url,extra=None): + h=hashlib.sha256(b).hexdigest() + if path in old and old[path]['sha256']!=h:raise RuntimeError('Frozen source changed: '+path) + p=dest/path;p.parent.mkdir(parents=True,exist_ok=True);p.write_bytes(b) + return dict(path=path,url=url,sha256=h,bytes=len(b),**(extra or {})) +p=dest/'original.ipynb' +b=p.read_bytes() if p.exists() else urllib.request.urlopen(cfg['notebook'],timeout=60).read() +receipts=[save('original.ipynb',b,cfg['notebook'])] +def acquire_class(name): + url=cfg['datasetBase']+name+'.zip' + existing=[v for v in old.values() if v.get('class')==name] + if len(existing)==cfg['recordingsPerClass'] and all((dest/v['path']).exists() for v in existing): + return [save(v['path'],(dest/v['path']).read_bytes(),url,{'class':name,'archiveMember':v['archiveMember']}) for v in existing] + with zipfile.ZipFile(RemoteZip(url)) as archive: + names=sorted(n for n in archive.namelist() if n.endswith('.csv')) + count=cfg['recordingsPerClass'] + selected=[v['archiveMember'] for v in existing] if len(existing)==count else [names[round(i*(len(names)-1)/(count-1))] for i in range(count)] + result=[] + for n in selected: + path='recordings/'+n + b=(dest/path).read_bytes() if (dest/path).exists() else archive.read(n) + result.append(save(path,b,url,{'class':name,'archiveMember':n})) + print('Verified',n,len(b),flush=True) + return result +with concurrent.futures.ThreadPoolExecutor(max_workers=3) as pool: + for records in pool.map(acquire_class,cfg['classes']):receipts.extend(records) +(data/'acquisition.json').write_text(json.dumps({'files':sorted(receipts,key=lambda r:r['path'])},indent=2)+'\n') diff --git a/scientific-workflows/mafaulda-tinyml/scripts/common.py b/scientific-workflows/mafaulda-tinyml/scripts/common.py new file mode 100644 index 0000000..35a6f20 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/scripts/common.py @@ -0,0 +1,50 @@ +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import numpy as np +import pandas as pd +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +ROOT = Path(__file__).resolve().parents[1] +DATA = ROOT / 'data' +plt.rcParams.update({'figure.dpi': 150, 'axes.spines.top': False, 'axes.spines.right': False}) + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + +def write(path, value): + Path(path).write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') + +def inputs(): + receipt = json.loads((DATA / 'acquisition.json').read_text()) + for item in receipt['files']: + p = DATA / 'inputs' / item['path'] + if digest(p) != item['sha256']: + raise RuntimeError('Input checksum mismatch: ' + str(p)) + return receipt + +def finish(output, artifacts, findings): + provenance = json.loads((DATA / 'provenance.json').read_text()) + write(output / 'scientific-validation.json', {'status': 'passed', 'findings': findings, 'provenance': provenance, 'acquisition': inputs()}) + artifacts = artifacts + ['scientific-validation.json'] + for name in artifacts: + if not (output / name).is_file() or (output / name).stat().st_size == 0: + raise RuntimeError('Missing artifact: ' + name) + write(output / 'manifest.json', {'showcase': provenance['slug'], 'status': 'success', 'artifacts': artifacts, 'sha256': {n: digest(output / n) for n in artifacts}}) + +def arguments(): + parser = argparse.ArgumentParser() + parser.add_argument('--stage', required=True) + parser.add_argument('--output', required=True) + a = parser.parse_args() + out = Path(a.output).resolve() + out.mkdir(parents=True, exist_ok=True) + return a.stage, out diff --git a/scientific-workflows/mafaulda-tinyml/scripts/remotezip.py b/scientific-workflows/mafaulda-tinyml/scripts/remotezip.py new file mode 100644 index 0000000..8d6cef3 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/scripts/remotezip.py @@ -0,0 +1,39 @@ +import io +import urllib.request +import time + +class RemoteZip(io.IOBase): + def __init__(self, url, length=None, offset=0): + self.url=url + self.offset=offset + if length is None: + with urllib.request.urlopen(urllib.request.Request(url,method='HEAD'),timeout=60) as r: + length=int(r.headers['Content-Length']) + self.length=length + self.position=0 + def seekable(self): + return True + def seek(self, offset, whence=0): + self.position=offset if whence==0 else self.position+offset if whence==1 else self.length+offset + return self.position + def tell(self): + return self.position + def read(self, size=-1): + if size<0:size=self.length-self.position + size=min(size,self.length-self.position) + if size<=0:return b'' + start=self.position+self.offset;end=start+size-1 + for attempt in range(4): + try: + req=urllib.request.Request(self.url,headers={'Range':f'bytes={start}-{end}','User-Agent':'Akoflow-scientific-reproduction/1.0'}) + with urllib.request.urlopen(req,timeout=120) as r: + if r.status!=206:raise RuntimeError('Server did not honor byte range') + if not r.headers.get('Content-Range','').startswith(f'bytes {start}-{end}/'): + raise RuntimeError('Unexpected content range') + data=r.read() + if len(data)!=size:raise RuntimeError('Incomplete byte range') + self.position+=size + return data + except Exception: + if attempt==3:raise + time.sleep(2**attempt) diff --git a/scientific-workflows/mafaulda-tinyml/scripts/run_stage.py b/scientific-workflows/mafaulda-tinyml/scripts/run_stage.py new file mode 100644 index 0000000..6a46077 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/scripts/run_stage.py @@ -0,0 +1,123 @@ +from common import * +from scipy import stats +import os +import zipfile + +stage,out=arguments() +classes=json.loads((DATA/'sources.json').read_text())['classes'] +notebook=json.loads((DATA/'inputs/original.ipynb').read_text()) +if stage=='validate-inputs': + receipt=inputs();assert len(receipt['files'])==31 + write(out/'inputs-validated.json',{'recordings':30,'classes':6}) +elif stage.startswith('features-'): + label=int(stage[-1]);name=classes[label] + env=dict(globals(),SAMPLE_RATE=50000,WINDOW_SIZE=2048,HOP_SIZE=1024,MAX_WINDOWS_PER_FILE=50,COL_NAMES=['tach','ub_rad','ub_ax','ub_tan','ob_rad','ob_ax','ob_tan','mic'],ACCEL_COLS=['ub_rad','ub_ax','ub_tan','ob_rad','ob_ax','ob_tan']) + for i in [6,7]:exec(compile(''.join(notebook['cells'][i]['source']),'original-notebook-cell-'+str(i),'exec'),env) + rows=[] + for p in sorted((DATA/'inputs/recordings'/name).rglob('*.csv')): + values=env['process_file'](str(p),label,name) + assert len(values)==50 + for v in values:v['file']=str(p.relative_to(DATA/'inputs/recordings')) + rows.extend(values) + assert len(rows)==250 + pd.DataFrame(rows).to_csv(out/(stage+'.csv'),index=False) +elif stage=='merge-features': + df=pd.concat([pd.read_csv(out/f'features-{i}.csv') for i in range(6)],ignore_index=True) + cols=[c for c in df.columns if c not in ['label','condition','file']] + assert len(df)==1500 and len(cols)==132 and df.file.nunique()==30 + assert np.isfinite(df[cols].to_numpy()).all() + df.to_csv(out/'features.csv',index=False) +elif stage.startswith('train-'): + from sklearn.model_selection import StratifiedGroupKFold + from sklearn.preprocessing import StandardScaler + from sklearn.metrics import f1_score,confusion_matrix + from sklearn.ensemble import RandomForestClassifier + import joblib + model_name=stage[6:];df=pd.read_csv(out/'features.csv');cols=[c for c in df if c not in ['label','condition','file']] + X=df[cols].to_numpy(dtype=np.float32);y=df.label.to_numpy();groups=df.file.to_numpy() + cv=StratifiedGroupKFold(n_splits=5,shuffle=True,random_state=42) + if model_name!='rf': + import tensorflow as tf + from tensorflow import keras + from tensorflow.keras import layers + tf.keras.utils.set_random_seed(42) + env=dict(keras=keras,layers=layers) + exec(compile(''.join(notebook['cells'][13]['source']),'original-notebook-cell-13','exec'),env) + records=[];cm=None + work=out/(model_name+'-bundle');work.mkdir() + standard=os.environ.get('AKOFLOW_PROFILE')=='standard' + epochs=(15 if model_name=='lstm' else 50) if standard else (5 if model_name=='lstm' else 10) + for fold,(tr,te) in enumerate(cv.split(X,y,groups)): + assert not set(groups[tr])&set(groups[te]) + sc=StandardScaler();a=sc.fit_transform(X[tr]).astype(np.float32);b=sc.transform(X[te]).astype(np.float32) + if model_name=='rf': + model=RandomForestClassifier(n_estimators=200,max_depth=20,min_samples_split=5,min_samples_leaf=2,random_state=42,n_jobs=1) + model.fit(a,y[tr]);pred=model.predict(b) + else: + tf.keras.backend.clear_session();tf.keras.utils.set_random_seed(42+fold) + model=env['build_'+model_name](132,6) + if model_name!='mlp':a=a[...,None];b=b[...,None] + model.fit(a,y[tr],epochs=epochs,batch_size=64,verbose=0) + pred=model.predict(b,verbose=0).argmax(axis=1) + records.append({'fold':fold,'f1':float(f1_score(y[te],pred,average='macro')),'testWindows':len(te),'testRecordings':len(set(groups[te]))}) + if fold==4: + cm=confusion_matrix(y[te],pred,labels=list(range(6))).tolist() + np.savez_compressed(work/'split.npz',train=a,test=b,train_labels=y[tr],test_labels=y[te]) + if model_name=='rf':joblib.dump(model,work/'model.joblib') + else:model.save(work/'model.keras') + result={'model':model_name,'folds':records,'meanF1':float(np.mean([r['f1'] for r in records])),'lastFoldConfusion':cm,'epochs':0 if model_name=='rf' else epochs,'recordingGroupsDisjoint':True} + write(out/(model_name+'-baseline.json'),result) + with zipfile.ZipFile(out/(model_name+'-model.zip'),'w',zipfile.ZIP_DEFLATED) as archive: + for p in work.iterdir():archive.write(p,p.name) +elif stage=='compare': + baselines=[json.loads((out/(m+'-baseline.json')).read_text()) for m in ['mlp','cnn','lstm','rf']] + rows=[json.loads((out/(m+'-'+q+'.json')).read_text()) for m in ['mlp','cnn','lstm'] for q in ['fp32','fp16','int8']] + assert len(rows)==9 and all(np.isfinite(r['f1']) and 0<=r['f1']<=1 for r in rows) + assert all(r['calibrationTestOverlap']==0 for r in rows) + pd.DataFrame(rows).to_csv(out/'metrics.csv',index=False) + fig,axes=plt.subplots(1,2,figsize=(12,5),constrained_layout=True) + for m in ['mlp','cnn','lstm']: + s=[r for r in rows if r['model']==m] + axes[0].plot([r['sizeKiB'] for r in s],[r['f1'] for r in s],marker='o',label=m) + for r in s:axes[0].annotate(r['quantization'],(r['sizeKiB'],r['f1']),fontsize=7) + axes[0].set_xscale('log');axes[0].set_ylim(0,1.05);axes[0].set_xlabel('TFLite size (KiB, log scale)');axes[0].set_ylabel('Held-out final-fold macro F1');axes[0].legend() + axes[1].bar([r['model'] for r in baselines],[r['meanF1'] for r in baselines],color='#426c95');axes[1].set_ylim(0,1.05);axes[1].set_ylabel('Mean macro F1 over five held-out folds') + fig.suptitle('MAFAULDA — 30 original recordings; portable profile, not paper-score reproduction') + fig.savefig(out/'quantization-comparison.png');plt.close(fig) + fig,axes=plt.subplots(1,4,figsize=(14,4),constrained_layout=True) + for ax,r in zip(axes,baselines): + ax.imshow(r['lastFoldConfusion'],cmap='Blues');ax.set_title(r['model']);ax.set_xlabel('Predicted fault class');ax.set_ylabel('True fault class') + fig.savefig(out/'confusion-matrices.png');plt.close(fig) + with zipfile.ZipFile(out/'quantized-models.zip','w',zipfile.ZIP_DEFLATED) as z: + for m in ['mlp','cnn','lstm']: + for q in ['fp32','fp16','int8']: + p=out/(m+'-'+q+'.tflite');z.write(p,p.name) + finish(out,['metrics.csv','quantization-comparison.png','confusion-matrices.png','quantized-models.zip'],{'recordings':30,'classes':6,'windows':1500,'features':132,'baselineModels':baselines,'quantizedModels':9,'evaluation':'recording-disjoint 5-fold; quantization calibration=train, evaluation=test','paperScoreAgreementClaimed':False}) +else: + import tensorflow as tf + from sklearn.metrics import f1_score + model_name,level=stage.split('-');work=out/(stage+'-bundle');work.mkdir() + with zipfile.ZipFile(out/(model_name+'-model.zip')) as archive: + for name in ['model.keras','split.npz']:(work/name).write_bytes(archive.read(name)) + split=np.load(work/'split.npz');model=tf.keras.models.load_model(work/'model.keras') + converter=tf.lite.TFLiteConverter.from_keras_model(model) + if level=='fp16': + converter.optimizations=[tf.lite.Optimize.DEFAULT];converter.target_spec.supported_types=[tf.float16] + if level=='int8': + converter.optimizations=[tf.lite.Optimize.DEFAULT] + a=split['train'];labels=split['train_labels'];rng=np.random.default_rng(42) + indices=np.concatenate([rng.choice(np.flatnonzero(labels==c),min(100,int((labels==c).sum())),replace=False) for c in range(6)]) + def representative(): + for i in indices:yield [a[i:i+1].astype(np.float32)] + converter.representative_dataset=representative;converter.target_spec.supported_ops=[tf.lite.OpsSet.TFLITE_BUILTINS_INT8] + converter.inference_input_type=tf.int8;converter.inference_output_type=tf.int8 + b=converter.convert();(out/(stage+'.tflite')).write_bytes(b) + interpreter=tf.lite.Interpreter(model_content=b,num_threads=1);interpreter.allocate_tensors() + info=interpreter.get_input_details()[0];output=interpreter.get_output_details()[0];pred=[] + for row in split['test']: + x=row[None,...].astype(np.float32) + if info['dtype']==np.int8: + scale,z=info['quantization'];assert scale>0 + x=np.clip(np.rint(x/scale+z),-128,127).astype(np.int8) + interpreter.set_tensor(info['index'],x);interpreter.invoke();pred.append(int(interpreter.get_tensor(output['index']).argmax())) + write(out/(stage+'.json'),{'model':model_name,'quantization':level,'sizeKiB':len(b)/1024,'f1':float(f1_score(split['test_labels'],pred,average='macro')),'testWindows':len(pred),'calibrationTestOverlap':0}) diff --git a/scientific-workflows/mafaulda-tinyml/scripts/validate.py b/scientific-workflows/mafaulda-tinyml/scripts/validate.py new file mode 100644 index 0000000..1a846f9 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/scripts/validate.py @@ -0,0 +1,11 @@ +import json +from pathlib import Path +from common import digest +root = Path(__file__).resolve().parents[1] +out = root / 'outputs' +m = json.loads((out / 'manifest.json').read_text()) +v = json.loads((out / 'scientific-validation.json').read_text()) +assert m['status'] == 'success' and v['status'] == 'passed' +for name in m['artifacts']: + assert digest(out / name) == m['sha256'][name], name +print(json.dumps(v['findings'], ensure_ascii=False)) diff --git a/scientific-workflows/mafaulda-tinyml/topology.yaml b/scientific-workflows/mafaulda-tinyml/topology.yaml new file mode 100644 index 0000000..a32fdbe --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/topology.yaml @@ -0,0 +1,5 @@ +id: mafaulda-tinyml-local-topology +name: mafaulda-tinyml-local local topology +version: 1 +executionScopeId: mafaulda-tinyml-local-scope +links: [] diff --git a/scientific-workflows/mafaulda-tinyml/validate.sh b/scientific-workflows/mafaulda-tinyml/validate.sh new file mode 100755 index 0000000..fda8497 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/validate.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +result="${AKOFLOW_RESULT_DIR:-$root/outputs}" +docker run --rm --network none --mount "type=bind,src=$result,dst=/outputs,readonly" --mount "type=bind,src=$root/expected,dst=/verification,readonly" --entrypoint python akoflow-local/mafaulda-tinyml:workload /verification/validate.py diff --git a/scientific-workflows/mafaulda-tinyml/workflow.yaml b/scientific-workflows/mafaulda-tinyml/workflow.yaml new file mode 100644 index 0000000..114ea84 --- /dev/null +++ b/scientific-workflows/mafaulda-tinyml/workflow.yaml @@ -0,0 +1,518 @@ +name: mafaulda-tinyml +spec: + namespace: akoflow-examples + image: akoflow-local/mafaulda-tinyml:workload + activities: + - name: validate-inputs + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: [] + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - validate-inputs + - --output + - . + - name: features-0 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - features-0 + - --output + - . + - name: features-1 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - features-1 + - --output + - . + - name: features-2 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - features-2 + - --output + - . + - name: features-3 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - features-3 + - --output + - . + - name: features-4 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - features-4 + - --output + - . + - name: features-5 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - features-5 + - --output + - . + - name: merge-features + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - features-0 + - features-1 + - features-2 + - features-3 + - features-4 + - features-5 + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - merge-features + - --output + - . + - name: train-mlp + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - merge-features + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - train-mlp + - --output + - . + - name: train-cnn + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - merge-features + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - train-cnn + - --output + - . + - name: train-lstm + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - merge-features + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - train-lstm + - --output + - . + - name: train-rf + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - merge-features + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - train-rf + - --output + - . + - name: mlp-fp32 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-mlp + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mlp-fp32 + - --output + - . + - name: mlp-fp16 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-mlp + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mlp-fp16 + - --output + - . + - name: mlp-int8 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-mlp + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mlp-int8 + - --output + - . + - name: cnn-fp32 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-cnn + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - cnn-fp32 + - --output + - . + - name: cnn-fp16 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-cnn + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - cnn-fp16 + - --output + - . + - name: cnn-int8 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-cnn + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - cnn-int8 + - --output + - . + - name: lstm-fp32 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-lstm + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - lstm-fp32 + - --output + - . + - name: lstm-fp16 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-lstm + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - lstm-fp16 + - --output + - . + - name: lstm-int8 + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-lstm + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - lstm-int8 + - --output + - . + - name: compare + runtime: mafaulda-tinyml-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - train-mlp + - train-cnn + - train-lstm + - train-rf + - mlp-fp32 + - mlp-fp16 + - mlp-int8 + - cnn-fp32 + - cnn-fp16 + - cnn-int8 + - lstm-fp32 + - lstm-fp16 + - lstm-int8 + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - compare + - --output + - . + dataDependencies: + - producerActivity: validate-inputs + consumerActivity: features-0 + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: features-1 + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: features-2 + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: features-3 + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: features-4 + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: features-5 + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: features-0 + consumerActivity: merge-features + logicalName: features-0.csv + sizeBytes: 10000000 + - producerActivity: features-1 + consumerActivity: merge-features + logicalName: features-1.csv + sizeBytes: 10000000 + - producerActivity: features-2 + consumerActivity: merge-features + logicalName: features-2.csv + sizeBytes: 10000000 + - producerActivity: features-3 + consumerActivity: merge-features + logicalName: features-3.csv + sizeBytes: 10000000 + - producerActivity: features-4 + consumerActivity: merge-features + logicalName: features-4.csv + sizeBytes: 10000000 + - producerActivity: features-5 + consumerActivity: merge-features + logicalName: features-5.csv + sizeBytes: 10000000 + - producerActivity: merge-features + consumerActivity: train-mlp + logicalName: features.csv + sizeBytes: 10000000 + - producerActivity: merge-features + consumerActivity: train-cnn + logicalName: features.csv + sizeBytes: 10000000 + - producerActivity: merge-features + consumerActivity: train-lstm + logicalName: features.csv + sizeBytes: 10000000 + - producerActivity: merge-features + consumerActivity: train-rf + logicalName: features.csv + sizeBytes: 10000000 + - producerActivity: train-mlp + consumerActivity: mlp-fp32 + logicalName: mlp-model.zip + sizeBytes: 10000000 + - producerActivity: train-mlp + consumerActivity: mlp-fp16 + logicalName: mlp-model.zip + sizeBytes: 10000000 + - producerActivity: train-mlp + consumerActivity: mlp-int8 + logicalName: mlp-model.zip + sizeBytes: 10000000 + - producerActivity: train-cnn + consumerActivity: cnn-fp32 + logicalName: cnn-model.zip + sizeBytes: 10000000 + - producerActivity: train-cnn + consumerActivity: cnn-fp16 + logicalName: cnn-model.zip + sizeBytes: 10000000 + - producerActivity: train-cnn + consumerActivity: cnn-int8 + logicalName: cnn-model.zip + sizeBytes: 10000000 + - producerActivity: train-lstm + consumerActivity: lstm-fp32 + logicalName: lstm-model.zip + sizeBytes: 10000000 + - producerActivity: train-lstm + consumerActivity: lstm-fp16 + logicalName: lstm-model.zip + sizeBytes: 10000000 + - producerActivity: train-lstm + consumerActivity: lstm-int8 + logicalName: lstm-model.zip + sizeBytes: 10000000 + - producerActivity: train-mlp + consumerActivity: compare + logicalName: mlp-baseline.json + sizeBytes: 10000000 + - producerActivity: train-cnn + consumerActivity: compare + logicalName: cnn-baseline.json + sizeBytes: 10000000 + - producerActivity: train-lstm + consumerActivity: compare + logicalName: lstm-baseline.json + sizeBytes: 10000000 + - producerActivity: train-rf + consumerActivity: compare + logicalName: rf-baseline.json + sizeBytes: 10000000 + - producerActivity: mlp-fp32 + consumerActivity: compare + logicalName: mlp-fp32.json + sizeBytes: 10000000 + - producerActivity: mlp-fp32 + consumerActivity: compare + logicalName: mlp-fp32.tflite + sizeBytes: 10000000 + - producerActivity: mlp-fp16 + consumerActivity: compare + logicalName: mlp-fp16.json + sizeBytes: 10000000 + - producerActivity: mlp-fp16 + consumerActivity: compare + logicalName: mlp-fp16.tflite + sizeBytes: 10000000 + - producerActivity: mlp-int8 + consumerActivity: compare + logicalName: mlp-int8.json + sizeBytes: 10000000 + - producerActivity: mlp-int8 + consumerActivity: compare + logicalName: mlp-int8.tflite + sizeBytes: 10000000 + - producerActivity: cnn-fp32 + consumerActivity: compare + logicalName: cnn-fp32.json + sizeBytes: 10000000 + - producerActivity: cnn-fp32 + consumerActivity: compare + logicalName: cnn-fp32.tflite + sizeBytes: 10000000 + - producerActivity: cnn-fp16 + consumerActivity: compare + logicalName: cnn-fp16.json + sizeBytes: 10000000 + - producerActivity: cnn-fp16 + consumerActivity: compare + logicalName: cnn-fp16.tflite + sizeBytes: 10000000 + - producerActivity: cnn-int8 + consumerActivity: compare + logicalName: cnn-int8.json + sizeBytes: 10000000 + - producerActivity: cnn-int8 + consumerActivity: compare + logicalName: cnn-int8.tflite + sizeBytes: 10000000 + - producerActivity: lstm-fp32 + consumerActivity: compare + logicalName: lstm-fp32.json + sizeBytes: 10000000 + - producerActivity: lstm-fp32 + consumerActivity: compare + logicalName: lstm-fp32.tflite + sizeBytes: 10000000 + - producerActivity: lstm-fp16 + consumerActivity: compare + logicalName: lstm-fp16.json + sizeBytes: 10000000 + - producerActivity: lstm-fp16 + consumerActivity: compare + logicalName: lstm-fp16.tflite + sizeBytes: 10000000 + - producerActivity: lstm-int8 + consumerActivity: compare + logicalName: lstm-int8.json + sizeBytes: 10000000 + - producerActivity: lstm-int8 + consumerActivity: compare + logicalName: lstm-int8.tflite + sizeBytes: 10000000 diff --git a/scientific-workflows/sqlsim/.dockerignore b/scientific-workflows/sqlsim/.dockerignore new file mode 100644 index 0000000..f7c11d3 --- /dev/null +++ b/scientific-workflows/sqlsim/.dockerignore @@ -0,0 +1,5 @@ +outputs +screenshots +evidence +.venv +**/__pycache__ diff --git a/scientific-workflows/sqlsim/.gitignore b/scientific-workflows/sqlsim/.gitignore new file mode 100644 index 0000000..194ed53 --- /dev/null +++ b/scientific-workflows/sqlsim/.gitignore @@ -0,0 +1,3 @@ +data/inputs/ +outputs/ +outputs-daemon/ diff --git a/scientific-workflows/sqlsim/README.md b/scientific-workflows/sqlsim/README.md new file mode 100644 index 0000000..aa5b0d2 --- /dev/null +++ b/scientific-workflows/sqlsim/README.md @@ -0,0 +1,76 @@ +# SQLSIM — analytical similarity queries in PostgreSQL + +Conference tags: `bresci`, `bresci-2024`. [Browse BreSci on the Hub](https://hub.akoflow.com/categories/bresci). + +Adapted from **XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD**. Original authors: **Antônio Lívio C. de Mendonça, Maria Camila N. Barioni, Humberto Razente**. + +[Original paper](https://sol.sbc.org.br/index.php/bresci/article/view/30580) · [Original code and data](https://github.com/liviomendonca/sqlsim) + +## Scientific scope + +Execute the original PL/pgSQL functions and both original 2D/3D CUBE queries on all 569 original Wisconsin Diagnostic Breast Cancer observations supplied by the authors. Each query gets an isolated PostgreSQL/PostGIS instance, so parallel activities do not mutate one another’s clustering state. Transport path is adapted and PostgreSQL random seed is fixed to 0.42 for the authors’ generated hospital/date dimensions. Hospital locations and dates are illustrative generated dimensions, not clinical provenance. Runtime uses PostgreSQL 15/PostGIS 3 on Debian Bookworm rather than the paper’s PostgreSQL 16.3; result semantics, not timing equivalence, are checked. Original dataset: https://archive.ics.uci.edu/dataset/17/breast+cancer+wisconsin+diagnostic . Upstream repository has no explicit code license; no redistribution grant is inferred. + +This is an adaptation of the cited scientific application to native AkôFlow activities. It is not a claim of exact agreement with the paper. Source URLs, immutable revisions and input SHA-256 hashes are recorded in `data/sources.json` and `data/acquisition.json`. Original authors retain authorship of the scientific methods and artifacts; the AkôFlow contribution is orchestration, packaging and validation. + +## Execute + +[Original input URL manifest](data/sources.json) · [Verified input SHA-256 receipts](data/acquisition.json) · [Scientific provenance](data/provenance.json) + +```sh +./prepare.sh +./run.sh +``` + +Preparation acquires original inputs and builds the image. All computation then executes with networking disabled. No synthetic fallback replaces unavailable original data. `AKOFLOW_PARALLEL` controls standalone concurrency. + +To register and execute in Desktop through the local daemon, from the repository root: + +```sh +go run ./tools/daemon-local -example scientific-workflows/sqlsim -env-file /path/to/installation.env -api-url http://YOUR_DAEMON:8080/akoflow-api -lanes 3 +``` + +Tracking item: [AKO-46](https://github.com/UFFeScience/akoflow-examples/issues/46). + +The daemon records the exact image and execution identity in `evidence/daemon-run.json`. `workflow.yaml` declares dependencies and explicit artifact transfers. `outputs/scientific-validation.json` contains semantic checks and findings. A successful exit alone is not a scientific validation. + +## Results + +Native daemon run `sqlsim-local-164a71f419-run-20261117t150646.625598270` completed **4/4 activities**. Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results. + +Findings: + +```json +{ + "observations": 569, + "queries": { + "cube-2d": { + "cubeRows": 486, + "assignedObservations": 569, + "metricClusters": 115, + "spatialClusters": 8 + }, + "cube-3d": { + "cubeRows": 1121, + "assignedObservations": 569, + "metricClusters": 67, + "spatialClusters": 8 + } + }, + "databaseIsolation": "one PostgreSQL cluster per activity", + "seed": 0.42 +} +``` + +![query comparison](screenshots/current/query-comparison.png) + +![similarity clusters](screenshots/current/similarity-clusters.png) + +## Observed parallel execution + +The native run completed 4 activities in **15.90 seconds**, with **2 overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline. + +![Measured execution timeline](screenshots/current/execution-timeline.png) + +Python dependency versions from the measured image are retained in [`evidence/python-packages.txt`](evidence/python-packages.txt). Independent post-run validation is recorded in [`evidence/independent-validation.json`](evidence/independent-validation.json). + +To regenerate the execution timeline from an observed run, mount this bundle at `/bundle` in its measured image and run `python /bundle/expected/render_execution.py`. The renderer uses `evidence/daemon-run.json`; predicted schedule times are excluded. diff --git a/scientific-workflows/sqlsim/data/acquisition.json b/scientific-workflows/sqlsim/data/acquisition.json new file mode 100644 index 0000000..0cc7291 --- /dev/null +++ b/scientific-workflows/sqlsim/data/acquisition.json @@ -0,0 +1,28 @@ +{ + "files": [ + { + "path": "wdbc.data", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/wdbc.data", + "sha256": "d606af411f3e5be8a317a5a8b652b425aaf0ff38ca683d5327ffff94c3695f4a", + "bytes": 124103 + }, + { + "path": "data_preparation.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/data_preparation.sql", + "sha256": "ca5be806e5538c64c1102831dfeb31fe23e45295d199d66d16df7e2433fd876f", + "bytes": 3400 + }, + { + "path": "functions.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/main.sql", + "sha256": "c480f237b511b2f26ea98c74b5f0154157eb1416766501d19ff7641ca93bbba5", + "bytes": 3561 + }, + { + "path": "queries.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/main.sql", + "sha256": "acfbcd3532fa8f7d32f201d4db8341694bae9c878272ddc71d63b5cde050fe05", + "bytes": 761 + } + ] +} diff --git a/scientific-workflows/sqlsim/data/dag.json b/scientific-workflows/sqlsim/data/dag.json new file mode 100644 index 0000000..3de3ab5 --- /dev/null +++ b/scientific-workflows/sqlsim/data/dag.json @@ -0,0 +1,122 @@ +{ + "name": "sqlsim", + "spec": { + "namespace": "akoflow-examples", + "image": "akoflow-local/sqlsim:workload", + "activities": [ + { + "name": "validate-inputs", + "runtime": "sqlsim-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "validate-inputs", + "--output", + "." + ] + } + }, + { + "name": "cube-2d", + "runtime": "sqlsim-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "cube-2d", + "--output", + "." + ] + } + }, + { + "name": "cube-3d", + "runtime": "sqlsim-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "cube-3d", + "--output", + "." + ] + } + }, + { + "name": "compare", + "runtime": "sqlsim-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "cube-2d", + "cube-3d" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "compare", + "--output", + "." + ] + } + } + ], + "dataDependencies": [ + { + "producerActivity": "validate-inputs", + "consumerActivity": "cube-2d", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "cube-3d", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "cube-2d", + "consumerActivity": "compare", + "logicalName": "cube-2d.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "cube-2d", + "consumerActivity": "compare", + "logicalName": "cube-2d-assignments.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "cube-3d", + "consumerActivity": "compare", + "logicalName": "cube-3d.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "cube-3d", + "consumerActivity": "compare", + "logicalName": "cube-3d-assignments.csv", + "sizeBytes": 10000000 + } + ] + } +} diff --git a/scientific-workflows/sqlsim/data/provenance.json b/scientific-workflows/sqlsim/data/provenance.json new file mode 100644 index 0000000..6f205e0 --- /dev/null +++ b/scientific-workflows/sqlsim/data/provenance.json @@ -0,0 +1,20 @@ +{ + "slug": "sqlsim", + "title": "SQLSIM — analytical similarity queries in PostgreSQL", + "authors": [ + "Antônio Lívio C. de Mendonça", + "Maria Camila N. Barioni", + "Humberto Razente" + ], + "conference": "XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/30580", + "source": "https://github.com/liviomendonca/sqlsim", + "scope": "Execute the original PL/pgSQL functions and both original 2D/3D CUBE queries on all 569 original Wisconsin Diagnostic Breast Cancer observations supplied by the authors. Each query gets an isolated PostgreSQL/PostGIS instance, so parallel activities do not mutate one another’s clustering state. Transport path is adapted and PostgreSQL random seed is fixed to 0.42 for the authors’ generated hospital/date dimensions. Hospital locations and dates are illustrative generated dimensions, not clinical provenance. Runtime uses PostgreSQL 15/PostGIS 3 on Debian Bookworm rather than the paper’s PostgreSQL 16.3; result semantics, not timing equivalence, are checked. Original dataset: https://archive.ics.uci.edu/dataset/17/breast+cancer+wisconsin+diagnostic . Upstream repository has no explicit code license; no redistribution grant is inferred.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence.", + "tags": [ + "bresci", + "bresci-2024", + "scientific-reproducibility", + "scientific-workflows" + ] +} diff --git a/scientific-workflows/sqlsim/data/sources.json b/scientific-workflows/sqlsim/data/sources.json new file mode 100644 index 0000000..52509c4 --- /dev/null +++ b/scientific-workflows/sqlsim/data/sources.json @@ -0,0 +1,20 @@ +{ + "files": [ + { + "path": "wdbc.data", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/wdbc.data" + }, + { + "path": "data_preparation.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/data_preparation.sql" + }, + { + "path": "functions.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/main.sql" + }, + { + "path": "queries.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/main.sql" + } + ] +} diff --git a/scientific-workflows/sqlsim/docker/Dockerfile b/scientific-workflows/sqlsim/docker/Dockerfile new file mode 100644 index 0000000..82d2dab --- /dev/null +++ b/scientific-workflows/sqlsim/docker/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.11.13-slim-bookworm@sha256:86adf8dbadc3d6e82ee5dd2c74bec2e1c2467cdad47886280501df722372d2e1 +ENV MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 PYTHONDONTWRITEBYTECODE=1 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +RUN apt-get update && apt-get install -y --no-install-recommends postgresql-15 postgresql-15-postgis-3 && rm -rf /var/lib/apt/lists/* && useradd --uid 1000 --no-create-home scientist && useradd --uid 1001 --no-create-home ci-scientist +COPY scripts /app/scripts +COPY data /app/data +ENV PATH=/usr/lib/postgresql/15/bin:$PATH diff --git a/scientific-workflows/sqlsim/environment.yaml b/scientific-workflows/sqlsim/environment.yaml new file mode 100644 index 0000000..4e8a47c --- /dev/null +++ b/scientific-workflows/sqlsim/environment.yaml @@ -0,0 +1,42 @@ +environment: + id: sqlsim-local + name: sqlsim-local local Docker + description: CPU-only local execution; no remote capacity is provisioned + status: ready +version: + id: sqlsim-local-v1 + environmentId: sqlsim-local + version: 1 + status: published + networkModel: local + interferenceModel: none + costModel: free + configurationHash: sqlsim-local-v1 +runtimes: + - environmentVersionId: sqlsim-local-v1 + id: sqlsim-local-local + name: Local Docker host + driver: local + mode: execution + role: compute + capabilities: {batch: true, container: true} +resources: + - id: sqlsim-local-local-docker + environmentVersionId: sqlsim-local-v1 + type: machine + name: Local Docker host + providerId: local-docker + cpuCores: 4 + cpuCapacity: 4 + memoryBytes: 8589934592 + storageBytes: 21474836480 + computeSpeedup: 1 + pricePerSecond: 0 + bootOverheadSeconds: 0 + containerOverheadSeconds: 0 + schedulable: true +storages: [] +connections: [] +activityResourceProfiles: [] +resourceRuntimeBindings: + - {resourceId: sqlsim-local-local-docker, runtimeId: sqlsim-local-local, enabled: true} diff --git a/scientific-workflows/sqlsim/evidence/daemon-run.json b/scientific-workflows/sqlsim/evidence/daemon-run.json new file mode 100644 index 0000000..162850d --- /dev/null +++ b/scientific-workflows/sqlsim/evidence/daemon-run.json @@ -0,0 +1,171 @@ +{ + "activityCount": 4, + "completedActivityCount": 4, + "image": "akoflow-local/sqlsim:local-fdf6a614d119ddf5", + "imageId": "sha256:fdf6a614d119ddf5b9b712ea9f4a7d61fbf280fe0ae80d5be6dbf55c742d573a", + "observedAt": "2026-11-17T15:07:05Z", + "planId": "sqlsim-local-164a71f419-manual-plan-20261117t150646.566791652", + "projection": { + "run": { + "activityCount": 4, + "breakdown": { + "computeSeconds": 18.624934911727905, + "interferenceSeconds": 0, + "overheadSeconds": 0, + "queueSeconds": 0, + "transferSeconds": 0.9772143363952637 + }, + "completedActivityCount": 4, + "cost": 0, + "environmentNames": [ + "sqlsim-local local Docker" + ], + "finishedAt": "2026-11-17T15:07:04Z", + "id": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "kind": "workflow", + "makespanSeconds": 15.898435115814209, + "mode": "real", + "schedulePlanId": "sqlsim-local-164a71f419-manual-plan-20261117t150646.566791652", + "seed": 0, + "startedAt": "2026-11-17T15:06:46Z", + "status": "completed", + "title": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "transferredBytes": 52645, + "workflowId": "sqlsim-local-164a71f419", + "workflowName": "sqlsim-local-164a71f419", + "workflowVersionId": "sqlsim-local-164a71f419-v1" + }, + "activities": [ + { + "activityId": "sqlsim-local-164a71f419-validate-inputs", + "allocatedResourceId": "sqlsim-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "finishedAt": 1794928008.323404, + "id": "sqlsim-local-164a71f419-run-20261117t150646.625598270:sqlsim-local-164a71f419-validate-inputs", + "interferenceSeconds": 0, + "metadata": { + "pricePerSecond": 0, + "runtimeId": "sqlsim-local-local" + }, + "overheadSeconds": 0, + "planAssignmentId": "sqlsim-local-164a71f419-manual-plan-20261117t150646.566791652-sqlsim-local-164a71f419-validate-inputs", + "plannedResourceId": "sqlsim-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928007.0572033, + "readyAt": 1794928007.0572033, + "runtimeId": "sqlsim-local-local", + "runtimeSeconds": 0.9472670555114746, + "startedAt": 1794928007.376137, + "status": "completed", + "transferBytes": 0, + "transferSeconds": 0 + }, + { + "activityId": "sqlsim-local-164a71f419-cube-3d", + "allocatedResourceId": "sqlsim-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "finishedAt": 1794928018.8271966, + "id": "sqlsim-local-164a71f419-run-20261117t150646.625598270:sqlsim-local-164a71f419-cube-3d", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5813772678375244, + "preparationFinishedAt": 1794928010.3833342, + "preparationStartedAt": 1794928010.2073843, + "pricePerSecond": 0, + "readyWaitSeconds": 0.030260086059570312, + "runtimeId": "sqlsim-local-local", + "transferElapsedSeconds": 0.1759498119354248, + "transferWorkSeconds": 0.1759498119354248 + }, + "overheadSeconds": 0, + "planAssignmentId": "sqlsim-local-164a71f419-manual-plan-20261117t150646.566791652-sqlsim-local-164a71f419-cube-3d", + "plannedResourceId": "sqlsim-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928010.1356344, + "readyAt": 1794928010.1356344, + "runtimeId": "sqlsim-local-local", + "runtimeSeconds": 7.86248517036438, + "startedAt": 1794928010.9647114, + "status": "completed", + "transferBytes": 51, + "transferSeconds": 0.1759498119354248 + }, + { + "activityId": "sqlsim-local-164a71f419-cube-2d", + "allocatedResourceId": "sqlsim-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "finishedAt": 1794928018.959319, + "id": "sqlsim-local-164a71f419-run-20261117t150646.625598270:sqlsim-local-164a71f419-cube-2d", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.6248228549957275, + "preparationFinishedAt": 1794928010.3687882, + "preparationStartedAt": 1794928010.1926768, + "pricePerSecond": 0, + "readyWaitSeconds": 0.0292208194732666, + "runtimeId": "sqlsim-local-local", + "transferElapsedSeconds": 0.17611145973205566, + "transferWorkSeconds": 0.17611145973205566 + }, + "overheadSeconds": 0, + "planAssignmentId": "sqlsim-local-164a71f419-manual-plan-20261117t150646.566791652-sqlsim-local-164a71f419-cube-2d", + "plannedResourceId": "sqlsim-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928010.1204455, + "readyAt": 1794928010.1204455, + "runtimeId": "sqlsim-local-local", + "runtimeSeconds": 7.965708017349243, + "startedAt": 1794928010.993611, + "status": "completed", + "transferBytes": 51, + "transferSeconds": 0.17611145973205566 + }, + { + "activityId": "sqlsim-local-164a71f419-compare", + "allocatedResourceId": "sqlsim-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "finishedAt": 1794928023.2745721, + "id": "sqlsim-local-164a71f419-run-20261117t150646.625598270:sqlsim-local-164a71f419-compare", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.450819730758667, + "preparationFinishedAt": 1794928020.9742777, + "preparationStartedAt": 1794928020.591749, + "pricePerSecond": 0, + "readyWaitSeconds": 0.08294439315795898, + "runtimeId": "sqlsim-local-local", + "transferElapsedSeconds": 0.38252878189086914, + "transferWorkSeconds": 0.6251530647277832 + }, + "overheadSeconds": 0, + "planAssignmentId": "sqlsim-local-164a71f419-manual-plan-20261117t150646.566791652-sqlsim-local-164a71f419-compare", + "plannedResourceId": "sqlsim-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794928020.4285073, + "readyAt": 1794928020.4285073, + "runtimeId": "sqlsim-local-local", + "runtimeSeconds": 1.8494746685028076, + "startedAt": 1794928021.4250975, + "status": "completed", + "transferBytes": 52543, + "transferSeconds": 0.6251530647277832 + } + ] + }, + "runId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "status": "completed", + "workflowId": "sqlsim-local-164a71f419", + "projectionScope": "Observed terminal run and activity timing records; complete event and transfer history remains available from the daemon execution API." +} diff --git a/scientific-workflows/sqlsim/evidence/execution-summary.json b/scientific-workflows/sqlsim/evidence/execution-summary.json new file mode 100644 index 0000000..dac8b16 --- /dev/null +++ b/scientific-workflows/sqlsim/evidence/execution-summary.json @@ -0,0 +1,8 @@ +{ + "runId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "imageId": "sha256:fdf6a614d119ddf5b9b712ea9f4a7d61fbf280fe0ae80d5be6dbf55c742d573a", + "completedActivities": 4, + "observedMakespanSeconds": 15.898435115814209, + "peakOverlappingActivities": 2, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" +} diff --git a/scientific-workflows/sqlsim/evidence/independent-validation.json b/scientific-workflows/sqlsim/evidence/independent-validation.json new file mode 100644 index 0000000..e39e1e3 --- /dev/null +++ b/scientific-workflows/sqlsim/evidence/independent-validation.json @@ -0,0 +1 @@ +{"status": "passed", "validator": "independent artifact semantics, SHA-256 and scientific figure pixels", "showcase": "sqlsim", "artifacts": 5} diff --git a/scientific-workflows/sqlsim/evidence/manifest.json b/scientific-workflows/sqlsim/evidence/manifest.json new file mode 100644 index 0000000..0774439 --- /dev/null +++ b/scientific-workflows/sqlsim/evidence/manifest.json @@ -0,0 +1,18 @@ +{ + "showcase": "sqlsim", + "status": "success", + "artifacts": [ + "query-results.zip", + "summary.csv", + "similarity-clusters.png", + "query-comparison.png", + "scientific-validation.json" + ], + "sha256": { + "query-results.zip": "c6b4d550892b9aa8d69150bc9969cf95f4f2e4594dc70d99c19d199ffaf3a636", + "summary.csv": "cbf359e093e26a6c631092337b07c8f511e245b9fec9d4f6e954db211c51b0ec", + "similarity-clusters.png": "99634b53f1c3ef925c353a97b4a876347b478982076f124f8314fc524b05c84b", + "query-comparison.png": "0d3d1f62e6206f430b051d1f9a261a19d2083dcd0db8533c3d169ee016c1a06a", + "scientific-validation.json": "c9a15dee2b9c4100ec02ff8157096963a40f7e84c334d46e0613480105192523" + } +} diff --git a/scientific-workflows/sqlsim/evidence/python-packages.txt b/scientific-workflows/sqlsim/evidence/python-packages.txt new file mode 100644 index 0000000..2fc187b --- /dev/null +++ b/scientific-workflows/sqlsim/evidence/python-packages.txt @@ -0,0 +1,23 @@ +cloudpickle==3.1.2 +contourpy==1.3.3 +cycler==0.12.1 +fonttools==4.68.0 +joblib==1.6.0 +kiwisolver==1.5.1 +matplotlib==3.9.2 +networkx==3.4.2 +numpy==1.26.4 +packaging==26.3 +pandas==2.2.3 +patsy==1.0.3 +pillow==13.0.0 +pyparsing==3.3.3 +pyreadr==0.5.2 +python-dateutil==4.0.0 +pytz==2026.6 +PyYAML==6.0.2 +scikit-learn==1.5.2 +scipy==1.14.1 +statsmodels==0.14.4 +threadpoolctl==3.8.0 +tzdata==2026.6 diff --git a/scientific-workflows/sqlsim/evidence/scientific-validation.json b/scientific-workflows/sqlsim/evidence/scientific-validation.json new file mode 100644 index 0000000..c959be9 --- /dev/null +++ b/scientific-workflows/sqlsim/evidence/scientific-validation.json @@ -0,0 +1,64 @@ +{ + "status": "passed", + "findings": { + "observations": 569, + "queries": { + "cube-2d": { + "cubeRows": 486, + "assignedObservations": 569, + "metricClusters": 115, + "spatialClusters": 8 + }, + "cube-3d": { + "cubeRows": 1121, + "assignedObservations": 569, + "metricClusters": 67, + "spatialClusters": 8 + } + }, + "databaseIsolation": "one PostgreSQL cluster per activity", + "seed": 0.42 + }, + "provenance": { + "slug": "sqlsim", + "title": "SQLSIM — analytical similarity queries in PostgreSQL", + "authors": [ + "Antônio Lívio C. de Mendonça", + "Maria Camila N. Barioni", + "Humberto Razente" + ], + "conference": "XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/30580", + "source": "https://github.com/liviomendonca/sqlsim", + "scope": "Execute the original PL/pgSQL functions and both original 2D/3D CUBE queries on all 569 original Wisconsin Diagnostic Breast Cancer observations supplied by the authors. Each query gets an isolated PostgreSQL/PostGIS instance, so parallel activities do not mutate one another’s clustering state. Transport path is adapted and PostgreSQL random seed is fixed to 0.42 for the authors’ generated hospital/date dimensions. Hospital locations and dates are illustrative generated dimensions, not clinical provenance. Runtime uses PostgreSQL 15/PostGIS 3 on Debian Bookworm rather than the paper’s PostgreSQL 16.3; result semantics, not timing equivalence, are checked. Original dataset: https://archive.ics.uci.edu/dataset/17/breast+cancer+wisconsin+diagnostic . Upstream repository has no explicit code license; no redistribution grant is inferred.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence." + }, + "acquisition": { + "files": [ + { + "path": "wdbc.data", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/wdbc.data", + "sha256": "d606af411f3e5be8a317a5a8b652b425aaf0ff38ca683d5327ffff94c3695f4a", + "bytes": 124103 + }, + { + "path": "data_preparation.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/data_preparation.sql", + "sha256": "ca5be806e5538c64c1102831dfeb31fe23e45295d199d66d16df7e2433fd876f", + "bytes": 3400 + }, + { + "path": "functions.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/main.sql", + "sha256": "c480f237b511b2f26ea98c74b5f0154157eb1416766501d19ff7641ca93bbba5", + "bytes": 3561 + }, + { + "path": "queries.sql", + "url": "https://raw.githubusercontent.com/liviomendonca/sqlsim/dc37bacae5c2d51fc8aa16ae1230bda3a57933c5/examples/breastcancer/main.sql", + "sha256": "acfbcd3532fa8f7d32f201d4db8341694bae9c878272ddc71d63b5cde050fe05", + "bytes": 761 + } + ] + } +} diff --git a/scientific-workflows/sqlsim/evidence/summary.csv b/scientific-workflows/sqlsim/evidence/summary.csv new file mode 100644 index 0000000..96c1dde --- /dev/null +++ b/scientific-workflows/sqlsim/evidence/summary.csv @@ -0,0 +1,3 @@ +query,cubeRows,assignedObservations,metricClusters,spatialClusters +cube-2d,486,569,115,8 +cube-3d,1121,569,67,8 diff --git a/scientific-workflows/sqlsim/expected/render_execution.py b/scientific-workflows/sqlsim/expected/render_execution.py new file mode 100644 index 0000000..fd9861b --- /dev/null +++ b/scientific-workflows/sqlsim/expected/render_execution.py @@ -0,0 +1,28 @@ +from pathlib import Path +import hashlib,json +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +root=Path('/bundle') +r=json.loads((root/'evidence/daemon-run.json').read_text()) +a=r['projection']['activities'];assert len(a)==r['activityCount'] and all(x['status']=='completed' for x in a) +a=sorted(a,key=lambda x:x['startedAt']);start=min(x['startedAt'] for x in a) +fig,ax=plt.subplots(figsize=(12,max(4,len(a)*.3)),constrained_layout=True) +colors=plt.get_cmap('tab20') +for i,x in enumerate(a): + ax.barh(i,x['finishedAt']-x['startedAt'],left=x['startedAt']-start,color=colors(i%20),height=.7) +ax.set_yticks(range(len(a)),[x['activityId'].removeprefix(r['workflowId']+'-') for x in a],fontsize=8) +ax.invert_yaxis();ax.set_xlabel('Observed seconds from first activity start');ax.set_title(root.name+' — measured native daemon execution') +ax.spines[['top','right']].set_visible(False);ax.grid(axis='x',alpha=.2) +fig.savefig(root/'screenshots/current/execution-timeline.png',dpi=150) +current=0;peak=0 +for _,delta in sorted([(x['startedAt'],1) for x in a]+[(x['finishedAt'],-1) for x in a]):current+=delta;peak=max(peak,current) +summary={'runId':r['runId'],'imageId':r['imageId'],'completedActivities':len(a),'observedMakespanSeconds':r['projection']['run']['makespanSeconds'],'peakOverlappingActivities':peak,'timingSource':'observed native startedAt/finishedAt; imported predicted times excluded'} +(root/'evidence/execution-summary.json').write_text(json.dumps(summary,indent=2)+'\n') +p=root/'screenshots/current/manifest.json';m=json.loads(p.read_text());m['source']='scientific figures copied from completed daemon outputs; timeline derived from observed native activity times' +m['figures']['execution-timeline.png']=hashlib.sha256((root/'screenshots/current/execution-timeline.png').read_bytes()).hexdigest();m['executionSummary']=summary;p.write_text(json.dumps(m,indent=2,ensure_ascii=False)+'\n') +p=root/'README.md';s=p.read_text().split('\n## Observed parallel execution\n')[0];s=s.replace('Figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. They show actual computed results, not interface mockups.', 'Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results.') +s+='\n## Observed parallel execution\n\n'+f"The native run completed {len(a)} activities in **{summary['observedMakespanSeconds']:.2f} seconds**, with **{peak} overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline.\n\n![Measured execution timeline](screenshots/current/execution-timeline.png)\n" +p.write_text(s) +print(json.dumps(summary)) diff --git a/scientific-workflows/sqlsim/expected/validate.py b/scientific-workflows/sqlsim/expected/validate.py new file mode 100644 index 0000000..c1239b9 --- /dev/null +++ b/scientific-workflows/sqlsim/expected/validate.py @@ -0,0 +1,31 @@ +import hashlib +import io +import json +from pathlib import Path +import zipfile +import numpy as np +import pandas as pd +from PIL import Image + +out=Path('/outputs') +m=json.loads((out/'manifest.json').read_text()) +v=json.loads((out/'scientific-validation.json').read_text()) +assert m['status']=='success' and v['status']=='passed' +for name in m['artifacts']: + p=out/name + assert hashlib.sha256(p.read_bytes()).hexdigest()==m['sha256'][name],name + if p.suffix=='.png': + with Image.open(p) as image: + assert min(image.size)>100 and np.asarray(image).std()>1 + +with zipfile.ZipFile(out/'query-results.zip') as z: + for name,dims in [('cube-2d',2),('cube-3d',3)]: + df=pd.read_csv(io.BytesIO(z.read(name+'.csv'))) + columns=['spatial','metric'] if dims==2 else ['spatial','temporal','metric'] + assert int(df['count'].sum())==569*2**dims + grand=df[df[columns].isna().all(axis=1)] + assert len(grand)==1 and int(grand.iloc[0]['count'])==569 + a=pd.read_csv(io.BytesIO(z.read(name+'-assignments.csv'))) + assert len(a)==569 and a.id.nunique()==569 and a.metric.notna().all() + +print(json.dumps({'status':'passed','validator':'independent artifact semantics, SHA-256 and scientific figure pixels','showcase':m['showcase'],'artifacts':len(m['artifacts'])})) diff --git a/scientific-workflows/sqlsim/prepare.sh b/scientific-workflows/sqlsim/prepare.sh new file mode 100755 index 0000000..03d1796 --- /dev/null +++ b/scientific-workflows/sqlsim/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +python3 "$root/scripts/acquire.py" +go run "$root/../../tools/showcase/main.go" -root "$root" -prepare-container diff --git a/scientific-workflows/sqlsim/requirements.txt b/scientific-workflows/sqlsim/requirements.txt new file mode 100644 index 0000000..fc39612 --- /dev/null +++ b/scientific-workflows/sqlsim/requirements.txt @@ -0,0 +1,9 @@ +numpy==1.26.4 +pandas==2.2.3 +scipy==1.14.1 +scikit-learn==1.5.2 +statsmodels==0.14.4 +matplotlib==3.9.2 +networkx==3.4.2 +pyreadr==0.5.2 +PyYAML==6.0.2 diff --git a/scientific-workflows/sqlsim/run.sh b/scientific-workflows/sqlsim/run.sh new file mode 100755 index 0000000..b487925 --- /dev/null +++ b/scientific-workflows/sqlsim/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +go run "$root/../../tools/showcase/main.go" -root "$root" -container -parallel "${AKOFLOW_PARALLEL:-3}" +if ! "$root/validate.sh"; then + rm -f "$root/outputs/manifest.json" + exit 1 +fi diff --git a/scientific-workflows/sqlsim/scope.yaml b/scientific-workflows/sqlsim/scope.yaml new file mode 100644 index 0000000..db6b7f1 --- /dev/null +++ b/scientific-workflows/sqlsim/scope.yaml @@ -0,0 +1,3 @@ +id: sqlsim-local-scope +name: sqlsim-local local scope +environmentVersionIds: [sqlsim-local-v1] diff --git a/scientific-workflows/sqlsim/screenshots/current/execution-timeline.png b/scientific-workflows/sqlsim/screenshots/current/execution-timeline.png new file mode 100644 index 0000000..cd83bcd Binary files /dev/null and b/scientific-workflows/sqlsim/screenshots/current/execution-timeline.png differ diff --git a/scientific-workflows/sqlsim/screenshots/current/manifest.json b/scientific-workflows/sqlsim/screenshots/current/manifest.json new file mode 100644 index 0000000..64a13ab --- /dev/null +++ b/scientific-workflows/sqlsim/screenshots/current/manifest.json @@ -0,0 +1,38 @@ +{ + "runId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "image": "akoflow-local/sqlsim:local-fdf6a614d119ddf5", + "imageId": "sha256:fdf6a614d119ddf5b9b712ea9f4a7d61fbf280fe0ae80d5be6dbf55c742d573a", + "source": "scientific figures copied from completed daemon outputs; timeline derived from observed native activity times", + "figures": { + "query-comparison.png": "0d3d1f62e6206f430b051d1f9a261a19d2083dcd0db8533c3d169ee016c1a06a", + "similarity-clusters.png": "99634b53f1c3ef925c353a97b4a876347b478982076f124f8314fc524b05c84b", + "execution-timeline.png": "d0290ced4d53dcec45aeea7c34b863315acb4885220d2ce67f2b57209e284879" + }, + "findings": { + "observations": 569, + "queries": { + "cube-2d": { + "cubeRows": 486, + "assignedObservations": 569, + "metricClusters": 115, + "spatialClusters": 8 + }, + "cube-3d": { + "cubeRows": 1121, + "assignedObservations": 569, + "metricClusters": 67, + "spatialClusters": 8 + } + }, + "databaseIsolation": "one PostgreSQL cluster per activity", + "seed": 0.42 + }, + "executionSummary": { + "runId": "sqlsim-local-164a71f419-run-20261117t150646.625598270", + "imageId": "sha256:fdf6a614d119ddf5b9b712ea9f4a7d61fbf280fe0ae80d5be6dbf55c742d573a", + "completedActivities": 4, + "observedMakespanSeconds": 15.898435115814209, + "peakOverlappingActivities": 2, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" + } +} diff --git a/scientific-workflows/sqlsim/screenshots/current/query-comparison.png b/scientific-workflows/sqlsim/screenshots/current/query-comparison.png new file mode 100644 index 0000000..353fdc2 Binary files /dev/null and b/scientific-workflows/sqlsim/screenshots/current/query-comparison.png differ diff --git a/scientific-workflows/sqlsim/screenshots/current/similarity-clusters.png b/scientific-workflows/sqlsim/screenshots/current/similarity-clusters.png new file mode 100644 index 0000000..8449b3a Binary files /dev/null and b/scientific-workflows/sqlsim/screenshots/current/similarity-clusters.png differ diff --git a/scientific-workflows/sqlsim/scripts/acquire.py b/scientific-workflows/sqlsim/scripts/acquire.py new file mode 100644 index 0000000..2ec5a91 --- /dev/null +++ b/scientific-workflows/sqlsim/scripts/acquire.py @@ -0,0 +1,48 @@ +import hashlib +import json +from pathlib import Path +import urllib.request +import time + +root = Path(__file__).resolve().parents[1] +data = root / 'data' +config = json.loads((data / 'sources.json').read_text()) +previous = {} +if (data / 'acquisition.json').exists(): + previous = {f['path']: f for f in json.loads((data / 'acquisition.json').read_text())['files']} +receipts = [] +for item in config['files']: + target = data / 'inputs' / item['path'] + target.parent.mkdir(parents=True, exist_ok=True) + old = previous.get(item['path'], {}) + pinned = item.get('sha256') or (old.get('sha256') if old.get('url') == item['url'] else None) + if target.exists() and old.get('url') == item['url']: + expected = item.get('sha256', old.get('sha256')) + observed = hashlib.sha256(target.read_bytes()).hexdigest() + if expected == observed: + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + continue + temp = target.with_suffix(target.suffix + '.partial') + for attempt in range(4): + try: + request = urllib.request.Request(item['url'], headers={'User-Agent': 'Akoflow-scientific-reproduction/1.0'}) + with urllib.request.urlopen(request, timeout=120) as src, temp.open('wb') as dst: + while chunk := src.read(1024 * 1024): + dst.write(chunk) + observed = hashlib.sha256(temp.read_bytes()).hexdigest() + if pinned and pinned != observed: + raise RuntimeError('Pinned SHA256 mismatch: ' + item['path']) + if item.get('md5') and hashlib.md5(temp.read_bytes()).hexdigest() != item['md5']: + raise RuntimeError('Vendor MD5 mismatch: ' + item['path']) + if item.get('bytes') and temp.stat().st_size != item['bytes']: + raise RuntimeError('Length mismatch: ' + item['path']) + temp.replace(target) + break + except Exception: + temp.unlink(missing_ok=True) + if attempt == 3: + raise + time.sleep(2 ** attempt) + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + print('Verified', item['path'], target.stat().st_size, flush=True) +(data / 'acquisition.json').write_text(json.dumps({'files': receipts}, indent=2) + '\n') diff --git a/scientific-workflows/sqlsim/scripts/common.py b/scientific-workflows/sqlsim/scripts/common.py new file mode 100644 index 0000000..35a6f20 --- /dev/null +++ b/scientific-workflows/sqlsim/scripts/common.py @@ -0,0 +1,50 @@ +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import numpy as np +import pandas as pd +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +ROOT = Path(__file__).resolve().parents[1] +DATA = ROOT / 'data' +plt.rcParams.update({'figure.dpi': 150, 'axes.spines.top': False, 'axes.spines.right': False}) + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + +def write(path, value): + Path(path).write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') + +def inputs(): + receipt = json.loads((DATA / 'acquisition.json').read_text()) + for item in receipt['files']: + p = DATA / 'inputs' / item['path'] + if digest(p) != item['sha256']: + raise RuntimeError('Input checksum mismatch: ' + str(p)) + return receipt + +def finish(output, artifacts, findings): + provenance = json.loads((DATA / 'provenance.json').read_text()) + write(output / 'scientific-validation.json', {'status': 'passed', 'findings': findings, 'provenance': provenance, 'acquisition': inputs()}) + artifacts = artifacts + ['scientific-validation.json'] + for name in artifacts: + if not (output / name).is_file() or (output / name).stat().st_size == 0: + raise RuntimeError('Missing artifact: ' + name) + write(output / 'manifest.json', {'showcase': provenance['slug'], 'status': 'success', 'artifacts': artifacts, 'sha256': {n: digest(output / n) for n in artifacts}}) + +def arguments(): + parser = argparse.ArgumentParser() + parser.add_argument('--stage', required=True) + parser.add_argument('--output', required=True) + a = parser.parse_args() + out = Path(a.output).resolve() + out.mkdir(parents=True, exist_ok=True) + return a.stage, out diff --git a/scientific-workflows/sqlsim/scripts/run_stage.py b/scientific-workflows/sqlsim/scripts/run_stage.py new file mode 100644 index 0000000..caa30a3 --- /dev/null +++ b/scientific-workflows/sqlsim/scripts/run_stage.py @@ -0,0 +1,70 @@ +from common import * +import os +import subprocess +import tempfile + +stage, out = arguments() +if stage == 'validate-inputs': + inputs() + df=pd.read_csv(DATA/'inputs/wdbc.data',header=None) + assert df.shape == (569,32) + assert set(df[1])=={'M','B'} + write(out/'inputs-validated.json',{'observations':569,'originalColumns':32}) +elif stage == 'compare': + counts={} + for name,dims in [('cube-2d',2),('cube-3d',3)]: + df=pd.read_csv(out/(name+'.csv')) + columns=['spatial','metric'] if dims==2 else ['spatial','temporal','metric'] + grand=df[df[columns].isna().all(axis=1)] + assert len(grand)==1 and int(grand.iloc[0]['count'])==569 + assert int(df['count'].sum()) == 569 * (2**dims) + a=pd.read_csv(out/(name+'-assignments.csv')) + assert len(a)==569 and a.id.nunique()==569 and a.metric.notna().all() + counts[name]={'cubeRows':len(df),'assignedObservations':len(a),'metricClusters':int(a.metric.nunique()),'spatialClusters':int(a.spatial.nunique())} + fig,axes=plt.subplots(1,2,figsize=(12,5),constrained_layout=True) + a=pd.read_csv(out/'cube-2d-assignments.csv') + axes[0].scatter(a.radius1,a.texture1,c=a.metric,cmap='turbo',s=13,alpha=.7) + axes[0].set_xlabel('Mean radius');axes[0].set_ylabel('Mean texture');axes[0].set_title('Original observations; metric-similarity assignments') + axes[1].scatter(a.x,a.y,c=a.spatial,cmap='tab20',s=22,alpha=.6) + axes[1].set_xlabel('Illustrative hospital X');axes[1].set_ylabel('Illustrative hospital Y');axes[1].set_title('Authors’ generated spatial dimension; not patient locations') + fig.suptitle('SQLSIM — original PostgreSQL functions and CUBE queries') + fig.savefig(out/'similarity-clusters.png');plt.close(fig) + summary=pd.DataFrame([dict(query=k,**v) for k,v in counts.items()]);summary.to_csv(out/'summary.csv',index=False) + fig,ax=plt.subplots(figsize=(7,4),constrained_layout=True) + summary.set_index('query')[['metricClusters','spatialClusters']].plot.bar(ax=ax,rot=0) + ax.set_ylabel('Measured clusters');ax.set_title('Independent database state per original query') + fig.savefig(out/'query-comparison.png');plt.close(fig) + import zipfile + with zipfile.ZipFile(out/'query-results.zip','w',zipfile.ZIP_DEFLATED) as archive: + for name in ['cube-2d.csv','cube-3d.csv','cube-2d-assignments.csv','cube-3d-assignments.csv']: + archive.write(out/name,name) + finish(out,['query-results.zip','summary.csv','similarity-clusters.png','query-comparison.png'],{'observations':569,'queries':counts,'databaseIsolation':'one PostgreSQL cluster per activity','seed':0.42}) +else: + temp=Path(tempfile.mkdtemp(prefix='sqlsim-'));cluster=temp/'db';socket=temp/'socket';socket.mkdir() + prefix=[] + if os.geteuid()==0: + import pwd + u=pwd.getpwnam('postgres') + os.chown(temp,u.pw_uid,u.pw_gid);os.chown(socket,u.pw_uid,u.pw_gid) + prefix=['runuser','-u','postgres','--'] + def command(args,**kwargs): + r=subprocess.run(prefix+args,text=True,capture_output=True,**kwargs) + if r.returncode: raise RuntimeError(str(args)+': '+r.stderr) + return r.stdout + command(['initdb','-D',str(cluster),'-A','trust','-U','postgres','--no-locale']) + command(['pg_ctl','-D',str(cluster),'-l',str(temp/'server.log'),'-o',"-F -k "+str(socket)+" -h ''",'-w','start']) + def sql(text): + return command(['psql','-h',str(socket),'-U','postgres','-d','postgres','-v','ON_ERROR_STOP=1','-q','-c',text]) + try: + prepare=(DATA/'inputs/data_preparation.sql').read_text().replace('/breastcancer/wdbc.data',str(DATA/'inputs/wdbc.data')) + sql('SELECT setseed(0.42);'+prepare) + sql((DATA/'inputs/functions.sql').read_text()) + original=(DATA/'inputs/queries.sql').read_text() + queries=[q.strip() for q in original.split(';') if 'GROUP BY' in q] + query=queries[0 if stage=='cube-2d' else 1] + (out/(stage+'.csv')).write_text(sql('COPY ('+query+') TO STDOUT WITH CSV HEADER')) + assignments="SELECT b.id,b.diagnosis,b.radius1,b.texture1,ST_X(b.hospital) AS x,ST_Y(b.hospital) AS y,c.centroid AS metric,spatial_sim(b.hospital,"+('3.5' if stage=='cube-2d' else '5')+") AS spatial FROM breastcancer b JOIN cent_assign c ON c.obs_id=b.id ORDER BY b.id" + (out/(stage+'-assignments.csv')).write_text(sql('COPY ('+assignments+') TO STDOUT WITH CSV HEADER')) + finally: + command(['pg_ctl','-D',str(cluster),'-m','fast','-w','stop']) + shutil.rmtree(temp) diff --git a/scientific-workflows/sqlsim/scripts/validate.py b/scientific-workflows/sqlsim/scripts/validate.py new file mode 100644 index 0000000..1a846f9 --- /dev/null +++ b/scientific-workflows/sqlsim/scripts/validate.py @@ -0,0 +1,11 @@ +import json +from pathlib import Path +from common import digest +root = Path(__file__).resolve().parents[1] +out = root / 'outputs' +m = json.loads((out / 'manifest.json').read_text()) +v = json.loads((out / 'scientific-validation.json').read_text()) +assert m['status'] == 'success' and v['status'] == 'passed' +for name in m['artifacts']: + assert digest(out / name) == m['sha256'][name], name +print(json.dumps(v['findings'], ensure_ascii=False)) diff --git a/scientific-workflows/sqlsim/topology.yaml b/scientific-workflows/sqlsim/topology.yaml new file mode 100644 index 0000000..dd334cd --- /dev/null +++ b/scientific-workflows/sqlsim/topology.yaml @@ -0,0 +1,5 @@ +id: sqlsim-local-topology +name: sqlsim-local local topology +version: 1 +executionScopeId: sqlsim-local-scope +links: [] diff --git a/scientific-workflows/sqlsim/validate.sh b/scientific-workflows/sqlsim/validate.sh new file mode 100755 index 0000000..66499a5 --- /dev/null +++ b/scientific-workflows/sqlsim/validate.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +result="${AKOFLOW_RESULT_DIR:-$root/outputs}" +docker run --rm --network none --mount "type=bind,src=$result,dst=/outputs,readonly" --mount "type=bind,src=$root/expected,dst=/verification,readonly" --entrypoint python akoflow-local/sqlsim:workload /verification/validate.py diff --git a/scientific-workflows/sqlsim/workflow.yaml b/scientific-workflows/sqlsim/workflow.yaml new file mode 100644 index 0000000..ab0f92f --- /dev/null +++ b/scientific-workflows/sqlsim/workflow.yaml @@ -0,0 +1,86 @@ +name: sqlsim +spec: + namespace: akoflow-examples + image: akoflow-local/sqlsim:workload + activities: + - name: validate-inputs + runtime: sqlsim-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: [] + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - validate-inputs + - --output + - . + - name: cube-2d + runtime: sqlsim-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - cube-2d + - --output + - . + - name: cube-3d + runtime: sqlsim-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - cube-3d + - --output + - . + - name: compare + runtime: sqlsim-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - cube-2d + - cube-3d + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - compare + - --output + - . + dataDependencies: + - producerActivity: validate-inputs + consumerActivity: cube-2d + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: cube-3d + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: cube-2d + consumerActivity: compare + logicalName: cube-2d.csv + sizeBytes: 10000000 + - producerActivity: cube-2d + consumerActivity: compare + logicalName: cube-2d-assignments.csv + sizeBytes: 10000000 + - producerActivity: cube-3d + consumerActivity: compare + logicalName: cube-3d.csv + sizeBytes: 10000000 + - producerActivity: cube-3d + consumerActivity: compare + logicalName: cube-3d-assignments.csv + sizeBytes: 10000000 diff --git a/scientific-workflows/tpch-databases/.dockerignore b/scientific-workflows/tpch-databases/.dockerignore new file mode 100644 index 0000000..f7c11d3 --- /dev/null +++ b/scientific-workflows/tpch-databases/.dockerignore @@ -0,0 +1,5 @@ +outputs +screenshots +evidence +.venv +**/__pycache__ diff --git a/scientific-workflows/tpch-databases/.gitignore b/scientific-workflows/tpch-databases/.gitignore new file mode 100644 index 0000000..194ed53 --- /dev/null +++ b/scientific-workflows/tpch-databases/.gitignore @@ -0,0 +1,3 @@ +data/inputs/ +outputs/ +outputs-daemon/ diff --git a/scientific-workflows/tpch-databases/README.md b/scientific-workflows/tpch-databases/README.md new file mode 100644 index 0000000..481cdaf --- /dev/null +++ b/scientific-workflows/tpch-databases/README.md @@ -0,0 +1,72 @@ +# TPC-H Q1 — MongoDB embedding versus PostgreSQL reproducibility audit + +Conference tags: `bresci`, `bresci-2024`. [Browse BreSci on the Hub](https://hub.akoflow.com/categories/bresci). + +Adapted from **XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD**. Original authors: **André Merlo, Jorge N. S. Pavão, Luiz C. de Freitas, Jorge Soares, Diego Brandão, Kele Belloze**. + +[Original paper](https://sol.sbc.org.br/index.php/bresci/article/view/30582) · [Original code and data](https://github.com/jnpavao/tpch_mongodb) + +## Scientific scope + +Portable audit of Q1 from the published repository, using genuine TPC-H dbgen 2.13.0 at scale factor 0.01 (complete generated lineitem table). The original MongoDB pipeline filters through 1998-12-01 while the original PostgreSQL query filters through 1998-09-02. Run both unchanged, then an explicitly named aligned variant that changes only MongoDB’s cutoff to 1998-09-02. Execute each engine/mode with and without an index in isolated database instances. Validate numerical equivalence only for aligned semantics and record original-source disagreement. This is a Q1 audit, not reproduction of all 22 queries, the paper’s hardware, scale or performance ranking. Timings under concurrent execution are observations, not a controlled database benchmark. Original data generator and specification: https://www.tpc.org/tpch/ and https://github.com/electrum/tpch-dbgen/tree/32f1c1b92d1664dba542e927d23d86ffa57aa253. TPC-H data are generated by definition; no hand-built fixture replaces them. Original code authors retain attribution; upstream has no explicit license declaration. MongoDB binary is obtained from its official distribution; respective upstream terms apply. + +This is an adaptation of the cited scientific application to native AkôFlow activities. It is not a claim of exact agreement with the paper. Source URLs, immutable revisions and input SHA-256 hashes are recorded in `data/sources.json` and `data/acquisition.json`. Original authors retain authorship of the scientific methods and artifacts; the AkôFlow contribution is orchestration, packaging and validation. + +## Execute + +[Original input URL manifest](data/sources.json) · [Verified input SHA-256 receipts](data/acquisition.json) · [Scientific provenance](data/provenance.json) + +```sh +./prepare.sh +./run.sh +``` + +Preparation acquires original inputs and builds the image. All computation then executes with networking disabled. No synthetic fallback replaces unavailable original data. `AKOFLOW_PARALLEL` controls standalone concurrency. + +To register and execute in Desktop through the local daemon, from the repository root: + +```sh +go run ./tools/daemon-local -example scientific-workflows/tpch-databases -env-file /path/to/installation.env -api-url http://YOUR_DAEMON:8080/akoflow-api -lanes 3 +``` + +Tracking item: [AKO-46](https://github.com/UFFeScience/akoflow-examples/issues/46). + +The daemon records the exact image and execution identity in `evidence/daemon-run.json`. `workflow.yaml` declares dependencies and explicit artifact transfers. `outputs/scientific-validation.json` contains semantic checks and findings. A successful exit alone is not a scientific validation. + +## Results + +Native daemon run `tpch-databases-local-5dff16106f-run-20261117t152506.699433105` completed **10/10 activities**. Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results. + +Findings: + +```json +{ + "query": "TPC-H Q1", + "scaleFactor": 0.01, + "originalMatchedRows": { + "postgres": 59307, + "mongo": 60175 + }, + "originalSourceMismatchObserved": true, + "alignedAllNumericAggregatesAgree": true, + "isolatedDatabaseRuns": 8, + "originalSqlCutoff": "1998-09-02", + "originalMongoCutoff": "1998-12-01" +} +``` + +![aligned aggregates](screenshots/current/aligned-aggregates.png) + +![database comparison](screenshots/current/database-comparison.png) + +Python dependency versions from the measured image are retained in [`evidence/python-packages.txt`](evidence/python-packages.txt). Independent post-run validation is recorded in [`evidence/independent-validation.json`](evidence/independent-validation.json). + +## Observed parallel execution + +The native run completed 10 activities in **32.59 seconds**, with **3 overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline. + +![Measured execution timeline](screenshots/current/execution-timeline.png) + +Timing interpretation: PostgreSQL measurements include a new `psql` client process per repetition, while MongoDB reuses a Python client. These end-to-end diagnostic observations cannot establish an engine performance ranking. The principal checked result is query-semantic equivalence after explicitly aligning the date cutoff. + +To regenerate the execution timeline from an observed run, mount this bundle at `/bundle` in its measured image and run `python /bundle/expected/render_execution.py`. The renderer uses `evidence/daemon-run.json`; predicted schedule times are excluded. diff --git a/scientific-workflows/tpch-databases/data/acquisition.json b/scientific-workflows/tpch-databases/data/acquisition.json new file mode 100644 index 0000000..df488f3 --- /dev/null +++ b/scientific-workflows/tpch-databases/data/acquisition.json @@ -0,0 +1,28 @@ +{ + "files": [ + { + "path": "AvaliaMongoDB.py", + "url": "https://raw.githubusercontent.com/jnpavao/tpch_mongodb/680b36b32746df155f18620ee4e48d4a0f1eaf7a/AvaliaMongoDB.py", + "sha256": "6d19fae08ad3f21f7cdf2579bb9cce9b97a50e2a5103ce98ba81ea67a5003d05", + "bytes": 46876 + }, + { + "path": "AvaliaPostgreSQL.py", + "url": "https://raw.githubusercontent.com/jnpavao/tpch_mongodb/680b36b32746df155f18620ee4e48d4a0f1eaf7a/AvaliaPostgreSQL.py", + "sha256": "2924e1aa5ab337c61bf1b3b528d7ca0abbc50ab0a100886ef82778e9761cb918", + "bytes": 36172 + }, + { + "path": "dbgen.tar.gz", + "url": "https://codeload.github.com/electrum/tpch-dbgen/tar.gz/32f1c1b92d1664dba542e927d23d86ffa57aa253", + "sha256": "01d8a4fa0fff4be83a9f43dbdc5a69f560d34f5ff0b4dbff1fc3a5320baf6318", + "bytes": 211381 + }, + { + "path": "mongodb.tgz", + "url": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.16.tgz", + "sha256": "073b4ffa712a7f74e1ad046e3c7dc8d7af8db550b329b5c75466c7ea43ec6d38", + "bytes": 84762182 + } + ] +} diff --git a/scientific-workflows/tpch-databases/data/dag.json b/scientific-workflows/tpch-databases/data/dag.json new file mode 100644 index 0000000..fbe5ff0 --- /dev/null +++ b/scientific-workflows/tpch-databases/data/dag.json @@ -0,0 +1,302 @@ +{ + "name": "tpch-databases", + "spec": { + "namespace": "akoflow-examples", + "image": "akoflow-local/tpch-databases:workload", + "activities": [ + { + "name": "generate", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "generate", + "--output", + "." + ] + } + }, + { + "name": "postgres-original-plain", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "postgres-original-plain", + "--output", + "." + ] + } + }, + { + "name": "postgres-original-indexed", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "postgres-original-indexed", + "--output", + "." + ] + } + }, + { + "name": "postgres-aligned-plain", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "postgres-aligned-plain", + "--output", + "." + ] + } + }, + { + "name": "postgres-aligned-indexed", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "postgres-aligned-indexed", + "--output", + "." + ] + } + }, + { + "name": "mongo-original-plain", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "mongo-original-plain", + "--output", + "." + ] + } + }, + { + "name": "mongo-original-indexed", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "mongo-original-indexed", + "--output", + "." + ] + } + }, + { + "name": "mongo-aligned-plain", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "mongo-aligned-plain", + "--output", + "." + ] + } + }, + { + "name": "mongo-aligned-indexed", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "generate" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "mongo-aligned-indexed", + "--output", + "." + ] + } + }, + { + "name": "compare", + "runtime": "tpch-databases-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "postgres-original-plain", + "postgres-original-indexed", + "postgres-aligned-plain", + "postgres-aligned-indexed", + "mongo-original-plain", + "mongo-original-indexed", + "mongo-aligned-plain", + "mongo-aligned-indexed" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "compare", + "--output", + "." + ] + } + } + ], + "dataDependencies": [ + { + "producerActivity": "generate", + "consumerActivity": "postgres-original-plain", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "generate", + "consumerActivity": "postgres-original-indexed", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "generate", + "consumerActivity": "postgres-aligned-plain", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "generate", + "consumerActivity": "postgres-aligned-indexed", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "generate", + "consumerActivity": "mongo-original-plain", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "generate", + "consumerActivity": "mongo-original-indexed", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "generate", + "consumerActivity": "mongo-aligned-plain", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "generate", + "consumerActivity": "mongo-aligned-indexed", + "logicalName": "lineitem.csv", + "sizeBytes": 10000000 + }, + { + "producerActivity": "postgres-original-plain", + "consumerActivity": "compare", + "logicalName": "postgres-original-plain.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "postgres-original-indexed", + "consumerActivity": "compare", + "logicalName": "postgres-original-indexed.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "postgres-aligned-plain", + "consumerActivity": "compare", + "logicalName": "postgres-aligned-plain.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "postgres-aligned-indexed", + "consumerActivity": "compare", + "logicalName": "postgres-aligned-indexed.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mongo-original-plain", + "consumerActivity": "compare", + "logicalName": "mongo-original-plain.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mongo-original-indexed", + "consumerActivity": "compare", + "logicalName": "mongo-original-indexed.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mongo-aligned-plain", + "consumerActivity": "compare", + "logicalName": "mongo-aligned-plain.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "mongo-aligned-indexed", + "consumerActivity": "compare", + "logicalName": "mongo-aligned-indexed.json", + "sizeBytes": 10000000 + } + ] + } +} diff --git a/scientific-workflows/tpch-databases/data/provenance.json b/scientific-workflows/tpch-databases/data/provenance.json new file mode 100644 index 0000000..1d49b01 --- /dev/null +++ b/scientific-workflows/tpch-databases/data/provenance.json @@ -0,0 +1,23 @@ +{ + "slug": "tpch-databases", + "title": "TPC-H Q1 — MongoDB embedding versus PostgreSQL reproducibility audit", + "authors": [ + "André Merlo", + "Jorge N. S. Pavão", + "Luiz C. de Freitas", + "Jorge Soares", + "Diego Brandão", + "Kele Belloze" + ], + "conference": "XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/30582", + "source": "https://github.com/jnpavao/tpch_mongodb", + "scope": "Portable audit of Q1 from the published repository, using genuine TPC-H dbgen 2.13.0 at scale factor 0.01 (complete generated lineitem table). The original MongoDB pipeline filters through 1998-12-01 while the original PostgreSQL query filters through 1998-09-02. Run both unchanged, then an explicitly named aligned variant that changes only MongoDB’s cutoff to 1998-09-02. Execute each engine/mode with and without an index in isolated database instances. Validate numerical equivalence only for aligned semantics and record original-source disagreement. This is a Q1 audit, not reproduction of all 22 queries, the paper’s hardware, scale or performance ranking. Timings under concurrent execution are observations, not a controlled database benchmark. Original data generator and specification: https://www.tpc.org/tpch/ and https://github.com/electrum/tpch-dbgen/tree/32f1c1b92d1664dba542e927d23d86ffa57aa253. TPC-H data are generated by definition; no hand-built fixture replaces them. Original code authors retain attribution; upstream has no explicit license declaration. MongoDB binary is obtained from its official distribution; respective upstream terms apply.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence.", + "tags": [ + "bresci", + "bresci-2024", + "scientific-reproducibility", + "scientific-workflows" + ] +} diff --git a/scientific-workflows/tpch-databases/data/sources.json b/scientific-workflows/tpch-databases/data/sources.json new file mode 100644 index 0000000..c4a9ae3 --- /dev/null +++ b/scientific-workflows/tpch-databases/data/sources.json @@ -0,0 +1,21 @@ +{ + "files": [ + { + "path": "AvaliaMongoDB.py", + "url": "https://raw.githubusercontent.com/jnpavao/tpch_mongodb/680b36b32746df155f18620ee4e48d4a0f1eaf7a/AvaliaMongoDB.py" + }, + { + "path": "AvaliaPostgreSQL.py", + "url": "https://raw.githubusercontent.com/jnpavao/tpch_mongodb/680b36b32746df155f18620ee4e48d4a0f1eaf7a/AvaliaPostgreSQL.py" + }, + { + "path": "dbgen.tar.gz", + "url": "https://codeload.github.com/electrum/tpch-dbgen/tar.gz/32f1c1b92d1664dba542e927d23d86ffa57aa253" + }, + { + "path": "mongodb.tgz", + "url": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.16.tgz", + "sha256": "073b4ffa712a7f74e1ad046e3c7dc8d7af8db550b329b5c75466c7ea43ec6d38" + } + ] +} diff --git a/scientific-workflows/tpch-databases/docker/Dockerfile b/scientific-workflows/tpch-databases/docker/Dockerfile new file mode 100644 index 0000000..07de015 --- /dev/null +++ b/scientific-workflows/tpch-databases/docker/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.11.13-slim-bookworm@sha256:86adf8dbadc3d6e82ee5dd2c74bec2e1c2467cdad47886280501df722372d2e1 +ENV MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 PYTHONDONTWRITEBYTECODE=1 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +RUN apt-get update && apt-get install -y --no-install-recommends postgresql-15 build-essential libcurl4 && useradd --uid 1000 --no-create-home scientist && useradd --uid 1001 --no-create-home ci-scientist && rm -rf /var/lib/apt/lists/* +COPY scripts /app/scripts +COPY data /app/data +RUN mkdir -p /opt/dbgen /opt/mongodb && tar -xzf /app/data/inputs/dbgen.tar.gz -C /opt/dbgen --strip-components=1 && make -C /opt/dbgen -f makefile.suite CC=gcc DATABASE=ORACLE MACHINE=LINUX WORKLOAD=TPCH && tar -xzf /app/data/inputs/mongodb.tgz -C /opt/mongodb --strip-components=1 +ENV PATH=/usr/lib/postgresql/15/bin:/opt/mongodb/bin:$PATH DSS_CONFIG=/opt/dbgen diff --git a/scientific-workflows/tpch-databases/environment.yaml b/scientific-workflows/tpch-databases/environment.yaml new file mode 100644 index 0000000..66e5a6b --- /dev/null +++ b/scientific-workflows/tpch-databases/environment.yaml @@ -0,0 +1,42 @@ +environment: + id: tpch-databases-local + name: tpch-databases-local local Docker + description: CPU-only local execution; no remote capacity is provisioned + status: ready +version: + id: tpch-databases-local-v1 + environmentId: tpch-databases-local + version: 1 + status: published + networkModel: local + interferenceModel: none + costModel: free + configurationHash: tpch-databases-local-v1 +runtimes: + - environmentVersionId: tpch-databases-local-v1 + id: tpch-databases-local-local + name: Local Docker host + driver: local + mode: execution + role: compute + capabilities: {batch: true, container: true} +resources: + - id: tpch-databases-local-local-docker + environmentVersionId: tpch-databases-local-v1 + type: machine + name: Local Docker host + providerId: local-docker + cpuCores: 4 + cpuCapacity: 4 + memoryBytes: 8589934592 + storageBytes: 21474836480 + computeSpeedup: 1 + pricePerSecond: 0 + bootOverheadSeconds: 0 + containerOverheadSeconds: 0 + schedulable: true +storages: [] +connections: [] +activityResourceProfiles: [] +resourceRuntimeBindings: + - {resourceId: tpch-databases-local-local-docker, runtimeId: tpch-databases-local-local, enabled: true} diff --git a/scientific-workflows/tpch-databases/evidence/daemon-run.json b/scientific-workflows/tpch-databases/evidence/daemon-run.json new file mode 100644 index 0000000..5779781 --- /dev/null +++ b/scientific-workflows/tpch-databases/evidence/daemon-run.json @@ -0,0 +1,369 @@ +{ + "activityCount": 10, + "completedActivityCount": 10, + "image": "akoflow-local/tpch-databases:local-9bfa73e297c7e7dd", + "imageId": "sha256:9bfa73e297c7e7ddbec9dfec7493e7c5373d8342392599374d0a37d59ad9459d", + "observedAt": "2026-11-17T15:25:40Z", + "planId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152", + "projection": { + "run": { + "activityCount": 10, + "breakdown": { + "computeSeconds": 50.42861318588257, + "interferenceSeconds": 0, + "overheadSeconds": 0, + "queueSeconds": 0, + "transferSeconds": 11.887973070144653 + }, + "completedActivityCount": 10, + "cost": 0, + "environmentNames": [ + "tpch-databases-local local Docker" + ], + "finishedAt": "2026-11-17T15:25:40Z", + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "kind": "workflow", + "makespanSeconds": 32.59038686752319, + "mode": "real", + "schedulePlanId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152", + "seed": 0, + "startedAt": "2026-11-17T15:25:06Z", + "status": "completed", + "title": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "transferredBytes": 130227543, + "workflowId": "tpch-databases-local-5dff16106f", + "workflowName": "tpch-databases-local-5dff16106f", + "workflowVersionId": "tpch-databases-local-5dff16106f-v1" + }, + "activities": [ + { + "activityId": "tpch-databases-local-5dff16106f-generate", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929111.8333654, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-generate", + "interferenceSeconds": 0, + "metadata": { + "pricePerSecond": 0, + "runtimeId": "tpch-databases-local-local" + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-generate", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929107.2426536, + "readyAt": 1794929107.2426536, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 4.329689979553223, + "startedAt": 1794929107.5036755, + "status": "completed", + "transferBytes": 0, + "transferSeconds": 0 + }, + { + "activityId": "tpch-databases-local-5dff16106f-postgres-original-indexed", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929122.8414843, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-postgres-original-indexed", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 1.0663790702819824, + "preparationFinishedAt": 1794929112.6789665, + "preparationStartedAt": 1794929112.4659634, + "pricePerSecond": 0, + "readyWaitSeconds": 0.033110857009887695, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.21300315856933594, + "transferWorkSeconds": 0.21300315856933594 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-postgres-original-indexed", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929112.3894281, + "readyAt": 1794929112.3894281, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 9.096138715744019, + "startedAt": 1794929113.7453456, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.21300315856933594 + }, + { + "activityId": "tpch-databases-local-5dff16106f-postgres-original-plain", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929122.7900486, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-postgres-original-plain", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 1.1634581089019775, + "preparationFinishedAt": 1794929112.6996536, + "preparationStartedAt": 1794929112.4768538, + "pricePerSecond": 0, + "readyWaitSeconds": 0.05481886863708496, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.22279977798461914, + "transferWorkSeconds": 0.22279977798461914 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-postgres-original-plain", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929112.4002414, + "readyAt": 1794929112.4002414, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 8.926936864852905, + "startedAt": 1794929113.8631117, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.22279977798461914 + }, + { + "activityId": "tpch-databases-local-5dff16106f-postgres-aligned-plain", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929122.759797, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-postgres-aligned-plain", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 1.2045834064483643, + "preparationFinishedAt": 1794929112.7143195, + "preparationStartedAt": 1794929112.4912283, + "pricePerSecond": 0, + "readyWaitSeconds": 0.04750490188598633, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.22309112548828125, + "transferWorkSeconds": 0.22309112548828125 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-postgres-aligned-plain", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929112.378582, + "readyAt": 1794929112.378582, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 8.840894222259521, + "startedAt": 1794929113.9189029, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.22309112548828125 + }, + { + "activityId": "tpch-databases-local-5dff16106f-postgres-aligned-indexed", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929131.336813, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-postgres-aligned-indexed", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.617119312286377, + "preparationFinishedAt": 1794929125.8944077, + "preparationStartedAt": 1794929125.676192, + "pricePerSecond": 0, + "readyWaitSeconds": 0.05405426025390625, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.2182157039642334, + "transferWorkSeconds": 0.2182157039642334 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-postgres-aligned-indexed", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929125.6000214, + "readyAt": 1794929125.6000214, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 4.825285911560059, + "startedAt": 1794929126.511527, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.2182157039642334 + }, + { + "activityId": "tpch-databases-local-5dff16106f-mongo-original-indexed", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929130.0199718, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-mongo-original-indexed", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.611764669418335, + "preparationFinishedAt": 1794929125.9307353, + "preparationStartedAt": 1794929125.6918218, + "pricePerSecond": 0, + "readyWaitSeconds": 0.0474848747253418, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.23891353607177734, + "transferWorkSeconds": 0.23891353607177734 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-mongo-original-indexed", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929125.5665693, + "readyAt": 1794929125.5665693, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 3.4774718284606934, + "startedAt": 1794929126.5425, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.23891353607177734 + }, + { + "activityId": "tpch-databases-local-5dff16106f-mongo-original-plain", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929129.9136796, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-mongo-original-plain", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.675072431564331, + "preparationFinishedAt": 1794929125.8860862, + "preparationStartedAt": 1794929125.6564975, + "pricePerSecond": 0, + "readyWaitSeconds": 0.02321767807006836, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.22958874702453613, + "transferWorkSeconds": 0.22958874702453613 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-mongo-original-plain", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929125.587662, + "readyAt": 1794929125.587662, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 3.3525209426879883, + "startedAt": 1794929126.5611587, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.22958874702453613 + }, + { + "activityId": "tpch-databases-local-5dff16106f-mongo-aligned-indexed", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929134.7418807, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-mongo-aligned-indexed", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.43518853187561035, + "preparationFinishedAt": 1794929130.924164, + "preparationStartedAt": 1794929130.7078688, + "pricePerSecond": 0, + "readyWaitSeconds": 0.011098861694335938, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.2162952423095703, + "transferWorkSeconds": 0.2162952423095703 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-mongo-aligned-indexed", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929130.673708, + "readyAt": 1794929130.673708, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 3.382528066635132, + "startedAt": 1794929131.3593526, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.2162952423095703 + }, + { + "activityId": "tpch-databases-local-5dff16106f-mongo-aligned-plain", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929135.6608927, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-mongo-aligned-plain", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.39496636390686035, + "preparationFinishedAt": 1794929132.1637135, + "preparationStartedAt": 1794929131.926875, + "pricePerSecond": 0, + "readyWaitSeconds": 0.023074865341186523, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 0.23683834075927734, + "transferWorkSeconds": 0.23683834075927734 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-mongo-aligned-plain", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929131.8802478, + "readyAt": 1794929131.8802478, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 3.102212905883789, + "startedAt": 1794929132.5586798, + "status": "completed", + "transferBytes": 14468325, + "transferSeconds": 0.23683834075927734 + }, + { + "activityId": "tpch-databases-local-5dff16106f-compare", + "allocatedResourceId": "tpch-databases-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "finishedAt": 1794929140.0940623, + "id": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105:tpch-databases-local-5dff16106f-compare", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.8100228309631348, + "preparationFinishedAt": 1794929138.1891057, + "preparationStartedAt": 1794929136.41588, + "pricePerSecond": 0, + "readyWaitSeconds": 0.08978629112243652, + "runtimeId": "tpch-databases-local-local", + "transferElapsedSeconds": 1.7732257843017578, + "transferWorkSeconds": 10.089227437973022 + }, + "overheadSeconds": 0, + "planAssignmentId": "tpch-databases-local-5dff16106f-manual-plan-20261117t152506.653327152-tpch-databases-local-5dff16106f-compare", + "plannedResourceId": "tpch-databases-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794929136.3041766, + "readyAt": 1794929136.3041766, + "runtimeId": "tpch-databases-local-local", + "runtimeSeconds": 1.0949337482452393, + "startedAt": 1794929138.9991286, + "status": "completed", + "transferBytes": 14480943, + "transferSeconds": 10.089227437973022 + } + ] + }, + "runId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "status": "completed", + "workflowId": "tpch-databases-local-5dff16106f", + "projectionScope": "Observed terminal run and activity timing records; complete event and transfer history remains available from the daemon execution API." +} diff --git a/scientific-workflows/tpch-databases/evidence/execution-summary.json b/scientific-workflows/tpch-databases/evidence/execution-summary.json new file mode 100644 index 0000000..6e32846 --- /dev/null +++ b/scientific-workflows/tpch-databases/evidence/execution-summary.json @@ -0,0 +1,8 @@ +{ + "runId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "imageId": "sha256:9bfa73e297c7e7ddbec9dfec7493e7c5373d8342392599374d0a37d59ad9459d", + "completedActivities": 10, + "observedMakespanSeconds": 32.59038686752319, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" +} diff --git a/scientific-workflows/tpch-databases/evidence/independent-validation.json b/scientific-workflows/tpch-databases/evidence/independent-validation.json new file mode 100644 index 0000000..f542356 --- /dev/null +++ b/scientific-workflows/tpch-databases/evidence/independent-validation.json @@ -0,0 +1 @@ +{"status": "passed", "validator": "independent artifact semantics, SHA-256 and scientific figure pixels", "showcase": "tpch-databases", "artifacts": 5} diff --git a/scientific-workflows/tpch-databases/evidence/manifest.json b/scientific-workflows/tpch-databases/evidence/manifest.json new file mode 100644 index 0000000..492a07e --- /dev/null +++ b/scientific-workflows/tpch-databases/evidence/manifest.json @@ -0,0 +1,18 @@ +{ + "showcase": "tpch-databases", + "status": "success", + "artifacts": [ + "metrics.csv", + "query-results.json", + "database-comparison.png", + "aligned-aggregates.png", + "scientific-validation.json" + ], + "sha256": { + "metrics.csv": "92d5609819620dab97f5c232898394c6266c9403fc12d79961a137ee593edc7c", + "query-results.json": "2700bf5a9ba4e26329a3c03302ec783c3fe3ee1f9f9fd4a6a4ed8726cd9479c7", + "database-comparison.png": "59ed3dc845c171417cd03d55aa29d03c8d33f69694f31e2f3d68240d2852f1b2", + "aligned-aggregates.png": "4c6d21151096bf70c6ab7bededc82c17df64f968803cac75d9da5ed8d0b91fb0", + "scientific-validation.json": "3c2d7e2cc8515039d3005c3d129d3f54c7802c2c23994089d1b3e6c690d6197a" + } +} diff --git a/scientific-workflows/tpch-databases/evidence/metrics.csv b/scientific-workflows/tpch-databases/evidence/metrics.csv new file mode 100644 index 0000000..bf09538 --- /dev/null +++ b/scientific-workflows/tpch-databases/evidence/metrics.csv @@ -0,0 +1,9 @@ +stage,engine,mode,indexed,medianQueryMs,matchedRows +postgres-original-plain,postgres,original,False,36.56037896871567,59307 +postgres-original-indexed,postgres,original,True,50.60577602125704,59307 +postgres-aligned-plain,postgres,aligned,False,74.66737111099064,59307 +postgres-aligned-indexed,postgres,aligned,True,20.994374062865973,59307 +mongo-original-plain,mongo,original,False,122.37111292779446,60175 +mongo-original-indexed,mongo,original,True,124.81195898726583,60175 +mongo-aligned-plain,mongo,aligned,False,120.4406451433897,59307 +mongo-aligned-indexed,mongo,aligned,True,116.27641809172928,59307 diff --git a/scientific-workflows/tpch-databases/evidence/python-packages.txt b/scientific-workflows/tpch-databases/evidence/python-packages.txt new file mode 100644 index 0000000..6347106 --- /dev/null +++ b/scientific-workflows/tpch-databases/evidence/python-packages.txt @@ -0,0 +1,25 @@ +cloudpickle==3.1.2 +contourpy==1.3.3 +cycler==0.12.1 +dnspython==2.9.2 +fonttools==4.68.0 +joblib==1.6.0 +kiwisolver==1.5.1 +matplotlib==3.9.2 +networkx==3.4.2 +numpy==1.26.4 +packaging==26.3 +pandas==2.2.3 +patsy==1.0.3 +pillow==13.0.0 +pymongo==4.10.1 +pyparsing==3.3.3 +pyreadr==0.5.2 +python-dateutil==4.0.0 +pytz==2026.6 +PyYAML==6.0.2 +scikit-learn==1.5.2 +scipy==1.14.1 +statsmodels==0.14.4 +threadpoolctl==3.8.0 +tzdata==2026.6 diff --git a/scientific-workflows/tpch-databases/evidence/scientific-validation.json b/scientific-workflows/tpch-databases/evidence/scientific-validation.json new file mode 100644 index 0000000..d749132 --- /dev/null +++ b/scientific-workflows/tpch-databases/evidence/scientific-validation.json @@ -0,0 +1,61 @@ +{ + "status": "passed", + "findings": { + "query": "TPC-H Q1", + "scaleFactor": 0.01, + "originalMatchedRows": { + "postgres": 59307, + "mongo": 60175 + }, + "originalSourceMismatchObserved": true, + "alignedAllNumericAggregatesAgree": true, + "isolatedDatabaseRuns": 8, + "originalSqlCutoff": "1998-09-02", + "originalMongoCutoff": "1998-12-01" + }, + "provenance": { + "slug": "tpch-databases", + "title": "TPC-H Q1 — MongoDB embedding versus PostgreSQL reproducibility audit", + "authors": [ + "André Merlo", + "Jorge N. S. Pavão", + "Luiz C. de Freitas", + "Jorge Soares", + "Diego Brandão", + "Kele Belloze" + ], + "conference": "XVIII Brazilian e-Science Workshop (BreSci 2024), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/30582", + "source": "https://github.com/jnpavao/tpch_mongodb", + "scope": "Portable audit of Q1 from the published repository, using genuine TPC-H dbgen 2.13.0 at scale factor 0.01 (complete generated lineitem table). The original MongoDB pipeline filters through 1998-12-01 while the original PostgreSQL query filters through 1998-09-02. Run both unchanged, then an explicitly named aligned variant that changes only MongoDB’s cutoff to 1998-09-02. Execute each engine/mode with and without an index in isolated database instances. Validate numerical equivalence only for aligned semantics and record original-source disagreement. This is a Q1 audit, not reproduction of all 22 queries, the paper’s hardware, scale or performance ranking. Timings under concurrent execution are observations, not a controlled database benchmark. Original data generator and specification: https://www.tpc.org/tpch/ and https://github.com/electrum/tpch-dbgen/tree/32f1c1b92d1664dba542e927d23d86ffa57aa253. TPC-H data are generated by definition; no hand-built fixture replaces them. Original code authors retain attribution; upstream has no explicit license declaration. MongoDB binary is obtained from its official distribution; respective upstream terms apply.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence." + }, + "acquisition": { + "files": [ + { + "path": "AvaliaMongoDB.py", + "url": "https://raw.githubusercontent.com/jnpavao/tpch_mongodb/680b36b32746df155f18620ee4e48d4a0f1eaf7a/AvaliaMongoDB.py", + "sha256": "6d19fae08ad3f21f7cdf2579bb9cce9b97a50e2a5103ce98ba81ea67a5003d05", + "bytes": 46876 + }, + { + "path": "AvaliaPostgreSQL.py", + "url": "https://raw.githubusercontent.com/jnpavao/tpch_mongodb/680b36b32746df155f18620ee4e48d4a0f1eaf7a/AvaliaPostgreSQL.py", + "sha256": "2924e1aa5ab337c61bf1b3b528d7ca0abbc50ab0a100886ef82778e9761cb918", + "bytes": 36172 + }, + { + "path": "dbgen.tar.gz", + "url": "https://codeload.github.com/electrum/tpch-dbgen/tar.gz/32f1c1b92d1664dba542e927d23d86ffa57aa253", + "sha256": "01d8a4fa0fff4be83a9f43dbdc5a69f560d34f5ff0b4dbff1fc3a5320baf6318", + "bytes": 211381 + }, + { + "path": "mongodb.tgz", + "url": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.16.tgz", + "sha256": "073b4ffa712a7f74e1ad046e3c7dc8d7af8db550b329b5c75466c7ea43ec6d38", + "bytes": 84762182 + } + ] + } +} diff --git a/scientific-workflows/tpch-databases/expected/render_execution.py b/scientific-workflows/tpch-databases/expected/render_execution.py new file mode 100644 index 0000000..fd9861b --- /dev/null +++ b/scientific-workflows/tpch-databases/expected/render_execution.py @@ -0,0 +1,28 @@ +from pathlib import Path +import hashlib,json +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +root=Path('/bundle') +r=json.loads((root/'evidence/daemon-run.json').read_text()) +a=r['projection']['activities'];assert len(a)==r['activityCount'] and all(x['status']=='completed' for x in a) +a=sorted(a,key=lambda x:x['startedAt']);start=min(x['startedAt'] for x in a) +fig,ax=plt.subplots(figsize=(12,max(4,len(a)*.3)),constrained_layout=True) +colors=plt.get_cmap('tab20') +for i,x in enumerate(a): + ax.barh(i,x['finishedAt']-x['startedAt'],left=x['startedAt']-start,color=colors(i%20),height=.7) +ax.set_yticks(range(len(a)),[x['activityId'].removeprefix(r['workflowId']+'-') for x in a],fontsize=8) +ax.invert_yaxis();ax.set_xlabel('Observed seconds from first activity start');ax.set_title(root.name+' — measured native daemon execution') +ax.spines[['top','right']].set_visible(False);ax.grid(axis='x',alpha=.2) +fig.savefig(root/'screenshots/current/execution-timeline.png',dpi=150) +current=0;peak=0 +for _,delta in sorted([(x['startedAt'],1) for x in a]+[(x['finishedAt'],-1) for x in a]):current+=delta;peak=max(peak,current) +summary={'runId':r['runId'],'imageId':r['imageId'],'completedActivities':len(a),'observedMakespanSeconds':r['projection']['run']['makespanSeconds'],'peakOverlappingActivities':peak,'timingSource':'observed native startedAt/finishedAt; imported predicted times excluded'} +(root/'evidence/execution-summary.json').write_text(json.dumps(summary,indent=2)+'\n') +p=root/'screenshots/current/manifest.json';m=json.loads(p.read_text());m['source']='scientific figures copied from completed daemon outputs; timeline derived from observed native activity times' +m['figures']['execution-timeline.png']=hashlib.sha256((root/'screenshots/current/execution-timeline.png').read_bytes()).hexdigest();m['executionSummary']=summary;p.write_text(json.dumps(m,indent=2,ensure_ascii=False)+'\n') +p=root/'README.md';s=p.read_text().split('\n## Observed parallel execution\n')[0];s=s.replace('Figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. They show actual computed results, not interface mockups.', 'Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results.') +s+='\n## Observed parallel execution\n\n'+f"The native run completed {len(a)} activities in **{summary['observedMakespanSeconds']:.2f} seconds**, with **{peak} overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline.\n\n![Measured execution timeline](screenshots/current/execution-timeline.png)\n" +p.write_text(s) +print(json.dumps(summary)) diff --git a/scientific-workflows/tpch-databases/expected/validate.py b/scientific-workflows/tpch-databases/expected/validate.py new file mode 100644 index 0000000..54a9f5c --- /dev/null +++ b/scientific-workflows/tpch-databases/expected/validate.py @@ -0,0 +1,33 @@ +import hashlib +import io +import json +from pathlib import Path +import zipfile +import numpy as np +import pandas as pd +from PIL import Image + +out=Path('/outputs') +m=json.loads((out/'manifest.json').read_text()) +v=json.loads((out/'scientific-validation.json').read_text()) +assert m['status']=='success' and v['status']=='passed' +for name in m['artifacts']: + p=out/name + assert hashlib.sha256(p.read_bytes()).hexdigest()==m['sha256'][name],name + if p.suffix=='.png': + with Image.open(p) as image: + assert min(image.size)>100 and np.asarray(image).std()>1 + +rows=json.loads((out/'query-results.json').read_text()) +assert len(rows)==8 +aligned=[r for r in rows if r['mode']=='aligned'] +ref=pd.DataFrame(aligned[0]['groups']).sort_values(['returnflag','linestatus']).reset_index(drop=True) +numeric=[c for c in ref if c not in ['returnflag','linestatus']] +for r in aligned[1:]: + table=pd.DataFrame(r['groups']).sort_values(['returnflag','linestatus']).reset_index(drop=True) + assert table[['returnflag','linestatus']].equals(ref[['returnflag','linestatus']]) + assert np.allclose(table[numeric],ref[numeric],rtol=1e-9,atol=1e-6) +original={r['engine']:r['matchedRows'] for r in rows if r['mode']=='original' and not r['indexed']} +assert original['mongo']>original['postgres'] + +print(json.dumps({'status':'passed','validator':'independent artifact semantics, SHA-256 and scientific figure pixels','showcase':m['showcase'],'artifacts':len(m['artifacts'])})) diff --git a/scientific-workflows/tpch-databases/prepare.sh b/scientific-workflows/tpch-databases/prepare.sh new file mode 100755 index 0000000..03d1796 --- /dev/null +++ b/scientific-workflows/tpch-databases/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +python3 "$root/scripts/acquire.py" +go run "$root/../../tools/showcase/main.go" -root "$root" -prepare-container diff --git a/scientific-workflows/tpch-databases/requirements.txt b/scientific-workflows/tpch-databases/requirements.txt new file mode 100644 index 0000000..656f513 --- /dev/null +++ b/scientific-workflows/tpch-databases/requirements.txt @@ -0,0 +1,10 @@ +numpy==1.26.4 +pandas==2.2.3 +scipy==1.14.1 +scikit-learn==1.5.2 +statsmodels==0.14.4 +matplotlib==3.9.2 +networkx==3.4.2 +pyreadr==0.5.2 +PyYAML==6.0.2 +pymongo==4.10.1 diff --git a/scientific-workflows/tpch-databases/run.sh b/scientific-workflows/tpch-databases/run.sh new file mode 100755 index 0000000..b487925 --- /dev/null +++ b/scientific-workflows/tpch-databases/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +go run "$root/../../tools/showcase/main.go" -root "$root" -container -parallel "${AKOFLOW_PARALLEL:-3}" +if ! "$root/validate.sh"; then + rm -f "$root/outputs/manifest.json" + exit 1 +fi diff --git a/scientific-workflows/tpch-databases/scope.yaml b/scientific-workflows/tpch-databases/scope.yaml new file mode 100644 index 0000000..f7e35a9 --- /dev/null +++ b/scientific-workflows/tpch-databases/scope.yaml @@ -0,0 +1,3 @@ +id: tpch-databases-local-scope +name: tpch-databases-local local scope +environmentVersionIds: [tpch-databases-local-v1] diff --git a/scientific-workflows/tpch-databases/screenshots/current/aligned-aggregates.png b/scientific-workflows/tpch-databases/screenshots/current/aligned-aggregates.png new file mode 100644 index 0000000..6daae1e Binary files /dev/null and b/scientific-workflows/tpch-databases/screenshots/current/aligned-aggregates.png differ diff --git a/scientific-workflows/tpch-databases/screenshots/current/database-comparison.png b/scientific-workflows/tpch-databases/screenshots/current/database-comparison.png new file mode 100644 index 0000000..e3a947c Binary files /dev/null and b/scientific-workflows/tpch-databases/screenshots/current/database-comparison.png differ diff --git a/scientific-workflows/tpch-databases/screenshots/current/execution-timeline.png b/scientific-workflows/tpch-databases/screenshots/current/execution-timeline.png new file mode 100644 index 0000000..bda304f Binary files /dev/null and b/scientific-workflows/tpch-databases/screenshots/current/execution-timeline.png differ diff --git a/scientific-workflows/tpch-databases/screenshots/current/manifest.json b/scientific-workflows/tpch-databases/screenshots/current/manifest.json new file mode 100644 index 0000000..28e856f --- /dev/null +++ b/scientific-workflows/tpch-databases/screenshots/current/manifest.json @@ -0,0 +1,32 @@ +{ + "runId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "image": "akoflow-local/tpch-databases:local-9bfa73e297c7e7dd", + "imageId": "sha256:9bfa73e297c7e7ddbec9dfec7493e7c5373d8342392599374d0a37d59ad9459d", + "source": "scientific figures copied from completed daemon outputs; timeline derived from observed native activity times", + "figures": { + "aligned-aggregates.png": "4c6d21151096bf70c6ab7bededc82c17df64f968803cac75d9da5ed8d0b91fb0", + "database-comparison.png": "59ed3dc845c171417cd03d55aa29d03c8d33f69694f31e2f3d68240d2852f1b2", + "execution-timeline.png": "81e0abd864c5b45937caf01c18975d9bf896cca8cd25789ddc261d4a53d1b0d3" + }, + "findings": { + "query": "TPC-H Q1", + "scaleFactor": 0.01, + "originalMatchedRows": { + "postgres": 59307, + "mongo": 60175 + }, + "originalSourceMismatchObserved": true, + "alignedAllNumericAggregatesAgree": true, + "isolatedDatabaseRuns": 8, + "originalSqlCutoff": "1998-09-02", + "originalMongoCutoff": "1998-12-01" + }, + "executionSummary": { + "runId": "tpch-databases-local-5dff16106f-run-20261117t152506.699433105", + "imageId": "sha256:9bfa73e297c7e7ddbec9dfec7493e7c5373d8342392599374d0a37d59ad9459d", + "completedActivities": 10, + "observedMakespanSeconds": 32.59038686752319, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" + } +} diff --git a/scientific-workflows/tpch-databases/scripts/acquire.py b/scientific-workflows/tpch-databases/scripts/acquire.py new file mode 100644 index 0000000..2ec5a91 --- /dev/null +++ b/scientific-workflows/tpch-databases/scripts/acquire.py @@ -0,0 +1,48 @@ +import hashlib +import json +from pathlib import Path +import urllib.request +import time + +root = Path(__file__).resolve().parents[1] +data = root / 'data' +config = json.loads((data / 'sources.json').read_text()) +previous = {} +if (data / 'acquisition.json').exists(): + previous = {f['path']: f for f in json.loads((data / 'acquisition.json').read_text())['files']} +receipts = [] +for item in config['files']: + target = data / 'inputs' / item['path'] + target.parent.mkdir(parents=True, exist_ok=True) + old = previous.get(item['path'], {}) + pinned = item.get('sha256') or (old.get('sha256') if old.get('url') == item['url'] else None) + if target.exists() and old.get('url') == item['url']: + expected = item.get('sha256', old.get('sha256')) + observed = hashlib.sha256(target.read_bytes()).hexdigest() + if expected == observed: + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + continue + temp = target.with_suffix(target.suffix + '.partial') + for attempt in range(4): + try: + request = urllib.request.Request(item['url'], headers={'User-Agent': 'Akoflow-scientific-reproduction/1.0'}) + with urllib.request.urlopen(request, timeout=120) as src, temp.open('wb') as dst: + while chunk := src.read(1024 * 1024): + dst.write(chunk) + observed = hashlib.sha256(temp.read_bytes()).hexdigest() + if pinned and pinned != observed: + raise RuntimeError('Pinned SHA256 mismatch: ' + item['path']) + if item.get('md5') and hashlib.md5(temp.read_bytes()).hexdigest() != item['md5']: + raise RuntimeError('Vendor MD5 mismatch: ' + item['path']) + if item.get('bytes') and temp.stat().st_size != item['bytes']: + raise RuntimeError('Length mismatch: ' + item['path']) + temp.replace(target) + break + except Exception: + temp.unlink(missing_ok=True) + if attempt == 3: + raise + time.sleep(2 ** attempt) + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + print('Verified', item['path'], target.stat().st_size, flush=True) +(data / 'acquisition.json').write_text(json.dumps({'files': receipts}, indent=2) + '\n') diff --git a/scientific-workflows/tpch-databases/scripts/common.py b/scientific-workflows/tpch-databases/scripts/common.py new file mode 100644 index 0000000..35a6f20 --- /dev/null +++ b/scientific-workflows/tpch-databases/scripts/common.py @@ -0,0 +1,50 @@ +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import numpy as np +import pandas as pd +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +ROOT = Path(__file__).resolve().parents[1] +DATA = ROOT / 'data' +plt.rcParams.update({'figure.dpi': 150, 'axes.spines.top': False, 'axes.spines.right': False}) + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + +def write(path, value): + Path(path).write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') + +def inputs(): + receipt = json.loads((DATA / 'acquisition.json').read_text()) + for item in receipt['files']: + p = DATA / 'inputs' / item['path'] + if digest(p) != item['sha256']: + raise RuntimeError('Input checksum mismatch: ' + str(p)) + return receipt + +def finish(output, artifacts, findings): + provenance = json.loads((DATA / 'provenance.json').read_text()) + write(output / 'scientific-validation.json', {'status': 'passed', 'findings': findings, 'provenance': provenance, 'acquisition': inputs()}) + artifacts = artifacts + ['scientific-validation.json'] + for name in artifacts: + if not (output / name).is_file() or (output / name).stat().st_size == 0: + raise RuntimeError('Missing artifact: ' + name) + write(output / 'manifest.json', {'showcase': provenance['slug'], 'status': 'success', 'artifacts': artifacts, 'sha256': {n: digest(output / n) for n in artifacts}}) + +def arguments(): + parser = argparse.ArgumentParser() + parser.add_argument('--stage', required=True) + parser.add_argument('--output', required=True) + a = parser.parse_args() + out = Path(a.output).resolve() + out.mkdir(parents=True, exist_ok=True) + return a.stage, out diff --git a/scientific-workflows/tpch-databases/scripts/run_stage.py b/scientific-workflows/tpch-databases/scripts/run_stage.py new file mode 100644 index 0000000..5d86889 --- /dev/null +++ b/scientific-workflows/tpch-databases/scripts/run_stage.py @@ -0,0 +1,108 @@ +from common import * +import ast +from datetime import datetime +import io +import os +import subprocess +import tempfile +import time + +stage,out=arguments() +def expression(filename): + tree=ast.parse((DATA/'inputs'/filename).read_text()) + for node in ast.walk(tree): + if isinstance(node,ast.Assign) and any(isinstance(t,ast.Attribute) and t.attr=='query1' for t in node.targets): + return eval(compile(ast.Expression(node.value),filename,'eval'),{'datetime':datetime}) + raise RuntimeError('Original Q1 not found') +if stage=='generate': + inputs();work=out/'generated';work.mkdir() + subprocess.run(['/opt/dbgen/dbgen','-s','0.01','-f','-T','L'],cwd=work,check=True) + source=work/'lineitem.tbl';count=0 + with source.open() as src,(out/'lineitem.csv').open('w') as dst: + for line in src: + parts=line.rstrip('\n').split('|');assert len(parts)==17 and parts[-1]=='' + dst.write('|'.join(parts[:-1])+'\n');count+=1 + assert count>50000 +elif stage=='compare': + cfg=json.loads((DATA/'dag.json').read_text()) + rows=[json.loads((out/(a['name']+'.json')).read_text()) for a in cfg['spec']['activities'] if a['name'] not in ['generate','compare']] + assert len(rows)==8 + def values(r):return pd.DataFrame(r['groups']).sort_values(['returnflag','linestatus']).reset_index(drop=True) + aligned=[r for r in rows if r['mode']=='aligned'] + ref=values(aligned[0]);numeric=[c for c in ref if c not in ['returnflag','linestatus']] + for r in aligned[1:]: + table=values(r) + assert table[['returnflag','linestatus']].equals(ref[['returnflag','linestatus']]) + assert np.allclose(table[numeric],ref[numeric],rtol=1e-9,atol=1e-6) + counts={r['engine']:int(sum(g['count_order'] for g in r['groups'])) for r in rows if r['mode']=='original' and not r['indexed']} + assert counts['mongo']!=counts['postgres'] + table=pd.DataFrame([{k:v for k,v in r.items() if k!='groups'} for r in rows]);table.to_csv(out/'metrics.csv',index=False) + fig,axes=plt.subplots(1,2,figsize=(12,5),constrained_layout=True) + for i,engine in enumerate(['postgres','mongo']): + orig=next(r for r in rows if r['engine']==engine and r['mode']=='original' and not r['indexed']) + align=next(r for r in rows if r['engine']==engine and r['mode']=='aligned' and not r['indexed']) + axes[0].bar(np.array([0,1])+i*.35,[orig['matchedRows'],align['matchedRows']],width=.35,label=engine) + axes[0].set_xticks([.175,1.175],['Original source cutoffs','Aligned cutoff']);axes[0].set_ylabel('Matched line items');axes[0].legend();axes[0].set_title('Q1 source mismatch: Dec 1 versus Sep 2, 1998') + axes[1].barh(table.stage,table.medianQueryMs,color='#426c95');axes[1].set_xlabel('Observed median query ms (3 warm repetitions)');axes[1].set_title('Concurrent diagnostic timings; not a controlled ranking') + fig.savefig(out/'database-comparison.png');plt.close(fig) + fig,ax=plt.subplots(figsize=(9,4),constrained_layout=True) + groups=[g['returnflag']+'/'+g['linestatus'] for g in ref.to_dict('records')] + ax.bar(groups,ref['sum_disc_price'],color='#426c95');ax.set_ylabel('Discounted revenue');ax.set_title('Aligned Q1 — independently agreeing PostgreSQL / MongoDB aggregates') + fig.savefig(out/'aligned-aggregates.png');plt.close(fig) + write(out/'query-results.json',rows) + finish(out,['metrics.csv','query-results.json','database-comparison.png','aligned-aggregates.png'],{'query':'TPC-H Q1','scaleFactor':0.01,'originalMatchedRows':counts,'originalSourceMismatchObserved':True,'alignedAllNumericAggregatesAgree':True,'isolatedDatabaseRuns':8,'originalSqlCutoff':'1998-09-02','originalMongoCutoff':'1998-12-01'}) +else: + engine,mode,idx=stage.split('-');indexed=idx=='indexed' + results=[];timings=[];temp=Path(tempfile.mkdtemp(prefix='tpch-')) + if engine=='postgres': + prefix=[] + if os.geteuid()==0: + import pwd + u=pwd.getpwnam('postgres');os.chown(temp,u.pw_uid,u.pw_gid);prefix=['runuser','-u','postgres','--'] + def cmd(args,**kwargs): + p=subprocess.run(prefix+args,text=True,capture_output=True,**kwargs) + if p.returncode:raise RuntimeError(str(args)+': '+p.stderr) + return p.stdout + socket=temp/'socket';socket.mkdir() + if prefix:os.chown(socket,u.pw_uid,u.pw_gid) + cmd(['initdb','-D',str(temp/'db'),'-A','trust','-U','postgres','--no-locale']) + cmd(['pg_ctl','-D',str(temp/'db'),'-l',str(temp/'server.log'),'-o',"-F -k "+str(socket)+" -h ''",'-w','start']) + def sql(s):return cmd(['psql','-h',str(socket),'-U','postgres','-v','ON_ERROR_STOP=1','-q','-c',s]) + try: + schema="CREATE TABLE lineitem (l_orderkey integer,l_partkey integer,l_suppkey integer,l_linenumber integer,l_quantity double precision,l_extendedprice double precision,l_discount double precision,l_tax double precision,l_returnflag char(1),l_linestatus char(1),l_shipdate date,l_commitdate date,l_receiptdate date,l_shipinstruct text,l_shipmode text,l_comment text);" + sql(schema) + cmd(['psql','-h',str(socket),'-U','postgres','-v','ON_ERROR_STOP=1','-q','-c',"COPY lineitem FROM STDIN WITH (FORMAT csv,DELIMITER '|')"],input=(out/'lineitem.csv').read_text()) + if indexed:sql('CREATE INDEX shipdate_idx ON lineitem(l_shipdate);') + sql('ANALYZE lineitem;') + query=expression('AvaliaPostgreSQL.py').strip().rstrip(';') + sql('COPY ('+query+') TO STDOUT WITH CSV HEADER') + for _ in range(3): + t=time.perf_counter();raw=sql('COPY ('+query+') TO STDOUT WITH CSV HEADER');timings.append((time.perf_counter()-t)*1000) + for r in pd.read_csv(io.StringIO(raw)).to_dict('records'): + r['returnflag']=r.pop('l_returnflag');r['linestatus']=r.pop('l_linestatus');results.append(r) + finally:cmd(['pg_ctl','-D',str(temp/'db'),'-m','fast','-w','stop']) + else: + from pymongo import MongoClient + (temp/'db').mkdir() + subprocess.run(['mongod','--dbpath',str(temp/'db'),'--bind_ip','127.0.0.1','--port','27017','--logpath',str(temp/'server.log'),'--fork'],check=True,capture_output=True) + client=MongoClient('mongodb://127.0.0.1:27017',serverSelectionTimeoutMS=30000) + try: + orders={} + with (out/'lineitem.csv').open() as stream: + for line in stream: + a=line.rstrip('\n').split('|');key=int(a[0]) + orders.setdefault(key,{'_id':key,'oOrderkey':key,'lineitems':[]})['lineitems'].append({'lQuantity':float(a[4]),'lExtendedprice':float(a[5]),'lDiscount':float(a[6]),'lTax':float(a[7]),'lReturnflag':a[8],'lLinestatus':a[9],'lShipdate':datetime.fromisoformat(a[10])}) + collection=client.tpch.orders;collection.insert_many(list(orders.values())) + if indexed:collection.create_index('lineitems.lShipdate') + pipeline=expression('AvaliaMongoDB.py') + if mode=='aligned':pipeline[1]['$match']['lineitems.lShipdate']['$lte']=datetime(1998,9,2) + list(collection.aggregate(pipeline)) + for _ in range(3): + t=time.perf_counter();raw=list(collection.aggregate(pipeline));timings.append((time.perf_counter()-t)*1000) + for r in raw: + group=r.pop('_id');r['returnflag']=group['lReturnflag'];r['linestatus']=group['lLinestatus'];results.append(r) + finally: + client.close() + subprocess.run(['mongod','--dbpath',str(temp/'db'),'--shutdown'],check=True,capture_output=True) + shutil.rmtree(temp) + write(out/(stage+'.json'),{'stage':stage,'engine':engine,'mode':mode,'indexed':indexed,'medianQueryMs':float(np.median(timings)),'matchedRows':int(sum(r['count_order'] for r in results)),'groups':results}) diff --git a/scientific-workflows/tpch-databases/scripts/validate.py b/scientific-workflows/tpch-databases/scripts/validate.py new file mode 100644 index 0000000..1a846f9 --- /dev/null +++ b/scientific-workflows/tpch-databases/scripts/validate.py @@ -0,0 +1,11 @@ +import json +from pathlib import Path +from common import digest +root = Path(__file__).resolve().parents[1] +out = root / 'outputs' +m = json.loads((out / 'manifest.json').read_text()) +v = json.loads((out / 'scientific-validation.json').read_text()) +assert m['status'] == 'success' and v['status'] == 'passed' +for name in m['artifacts']: + assert digest(out / name) == m['sha256'][name], name +print(json.dumps(v['findings'], ensure_ascii=False)) diff --git a/scientific-workflows/tpch-databases/topology.yaml b/scientific-workflows/tpch-databases/topology.yaml new file mode 100644 index 0000000..e57a87e --- /dev/null +++ b/scientific-workflows/tpch-databases/topology.yaml @@ -0,0 +1,5 @@ +id: tpch-databases-local-topology +name: tpch-databases-local local topology +version: 1 +executionScopeId: tpch-databases-local-scope +links: [] diff --git a/scientific-workflows/tpch-databases/validate.sh b/scientific-workflows/tpch-databases/validate.sh new file mode 100755 index 0000000..a8a20a2 --- /dev/null +++ b/scientific-workflows/tpch-databases/validate.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +result="${AKOFLOW_RESULT_DIR:-$root/outputs}" +docker run --rm --network none --mount "type=bind,src=$result,dst=/outputs,readonly" --mount "type=bind,src=$root/expected,dst=/verification,readonly" --entrypoint python akoflow-local/tpch-databases:workload /verification/validate.py diff --git a/scientific-workflows/tpch-databases/workflow.yaml b/scientific-workflows/tpch-databases/workflow.yaml new file mode 100644 index 0000000..734f536 --- /dev/null +++ b/scientific-workflows/tpch-databases/workflow.yaml @@ -0,0 +1,216 @@ +name: tpch-databases +spec: + namespace: akoflow-examples + image: akoflow-local/tpch-databases:workload + activities: + - name: generate + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: [] + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - generate + - --output + - . + - name: postgres-original-plain + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - postgres-original-plain + - --output + - . + - name: postgres-original-indexed + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - postgres-original-indexed + - --output + - . + - name: postgres-aligned-plain + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - postgres-aligned-plain + - --output + - . + - name: postgres-aligned-indexed + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - postgres-aligned-indexed + - --output + - . + - name: mongo-original-plain + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mongo-original-plain + - --output + - . + - name: mongo-original-indexed + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mongo-original-indexed + - --output + - . + - name: mongo-aligned-plain + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mongo-aligned-plain + - --output + - . + - name: mongo-aligned-indexed + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - generate + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - mongo-aligned-indexed + - --output + - . + - name: compare + runtime: tpch-databases-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - postgres-original-plain + - postgres-original-indexed + - postgres-aligned-plain + - postgres-aligned-indexed + - mongo-original-plain + - mongo-original-indexed + - mongo-aligned-plain + - mongo-aligned-indexed + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - compare + - --output + - . + dataDependencies: + - producerActivity: generate + consumerActivity: postgres-original-plain + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: generate + consumerActivity: postgres-original-indexed + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: generate + consumerActivity: postgres-aligned-plain + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: generate + consumerActivity: postgres-aligned-indexed + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: generate + consumerActivity: mongo-original-plain + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: generate + consumerActivity: mongo-original-indexed + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: generate + consumerActivity: mongo-aligned-plain + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: generate + consumerActivity: mongo-aligned-indexed + logicalName: lineitem.csv + sizeBytes: 10000000 + - producerActivity: postgres-original-plain + consumerActivity: compare + logicalName: postgres-original-plain.json + sizeBytes: 10000000 + - producerActivity: postgres-original-indexed + consumerActivity: compare + logicalName: postgres-original-indexed.json + sizeBytes: 10000000 + - producerActivity: postgres-aligned-plain + consumerActivity: compare + logicalName: postgres-aligned-plain.json + sizeBytes: 10000000 + - producerActivity: postgres-aligned-indexed + consumerActivity: compare + logicalName: postgres-aligned-indexed.json + sizeBytes: 10000000 + - producerActivity: mongo-original-plain + consumerActivity: compare + logicalName: mongo-original-plain.json + sizeBytes: 10000000 + - producerActivity: mongo-original-indexed + consumerActivity: compare + logicalName: mongo-original-indexed.json + sizeBytes: 10000000 + - producerActivity: mongo-aligned-plain + consumerActivity: compare + logicalName: mongo-aligned-plain.json + sizeBytes: 10000000 + - producerActivity: mongo-aligned-indexed + consumerActivity: compare + logicalName: mongo-aligned-indexed.json + sizeBytes: 10000000 diff --git a/scientific-workflows/united/.dockerignore b/scientific-workflows/united/.dockerignore new file mode 100644 index 0000000..f7c11d3 --- /dev/null +++ b/scientific-workflows/united/.dockerignore @@ -0,0 +1,5 @@ +outputs +screenshots +evidence +.venv +**/__pycache__ diff --git a/scientific-workflows/united/.gitignore b/scientific-workflows/united/.gitignore new file mode 100644 index 0000000..194ed53 --- /dev/null +++ b/scientific-workflows/united/.gitignore @@ -0,0 +1,3 @@ +data/inputs/ +outputs/ +outputs-daemon/ diff --git a/scientific-workflows/united/README.md b/scientific-workflows/united/README.md new file mode 100644 index 0000000..a1d7b69 --- /dev/null +++ b/scientific-workflows/united/README.md @@ -0,0 +1,63 @@ +# UniTED — labeled time-series event detection + +Conference tags: `bresci`, `bresci-2025`. [Browse BreSci on the Hub](https://hub.akoflow.com/categories/bresci). + +Adapted from **XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD**. Original authors: **Janio Lima, Hélio Castro, Luiz Oliveira, Ellen Paixão, Lais Baroni, Rebecca Salles, Ricardo Vargas, Eduardo Ogasawara**. + +[Original paper](https://sol.sbc.org.br/index.php/bresci/article/view/36901) · [Original code and data](https://github.com/cefet-rj-dal/united) + +## Scientific scope + +Four complete labeled NAB artificialWithAnomaly source series curated by UniTED, with no point subsampling. ARIMA(2,0,2) and a causal rolling-residual baseline are Python adapters; they are not the original R/Harbinger implementation and do not claim paper-metric equivalence. Detectors fit thresholds on the first 25% and are scored on the remaining observations with point-wise labels; no temporal-tolerance NAB score is claimed. These artificial signals are original benchmark inputs, not locally generated substitutes. Original upstream benchmark: https://github.com/numenta/NAB. UniTED code: MIT; upstream dataset conditions remain applicable. + +This is an adaptation of the cited scientific application to native AkôFlow activities. It is not a claim of exact agreement with the paper. Source URLs, immutable revisions and input SHA-256 hashes are recorded in `data/sources.json` and `data/acquisition.json`. Original authors retain authorship of the scientific methods and artifacts; the AkôFlow contribution is orchestration, packaging and validation. + +## Execute + +[Original input URL manifest](data/sources.json) · [Verified input SHA-256 receipts](data/acquisition.json) · [Scientific provenance](data/provenance.json) + +```sh +./prepare.sh +./run.sh +``` + +Preparation acquires original inputs and builds the image. All computation then executes with networking disabled. No synthetic fallback replaces unavailable original data. `AKOFLOW_PARALLEL` controls standalone concurrency. + +To register and execute in Desktop through the local daemon, from the repository root: + +```sh +go run ./tools/daemon-local -example scientific-workflows/united -env-file /path/to/installation.env -api-url http://YOUR_DAEMON:8080/akoflow-api -lanes 3 +``` + +Tracking item: [AKO-46](https://github.com/UFFeScience/akoflow-examples/issues/46). + +The daemon records the exact image and execution identity in `evidence/daemon-run.json`. `workflow.yaml` declares dependencies and explicit artifact transfers. `outputs/scientific-validation.json` contains semantic checks and findings. A successful exit alone is not a scientific validation. + +## Results + +Native daemon run `united-local-e796844aa5-run-20261117t145730.223156114` completed **10/10 activities**. Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results. + +Findings: + +```json +{ + "series": 4, + "detectorRuns": 8, + "totalInputPoints": 16128, + "evaluation": "held-out point-wise; Python adaptation" +} +``` + +![detections](screenshots/current/detections.png) + +![metrics](screenshots/current/metrics.png) + +## Observed parallel execution + +The native run completed 10 activities in **16.61 seconds**, with **3 overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline. + +![Measured execution timeline](screenshots/current/execution-timeline.png) + +Python dependency versions from the measured image are retained in [`evidence/python-packages.txt`](evidence/python-packages.txt). Independent post-run validation is recorded in [`evidence/independent-validation.json`](evidence/independent-validation.json). + +To regenerate the execution timeline from an observed run, mount this bundle at `/bundle` in its measured image and run `python /bundle/expected/render_execution.py`. The renderer uses `evidence/daemon-run.json`; predicted schedule times are excluded. diff --git a/scientific-workflows/united/data/acquisition.json b/scientific-workflows/united/data/acquisition.json new file mode 100644 index 0000000..fc633a1 --- /dev/null +++ b/scientific-workflows/united/data/acquisition.json @@ -0,0 +1,28 @@ +{ + "files": [ + { + "path": "art_daily_flatmiddle.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_flatmiddle.RData", + "sha256": "1432b25ee016df46c20857e3e3c45af0ff4a65bc9873edb7de473e16bfb4e485", + "bytes": 28895 + }, + { + "path": "art_daily_jumpsdown.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_jumpsdown.RData", + "sha256": "6babdf95c152129987f738a9d89bd57f90d6bb40098163d0e7d2d7181ff08095", + "bytes": 30602 + }, + { + "path": "art_daily_jumpsup.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_jumpsup.RData", + "sha256": "b06ecb354cbacfd6342c6e8da43ae628525d46ee2fab93c43cc31b953ffdbc58", + "bytes": 30612 + }, + { + "path": "art_daily_nojump.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_nojump.RData", + "sha256": "5bdc8b198e47e8adc6f0bda4a3576c22e277a22f66286d1b967fbaf21d02ceca", + "bytes": 30567 + } + ] +} diff --git a/scientific-workflows/united/data/dag.json b/scientific-workflows/united/data/dag.json new file mode 100644 index 0000000..c2fbef2 --- /dev/null +++ b/scientific-workflows/united/data/dag.json @@ -0,0 +1,302 @@ +{ + "name": "united", + "spec": { + "namespace": "akoflow-examples", + "image": "akoflow-local/united:workload", + "activities": [ + { + "name": "validate-inputs", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "validate-inputs", + "--output", + "." + ] + } + }, + { + "name": "art-daily-flatmiddle-arima", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-flatmiddle-arima", + "--output", + "." + ] + } + }, + { + "name": "art-daily-flatmiddle-rolling", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-flatmiddle-rolling", + "--output", + "." + ] + } + }, + { + "name": "art-daily-jumpsdown-arima", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-jumpsdown-arima", + "--output", + "." + ] + } + }, + { + "name": "art-daily-jumpsdown-rolling", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-jumpsdown-rolling", + "--output", + "." + ] + } + }, + { + "name": "art-daily-jumpsup-arima", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-jumpsup-arima", + "--output", + "." + ] + } + }, + { + "name": "art-daily-jumpsup-rolling", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-jumpsup-rolling", + "--output", + "." + ] + } + }, + { + "name": "art-daily-nojump-arima", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-nojump-arima", + "--output", + "." + ] + } + }, + { + "name": "art-daily-nojump-rolling", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "validate-inputs" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "art-daily-nojump-rolling", + "--output", + "." + ] + } + }, + { + "name": "compare", + "runtime": "united-local-local", + "cpuLimit": "1", + "memoryLimit": "4Gi", + "dependsOn": [ + "art-daily-flatmiddle-arima", + "art-daily-flatmiddle-rolling", + "art-daily-jumpsdown-arima", + "art-daily-jumpsdown-rolling", + "art-daily-jumpsup-arima", + "art-daily-jumpsup-rolling", + "art-daily-nojump-arima", + "art-daily-nojump-rolling" + ], + "command": { + "entrypoint": "python", + "arguments": [ + "/app/scripts/run_stage.py", + "--stage", + "compare", + "--output", + "." + ] + } + } + ], + "dataDependencies": [ + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-flatmiddle-arima", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-flatmiddle-rolling", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-jumpsdown-arima", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-jumpsdown-rolling", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-jumpsup-arima", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-jumpsup-rolling", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-nojump-arima", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "validate-inputs", + "consumerActivity": "art-daily-nojump-rolling", + "logicalName": "inputs-validated.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-flatmiddle-arima", + "consumerActivity": "compare", + "logicalName": "art-daily-flatmiddle-arima.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-flatmiddle-rolling", + "consumerActivity": "compare", + "logicalName": "art-daily-flatmiddle-rolling.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-jumpsdown-arima", + "consumerActivity": "compare", + "logicalName": "art-daily-jumpsdown-arima.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-jumpsdown-rolling", + "consumerActivity": "compare", + "logicalName": "art-daily-jumpsdown-rolling.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-jumpsup-arima", + "consumerActivity": "compare", + "logicalName": "art-daily-jumpsup-arima.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-jumpsup-rolling", + "consumerActivity": "compare", + "logicalName": "art-daily-jumpsup-rolling.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-nojump-arima", + "consumerActivity": "compare", + "logicalName": "art-daily-nojump-arima.json", + "sizeBytes": 10000000 + }, + { + "producerActivity": "art-daily-nojump-rolling", + "consumerActivity": "compare", + "logicalName": "art-daily-nojump-rolling.json", + "sizeBytes": 10000000 + } + ] + } +} diff --git a/scientific-workflows/united/data/provenance.json b/scientific-workflows/united/data/provenance.json new file mode 100644 index 0000000..2bb2ee8 --- /dev/null +++ b/scientific-workflows/united/data/provenance.json @@ -0,0 +1,25 @@ +{ + "slug": "united", + "title": "UniTED — labeled time-series event detection", + "authors": [ + "Janio Lima", + "Hélio Castro", + "Luiz Oliveira", + "Ellen Paixão", + "Lais Baroni", + "Rebecca Salles", + "Ricardo Vargas", + "Eduardo Ogasawara" + ], + "conference": "XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/36901", + "source": "https://github.com/cefet-rj-dal/united", + "scope": "Four complete labeled NAB artificialWithAnomaly source series curated by UniTED, with no point subsampling. ARIMA(2,0,2) and a causal rolling-residual baseline are Python adapters; they are not the original R/Harbinger implementation and do not claim paper-metric equivalence. Detectors fit thresholds on the first 25% and are scored on the remaining observations with point-wise labels; no temporal-tolerance NAB score is claimed. These artificial signals are original benchmark inputs, not locally generated substitutes. Original upstream benchmark: https://github.com/numenta/NAB. UniTED code: MIT; upstream dataset conditions remain applicable.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence.", + "tags": [ + "bresci", + "bresci-2025", + "scientific-reproducibility", + "scientific-workflows" + ] +} diff --git a/scientific-workflows/united/data/sources.json b/scientific-workflows/united/data/sources.json new file mode 100644 index 0000000..fa807ed --- /dev/null +++ b/scientific-workflows/united/data/sources.json @@ -0,0 +1,20 @@ +{ + "files": [ + { + "path": "art_daily_flatmiddle.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_flatmiddle.RData" + }, + { + "path": "art_daily_jumpsdown.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_jumpsdown.RData" + }, + { + "path": "art_daily_jumpsup.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_jumpsup.RData" + }, + { + "path": "art_daily_nojump.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_nojump.RData" + } + ] +} diff --git a/scientific-workflows/united/docker/Dockerfile b/scientific-workflows/united/docker/Dockerfile new file mode 100644 index 0000000..4269c68 --- /dev/null +++ b/scientific-workflows/united/docker/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.11.13-slim-bookworm@sha256:86adf8dbadc3d6e82ee5dd2c74bec2e1c2467cdad47886280501df722372d2e1 +ENV MPLBACKEND=Agg OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 PYTHONDONTWRITEBYTECODE=1 +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY scripts /app/scripts +COPY data /app/data diff --git a/scientific-workflows/united/environment.yaml b/scientific-workflows/united/environment.yaml new file mode 100644 index 0000000..f22d934 --- /dev/null +++ b/scientific-workflows/united/environment.yaml @@ -0,0 +1,42 @@ +environment: + id: united-local + name: united-local local Docker + description: CPU-only local execution; no remote capacity is provisioned + status: ready +version: + id: united-local-v1 + environmentId: united-local + version: 1 + status: published + networkModel: local + interferenceModel: none + costModel: free + configurationHash: united-local-v1 +runtimes: + - environmentVersionId: united-local-v1 + id: united-local-local + name: Local Docker host + driver: local + mode: execution + role: compute + capabilities: {batch: true, container: true} +resources: + - id: united-local-local-docker + environmentVersionId: united-local-v1 + type: machine + name: Local Docker host + providerId: local-docker + cpuCores: 4 + cpuCapacity: 4 + memoryBytes: 8589934592 + storageBytes: 21474836480 + computeSpeedup: 1 + pricePerSecond: 0 + bootOverheadSeconds: 0 + containerOverheadSeconds: 0 + schedulable: true +storages: [] +connections: [] +activityResourceProfiles: [] +resourceRuntimeBindings: + - {resourceId: united-local-local-docker, runtimeId: united-local-local, enabled: true} diff --git a/scientific-workflows/united/evidence/daemon-run.json b/scientific-workflows/united/evidence/daemon-run.json new file mode 100644 index 0000000..f328aaa --- /dev/null +++ b/scientific-workflows/united/evidence/daemon-run.json @@ -0,0 +1,369 @@ +{ + "activityCount": 10, + "completedActivityCount": 10, + "image": "akoflow-local/united:local-3ccc239aea4aedf2", + "imageId": "sha256:3ccc239aea4aedf2578d9f3895d5cda97472eff8bc6c51a456798070a0ed8192", + "observedAt": "2026-11-17T14:57:48Z", + "planId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410", + "projection": { + "run": { + "activityCount": 10, + "breakdown": { + "computeSeconds": 16.606584548950195, + "interferenceSeconds": 0, + "overheadSeconds": 0, + "queueSeconds": 0, + "transferSeconds": 9.003970384597778 + }, + "completedActivityCount": 10, + "cost": 0, + "environmentNames": [ + "united-local local Docker" + ], + "finishedAt": "2026-11-17T14:57:48Z", + "id": "united-local-e796844aa5-run-20261117t145730.223156114", + "kind": "workflow", + "makespanSeconds": 16.608977794647217, + "mode": "real", + "schedulePlanId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410", + "seed": 0, + "startedAt": "2026-11-17T14:57:30Z", + "status": "completed", + "title": "united-local-e796844aa5-run-20261117t145730.223156114", + "transferredBytes": 4852, + "workflowId": "united-local-e796844aa5", + "workflowName": "united-local-e796844aa5", + "workflowVersionId": "united-local-e796844aa5-v1" + }, + "activities": [ + { + "activityId": "united-local-e796844aa5-validate-inputs", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927452.8129907, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-validate-inputs", + "interferenceSeconds": 0, + "metadata": { + "pricePerSecond": 0, + "runtimeId": "united-local-local" + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-validate-inputs", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927450.8174345, + "readyAt": 1794927450.8174345, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.60760498046875, + "startedAt": 1794927451.2053857, + "status": "completed", + "transferBytes": 0, + "transferSeconds": 0 + }, + { + "activityId": "united-local-e796844aa5-art-daily-flatmiddle-rolling", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927456.2065933, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-flatmiddle-rolling", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.49137353897094727, + "preparationFinishedAt": 1794927454.2324572, + "preparationStartedAt": 1794927454.0561113, + "pricePerSecond": 0, + "readyWaitSeconds": 0.03936290740966797, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.1763458251953125, + "transferWorkSeconds": 0.1763458251953125 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-flatmiddle-rolling", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927453.9541376, + "readyAt": 1794927453.9541376, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.4827625751495361, + "startedAt": 1794927454.7238307, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.1763458251953125 + }, + { + "activityId": "united-local-e796844aa5-art-daily-jumpsdown-arima", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927456.531422, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-jumpsdown-arima", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.4707906246185303, + "preparationFinishedAt": 1794927454.2757843, + "preparationStartedAt": 1794927454.0996077, + "pricePerSecond": 0, + "readyWaitSeconds": 0.028743982315063477, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.1761765480041504, + "transferWorkSeconds": 0.1761765480041504 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-jumpsdown-arima", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927453.9659798, + "readyAt": 1794927453.9659798, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.7848470211029053, + "startedAt": 1794927454.7465749, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.1761765480041504 + }, + { + "activityId": "united-local-e796844aa5-art-daily-flatmiddle-arima", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927456.3840082, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-flatmiddle-arima", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5467009544372559, + "preparationFinishedAt": 1794927454.2177045, + "preparationStartedAt": 1794927454.0418441, + "pricePerSecond": 0, + "readyWaitSeconds": 0.05163168907165527, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.17586040496826172, + "transferWorkSeconds": 0.17586040496826172 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-flatmiddle-arima", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927453.9417508, + "readyAt": 1794927453.9417508, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.6196026802062988, + "startedAt": 1794927454.7644055, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.17586040496826172 + }, + { + "activityId": "united-local-e796844aa5-art-daily-jumpsup-arima", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927458.9433787, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-jumpsup-arima", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.27773118019104004, + "preparationFinishedAt": 1794927456.7759428, + "preparationStartedAt": 1794927456.6008387, + "pricePerSecond": 0, + "readyWaitSeconds": 0.019123315811157227, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.17510414123535156, + "transferWorkSeconds": 0.17510414123535156 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-jumpsup-arima", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927456.5519192, + "readyAt": 1794927456.5519192, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.889704704284668, + "startedAt": 1794927457.053674, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.17510414123535156 + }, + { + "activityId": "united-local-e796844aa5-art-daily-jumpsup-rolling", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927459.9560192, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-jumpsup-rolling", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5075221061706543, + "preparationFinishedAt": 1794927457.9316835, + "preparationStartedAt": 1794927457.7544875, + "pricePerSecond": 0, + "readyWaitSeconds": 0.028415441513061523, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.17719602584838867, + "transferWorkSeconds": 0.17719602584838867 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-jumpsup-rolling", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927457.67725, + "readyAt": 1794927457.67725, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.5168135166168213, + "startedAt": 1794927458.4392056, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.17719602584838867 + }, + { + "activityId": "united-local-e796844aa5-art-daily-jumpsdown-rolling", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927459.9931054, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-jumpsdown-rolling", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.5280680656433105, + "preparationFinishedAt": 1794927457.9177785, + "preparationStartedAt": 1794927457.739611, + "pricePerSecond": 0, + "readyWaitSeconds": 0.03595733642578125, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.17816758155822754, + "transferWorkSeconds": 0.17816758155822754 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-jumpsdown-rolling", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927457.666102, + "readyAt": 1794927457.666102, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.5472588539123535, + "startedAt": 1794927458.4458466, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.17816758155822754 + }, + { + "activityId": "united-local-e796844aa5-art-daily-nojump-rolling", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927461.5184412, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-nojump-rolling", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.2912440299987793, + "preparationFinishedAt": 1794927459.7339702, + "preparationStartedAt": 1794927459.5448408, + "pricePerSecond": 0, + "readyWaitSeconds": 0.011638641357421875, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.18912935256958008, + "transferWorkSeconds": 0.18912935256958008 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-nojump-rolling", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927459.5105596, + "readyAt": 1794927459.5105596, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.4932270050048828, + "startedAt": 1794927460.0252142, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.18912935256958008 + }, + { + "activityId": "united-local-e796844aa5-art-daily-nojump-arima", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927462.7941804, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-art-daily-nojump-arima", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.3606560230255127, + "preparationFinishedAt": 1794927460.8064904, + "preparationStartedAt": 1794927460.6293154, + "pricePerSecond": 0, + "readyWaitSeconds": 0.011801958084106445, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 0.17717504501342773, + "transferWorkSeconds": 0.17717504501342773 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-art-daily-nojump-arima", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927460.5910943, + "readyAt": 1794927460.5910943, + "runtimeId": "united-local-local", + "runtimeSeconds": 1.6270339488983154, + "startedAt": 1794927461.1671464, + "status": "completed", + "transferBytes": 123, + "transferSeconds": 0.17717504501342773 + }, + { + "activityId": "united-local-e796844aa5-compare", + "allocatedResourceId": "united-local-local-docker", + "attempt": 1, + "cost": 0, + "dataReadyAt": 0, + "executionRunId": "united-local-e796844aa5-run-20261117t145730.223156114", + "finishedAt": 1794927467.8143635, + "id": "united-local-e796844aa5-run-20261117t145730.223156114:united-local-e796844aa5-compare", + "interferenceSeconds": 0, + "metadata": { + "launchWaitSeconds": 0.7490739822387695, + "preparationFinishedAt": 1794927465.0275602, + "preparationStartedAt": 1794927463.6132154, + "pricePerSecond": 0, + "readyWaitSeconds": 0.1331043243408203, + "runtimeId": "united-local-local", + "transferElapsedSeconds": 1.4143447875976562, + "transferWorkSeconds": 7.578815460205078 + }, + "overheadSeconds": 0, + "planAssignmentId": "united-local-e796844aa5-manual-plan-20261117t145730.169758410-united-local-e796844aa5-compare", + "plannedResourceId": "united-local-local-docker", + "queueSeconds": 0, + "queuedAt": 1794927463.4469414, + "readyAt": 1794927463.4469414, + "runtimeId": "united-local-local", + "runtimeSeconds": 2.037729263305664, + "startedAt": 1794927465.7766342, + "status": "completed", + "transferBytes": 3868, + "transferSeconds": 7.578815460205078 + } + ] + }, + "runId": "united-local-e796844aa5-run-20261117t145730.223156114", + "status": "completed", + "workflowId": "united-local-e796844aa5", + "projectionScope": "Observed terminal run and activity timing records; complete event and transfer history remains available from the daemon execution API." +} diff --git a/scientific-workflows/united/evidence/execution-summary.json b/scientific-workflows/united/evidence/execution-summary.json new file mode 100644 index 0000000..d062963 --- /dev/null +++ b/scientific-workflows/united/evidence/execution-summary.json @@ -0,0 +1,8 @@ +{ + "runId": "united-local-e796844aa5-run-20261117t145730.223156114", + "imageId": "sha256:3ccc239aea4aedf2578d9f3895d5cda97472eff8bc6c51a456798070a0ed8192", + "completedActivities": 10, + "observedMakespanSeconds": 16.608977794647217, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" +} diff --git a/scientific-workflows/united/evidence/independent-validation.json b/scientific-workflows/united/evidence/independent-validation.json new file mode 100644 index 0000000..bdae222 --- /dev/null +++ b/scientific-workflows/united/evidence/independent-validation.json @@ -0,0 +1 @@ +{"status": "passed", "validator": "independent artifact semantics, SHA-256 and scientific figure pixels", "showcase": "united", "artifacts": 4} diff --git a/scientific-workflows/united/evidence/manifest.json b/scientific-workflows/united/evidence/manifest.json new file mode 100644 index 0000000..b8729d2 --- /dev/null +++ b/scientific-workflows/united/evidence/manifest.json @@ -0,0 +1,16 @@ +{ + "showcase": "united", + "status": "success", + "artifacts": [ + "detections.png", + "metrics.png", + "metrics.csv", + "scientific-validation.json" + ], + "sha256": { + "detections.png": "2ed2af64e5318fbb9d7f8161156e89095f49a8c561f7413531f2089291f1685a", + "metrics.png": "7ac23c05fc7685ea1ca4489962ef074a4593f5810208ce516e448187484afd9c", + "metrics.csv": "a2cde851da8b8c831a558038f34f6802ef80f5447d94c1da46d6078f409c98d5", + "scientific-validation.json": "03af73ac57edbe73917a645a78dd1930b5a24570dfdf98753c9b295369eaf1d2" + } +} diff --git a/scientific-workflows/united/evidence/metrics.csv b/scientific-workflows/united/evidence/metrics.csv new file mode 100644 index 0000000..339496d --- /dev/null +++ b/scientific-workflows/united/evidence/metrics.csv @@ -0,0 +1,9 @@ +series,detector,points,train_points,test_points,precision,recall,f1,tn,fp,fn,tp +art_daily_flatmiddle,arima,4032,1008,3024,0.045454545454545456,1.0,0.08695652173913043,3002,21,0,1 +art_daily_flatmiddle,rolling,4032,1008,3024,0.0,0.0,0.0,3023,0,1,0 +art_daily_jumpsdown,arima,4032,1008,3024,0.047619047619047616,1.0,0.09090909090909091,3003,20,0,1 +art_daily_jumpsdown,rolling,4032,1008,3024,0.0,0.0,0.0,3023,0,1,0 +art_daily_jumpsup,arima,4032,1008,3024,0.024390243902439025,1.0,0.047619047619047616,2983,40,0,1 +art_daily_jumpsup,rolling,4032,1008,3024,0.01639344262295082,1.0,0.03225806451612903,2963,60,0,1 +art_daily_nojump,arima,4032,1008,3024,0.0,0.0,0.0,3001,22,1,0 +art_daily_nojump,rolling,4032,1008,3024,0.0,0.0,0.0,3023,0,1,0 diff --git a/scientific-workflows/united/evidence/python-packages.txt b/scientific-workflows/united/evidence/python-packages.txt new file mode 100644 index 0000000..2fc187b --- /dev/null +++ b/scientific-workflows/united/evidence/python-packages.txt @@ -0,0 +1,23 @@ +cloudpickle==3.1.2 +contourpy==1.3.3 +cycler==0.12.1 +fonttools==4.68.0 +joblib==1.6.0 +kiwisolver==1.5.1 +matplotlib==3.9.2 +networkx==3.4.2 +numpy==1.26.4 +packaging==26.3 +pandas==2.2.3 +patsy==1.0.3 +pillow==13.0.0 +pyparsing==3.3.3 +pyreadr==0.5.2 +python-dateutil==4.0.0 +pytz==2026.6 +PyYAML==6.0.2 +scikit-learn==1.5.2 +scipy==1.14.1 +statsmodels==0.14.4 +threadpoolctl==3.8.0 +tzdata==2026.6 diff --git a/scientific-workflows/united/evidence/scientific-validation.json b/scientific-workflows/united/evidence/scientific-validation.json new file mode 100644 index 0000000..4ba1a7d --- /dev/null +++ b/scientific-workflows/united/evidence/scientific-validation.json @@ -0,0 +1,56 @@ +{ + "status": "passed", + "findings": { + "series": 4, + "detectorRuns": 8, + "totalInputPoints": 16128, + "evaluation": "held-out point-wise; Python adaptation" + }, + "provenance": { + "slug": "united", + "title": "UniTED — labeled time-series event detection", + "authors": [ + "Janio Lima", + "Hélio Castro", + "Luiz Oliveira", + "Ellen Paixão", + "Lais Baroni", + "Rebecca Salles", + "Ricardo Vargas", + "Eduardo Ogasawara" + ], + "conference": "XIX Brazilian e-Science Workshop (BreSci 2025), co-located with SBBD", + "article": "https://sol.sbc.org.br/index.php/bresci/article/view/36901", + "source": "https://github.com/cefet-rj-dal/united", + "scope": "Four complete labeled NAB artificialWithAnomaly source series curated by UniTED, with no point subsampling. ARIMA(2,0,2) and a causal rolling-residual baseline are Python adapters; they are not the original R/Harbinger implementation and do not claim paper-metric equivalence. Detectors fit thresholds on the first 25% and are scored on the remaining observations with point-wise labels; no temporal-tolerance NAB score is claimed. These artificial signals are original benchmark inputs, not locally generated substitutes. Original upstream benchmark: https://github.com/numenta/NAB. UniTED code: MIT; upstream dataset conditions remain applicable.", + "executionClaim": "Adapted scientific workflow; completion and agreement are reported only by measured evidence." + }, + "acquisition": { + "files": [ + { + "path": "art_daily_flatmiddle.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_flatmiddle.RData", + "sha256": "1432b25ee016df46c20857e3e3c45af0ff4a65bc9873edb7de473e16bfb4e485", + "bytes": 28895 + }, + { + "path": "art_daily_jumpsdown.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_jumpsdown.RData", + "sha256": "6babdf95c152129987f738a9d89bd57f90d6bb40098163d0e7d2d7181ff08095", + "bytes": 30602 + }, + { + "path": "art_daily_jumpsup.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_jumpsup.RData", + "sha256": "b06ecb354cbacfd6342c6e8da43ae628525d46ee2fab93c43cc31b953ffdbc58", + "bytes": 30612 + }, + { + "path": "art_daily_nojump.RData", + "url": "https://raw.githubusercontent.com/cefet-rj-dal/united/ed3c0369f49a643559e0da1ffba811afccfb6e92/etl/numenta/source/artificialWithAnomaly/art_daily_nojump.RData", + "sha256": "5bdc8b198e47e8adc6f0bda4a3576c22e277a22f66286d1b967fbaf21d02ceca", + "bytes": 30567 + } + ] + } +} diff --git a/scientific-workflows/united/expected/render_execution.py b/scientific-workflows/united/expected/render_execution.py new file mode 100644 index 0000000..fd9861b --- /dev/null +++ b/scientific-workflows/united/expected/render_execution.py @@ -0,0 +1,28 @@ +from pathlib import Path +import hashlib,json +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +root=Path('/bundle') +r=json.loads((root/'evidence/daemon-run.json').read_text()) +a=r['projection']['activities'];assert len(a)==r['activityCount'] and all(x['status']=='completed' for x in a) +a=sorted(a,key=lambda x:x['startedAt']);start=min(x['startedAt'] for x in a) +fig,ax=plt.subplots(figsize=(12,max(4,len(a)*.3)),constrained_layout=True) +colors=plt.get_cmap('tab20') +for i,x in enumerate(a): + ax.barh(i,x['finishedAt']-x['startedAt'],left=x['startedAt']-start,color=colors(i%20),height=.7) +ax.set_yticks(range(len(a)),[x['activityId'].removeprefix(r['workflowId']+'-') for x in a],fontsize=8) +ax.invert_yaxis();ax.set_xlabel('Observed seconds from first activity start');ax.set_title(root.name+' — measured native daemon execution') +ax.spines[['top','right']].set_visible(False);ax.grid(axis='x',alpha=.2) +fig.savefig(root/'screenshots/current/execution-timeline.png',dpi=150) +current=0;peak=0 +for _,delta in sorted([(x['startedAt'],1) for x in a]+[(x['finishedAt'],-1) for x in a]):current+=delta;peak=max(peak,current) +summary={'runId':r['runId'],'imageId':r['imageId'],'completedActivities':len(a),'observedMakespanSeconds':r['projection']['run']['makespanSeconds'],'peakOverlappingActivities':peak,'timingSource':'observed native startedAt/finishedAt; imported predicted times excluded'} +(root/'evidence/execution-summary.json').write_text(json.dumps(summary,indent=2)+'\n') +p=root/'screenshots/current/manifest.json';m=json.loads(p.read_text());m['source']='scientific figures copied from completed daemon outputs; timeline derived from observed native activity times' +m['figures']['execution-timeline.png']=hashlib.sha256((root/'screenshots/current/execution-timeline.png').read_bytes()).hexdigest();m['executionSummary']=summary;p.write_text(json.dumps(m,indent=2,ensure_ascii=False)+'\n') +p=root/'README.md';s=p.read_text().split('\n## Observed parallel execution\n')[0];s=s.replace('Figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. They show actual computed results, not interface mockups.', 'Scientific figures below were generated by the completed daemon run, verified against its artifact SHA-256 hashes, and copied without editing. The execution timeline is derived from observed native activity start/finish times. All figures show measured results.') +s+='\n## Observed parallel execution\n\n'+f"The native run completed {len(a)} activities in **{summary['observedMakespanSeconds']:.2f} seconds**, with **{peak} overlapping activities** at peak. These are execution observations, not a measured speedup against a sequential baseline.\n\n![Measured execution timeline](screenshots/current/execution-timeline.png)\n" +p.write_text(s) +print(json.dumps(summary)) diff --git a/scientific-workflows/united/expected/validate.py b/scientific-workflows/united/expected/validate.py new file mode 100644 index 0000000..44e2692 --- /dev/null +++ b/scientific-workflows/united/expected/validate.py @@ -0,0 +1,30 @@ +import hashlib +import io +import json +from pathlib import Path +import zipfile +import numpy as np +import pandas as pd +from PIL import Image + +out=Path('/outputs') +m=json.loads((out/'manifest.json').read_text()) +v=json.loads((out/'scientific-validation.json').read_text()) +assert m['status']=='success' and v['status']=='passed' +for name in m['artifacts']: + p=out/name + assert hashlib.sha256(p.read_bytes()).hexdigest()==m['sha256'][name],name + if p.suffix=='.png': + with Image.open(p) as image: + assert min(image.size)>100 and np.asarray(image).std()>1 + +df=pd.read_csv(out/'metrics.csv') +assert len(df)==8 and set(df.detector)=={'arima','rolling'} +assert (df[['tn','fp','fn','tp']].sum(axis=1)==df.test_points).all() +precision=np.divide(df.tp,df.tp+df.fp,out=np.zeros(len(df)),where=(df.tp+df.fp).to_numpy()!=0) +recall=np.divide(df.tp,df.tp+df.fn,out=np.zeros(len(df)),where=(df.tp+df.fn).to_numpy()!=0) +f1=np.divide(2*precision*recall,precision+recall,out=np.zeros(len(df)),where=precision+recall!=0) +assert np.allclose(df.f1,f1) +assert df.groupby('series').points.first().sum()==16128 + +print(json.dumps({'status':'passed','validator':'independent artifact semantics, SHA-256 and scientific figure pixels','showcase':m['showcase'],'artifacts':len(m['artifacts'])})) diff --git a/scientific-workflows/united/prepare.sh b/scientific-workflows/united/prepare.sh new file mode 100755 index 0000000..03d1796 --- /dev/null +++ b/scientific-workflows/united/prepare.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +python3 "$root/scripts/acquire.py" +go run "$root/../../tools/showcase/main.go" -root "$root" -prepare-container diff --git a/scientific-workflows/united/requirements.txt b/scientific-workflows/united/requirements.txt new file mode 100644 index 0000000..fc39612 --- /dev/null +++ b/scientific-workflows/united/requirements.txt @@ -0,0 +1,9 @@ +numpy==1.26.4 +pandas==2.2.3 +scipy==1.14.1 +scikit-learn==1.5.2 +statsmodels==0.14.4 +matplotlib==3.9.2 +networkx==3.4.2 +pyreadr==0.5.2 +PyYAML==6.0.2 diff --git a/scientific-workflows/united/run.sh b/scientific-workflows/united/run.sh new file mode 100755 index 0000000..b487925 --- /dev/null +++ b/scientific-workflows/united/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +go run "$root/../../tools/showcase/main.go" -root "$root" -container -parallel "${AKOFLOW_PARALLEL:-3}" +if ! "$root/validate.sh"; then + rm -f "$root/outputs/manifest.json" + exit 1 +fi diff --git a/scientific-workflows/united/scope.yaml b/scientific-workflows/united/scope.yaml new file mode 100644 index 0000000..482471c --- /dev/null +++ b/scientific-workflows/united/scope.yaml @@ -0,0 +1,3 @@ +id: united-local-scope +name: united-local local scope +environmentVersionIds: [united-local-v1] diff --git a/scientific-workflows/united/screenshots/current/detections.png b/scientific-workflows/united/screenshots/current/detections.png new file mode 100644 index 0000000..91af920 Binary files /dev/null and b/scientific-workflows/united/screenshots/current/detections.png differ diff --git a/scientific-workflows/united/screenshots/current/execution-timeline.png b/scientific-workflows/united/screenshots/current/execution-timeline.png new file mode 100644 index 0000000..7a2220c Binary files /dev/null and b/scientific-workflows/united/screenshots/current/execution-timeline.png differ diff --git a/scientific-workflows/united/screenshots/current/manifest.json b/scientific-workflows/united/screenshots/current/manifest.json new file mode 100644 index 0000000..b386c43 --- /dev/null +++ b/scientific-workflows/united/screenshots/current/manifest.json @@ -0,0 +1,25 @@ +{ + "runId": "united-local-e796844aa5-run-20261117t145730.223156114", + "image": "akoflow-local/united:local-3ccc239aea4aedf2", + "imageId": "sha256:3ccc239aea4aedf2578d9f3895d5cda97472eff8bc6c51a456798070a0ed8192", + "source": "scientific figures copied from completed daemon outputs; timeline derived from observed native activity times", + "figures": { + "detections.png": "2ed2af64e5318fbb9d7f8161156e89095f49a8c561f7413531f2089291f1685a", + "metrics.png": "7ac23c05fc7685ea1ca4489962ef074a4593f5810208ce516e448187484afd9c", + "execution-timeline.png": "c672c575ed671ccbaf8b1bd98e6a8c84c9969912ce0d5677f5dcac01321b7116" + }, + "findings": { + "series": 4, + "detectorRuns": 8, + "totalInputPoints": 16128, + "evaluation": "held-out point-wise; Python adaptation" + }, + "executionSummary": { + "runId": "united-local-e796844aa5-run-20261117t145730.223156114", + "imageId": "sha256:3ccc239aea4aedf2578d9f3895d5cda97472eff8bc6c51a456798070a0ed8192", + "completedActivities": 10, + "observedMakespanSeconds": 16.608977794647217, + "peakOverlappingActivities": 3, + "timingSource": "observed native startedAt/finishedAt; imported predicted times excluded" + } +} diff --git a/scientific-workflows/united/screenshots/current/metrics.png b/scientific-workflows/united/screenshots/current/metrics.png new file mode 100644 index 0000000..2265460 Binary files /dev/null and b/scientific-workflows/united/screenshots/current/metrics.png differ diff --git a/scientific-workflows/united/scripts/acquire.py b/scientific-workflows/united/scripts/acquire.py new file mode 100644 index 0000000..2ec5a91 --- /dev/null +++ b/scientific-workflows/united/scripts/acquire.py @@ -0,0 +1,48 @@ +import hashlib +import json +from pathlib import Path +import urllib.request +import time + +root = Path(__file__).resolve().parents[1] +data = root / 'data' +config = json.loads((data / 'sources.json').read_text()) +previous = {} +if (data / 'acquisition.json').exists(): + previous = {f['path']: f for f in json.loads((data / 'acquisition.json').read_text())['files']} +receipts = [] +for item in config['files']: + target = data / 'inputs' / item['path'] + target.parent.mkdir(parents=True, exist_ok=True) + old = previous.get(item['path'], {}) + pinned = item.get('sha256') or (old.get('sha256') if old.get('url') == item['url'] else None) + if target.exists() and old.get('url') == item['url']: + expected = item.get('sha256', old.get('sha256')) + observed = hashlib.sha256(target.read_bytes()).hexdigest() + if expected == observed: + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + continue + temp = target.with_suffix(target.suffix + '.partial') + for attempt in range(4): + try: + request = urllib.request.Request(item['url'], headers={'User-Agent': 'Akoflow-scientific-reproduction/1.0'}) + with urllib.request.urlopen(request, timeout=120) as src, temp.open('wb') as dst: + while chunk := src.read(1024 * 1024): + dst.write(chunk) + observed = hashlib.sha256(temp.read_bytes()).hexdigest() + if pinned and pinned != observed: + raise RuntimeError('Pinned SHA256 mismatch: ' + item['path']) + if item.get('md5') and hashlib.md5(temp.read_bytes()).hexdigest() != item['md5']: + raise RuntimeError('Vendor MD5 mismatch: ' + item['path']) + if item.get('bytes') and temp.stat().st_size != item['bytes']: + raise RuntimeError('Length mismatch: ' + item['path']) + temp.replace(target) + break + except Exception: + temp.unlink(missing_ok=True) + if attempt == 3: + raise + time.sleep(2 ** attempt) + receipts.append(dict(item, sha256=observed, bytes=target.stat().st_size)) + print('Verified', item['path'], target.stat().st_size, flush=True) +(data / 'acquisition.json').write_text(json.dumps({'files': receipts}, indent=2) + '\n') diff --git a/scientific-workflows/united/scripts/common.py b/scientific-workflows/united/scripts/common.py new file mode 100644 index 0000000..35a6f20 --- /dev/null +++ b/scientific-workflows/united/scripts/common.py @@ -0,0 +1,50 @@ +import argparse +import hashlib +import json +from pathlib import Path +import shutil +import numpy as np +import pandas as pd +import matplotlib +matplotlib.use('Agg') +import matplotlib.pyplot as plt + +ROOT = Path(__file__).resolve().parents[1] +DATA = ROOT / 'data' +plt.rcParams.update({'figure.dpi': 150, 'axes.spines.top': False, 'axes.spines.right': False}) + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + +def write(path, value): + Path(path).write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') + +def inputs(): + receipt = json.loads((DATA / 'acquisition.json').read_text()) + for item in receipt['files']: + p = DATA / 'inputs' / item['path'] + if digest(p) != item['sha256']: + raise RuntimeError('Input checksum mismatch: ' + str(p)) + return receipt + +def finish(output, artifacts, findings): + provenance = json.loads((DATA / 'provenance.json').read_text()) + write(output / 'scientific-validation.json', {'status': 'passed', 'findings': findings, 'provenance': provenance, 'acquisition': inputs()}) + artifacts = artifacts + ['scientific-validation.json'] + for name in artifacts: + if not (output / name).is_file() or (output / name).stat().st_size == 0: + raise RuntimeError('Missing artifact: ' + name) + write(output / 'manifest.json', {'showcase': provenance['slug'], 'status': 'success', 'artifacts': artifacts, 'sha256': {n: digest(output / n) for n in artifacts}}) + +def arguments(): + parser = argparse.ArgumentParser() + parser.add_argument('--stage', required=True) + parser.add_argument('--output', required=True) + a = parser.parse_args() + out = Path(a.output).resolve() + out.mkdir(parents=True, exist_ok=True) + return a.stage, out diff --git a/scientific-workflows/united/scripts/run_stage.py b/scientific-workflows/united/scripts/run_stage.py new file mode 100644 index 0000000..19b6587 --- /dev/null +++ b/scientific-workflows/united/scripts/run_stage.py @@ -0,0 +1,67 @@ +from common import * +import pyreadr +from statsmodels.tsa.arima.model import ARIMA +from sklearn.metrics import precision_recall_fscore_support, confusion_matrix + +stage, out = arguments() +config = json.loads((DATA / 'dag.json').read_text()) + +def load(name): + df = next(iter(pyreadr.read_r(str(DATA / 'inputs' / (name + '.RData'))).values())) + assert {'value', 'event'} <= set(df.columns) + assert len(df) > 1000 and df['value'].notna().all() + return df + +if stage == 'validate-inputs': + inputs() + rows = {p.stem: len(load(p.stem)) for p in sorted((DATA / 'inputs').glob('*.RData'))} + write(out / 'inputs-validated.json', rows) +elif stage == 'compare': + results = [json.loads((out / (a['name'] + '.json')).read_text()) for a in config['spec']['activities'] if a['name'] not in ['validate-inputs', 'compare']] + fig, axes = plt.subplots(4, 1, figsize=(12, 11), constrained_layout=True) + for ax, name in zip(axes, sorted({r['series'] for r in results})): + df = load(name) + ax.plot(df['value'].to_numpy(), lw=.8, color='#27374d') + mask = df['event'].astype(bool).to_numpy() + ax.fill_between(np.arange(len(df)), 0, 1, where=mask, transform=ax.get_xaxis_transform(), alpha=.18, color='red', label='Original anomaly labels') + for r in [v for v in results if v['series'] == name]: + idx = np.array(r['detected'], dtype=int) + ax.scatter(idx, df['value'].to_numpy()[idx], s=9, label=r['detector'], alpha=.65) + ax.set_title(name) + ax.legend(loc='upper right', fontsize=7) + fig.suptitle('UniTED / NAB — complete original series and measured detections') + fig.savefig(out / 'detections.png');plt.close(fig) + table = pd.DataFrame([{k:v for k,v in r.items() if k != 'detected'} for r in results]) + table.to_csv(out / 'metrics.csv', index=False) + fig, ax = plt.subplots(figsize=(11, 4), constrained_layout=True) + for detector in ['arima', 'rolling']: + sub=table[table.detector==detector] + ax.plot(sub.series, sub.f1, marker='o', label=detector) + ax.set_ylim(0, 1.05);ax.set_ylabel('Point-wise test F1');ax.legend();ax.set_title('Held-out evaluation; not the NAB temporal score') + fig.savefig(out / 'metrics.png');plt.close(fig) + assert len(results) == 8 + for r in results: + assert 0 <= r['f1'] <= 1 + assert r['tn'] + r['fp'] + r['fn'] + r['tp'] == r['test_points'] + assert min(r['detected'], default=r['train_points']) >= r['train_points'] + finish(out, ['detections.png','metrics.png','metrics.csv'], {'series':4,'detectorRuns':8,'totalInputPoints':sum(r['points'] for r in results)//2,'evaluation':'held-out point-wise; Python adaptation'}) +else: + detector = stage.rsplit('-',1)[1] + name = stage.rsplit('-',1)[0].replace('-','_') + df = load(name);x = df.value.to_numpy(dtype=float);cut = len(x)//4 + if detector == 'arima': + model = ARIMA(x[:cut], order=(2,0,2)).fit() + fitted = model.apply(x, refit=False) + residual = x - fitted.predict() + else: + history=pd.Series(x).shift(1) + baseline=history.rolling(48,min_periods=12).mean() + residual=x-baseline.to_numpy() + scale=np.nanstd(residual[12:cut]);center=np.nanmean(residual[12:cut]) + assert np.isfinite(scale) and scale>0 + pred=np.abs(residual-center)>3*scale + pred[:cut]=False + labels=df.event.astype(bool).to_numpy() + precision,recall,f1,_=precision_recall_fscore_support(labels[cut:],pred[cut:],average='binary',zero_division=0) + tn,fp,fn,tp=confusion_matrix(labels[cut:],pred[cut:],labels=[False,True]).ravel() + write(out / (stage+'.json'),{'series':name,'detector':detector,'points':len(x),'train_points':cut,'test_points':len(x)-cut,'precision':float(precision),'recall':float(recall),'f1':float(f1),'tn':int(tn),'fp':int(fp),'fn':int(fn),'tp':int(tp),'detected':np.flatnonzero(pred).tolist()}) diff --git a/scientific-workflows/united/scripts/validate.py b/scientific-workflows/united/scripts/validate.py new file mode 100644 index 0000000..1a846f9 --- /dev/null +++ b/scientific-workflows/united/scripts/validate.py @@ -0,0 +1,11 @@ +import json +from pathlib import Path +from common import digest +root = Path(__file__).resolve().parents[1] +out = root / 'outputs' +m = json.loads((out / 'manifest.json').read_text()) +v = json.loads((out / 'scientific-validation.json').read_text()) +assert m['status'] == 'success' and v['status'] == 'passed' +for name in m['artifacts']: + assert digest(out / name) == m['sha256'][name], name +print(json.dumps(v['findings'], ensure_ascii=False)) diff --git a/scientific-workflows/united/topology.yaml b/scientific-workflows/united/topology.yaml new file mode 100644 index 0000000..12ac184 --- /dev/null +++ b/scientific-workflows/united/topology.yaml @@ -0,0 +1,5 @@ +id: united-local-topology +name: united-local local topology +version: 1 +executionScopeId: united-local-scope +links: [] diff --git a/scientific-workflows/united/validate.sh b/scientific-workflows/united/validate.sh new file mode 100755 index 0000000..b6f1e75 --- /dev/null +++ b/scientific-workflows/united/validate.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu +root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +result="${AKOFLOW_RESULT_DIR:-$root/outputs}" +docker run --rm --network none --mount "type=bind,src=$result,dst=/outputs,readonly" --mount "type=bind,src=$root/expected,dst=/verification,readonly" --entrypoint python akoflow-local/united:workload /verification/validate.py diff --git a/scientific-workflows/united/workflow.yaml b/scientific-workflows/united/workflow.yaml new file mode 100644 index 0000000..e6c57de --- /dev/null +++ b/scientific-workflows/united/workflow.yaml @@ -0,0 +1,216 @@ +name: united +spec: + namespace: akoflow-examples + image: akoflow-local/united:workload + activities: + - name: validate-inputs + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: [] + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - validate-inputs + - --output + - . + - name: art-daily-flatmiddle-arima + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-flatmiddle-arima + - --output + - . + - name: art-daily-flatmiddle-rolling + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-flatmiddle-rolling + - --output + - . + - name: art-daily-jumpsdown-arima + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-jumpsdown-arima + - --output + - . + - name: art-daily-jumpsdown-rolling + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-jumpsdown-rolling + - --output + - . + - name: art-daily-jumpsup-arima + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-jumpsup-arima + - --output + - . + - name: art-daily-jumpsup-rolling + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-jumpsup-rolling + - --output + - . + - name: art-daily-nojump-arima + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-nojump-arima + - --output + - . + - name: art-daily-nojump-rolling + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - validate-inputs + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - art-daily-nojump-rolling + - --output + - . + - name: compare + runtime: united-local-local + cpuLimit: '1' + memoryLimit: 4Gi + dependsOn: + - art-daily-flatmiddle-arima + - art-daily-flatmiddle-rolling + - art-daily-jumpsdown-arima + - art-daily-jumpsdown-rolling + - art-daily-jumpsup-arima + - art-daily-jumpsup-rolling + - art-daily-nojump-arima + - art-daily-nojump-rolling + command: + entrypoint: python + arguments: + - /app/scripts/run_stage.py + - --stage + - compare + - --output + - . + dataDependencies: + - producerActivity: validate-inputs + consumerActivity: art-daily-flatmiddle-arima + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: art-daily-flatmiddle-rolling + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: art-daily-jumpsdown-arima + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: art-daily-jumpsdown-rolling + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: art-daily-jumpsup-arima + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: art-daily-jumpsup-rolling + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: art-daily-nojump-arima + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: validate-inputs + consumerActivity: art-daily-nojump-rolling + logicalName: inputs-validated.json + sizeBytes: 10000000 + - producerActivity: art-daily-flatmiddle-arima + consumerActivity: compare + logicalName: art-daily-flatmiddle-arima.json + sizeBytes: 10000000 + - producerActivity: art-daily-flatmiddle-rolling + consumerActivity: compare + logicalName: art-daily-flatmiddle-rolling.json + sizeBytes: 10000000 + - producerActivity: art-daily-jumpsdown-arima + consumerActivity: compare + logicalName: art-daily-jumpsdown-arima.json + sizeBytes: 10000000 + - producerActivity: art-daily-jumpsdown-rolling + consumerActivity: compare + logicalName: art-daily-jumpsdown-rolling.json + sizeBytes: 10000000 + - producerActivity: art-daily-jumpsup-arima + consumerActivity: compare + logicalName: art-daily-jumpsup-arima.json + sizeBytes: 10000000 + - producerActivity: art-daily-jumpsup-rolling + consumerActivity: compare + logicalName: art-daily-jumpsup-rolling.json + sizeBytes: 10000000 + - producerActivity: art-daily-nojump-arima + consumerActivity: compare + logicalName: art-daily-nojump-arima.json + sizeBytes: 10000000 + - producerActivity: art-daily-nojump-rolling + consumerActivity: compare + logicalName: art-daily-nojump-rolling.json + sizeBytes: 10000000 diff --git a/tools/catalog/main_test.go b/tools/catalog/main_test.go index 63e54d7..43cbe19 100644 --- a/tools/catalog/main_test.go +++ b/tools/catalog/main_test.go @@ -7,14 +7,14 @@ func TestCatalogIncludesEveryDomainPipeline(t *testing.T) { if err != nil { t.Fatal(err) } - if len(entries) != 44 { - t.Fatalf("expected 41 catalog showcases and 3 legacy local profiles, got %d", len(entries)) + if len(entries) != 51 { + t.Fatalf("expected 48 catalog showcases and 3 legacy local profiles, got %d", len(entries)) } images := map[string]string{} for _, e := range entries { images[e.Showcase] = e.Image } - for _, name := range []string{"document-intelligence", "video-intelligence", "blender-render-farm", "gawa", "openoil-ensemble-08", "openoil-ensemble-16", "openoil-ensemble-32", "earthquake", "sra-search", "variant-calling", "orcasound", "somospie", "rnaseq", "sarek", "pycbc", "opendronemap"} { + for _, name := range []string{"document-intelligence", "video-intelligence", "blender-render-farm", "gawa", "openoil-ensemble-08", "openoil-ensemble-16", "openoil-ensemble-32", "earthquake", "sra-search", "variant-calling", "orcasound", "somospie", "rnaseq", "sarek", "pycbc", "opendronemap", "united", "estrada-real", "sqlsim", "eidolon", "inmet", "mafaulda-tinyml", "tpch-databases"} { if images[name] == "" { t.Fatalf("missing domain pipeline: %s", name) }