Skip to content

Commit

Permalink
Merge pull request #100 from Cerebellum-Network/feature/central-redis…
Browse files Browse the repository at this point in the history
…-in-tests

Update tests to use new redis approach
  • Loading branch information
skambalin authored Jul 20, 2023
2 parents 9e6da04 + 8cbd74a commit 0c82c1d
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 615 deletions.
69 changes: 41 additions & 28 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
name: 'CI'
on:
push:
workflow_call:
push:
workflow_call:

permissions:
id-token: write
contents: read

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "true"
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
registry-url: 'https://registry.npmjs.org'
- name: Install packages
run: npm install
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Check protoc version
run: protoc --version
- name: Compile proto
run: npm run compile
- name: Integration tests
run: npm test
- name: Increase version
run: node scripts/release.js --major
- name: NPM set register
run: npm set registry http://localhost:4873/
- name: Publishing dry-run
run: node scripts/ci-test.mjs
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
registry-url: 'https://registry.npmjs.org'
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}:role/github
role-session-name: ${{ github.event.repository.name }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Install packages
run: npm install
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Check protoc version
run: protoc --version
- name: Compile proto
run: npm run compile
- name: Integration tests
run: npm test
- name: Increase version
run: node scripts/release.js --major
- name: NPM set register
run: npm set registry http://localhost:4873/
- name: Publishing dry-run
run: node scripts/ci-test.mjs
96 changes: 54 additions & 42 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,60 @@
name: 'CD release'
on:
release:
types: [prereleased, released]
release:
types: [prereleased, released]

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

permissions:
id-token: write
contents: read

jobs:
continuous-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "true"
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
registry-url: 'https://registry.npmjs.org'
submodules: "true"
- name: Install packages
run: npm install
- name: NPM set register
run: npm set registry https://registry.npmjs.org
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Check protoc version
run: protoc --version
- name: Compile proto
run: npm run compile
- name: NPM whoami
run: npm whoami
- name: Run tests
run: npm run test
- name: Publish
run: node scripts/publish.js
- name: Build artifacts
run: node scripts/release-artifacts.js
- name: Upload content-addressable-storage browser module
uses: actions/[email protected]
with:
name: "content-addressable-storage.js"
path: ./packages/content-addressable-storage/build/content-addressable-storage.js
- name: Upload ddc-client browser module
uses: actions/[email protected]
with:
name: "ddc-client.js"
path: .packages/ddc-client/build/ddc-client.js
continuous-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- uses: actions/setup-node@v2
with:
node-version: '16.15.0'
registry-url: 'https://registry.npmjs.org'
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}:role/github
role-session-name: ${{ github.event.repository.name }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Install packages
run: npm install
- name: NPM set register
run: npm set registry https://registry.npmjs.org
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
- name: Check protoc version
run: protoc --version
- name: Compile proto
run: npm run compile
- name: NPM whoami
run: npm whoami
- name: Run tests
run: npm run test
- name: Publish
run: node scripts/publish.js
- name: Build artifacts
run: node scripts/release-artifacts.js
- name: Upload content-addressable-storage browser module
uses: actions/[email protected]
with:
name: 'content-addressable-storage.js'
path: ./packages/content-addressable-storage/build/content-addressable-storage.js
- name: Upload ddc-client browser module
uses: actions/[email protected]
with:
name: 'ddc-client.js'
path: .packages/ddc-client/build/ddc-client.js
78 changes: 0 additions & 78 deletions ddc-test-cluster/docker-compose.volumes.yml

This file was deleted.

63 changes: 47 additions & 16 deletions ddc-test-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: "3"
version: "3.4"

services:
ddc-cdn-node:
platform: linux/amd64
container_name: "ddc-cdn-node"
image: 'cerebellumnetwork/ddc-cdn-node:dev-latest'
image: "625402836641.dkr.ecr.us-west-2.amazonaws.com/ddc-cdn-node:dev-latest"
environment:
- 'HTTP_PORT=8080'
- 'HTTP_ADDRESS=http://localhost:8080'
Expand All @@ -17,10 +18,14 @@ services:
interval: 3s
timeout: 1s
retries: 5
depends_on:
redis:
condition: service_healthy

ddc-storage-node-0:
platform: linux/amd64
container_name: "ddc-storage-node-0"
image: 'cerebellumnetwork/ddc-storage-node:dev-latest'
image: "625402836641.dkr.ecr.us-west-2.amazonaws.com/ddc-storage-node:dev-latest"
environment:
- 'HTTP_PORT=8090'
- 'HTTP_ADDRESS=http://localhost:8090'
Expand All @@ -34,10 +39,14 @@ services:
interval: 3s
timeout: 1s
retries: 5
depends_on:
redis:
condition: service_healthy

ddc-storage-node-1:
platform: linux/amd64
container_name: "ddc-storage-node-1"
image: 'cerebellumnetwork/ddc-storage-node:dev-latest'
image: "625402836641.dkr.ecr.us-west-2.amazonaws.com/ddc-storage-node:dev-latest"
environment:
- 'HTTP_PORT=8091'
- 'HTTP_ADDRESS=http://localhost:8091'
Expand All @@ -51,10 +60,14 @@ services:
interval: 3s
timeout: 1s
retries: 5
depends_on:
redis:
condition: service_healthy

ddc-storage-node-2:
platform: linux/amd64
container_name: "ddc-storage-node-2"
image: 'cerebellumnetwork/ddc-storage-node:dev-latest'
image: "625402836641.dkr.ecr.us-west-2.amazonaws.com/ddc-storage-node:dev-latest"
environment:
- 'HTTP_PORT=8092'
- 'HTTP_ADDRESS=http://localhost:8092'
Expand All @@ -68,10 +81,14 @@ services:
interval: 3s
timeout: 1s
retries: 5
depends_on:
redis:
condition: service_healthy

ddc-storage-node-3:
platform: linux/amd64
container_name: "ddc-storage-node-3"
image: 'cerebellumnetwork/ddc-storage-node:dev-latest'
image: "625402836641.dkr.ecr.us-west-2.amazonaws.com/ddc-storage-node:dev-latest"
environment:
- 'HTTP_PORT=8093'
- 'HTTP_ADDRESS=http://localhost:8093'
Expand All @@ -85,10 +102,14 @@ services:
interval: 3s
timeout: 1s
retries: 5
depends_on:
redis:
condition: service_healthy

ddc-storage-node-6:
platform: linux/amd64
container_name: "ddc-storage-node-6"
image: 'cerebellumnetwork/ddc-storage-node:dev-latest'
image: "625402836641.dkr.ecr.us-west-2.amazonaws.com/ddc-storage-node:dev-latest"
environment:
- 'HTTP_PORT=8096'
- 'HTTP_ADDRESS=http://localhost:8096'
Expand All @@ -102,16 +123,26 @@ services:
interval: 3s
timeout: 1s
retries: 5
depends_on:
redis:
condition: service_healthy

redis:
build: redis
container_name: dac-redis
image: 625402836641.dkr.ecr.us-west-2.amazonaws.com/dac-redis:dev-latest
container_name: redis
healthcheck:
test: ["CMD-SHELL", "/healthchecker-runner.sh || exit 1"]
interval: 10s
timeout: 10s
start_period: 10s
retries: 5
ports:
- 6379:6379
- "6379:6379"

redis-setup:
build: redis
restart: 'no'
depends_on:
- redis
entrypoint: ["bash", "-c", "cat mylib.lua | redis-cli -h redis -x FUNCTION LOAD REPLACE"]
webdis:
image: nicolas/webdis:0.1.21
container_name: webdis
environment:
REDIS_HOST: redis
ports:
- "7379:7379"
3 changes: 0 additions & 3 deletions ddc-test-cluster/redis/Dockerfile

This file was deleted.

Loading

0 comments on commit 0c82c1d

Please sign in to comment.