Add GH action for running finnegan's wake demo for pull requests/pushes.

Remove CircleCi validation from pre-commit checks.
pull/2997/head
derekpierre 2022-11-01 11:29:29 -04:00
parent 06cd86f532
commit d74d533851
14 changed files with 105 additions and 103 deletions

3
.github/labeler.yml vendored
View File

@ -4,9 +4,6 @@ ETH Contracts:
CLI:
- nucypher/cli/**/*
circleci:
- .circleci/**/*
Demos:
- examples/**/*

View File

@ -13,6 +13,6 @@ jobs:
name: 'Checking release note entry for PR ${{ github.event.number }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
ls -l ${{ github.workspace }}/newsfragments/${{ github.event.number }}.*.rst

View File

@ -7,7 +7,7 @@ concurrency:
cancel-in-progress: true
jobs:
build:
python-tests:
runs-on: ubuntu-latest
strategy:

25
.github/workflows/run_demo.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: '👷 Run Demo'
on: [push, pull_request]
jobs:
run-demo:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install docker compose
run: pip3 install docker-compose
- name: Start containers
run: docker-compose -f ./scripts/ci/docker-compose.yml build nucypher-ci-dev
- name: Run demo ursula fleet, finnegan's wake demo
run: ./scripts/ci/run_finnegans_wake_demo_docker-ci.sh

View File

@ -4,12 +4,6 @@ repos:
- repo: local
hooks:
# Custom
- id: Validate CircleCI
name: Validate CircleCI Config
entry: ./scripts/hooks/validate_circleci_config.sh
language: script
- id: tests
name: Run Nucypher Unit Tests
entry: scripts/hooks/run_unit_tests.sh

View File

@ -1,156 +1,156 @@
version: '3'
# USAGE
# docker-compose run nucypher-circle-dev python finnegans-wake-demo.py 172.29.1.3:11500
# docker-compose run nucypher-ci-dev python finnegans-wake-demo.py 172.29.1.3:11500
services:
nucypher-circle-dev:
nucypher-ci-dev:
ports:
- 11500
build:
context: ../..
dockerfile: deploy/docker/Dockerfile
image: circle:nucypher
container_name: nucypher-circle-dev
image: ci:nucypher
container_name: nucypher-ci-dev
working_dir: /code/examples/
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.0
environment:
- FINNEGANS_WAKE_PATH=finnegans_wake_demo/finnegans-wake-excerpt.txt
circleursula1:
ciursula1:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.1 --rest-port 11500 --lonely --disable-availability-check --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.1
container_name: circleursula1
circleursula2:
container_name: ciursula1
ciursula2:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.2 --rest-port 11500 --disable-availability-check --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.2
container_name: circleursula2
circleursula3:
container_name: ciursula2
ciursula3:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.3 --rest-port 11500 --disable-availability-check --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.3
container_name: circleursula3
circleursula4:
container_name: ciursula3
ciursula4:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.4 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.4
container_name: circleursula4
circleursula5:
container_name: ciursula4
ciursula5:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.5 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.5
container_name: circleursula5
circleursula6:
container_name: ciursula5
ciursula6:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.6 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.6
container_name: circleursula6
circleursula7:
container_name: ciursula6
ciursula7:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.7 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.7
container_name: circleursula7
circleursula8:
container_name: ciursula7
ciursula8:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.8 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.8
container_name: circleursula8
circleursula9:
container_name: ciursula8
ciursula9:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.9 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.9
container_name: circleursula9
circleursula10:
container_name: ciursula9
ciursula10:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.10 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.10
container_name: circleursula10
circleursula11:
container_name: ciursula10
ciursula11:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula1
- ciursula1
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.11 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.11
container_name: circleursula11
circleursula12:
container_name: ciursula11
ciursula12:
ports:
- 11500
image: circle:nucypher
image: ci:nucypher
depends_on:
- circleursula11
- ciursula11
command: nucypher ursula run --dev --federated-only --rest-host 172.29.1.12 --rest-port 11500 --teacher 172.29.1.1:11500 --no-ip-checkup
networks:
nucypher_circle_net:
nucypher_ci_net:
ipv4_address: 172.29.1.12
container_name: circleursula12
container_name: ciursula12
networks:
nucypher_circle_net:
nucypher_ci_net:
ipam:
driver: default
config:

8
scripts/ci/logOutput.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
LOGDIR=/tmp/ursulas-logs
mkdir $LOGDIR
docker exec ciursula1 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-1.txt
docker exec ciursula2 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-2.txt
docker exec ciursula3 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-3.txt
docker exec ciursula4 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-4.txt

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# runs in docker on circle ci
# runs in docker on ci
set -e
python /code/examples/finnegans_wake_demo/finnegans-wake-demo-federated.py 172.29.1.3:11500

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# runs in circleCI's build environment
# runs in ci environment
# runs finnegan's wake demo in a docker container
set -e
@ -21,7 +21,7 @@ sleep 3
# Run demo
echo "Starting Demo"
echo "working in directory: $PWD"
docker-compose run nucypher-circle-dev bash /code/scripts/circle/run_finnegans_wake.sh
docker-compose run nucypher-ci-dev bash /code/scripts/ci/run_finnegans_wake.sh
# spit out logs
./logOutput.sh

View File

@ -15,8 +15,8 @@ sleep 3
echo "running heartbeat demo"
# run alicia and bob all in one running of docker since we lack persistent disks in circle
docker-compose run nucypher-circle-dev bash /code/scripts/circle/run_heartbeat_alicia_and_bob.sh
# run alicia and bob all in one running of docker since we lack persistent disks in ci
docker-compose run nucypher-ci-dev bash /code/scripts/ci/run_heartbeat_alicia_and_bob.sh
# spit out logs
./logOutput.sh

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
LOGDIR=/tmp/ursulas-logs
mkdir $LOGDIR
docker exec -it circleursula1 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-1.txt
docker exec -it circleursula2 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-2.txt
docker exec -it circleursula3 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-3.txt
docker exec -it circleursula4 cat /root/.cache/nucypher/log/nucypher.log > $LOGDIR/ursula-4.txt

View File

@ -1,14 +0,0 @@
#!/usr/bin/env bash
# The following line is needed by the CircleCI Local Build Tool (due to Docker interactivity)
exec < /dev/tty
echo "Validating CircleCI YML Config..."
# If validation fails, tell Git to stop and provide error message. Otherwise, continue.
if ! eMSG=$(circleci config validate -c .circleci/config.yml); then
echo "CircleCI Configuration Failed Validation."
echo $eMSG
exit 1
fi
echo "CircleCI config is valid."
exit 0