Skip to content

feat: improve backpressure gossipsub batch #1545

feat: improve backpressure gossipsub batch

feat: improve backpressure gossipsub batch #1545

name: Docker build and push
on:
push:
branches: [main, debug/**]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docker:
uses: ./.github/workflows/docker_utils.yml
secrets: inherit
direct:
uses: ./.github/workflows/docker_utils.yml
secrets: inherit
with:
features: "tce-direct,sequencer"
network:
uses: ./.github/workflows/docker_utils.yml
secrets: inherit
with:
features: "network"
docker_e2e:
runs-on: ubuntu-latest
needs: docker
env:
EXPECTED_IMAGE_NAME: ghcr.io/${{ github.repository }}:main
steps:
- name: Set environment
run: |
# It's fine to assume a single tag. Our tagging strategy follows a 1:1 mapping of image:tag
tags=${{ needs.docker.outputs.tags }}
echo "docker_tag=${tags#*:}" >> $GITHUB_ENV
shell: bash
- name: Setup image to match docker-compose file
run: |
docker pull ghcr.io/${{ github.repository}}:${{ env.docker_tag }}
docker tag ghcr.io/${{ github.repository}}:${{ env.docker_tag }} ${{ env.EXPECTED_IMAGE_NAME }}
- name: Checkout
uses: actions/checkout@v3
- name: Running TCE cluster
run: |
docker compose -f tools/docker-compose.yml up -d peer
- name: Checking for healthy cluster
uses: nick-fields/[email protected]
with:
retry_on: error
max_attempts: 5
retry_wait_seconds: 40
timeout_minutes: 10
on_retry_command: docker inspect --format "{{ .Id }} {{ .State.Health.Status }}" $(docker compose -f tools/docker-compose.yml ps -aq peer boot) | grep "healthy$" | cut -d ' ' -f 1 | xargs -I{} sh -c 'echo "\nLogs for => {}\n" && docker logs {}'
command: |
EXPECTED=$(docker compose -f tools/docker-compose.yml ps -aq peer boot|wc -l)
COUNT=$(docker inspect --format "{{.State.Health.Status }}" $(docker compose -f tools/docker-compose.yml ps -aq peer boot)|grep "^healthy$"|wc -l)
echo "Number of Healthy containers: $COUNT"
if [[ $COUNT -eq $EXPECTED ]]; then
echo "All expected containers healthy"
exit 0
else
echo "Unhealthy containers"
docker compose -f tools/docker-compose.yml ps -a peer boot
exit 1
fi
- name: Run the check
run: |
docker compose -f tools/docker-compose.yml ps
docker compose -f tools/docker-compose.yml run --no-deps check
k8s_e2e:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
needs:
- docker
- docker_e2e
steps:
- name: Set environment
run: |
# It's fine to assume a single tag. Our tagging strategy follows a 1:1 mapping of image:tag
tags=${{ needs.docker.outputs.tags }}
echo "docker_tag=${tags#*:}" >> $GITHUB_ENV
shell: bash
- uses: convictional/[email protected]
with:
owner: toposware
repo: tce-k8s
github_token: ${{ secrets.ROBOT_TOPOSWARE_K8S_E2E_RW }}
workflow_file_name: test.yml
ref: main
wait_interval: 60
client_payload: '{ "git_commit": "${{ github.sha }}", "docker_tag": "${{ env.docker_tag }}" }'