<commit_before>#!/usr/bin/env bash

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

SN_NETWORK_ACCOUNT_PASSWORD=${SN_NETWORK_ACCOUNT_PASSWORD:=<PASSWORD>}

case "$1" in

init)
    #https://www.vaultproject.io/intro/getting-started/deploy.html#initializing-the-vault+
    ;;

demo)
    docker-compose -f docker-compose.demo.yml create --build --force-recreate demo
    docker-compose -f docker-compose.demo.yml run --service-ports demo ./agent.sh $2
    ;;

dev)
    docker-compose -f docker/docker-compose.dev.yml create --build --force-recreate dev
    docker-compose -f docker/docker-compose.dev.yml run --service-ports dev ./agent.sh run
    ;;

alice)
    docker-compose -f docker-compose.abc.yml create --build --force-recreate alice
    docker-compose -f docker-compose.abc.yml run --service-ports alice ./agent.sh run
    ;;

bob)
    docker-compose -f docker-compose.abc.yml create --build --force-recreate bob
    docker-compose -f docker-compose.abc.yml run --service-ports bob ./agent.sh run
    ;;

charlie)
    docker-compose -f docker-compose.abc.yml create --build --force-recreate charlie
    docker-compose -f docker-compose.abc.yml run --service-ports charlie ./agent.sh run
    ;;

agent-docs)
    docker-compose create --build --force-recreate test
    docker-compose run test ./agent.sh docs
    ;;

agent-test)
    docker-compose start testrpc
    docker-compose create --build test
    docker-compose run test ./agent.sh test
    ;;

agent-web)
    docker-compose run --service-ports agent-web ./agent-web.sh run
    ;;

opendht)
    docker-compose create --build --force-recreate opendht
    docker-compose run --service-ports opendht
    ;;

geth)
    docker-compose create --build --force-recreate geth
    docker-compose run --service-ports geth $2
    ;;

solc)
    docker-compose run --service-ports geth solc --help
    ;;

parity)
    docker-compose -f docker-compose.dev.yml create --build --force-recreate parity
    docker-compose -f docker-compose.dev.yml run --service-ports parity $2
    ;;

vault)
    docker-compose create --build --force-recreate vault
    docker-compose run --service-ports vault $2
    ;;

relex)
    docker-compose -f docker-compose.dev.yml  run --service-ports relex
    ;;

testrpc)
    docker-compose create --build --force-recreate testrpc
    docker-compose run --service-ports testrpc
    ;;

prepare-dao)
    docker-compose -f docker-compose.dao.yml create --build --force-recreate dao
    docker-compose -f docker-compose.dao.yml run --service-ports dao ./dao.sh $2
    ;;

ipfs)
    docker-compose run --service-ports ipfs daemon
    ;;

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

hard-clean)
    docker image prune
    docker-compose down --rmi all --remove-orphans
    docker kill `docker ps -q` || true
    docker rm `docker ps -a -q`
    docker rmi `docker images -q`
    docker volume rm `docker volume ls -qf dangling=true`
    ;;

create-web-cookie)
    docker-compose run agent-web-cookie
    ;;

gen-ssl)
    cd agent
    openssl req -nodes -new -x509  -keyout server.key -out server.crt -subj '/CN=localhost'<commit_msg>Update tools.sh for new docker directory<commit_after>#!/usr/bin/env bash

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

SN_NETWORK_ACCOUNT_PASSWORD=${SN_NETWORK_ACCOUNT_PASSWORD:=<PASSWORD>}

case "$1" in

init)
    #https://www.vaultproject.io/intro/getting-started/deploy.html#initializing-the-vault+
    ;;

demo)
    docker-compose -f docker/docker-compose.demo.yml create --build --force-recreate demo
    docker-compose -f docker/docker-compose.demo.yml run --service-ports demo ./agent.sh run
    ;;

demo-down)
    docker-compose -f docker/docker-compose.demo.yml down --remove-orphans
    ;;

dev)
    docker-compose -f docker/docker-compose.dev.yml create --build --force-recreate dev
    docker-compose -f docker/docker-compose.dev.yml run --service-ports dev ./agent.sh run
    ;;

dev-down)
    docker-compose -f docker/docker-compose.dev.yml down --remove-orphans
    ;;

alice)
    docker-compose -f docker/docker-compose.abc.yml create --build --force-recreate alice
    docker-compose -f docker/docker-compose.abc.yml run --service-ports alice ./agent.sh run
    ;;

bob)
    docker-compose -f docker/docker-compose.abc.yml create --build --force-recreate bob
    docker-compose -f docker/docker-compose.abc.yml run --service-ports bob ./agent.sh run
    ;;

charlie)
    docker-compose -f docker/docker-compose.abc.yml create --build --force-recreate charlie
    docker-compose -f docker/docker-compose.abc.yml run --service-ports charlie ./agent.sh run
    ;;

agent-docs)
    docker-compose -f docker/docker-compose.yml create --build --force-recreate test
    docker-compose -f docker/docker-compose.ymlrun test ./agent.sh docs
    ;;

agent-test)
    docker-compose -f docker/docker-compose.yml start testrpc
    docker-compose -f docker/docker-compose.yml create --build test
    docker-compose -f docker/docker-compose.yml run test ./agent.sh test
    ;;

opendht)
    docker-compose -f docker/docker-compose.yml create --build --force-recreate opendht
    docker-compose -f docker/docker-compose.yml run --service-ports opendht
    ;;

geth)
    docker-compose -f docker/docker-compose.yml create --build --force-recreate geth
    docker-compose -f docker/docker-compose.yml run --service-ports geth $2
    ;;

solc)
    docker-compose -f docker/docker-compose.yml run --service-ports geth solc --help
    ;;

parity)
    docker-compose -f docker-compose.dev.yml create --build --force-recreate parity
    docker-compose -f docker-compose.dev.yml run --service-ports parity $2
    ;;

vault)
    docker-compose -f docker/docker-compose.yml create --build --force-recreate vault
    docker-compose -f docker/docker-compose.yml run --service-ports vault $2
    ;;

relex)
    docker-compose -f docker/docker-compose.dev.yml  run --service-ports relex
    ;;

testrpc)
    docker-compose -f docker/docker-compose.yml create --build --force-recreate testrpc
    docker-compose -f docker/docker-compose.yml run --service-ports testrpc
    ;;

prepare-dao)
    docker-compose -f docker-compose.dao.yml create --build --force-recreate dao
    docker-compose -f docker-compose.dao.yml run --service-ports dao ./dao.sh $2
    ;;

ipfs)
    docker-compose -f docker/docker-compose.yml run --service-ports ipfs daemon
    ;;

clean)
    docker-compose -f docker/docker-compose.yml down --rmi all --remove-orphans
    ;;

hard-clean)
    docker image prune
    docker-compose -f docker/docker-compose.dev.yml down --rmi all --remove-orphans
    docker-compose -f docker/docker-compose.yml down --rmi all --remove-orphans
    docker kill `docker ps -q` || true
    docker rm `docker ps -a -q`
    docker rmi `docker images -q`
    docker volume rm `docker volume ls -qf dangling=true`
    ;;

create-web-cookie)
    docker-compose -f docker/docker-compose.yml run agent-web-cookie
    ;;

gen-ssl)
    cd agent
    openssl req -nodes -new -x509  -keyout server.key -out server.crt -subj '/CN=localhost'
{'fraction_non_alphanumeric': 0.12526539278131635, 'fraction_numerical': 0.0024062278839348905, 'mean_word_length': 2.7072402938090243, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7496085', 'n_tokens_mistral': 2683, 'n_tokens_neox': 2388, 'n_words': 615}