[RelayMiner] Streaming Support for SSE and NDJSON (used for LLMs) #10101
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Main build | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-push-container: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: "0" # Per https://github.com/ignite/cli/issues/1674#issuecomment-1144619147 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.24.3" | |
| - name: Install CI dependencies | |
| run: make install_ci_deps | |
| - name: install ignite | |
| run: make ignite_install | |
| - name: Install cosmovisor (optional) | |
| run: | | |
| set -e | |
| # Build/install; if your Makefile installs to $(go env GOPATH)/bin | |
| make install_cosmovisor || true | |
| COSMOVISOR="$(go env GOPATH)/bin/cosmovisor" | |
| if [ -x "$COSMOVISOR" ]; then | |
| mkdir -p ./bin | |
| cp "$COSMOVISOR" ./bin/ | |
| fi | |
| # TODO_IMPROVE(@okdas): Add this step. See https://github.com/pokt-network/poktroll/pull/544#issuecomment-2123063491 | |
| # - name: Generate protobufs | |
| # run: make proto_regen | |
| - name: Build | |
| run: make ignite_pocketd_build | |
| - name: Set up Docker Buildx | |
| if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) || (contains(github.event.pull_request.labels.*.name, 'devnet-test-e2e')) | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker Metadata action | |
| if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) || (contains(github.event.pull_request.labels.*.name, 'devnet-test-e2e')) | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| env: | |
| DOCKER_METADATA_PR_HEAD_SHA: "true" | |
| with: | |
| images: | | |
| ghcr.io/pokt-network/poktrolld | |
| ghcr.io/pokt-network/pocketd | |
| tags: | | |
| type=ref,event=branch,suffix=-dev | |
| type=ref,event=pr | |
| type=sha | |
| type=sha,format=long | |
| - name: Login to GitHub Container Registry | |
| if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) || (contains(github.event.pull_request.labels.*.name, 'devnet-test-e2e')) | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Copy binaries to inside of the Docker context | |
| if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) || (contains(github.event.pull_request.labels.*.name, 'devnet-test-e2e')) | |
| run: | | |
| mkdir -p ./bin # Make sure the bin directory exists | |
| cp $(which ignite) ./bin # Copy ignite binary to the repo's bin directory | |
| cp $(go env GOPATH)/bin/pocketd ./bin # Copy the binary to the repo's bin directory | |
| # Cosmovisor is optional in this workflow; copy it when present and log when it's missing. | |
| if [ -f "$(go env GOPATH)/bin/cosmovisor" ]; then | |
| cp $(go env GOPATH)/bin/cosmovisor ./bin | |
| else | |
| echo "Cosmovisor binary not found; we tried to copy it over but it wasn't available." | |
| fi | |
| ls -la ./bin | |
| - name: Build and push Docker image | |
| if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) || (contains(github.event.pull_request.labels.*.name, 'devnet-test-e2e')) | |
| uses: docker/build-push-action@v5 | |
| with: | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # NB: Uncomment below if arm64 build is needed; arm64 builds are off by default because build times are significant. | |
| platforms: linux/amd64 #,linux/arm64 | |
| file: Dockerfile.dev | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| context: . | |
| run-e2e-tests: | |
| timeout-minutes: 30 | |
| needs: build-push-container | |
| if: ${{ false }} # Temporarily disabled; devnet-test-e2e E2E runs are now manual. | |
| runs-on: ubuntu-latest | |
| env: | |
| GKE_CLUSTER: protocol-us-central1 | |
| GKE_ZONE: us-central1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| .github | |
| - id: "auth" | |
| name: "Authenticate to Google Cloud" | |
| uses: "google-github-actions/auth@v1" | |
| with: | |
| credentials_json: "${{ secrets.GKE_PROTOCOL_US_CENTRAL }}" | |
| - uses: google-github-actions/get-gke-credentials@v1 | |
| with: | |
| cluster_name: ${{ env.GKE_CLUSTER }} | |
| location: ${{ env.GKE_ZONE }} | |
| project_id: ${{ secrets.GKE_PROTOCOL_PROJECT }} | |
| - name: Run E2E test job | |
| env: | |
| IMAGE_TAG: sha-${{ github.event.pull_request.head.sha || github.sha }} | |
| NAMESPACE: devnet-issue-${{ github.event.number }} | |
| JOB_NAME: e2e-test-${{ github.event.pull_request.head.sha || github.sha }} | |
| POCKET_NODE: tcp://devnet-issue-${{ github.event.number }}-validator-pocketd:26657 | |
| run: bash .github/workflows-helpers/run-e2e-test.sh |