From 79303695d3c5473723df777a16c8ed2155ebee16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 15 Nov 2022 13:00:40 +0100 Subject: [PATCH 01/15] chore/add-caching-for-private-tangle --- .github/actions/private-tangle/setup/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 3d6feab379..af4aebec84 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -3,6 +3,10 @@ description: 'Setup a private tangle' runs: using: "composite" steps: + - name: Cache Docker images + uses: ScribeMD/docker-cache@0.2.6 + with: + key: docker-privateTangle - name: Setup private tangle shell: bash run: | From cbae5c941a67f218825d090548e3db1f8198152a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 15 Nov 2022 13:21:54 +0100 Subject: [PATCH 02/15] add cache hash --- .github/actions/private-tangle/setup/action.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index af4aebec84..2e9870ea4b 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -3,11 +3,7 @@ description: 'Setup a private tangle' runs: using: "composite" steps: - - name: Cache Docker images - uses: ScribeMD/docker-cache@0.2.6 - with: - key: docker-privateTangle - - name: Setup private tangle + - name: Download private tangle shell: bash run: | # TODO: use next lines when a working hornet release is published @@ -23,7 +19,13 @@ runs: # TODO: remove next lines when a working hornet release is published git clone https://github.com/iotaledger/hornet.git cd hornet/private_tangle - + - name: Cache Docker images + uses: ScribeMD/docker-cache@0.2.6 + with: + key: docker-privateTangle-${{ hashFiles(./) }} + - name: Setup private tangle + shell: bash + run: | # Set minPoWScore = 1 since the default (0) doesn't work with wasm_miner.rs in iota.rs currently. jq '.minPoWScore = $val' --argjson val 1 protocol_parameters.json > tmp.json && mv tmp.json protocol_parameters.json jq --color-output . protocol_parameters.json From 411aef9b51bfacb2b150972d42d2b3248ec1bbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 15 Nov 2022 13:49:20 +0100 Subject: [PATCH 03/15] fix hash path --- .github/actions/private-tangle/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 2e9870ea4b..864d57be0d 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -22,7 +22,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@0.2.6 with: - key: docker-privateTangle-${{ hashFiles(./) }} + key: docker-privateTangle-${{ hashFiles('./') }} - name: Setup private tangle shell: bash run: | From 8d35673d636a0b869872b7997860cab341c8db4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 15 Nov 2022 14:02:40 +0100 Subject: [PATCH 04/15] fix hash path --- .github/actions/private-tangle/setup/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 864d57be0d..5633eb0576 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -20,9 +20,9 @@ runs: git clone https://github.com/iotaledger/hornet.git cd hornet/private_tangle - name: Cache Docker images - uses: ScribeMD/docker-cache@0.2.6 + uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: - key: docker-privateTangle-${{ hashFiles('./') }} + key: docker-privateTangle-${{ hashFiles('**/private_tangle/**') }} - name: Setup private tangle shell: bash run: | From 1c87ac6820f47e5301d2cd39f7f4883faa79dd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 15 Nov 2022 14:16:03 +0100 Subject: [PATCH 05/15] fix path --- .github/actions/private-tangle/setup/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 5633eb0576..4d067e155d 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -3,9 +3,11 @@ description: 'Setup a private tangle' runs: using: "composite" steps: + - name: Download private tangle shell: bash run: | + # TODO: use next lines when a working hornet release is published # # Download the private_tangle setup from the hornet repo. # mkdir private_tangle @@ -19,13 +21,22 @@ runs: # TODO: remove next lines when a working hornet release is published git clone https://github.com/iotaledger/hornet.git cd hornet/private_tangle + - name: Cache Docker images uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: key: docker-privateTangle-${{ hashFiles('**/private_tangle/**') }} + - name: Setup private tangle shell: bash run: | + + # TODO: use next lines when a working hornet release is published + # cd private_tangle + + # TODO: remove next lines when a working hornet release is published + cd hornet/private_tangle + # Set minPoWScore = 1 since the default (0) doesn't work with wasm_miner.rs in iota.rs currently. jq '.minPoWScore = $val' --argjson val 1 protocol_parameters.json > tmp.json && mv tmp.json protocol_parameters.json jq --color-output . protocol_parameters.json @@ -38,11 +49,13 @@ runs: sudo ./cleanup.sh sudo ./bootstrap.sh sudo ./run.sh -d + - name: Wait for tangle to start shell: bash run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:14265/health -- echo "Tangle is up" env: WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3 + - name: Wait for faucet to start shell: bash run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:8091/api/info -- echo "Faucet is up" From 1a64ef098eadb62caa10432292417f94b7e231fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Mon, 21 Nov 2022 17:09:04 +0100 Subject: [PATCH 06/15] change hash path --- .github/actions/private-tangle/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 4d067e155d..5487307cd8 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -25,7 +25,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: - key: docker-privateTangle-${{ hashFiles('**/private_tangle/**') }} + key: docker-privateTangle-${{ hashFiles('**/private_tangle') }} - name: Setup private tangle shell: bash From 24068ef1fa4fcd464da89c13e047404279c4f337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Mon, 21 Nov 2022 17:38:39 +0100 Subject: [PATCH 07/15] change hash path --- .github/actions/private-tangle/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 5487307cd8..26f3260e7e 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -25,7 +25,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: - key: docker-privateTangle-${{ hashFiles('**/private_tangle') }} + key: docker-privateTangle-${{ hashFiles('**/private_tangle/*.*') }} - name: Setup private tangle shell: bash From cef9bf62504831fa613e07cc8f1e06417131865c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Mon, 21 Nov 2022 18:00:14 +0100 Subject: [PATCH 08/15] change hash path --- .github/actions/private-tangle/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 26f3260e7e..a17fcc21df 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -25,7 +25,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: - key: docker-privateTangle-${{ hashFiles('**/private_tangle/*.*') }} + key: docker-privateTangle-${{ hashFiles('hornet/private_tangle/**') }} - name: Setup private tangle shell: bash From a3093ae8e5105e4ee3ef6e2d3d96e25901674951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Mon, 21 Nov 2022 18:15:16 +0100 Subject: [PATCH 09/15] change hash path --- .github/actions/private-tangle/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index a17fcc21df..6faa03983d 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -25,7 +25,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: - key: docker-privateTangle-${{ hashFiles('hornet/private_tangle/**') }} + key: docker-privateTangle-${{ hashFiles('hornet/private_tangle/*') }} - name: Setup private tangle shell: bash From 55c4fb0c0bc03f6533db0232c83cef507b51238a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Mon, 21 Nov 2022 18:48:20 +0100 Subject: [PATCH 10/15] change hash path --- .github/actions/private-tangle/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index 6faa03983d..cf59951e23 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -25,7 +25,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: - key: docker-privateTangle-${{ hashFiles('hornet/private_tangle/*') }} + key: docker-privateTangle-${{ hashFiles('hornet/private_tangle/*.yml') }} - name: Setup private tangle shell: bash From 7c783a765ca202fa70bef53ea7e8a037b592afc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Mon, 21 Nov 2022 19:25:35 +0100 Subject: [PATCH 11/15] change hash path --- .github/actions/private-tangle/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/private-tangle/setup/action.yml index cf59951e23..db946839dd 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/private-tangle/setup/action.yml @@ -25,7 +25,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 with: - key: docker-privateTangle-${{ hashFiles('hornet/private_tangle/*.yml') }} + key: docker-privateTangle-${{ hashFiles('**/private_tangle/*.yml') }} - name: Setup private tangle shell: bash From 53a2041481033b4d7921a37133ebf06d2f66aae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 6 Feb 2024 17:27:15 +0100 Subject: [PATCH 12/15] adapt docker-cache --- .github/actions/iota-sandbox/setup/action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/iota-sandbox/setup/action.yml b/.github/actions/iota-sandbox/setup/action.yml index b62c175e7f..60f11a0354 100644 --- a/.github/actions/iota-sandbox/setup/action.yml +++ b/.github/actions/iota-sandbox/setup/action.yml @@ -3,7 +3,7 @@ description: 'Setup IOTA Sandbox' runs: using: "composite" steps: - - name: Setup iota sandbox + - name: Download iota sandbox shell: bash run: | # Use next lines for using the GitHub release @@ -21,6 +21,15 @@ runs: # git clone https://github.com/iotaledger/iota-sandbox # cd iota-sandbox/sandbox + - name: Cache Docker images + uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 + with: + key: docker-sandbox-${{ hashFiles('sandbox/*.yml') }} + + - name: Setup iota sandbox + shell: bash + run: | + cd # Start Tangle sudo ./bootstrap.sh docker compose up -d From e3228ee95cd990183eeb64a9aeb4f37791f43b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 6 Feb 2024 17:27:51 +0100 Subject: [PATCH 13/15] adapt docker-cache --- .github/actions/iota-sandbox/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/iota-sandbox/setup/action.yml b/.github/actions/iota-sandbox/setup/action.yml index 60f11a0354..3c5073fba4 100644 --- a/.github/actions/iota-sandbox/setup/action.yml +++ b/.github/actions/iota-sandbox/setup/action.yml @@ -22,7 +22,7 @@ runs: # cd iota-sandbox/sandbox - name: Cache Docker images - uses: ScribeMD/docker-cache@70723b070f0541d281d40017fd2e874d677357aa #0.2.6 + uses: ScribeMD/docker-cache@e481e638abdb45e2fa30845305c387a544cc617f #0.3.7 with: key: docker-sandbox-${{ hashFiles('sandbox/*.yml') }} From 82033d7121aa7333ef58bab65451929ad8c8ba40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 6 Feb 2024 17:34:16 +0100 Subject: [PATCH 14/15] fix paths --- .github/actions/iota-sandbox/setup/action.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/iota-sandbox/setup/action.yml b/.github/actions/iota-sandbox/setup/action.yml index 3c5073fba4..f37fb968c7 100644 --- a/.github/actions/iota-sandbox/setup/action.yml +++ b/.github/actions/iota-sandbox/setup/action.yml @@ -19,17 +19,16 @@ runs: # Use the next lines to use the main branch # git clone https://github.com/iotaledger/iota-sandbox - # cd iota-sandbox/sandbox - name: Cache Docker images uses: ScribeMD/docker-cache@e481e638abdb45e2fa30845305c387a544cc617f #0.3.7 with: - key: docker-sandbox-${{ hashFiles('sandbox/*.yml') }} + key: docker-sandbox-${{ hashFiles('iota-sandbox/**/*.yml') }} - name: Setup iota sandbox shell: bash run: | - cd + cd iota-sandbox/sandbox # Start Tangle sudo ./bootstrap.sh docker compose up -d From a2ed77c3947c4a6998bda8a3f2ec9a851e821a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Tue, 6 Feb 2024 18:08:03 +0100 Subject: [PATCH 15/15] use docker-compose.yml for cache key --- .github/actions/iota-sandbox/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/iota-sandbox/setup/action.yml b/.github/actions/iota-sandbox/setup/action.yml index f37fb968c7..1f63692215 100644 --- a/.github/actions/iota-sandbox/setup/action.yml +++ b/.github/actions/iota-sandbox/setup/action.yml @@ -23,7 +23,7 @@ runs: - name: Cache Docker images uses: ScribeMD/docker-cache@e481e638abdb45e2fa30845305c387a544cc617f #0.3.7 with: - key: docker-sandbox-${{ hashFiles('iota-sandbox/**/*.yml') }} + key: docker-sandbox-${{ hashFiles('iota-sandbox/sandbox/docker-compose.yml') }} - name: Setup iota sandbox shell: bash