Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
28a64f4
added smoketest that queries thegraph for all the exampledata from th…
samt1803 Aug 29, 2023
df1daba
debugging ci workflow
samt1803 Aug 29, 2023
8388089
update package lock
samt1803 Aug 29, 2023
ed0d395
fix installing local packages overwriting package.json entries
samt1803 Aug 31, 2023
691b498
fix subgraph docker image build
samt1803 Aug 31, 2023
f8bac52
add graph-cli to buildprocess
samt1803 Aug 31, 2023
4136893
skip subgraph build on host
samt1803 Aug 31, 2023
bc89c69
build packages in CI step, don't build fastchainimage on global "buil…
samt1803 Aug 31, 2023
38c11fa
update package.json and package-lock, decouple subrepo from monorepo,…
samt1803 Aug 31, 2023
0cbf7b9
Merge branch 'master' into ETH-585_CI_docker_build_smoke
samt1803 Sep 1, 2023
d9e3af9
remove fixed version of streamr packages, otherwise it pulls outdated…
samt1803 Sep 1, 2023
099a437
completely revamp fastchain image creation, clean up dependencies of …
samt1803 Sep 1, 2023
37ea38e
test graph entities with static and also dynamic ids
samt1803 Sep 1, 2023
cea22ec
cleanup
samt1803 Sep 1, 2023
a269b4e
make test green even if ids of example data entities change
samt1803 Sep 14, 2023
57f9abd
review change requests
samt1803 Sep 14, 2023
c6b0e82
Merge branch 'master' into ETH-585_CI_docker_build_smoke
samt1803 Sep 14, 2023
05a0f1a
force ci to install linux x64 amd gnu specific package
samt1803 Sep 14, 2023
cb598ba
disable ens integration test until the PR is merged, that adapts it t…
samt1803 Sep 14, 2023
2a8ab85
make contract size too big an error
samt1803 Sep 14, 2023
769d897
Merge remote-tracking branch 'origin/master' into ETH-585_CI_docker_b…
samt1803 Sep 14, 2023
bf6f9d2
contract adresses changed, also in subgraoph
samt1803 Sep 14, 2023
dbc90b5
Merge branch 'address_change_hotfix' into ETH-585_CI_docker_build_smoke
samt1803 Sep 14, 2023
8235816
moved some dependencies to devdepoendencies
samt1803 Sep 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:
packages/*/node_modules
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci --no-audit
npm i @nomicfoundation/solidity-analyzer-linux-x64-gnu
run: npm ci --no-audit
- name: Install linux x64 specific package
run: npm i @nomicfoundation/solidity-analyzer-linux-x64-gnu solidity-comments-linux-x64-gnu
- name: Build and lint
run: npm run build && npm run lint
- name: Unit tests
run: npm run test
integration-tests:
fastchain-docker-image:
timeout-minutes: 20
runs-on: ubuntu-20.04
needs:
- lint-and-unit-test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3.0.2
- uses: actions/setup-node@v3
Expand All @@ -59,17 +59,42 @@ jobs:
packages/*/node_modules
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci --no-audit
npm i @nomicfoundation/solidity-analyzer-linux-x64-gnu
- name: Build packages
run: npm run build -w packages/network-contracts -w packages/config
- name: Start Streamr Docker Stack
run: npm ci --no-audit
- name: Install linux x64 specific package
run: npm i @nomicfoundation/solidity-analyzer-linux-x64-gnu solidity-comments-linux-x64-gnu
- name: Build all packages
run: npm run build
- name: Build fastchain image
run: npm run docker:buildLocalArch -w packages/dev-chain-fast
- name: Build subgraph image
run: npm run docker:buildLocalArch -w packages/network-subgraphs
- name: Start docker stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.1
with:
services-to-start: 'ens-sync-script deploy-network-subgraphs'
- name: Integration Test (with dev-docker environment)
services-to-start: 'deploy-network-subgraphs-fastchain'
- name: Integration Test (with locally built images)
env:
TEST_TIMEOUT: '600000'
DEBUG: "*,-mocha:*"
run: npm run integration-test

# - name: Build & Push
# uses: docker/build-push-action@v4.1.1
# with:
# context: .
# file: ./packages/dev-chain-fast/Dockerfile
# platforms: linux/amd64
# push: true
# load: false
# build-args: |
# NODE_ENV=production
# tags: streamr/broker-node:dev
# labels: |
# org.opencontainers.image.source=
# uses: ./.github/workflows/docker-build.yml
# with:
# docker_file: ./packages/dev-chain-fast/Dockerfile
# image_name: streamr/broker-node
# test_services_to_start: cassandra init-keyspace dev-chain-fast deploy-network-subgraphs-fastchain broker-node-storage-1
# build_platforms: linux/amd64
# test_script: bash ./.github/healthcheck.sh http://localhost:8891/info streamr-dev-broker-node-storage-1
145 changes: 145 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: "Docker build"

on:
workflow_call:
inputs:
docker_file:
type: string
required: true
image_name:
type: string
required: true
test_services_to_start:
type: string
test_script:
type: string
push_image:
type: boolean
host_machine_platform:
type: string
required: false
default: ubuntu-20.04
build_platforms:
type: string
required: true

secrets:
dockerhub_username:
description: 'Required if the docker image is pushed'
required: false
dockerhub_token:
required: false

jobs:
build:
runs-on: ${{ inputs.host_machine_platform }}
steps:
- uses: actions/checkout@v3.5.2
- name: Cache Docker layers
uses: actions/cache@v3.3.1
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-v1-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-v1-
- name: Setup qemu
if: contains(inputs.build_platforms, 'arm64')
uses: docker/setup-qemu-action@v2.2.0
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.9.1
with:
driver-opts: |
network=host
- uses: docker/login-action@v2.2.0
if: ${{inputs.push_image}}
with:
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_token }}

- name: Get current Broker git tag (for Docker meta)
run: |
git fetch --tags origin --force
echo "broker_head_tag=$(git tag --points-at HEAD --list 'broker/v*')" >> $GITHUB_ENV


- name: Docker meta
id: docker_meta_success
uses: docker/metadata-action@v4.6.0
if: ${{inputs.push_image}}
with:
images: ${{inputs.image_name}}
flavor: |
latest=false
tags: |
type=match,pattern=broker/(v.*),group=1,value=${{ env.broker_head_tag }}
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/main' }}

- name: Build
if: ${{!inputs.push_image}}
uses: docker/build-push-action@v4.1.1
with:
context: .
file: ${{inputs.docker_file}}
platforms: ${{inputs.build_platforms}}
push: false
load: true
build-args: |
NODE_ENV=development
tags: ${{inputs.image_name}}:dev
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Start Streamr Docker Stack
if: ${{inputs.test_services_to_start && inputs.test_script }}
uses: streamr-dev/streamr-docker-dev-action@v1.0.1
with:
services-to-start: ${{inputs.test_services_to_start}}

- name: Run test script
if: ${{inputs.test_services_to_start && inputs.test_script }}
run: ${{inputs.test_script}}

- name: Build & Push
if: ${{inputs.push_image}}
uses: docker/build-push-action@v4.1.1
with:
context: .
file: ${{inputs.docker_file}}
platforms: ${{inputs.build_platforms}}
push: true
load: false
build-args: |
NODE_ENV=production
tags: ${{ steps.docker_meta_success.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2.2.1
with:
dest: 'logs'

- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@v3
with:
name: docker-logs-node${{ matrix.node-version }}--${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt}}
path: 'logs'

- name: Stop Streamr Docker Stack
if: always()
run: |
docker kill $(docker ps -q)
docker rm $(docker ps -a -q)

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Loading