Skip to content

Changes on the bee side to use the correct functions and send the correct function args for contracts #11347

Changes on the bee side to use the correct functions and send the correct function args for contracts

Changes on the bee side to use the correct functions and send the correct function args for contracts #11347

Workflow file for this run

name: Beekeeper
on:
repository_dispatch:
types: [trigger-beekeeper, beekeeper]
pull_request:
branches:
- "**"
env:
K3S_VERSION: "v1.22.17+k3s1"
REPLICA: 3
RUN_TYPE: "PR RUN"
SETUP_CONTRACT_IMAGE: "ethersphere/bee-localchain"
SETUP_CONTRACT_IMAGE_TAG: "0.9.0-rc3"
BEELOCAL_BRANCH: "main"
BEEKEEPER_BRANCH: "master"
BEEKEEPER_METRICS_ENABLED: false
REACHABILITY_OVERRIDE_PUBLIC: true
BATCHFACTOR_OVERRIDE_PUBLIC: 2
TIMEOUT: 30m
BUCKET_NAME: swarm-beekeeper-artifacts
AWS_ACCESS_KEY_ID: ${{ secrets.DO_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DO_AWS_SECRET_ACCESS_KEY }}
AWS_EC2_METADATA_DISABLED: true
AWS_ENDPOINT: fra1.digitaloceanspaces.com
VERTAG: ${GITHUB_RUN_ID}
jobs:
init:
name: Init
runs-on: ubuntu-latest
outputs:
msg: ${{ steps.commit.outputs.msg }}
steps:
- name: Checkout
uses: actions/checkout@v4
if: github.event.action != 'beekeeper'
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v4
if: github.event.action == 'beekeeper'
with:
fetch-depth: 0
ref: ${{ github.event.client_payload.ref }}
- name: Setup Go
uses: actions/setup-go@v5
with:
cache: false
go-version-file: go.mod
- name: Cache Go Modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get Commit Message
id: commit
run: |
MSG=$(git log --format=%s -n 1 ${{github.event.after}})
echo "msg=${MSG}" >> $GITHUB_OUTPUT
- name: Build - 0
run: |
make binary
mv dist/bee bee-0
- name: Apply patches and build - 1
run: |
patch pkg/api/postage.go .github/patches/postage_api.patch
patch pkg/retrieval/retrieval.go .github/patches/retrieval.patch
make binary
mv dist/bee bee-1
- name: Install beekeeper
run: |
export PATH=$(pwd):$PATH
timeout ${TIMEOUT} make beekeeper BEEKEEPER_INSTALL_DIR=$(pwd)
beekeeper version --log-verbosity 0
mv ~/.beekeeper.yaml .beekeeper.yaml
mv ~/.beekeeper/local.yaml local.yaml
- uses: actions/upload-artifact@v4
with:
name: temp-artifacts
path: |
Dockerfile.goreleaser
Makefile
bee-0
bee-1
bee-2
beekeeper
local.yaml
.beekeeper.yaml
.github/bin/beekeeper_artifacts.sh
retention-days: 5
beekeeper:
name: Integration tests
runs-on: ubuntu-latest
needs: [init]
steps:
- name: Cache
uses: actions/cache@v4
with:
path: |
/tmp/k3s-${{ env.K3S_VERSION }}
key: k3s-${{ env.K3S_VERSION }}
- name: "Download Artifact"
uses: actions/download-artifact@v4
with:
name: temp-artifacts
- name: Unpack artifacts
run: |
chmod +x bee-1 beekeeper .github/bin/beekeeper_artifacts.sh
mv .beekeeper.yaml ~/.beekeeper.yaml
mkdir ~/.beekeeper && mv local.yaml ~/.beekeeper/local.yaml
mv bee-1 bee
sudo mv beekeeper /usr/local/bin/beekeeper
- name: Prepare local cluster
run: |
timeout ${TIMEOUT} make beelocal OPTS='ci skip-vet' ACTION=prepare
- name: Set kube config
run: |
mkdir -p ~/.kube
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
- name: Set local cluster
run: |
timeout ${TIMEOUT} make deploylocal BEEKEEPER_CLUSTER=local-dns
- name: Test pingpong
id: pingpong
run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-pingpong; do echo "waiting for pingpong..."; sleep .3; done'
- name: Test fullconnectivity
id: fullconnectivity
run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks=ci-full-connectivity; do echo "waiting for full connectivity..."; sleep .3; done'
- name: Test settlements
id: settlements
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-settlements
- name: Sleep for time allowance to replenish
run: sleep 2
- name: Test pss
id: pss
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pss
- name: Test soc
id: soc
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-soc
- name: Test pushsync (chunks)
id: pushsync-chunks-1
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pushsync-chunks
- name: Test pushsync (light mode chunks)
id: pushsync-chunks-2
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pushsync-light-chunks
- name: Test retrieval
id: retrieval
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-retrieval
- name: Test manifest
id: manifest
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-manifest
- name: Test postage stamps
id: postage-stamps
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-postage
- name: Test staking
id: stake
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-stake
- name: Test withdraw
id: withdraw
run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-withdraw; do echo "waiting for withdraw..."; sleep .3; done'
- name: Test redundancy
id: redundancy
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-redundancy
- name: Collect debug artifacts
if: failure()
run: |
bash .github/bin/beekeeper_artifacts.sh local-dns
export FAILED='no-test'
if ${{ steps.pingpong.outcome=='failure' }}; then FAILED=pingpong; fi
if ${{ steps.fullconnectivity.outcome=='failure' }}; then FAILED=fullconnectivity; fi
if ${{ steps.settlements.outcome=='failure' }}; then FAILED=settlements; fi
if ${{ steps.pss.outcome=='failure' }}; then FAILED=pss; fi
if ${{ steps.soc.outcome=='failure' }}; then FAILED=soc; fi
if ${{ steps.pushsync-chunks-1.outcome=='failure' }}; then FAILED=pushsync-chunks-1; fi
if ${{ steps.pushsync-chunks-2.outcome=='failure' }}; then FAILED=pushsync-chunks-2; fi
if ${{ steps.retrieval.outcome=='failure' }}; then FAILED=retrieval; fi
if ${{ steps.manifest.outcome=='failure' }}; then FAILED=manifest; fi
if ${{ steps.content-availability.outcome=='failure' }}; then FAILED=content-availability; fi
curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**${RUN_TYPE}** Beekeeper Error\nBranch: \`${{ github.head_ref }}\`\nUser: @${{ github.event.pull_request.user.login }}\nDebugging artifacts: [click](https://$BUCKET_NAME.$AWS_ENDPOINT/artifacts_$VERTAG.tar.gz)\nStep failed: \`${FAILED}\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.TUNSHELL_KEY }}
echo "Failed test: ${FAILED}"
- name: Create tunshell session for debug
if: failure() && contains(needs.init.outputs.msg, '[debug]')
run: |
KEYS=$(curl -sSf -X POST https://eu.relay.tunshell.com/api/sessions)
curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**Integration tests** Beekeeper Debug\nBranch: \`${{ github.head_ref }}\`\nUser: @${{ github.event.pull_request.user.login }}\nDebug shell: \`sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} eu.relay.tunshell.com\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.TUNSHELL_KEY }}
echo "Connect to github actions node using"
echo "sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} eu.relay.tunshell.com"
curl -sSf https://lets.tunshell.com/init.sh | sh /dev/stdin T $(echo $KEYS | jq -r .peer1_key) ${{ secrets.TUNSHELL_SECRET }} eu.relay.tunshell.com
- uses: actions/upload-artifact@v4
if: failure()
with:
name: debug-dump
path: dump/
retag:
name: Retag and Trigger ArgoCD
env:
TIMEOUT: 10m
needs: [beekeeper]
runs-on: ubuntu-latest
steps:
- name: "Download Artifact"
uses: actions/download-artifact@v4
with:
name: temp-artifacts
- name: Unpack artifacts
run: |
chmod +x bee-0
mv bee-0 bee
- name: Build image
run: |
timeout ${TIMEOUT} make beelocal ACTION=build OPTS='ci skip-vet skip-push'
- name: Retag Docker image and push
if: github.ref == 'refs/heads/master' && github.event.action != 'beekeeper' && success()
run: |
docker tag k3d-registry.localhost:5000/ethersphere/bee:latest ethersphere/bee:latest
docker tag k3d-registry.localhost:5000/ethersphere/bee:latest quay.io/ethersphere/bee:latest
printf ${{ secrets.DOCKERHUB_PASSWORD }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
printf ${{ secrets.QUAY_PASSWORD }} | docker login --username ${{ secrets.QUAY_USERNAME }} quay.io --password-stdin
docker push ethersphere/bee:latest
docker push quay.io/ethersphere/bee:latest
echo RUN_TYPE="MERGE RUN" >> $GITHUB_ENV
- name: Trigger Bee Factory latest build
if: github.ref == 'refs/heads/master' && github.event.action != 'beekeeper' && success()
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GHA_PAT_BASIC }}
repository: ethersphere/bee-factory
event-type: build-images
client-payload: '{"tag": "latest"}'