Skip to content

Commit 8dd0d97

Browse files
committed
ci: add radius-decrease liveness check for puller manage() recovery
1 parent 8f23985 commit 8dd0d97

3 files changed

Lines changed: 75 additions & 1 deletion

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
45c45
2+
< func threshold(capacity int) int { return capacity * 5 / 10 }
3+
---
4+
> func threshold(capacity int) int { return capacity }
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
251c251
2+
< DefaultReserveCapacity = 1 << 22 // 4194304 chunks
3+
---
4+
> DefaultReserveCapacity = 200
5+
411c411
6+
< ReserveWakeUpDuration: time.Minute * 30,
7+
---
8+
> ReserveWakeUpDuration: time.Second * 10,

.github/workflows/beekeeper.yml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
SETUP_CONTRACT_IMAGE: "ethersphere/bee-localchain"
1515
SETUP_CONTRACT_IMAGE_TAG: "0.9.4"
1616
BEELOCAL_BRANCH: "main"
17-
BEEKEEPER_BRANCH: "master"
17+
BEEKEEPER_BRANCH: "ci/radius-decrease-check"
1818
BEEKEEPER_METRICS_ENABLED: false
1919
REACHABILITY_OVERRIDE_PUBLIC: true
2020
BATCHFACTOR_OVERRIDE_PUBLIC: 2
@@ -72,6 +72,14 @@ jobs:
7272
patch pkg/retrieval/retrieval.go .github/patches/retrieval.patch
7373
make binary
7474
mv dist/bee bee-1
75+
- name: Apply patches and build - 2 (radius-decrease liveness test)
76+
run: |
77+
git checkout pkg/api/postage.go pkg/retrieval/retrieval.go
78+
patch pkg/storer/storer.go .github/patches/radius_decrease_storer.patch
79+
patch pkg/storer/reserve.go .github/patches/radius_decrease_reserve.patch
80+
make binary
81+
mv dist/bee bee-2
82+
git checkout pkg/storer/storer.go pkg/storer/reserve.go
7583
- name: Install beekeeper
7684
run: |
7785
export PATH=$(pwd):$PATH
@@ -220,6 +228,60 @@ jobs:
220228
with:
221229
name: debug-dump
222230
path: dump/
231+
radius-decrease:
232+
name: Radius-decrease liveness test
233+
runs-on: ubuntu-latest
234+
needs: [init]
235+
steps:
236+
- name: Cache
237+
uses: actions/cache@v4
238+
with:
239+
path: |
240+
/tmp/k3s-${{ env.K3S_VERSION }}
241+
key: k3s-${{ env.K3S_VERSION }}
242+
- name: "Download Artifact"
243+
uses: actions/download-artifact@v4
244+
with:
245+
name: temp-artifacts
246+
- name: Unpack artifacts
247+
run: |
248+
chmod +x bee-2 beekeeper .github/bin/beekeeper_artifacts.sh
249+
mv .beekeeper.yaml ~/.beekeeper.yaml
250+
mkdir ~/.beekeeper && mv local.yaml ~/.beekeeper/local.yaml
251+
mv bee-2 bee
252+
sudo mv beekeeper /usr/local/bin/beekeeper
253+
- name: Prepare local cluster
254+
run: |
255+
timeout ${TIMEOUT} make beelocal OPTS='ci skip-vet' ACTION=prepare
256+
- name: Set kube config
257+
run: |
258+
mkdir -p ~/.kube
259+
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
260+
- name: Set local cluster
261+
run: |
262+
timeout ${TIMEOUT} make deploylocal BEEKEEPER_CLUSTER=local-dns
263+
- name: Test pingpong (smoke)
264+
run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-pingpong; do echo "waiting for pingpong..."; sleep .3; done'
265+
- name: Test radius-decrease liveness
266+
id: radius-decrease
267+
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-radius-decrease
268+
- name: Collect debug artifacts
269+
if: failure()
270+
env:
271+
HEAD_REF: ${{ github.head_ref }}
272+
PR_USER: ${{ github.event.pull_request.user.login }}
273+
TUNSHELL_KEY: ${{ secrets.TUNSHELL_KEY }}
274+
run: |
275+
bash .github/bin/beekeeper_artifacts.sh local-dns
276+
export FAILED='no-test'
277+
if ${{ steps.radius-decrease.outcome=='failure' }}; then FAILED=radius-decrease; fi
278+
curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**${RUN_TYPE}** Radius-Decrease Test Error\nBranch: \`${HEAD_REF}\`\nUser: @${PR_USER}\nDebugging artifacts: [click](https://$BUCKET_NAME.$AWS_ENDPOINT/artifacts_$VERTAG.tar.gz)\nStep failed: \`${FAILED}\`\"}" https://beehive.ethswarm.org/hooks/$TUNSHELL_KEY
279+
- uses: actions/upload-artifact@v4
280+
if: failure()
281+
with:
282+
name: debug-dump-radius-decrease
283+
path: dump/
284+
223285
retag:
224286
name: Retag and Trigger ArgoCD
225287
env:

0 commit comments

Comments
 (0)