Skip to content

Commit

Permalink
Merging
Browse files Browse the repository at this point in the history
  • Loading branch information
jensenbox committed Sep 26, 2017
1 parent 329ca74 commit 675fd4e
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 37 deletions.
37 changes: 37 additions & 0 deletions agent-web/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset

function run_tests {
py.test --verbose --cov-config .coveragerc --cov-report html --cov=sn_agent tests
}

case "$1" in

noop)
;;

run)
python agent-web.py
;;

docs)
cd docs
make html
;;

test)
run_tests
;;

travis-test)
run_tests
coveralls
;;

*) echo 'No operation specified'
exit 0;
;;

esac
65 changes: 37 additions & 28 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
version: "3"

services:

agent:
build: agent
environment:
Expand All @@ -12,6 +13,7 @@ services:
- "8000:8000"
volumes:
- ./agent-data:/data

working_dir: /code
entrypoint: ./run.sh
command: noop
Expand All @@ -22,34 +24,41 @@ services:
- "8080:8080"
environment:
- SN_WEB_COOKIE_SECRET=kubr6DvIuYj4GREdgXq5CCoL5qHQWglj8IECTsI79mY=
- PYTHONPATH=/code
working_dir: /code
entrypoint: ./run.sh
command: noop

geth:
build: geth
ports:
- "8545:8545"
- "8546:8546"
- "30303:30303"
volumes:
- ./geth-data:/data
deploy:
resources:
limits:
cpus: '0.001'
memory: 50M
reservations:
cpus: '0.0001'
memory: 20M

working_dir: /geth
entrypoint: ./run.sh
command: noop

parity:
build: parity
volumes:
- ./parity-data:/data

working_dir: /parity
entrypoint: ./run.sh
command: noop

# geth:
# build: geth
# ports:
# - "8545:8545"
# - "8546:8546"
# - "30303:30303"
# volumes:
# - ./geth-data:/geth-data
# entrypoint: ./run.sh
# command: noop
# deploy:
# resources:
# limits:
# cpus: '0.001'
# memory: 50M
# reservations:
# cpus: '0.0001'
# memory: 20M

# parity:
# build: parity
# entrypoint: ./run.sh
# command: noop
#
# truffle:
# build: truffle
# entrypoint: ./run.sh
# command: noop
truffle:
build: truffle
entrypoint: truffle
3 changes: 3 additions & 0 deletions geth/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ apt-get update && \
apt-get -y -qq install geth solc && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /geth
ADD . /geth
19 changes: 18 additions & 1 deletion geth/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#!/usr/bin/env bash

geth --datadir=/geth-data --metrics --shh --rpc --rpcaddr 0.0.0.0 --ws --wsaddr 0.0.0.0 --nat none --verbosity 5 --vmdebug --dev --maxpeers 0 --gasprice 0 --debug --pprof
set -o errexit
set -o nounset


case "$1" in

noop)
;;

run)
geth --datadir=/geth-data --metrics --shh --rpc --rpcaddr 0.0.0.0 --ws --wsaddr 0.0.0.0 --nat none --verbosity 5 --vmdebug --dev --maxpeers 0 --gasprice 0 --debug --pprof
;;

*) echo 'No operation specified'
exit 0;
;;

esac
3 changes: 2 additions & 1 deletion parity/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ FROM parity/parity:stable

ENV DEBIAN_FRONTEND noninteractive

RUN ls -lar
WORKDIR /parity
ADD . /parity
10 changes: 4 additions & 6 deletions parity/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
#!/usr/bin/env bash

set -o errexit
set -o verbose
set -o xtrace
set -o nounset


case "$1" in

run)
ls -lar
noop)
;;

--help)
echo 'Executing in the default context, specify "run" to actually execute'
run)
parity --help
;;

*) echo 'No operation specified'
Expand Down
6 changes: 5 additions & 1 deletion tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ set -o nounset

case "$1" in

run)
up)
docker-compose up --build --force-recreate
;;

run)
docker-compose run agent run
;;

clean)
docker-compose down --rmi all --remove-orphans
;;
Expand Down

0 comments on commit 675fd4e

Please sign in to comment.