Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web deploy prerequisites #1851

Merged
merged 71 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
016018e
reduce bundle size
sabau Jan 17, 2019
d3848ed
Trying to remove lcdMockClient from our production build
sabau Jan 17, 2019
7b2b801
split per module, this will boost network in modern browsers
sabau Jan 17, 2019
46f4f20
Merge branch 'web' into sabau/web/1833-deploy-prerequisites
sabau Jan 21, 2019
64c81d8
add +e error flag for security circleci check
sabau Jan 21, 2019
d64e66e
remove unnecessary test, mock removed from node
sabau Jan 21, 2019
967ffb1
test audit job
sabau Jan 21, 2019
1edf21d
Undo audit job test
sabau Jan 21, 2019
ac5e061
Merge remote-tracking branch 'origin/sabau/web/1833-deploy-prerequisi…
sabau Jan 21, 2019
36f4120
remove Low from security audit check
sabau Jan 21, 2019
27b8aa7
WIP automation to deploy frontend and backend
sabau Jan 22, 2019
1b67222
fix certificate names
sabau Jan 22, 2019
95c9c0b
Merge branch 'web' into sabau/web/1833-deploy-prerequisites
sabau Jan 24, 2019
f5ce8e7
boot scripts, S3 to pass info and autofaucet stuff
sabau Jan 24, 2019
1026a0c
Merge remote-tracking branch 'origin/sabau/web/1833-deploy-prerequisi…
sabau Jan 24, 2019
0a7feb4
working boot process
sabau Jan 24, 2019
05a2cd1
progress on automation
sabau Jan 25, 2019
56bc3fd
Merge branch 'develop' into sabau/web/1833-deploy-prerequisites
sabau Jan 29, 2019
753fd41
clean deploy
sabau Jan 30, 2019
7cc72f8
route to voyager.ninja
sabau Jan 30, 2019
feaaca6
route to voyager.ninja
sabau Jan 30, 2019
6c0cba7
favicon, config and restore full lodash for a single instance using it
sabau Jan 30, 2019
4a2bbcc
Merge remote-tracking branch 'origin/develop' into sabau/web/1833-dep…
Jan 30, 2019
350162d
fix for empty accounts
Jan 30, 2019
5ddd0de
add aliases, replace bash deploy with orb sync job, seems easier to read
sabau Jan 31, 2019
7afb09d
Merge branch 'sabau/web/1833-deploy-prerequisites' of github.com:cosm…
sabau Jan 31, 2019
f8e549c
fix commands definition
sabau Jan 31, 2019
3add0a3
fix commands definition
sabau Jan 31, 2019
ad0e32d
indentation fix on circleci commands
sabau Jan 31, 2019
f4a7d6e
indentation fix on circleci commands
sabau Jan 31, 2019
6de0f30
simplify workflow until we merge mircea work
sabau Jan 31, 2019
66cf411
only after test we deploy
sabau Jan 31, 2019
f81241e
damsn build is everywhere
sabau Jan 31, 2019
ce35078
renaming
sabau Jan 31, 2019
db13411
no params for now
sabau Jan 31, 2019
15245af
restore build job
sabau Jan 31, 2019
c5cf5d5
build only clean and safe dependency
sabau Jan 31, 2019
2177370
changelog
sabau Jan 31, 2019
08e998e
random naming does not make circleci happy
sabau Jan 31, 2019
08496c8
mkdir for stats
sabau Jan 31, 2019
a72e9cb
build do not need the bundle on circle ci
sabau Jan 31, 2019
8023c9e
experiment deploy on this branch
sabau Jan 31, 2019
fb97647
Merge branch 'develop' into sabau/web/1833-deploy-prerequisites
sabau Jan 31, 2019
a474d0d
remove side effect: helpers taken out to be tested, runner does not r…
sabau Jan 31, 2019
f01e1b9
reduce unnecessary movements, keep things where they are
sabau Jan 31, 2019
65364ee
little refactor circleci
sabau Jan 31, 2019
ef6904c
rename folders, try to upload without nesting
sabau Jan 31, 2019
303282a
comments on circleci configuration
sabau Jan 31, 2019
7ffa670
dev dependency fix
sabau Jan 31, 2019
ffa9e31
check mounted of App
sabau Feb 1, 2019
3925acc
add some test on store
sabau Feb 1, 2019
a41e20d
config to js to switch localhost VS remote nodes
sabau Feb 1, 2019
e4215d4
import properly new pumped up config.js
sabau Feb 1, 2019
82d34dc
fix node env flag
sabau Feb 1, 2019
5a99626
Update circle.ebs_deploy.sh
faboweb Feb 1, 2019
9a0d2a6
- restore source map for Sentry
sabau Feb 1, 2019
be42509
Merge remote-tracking branch 'origin/sabau/web/1833-deploy-prerequisi…
sabau Feb 1, 2019
09c8d76
fallback configuration to allow builder to choose their values
sabau Feb 1, 2019
d45f655
keep the old name, now is hardcoded on github
sabau Feb 1, 2019
163bbcf
remove duplicated yarn upgrade, restore fixed version
sabau Feb 1, 2019
0b87b33
wait for genesis from main node
sabau Feb 2, 2019
081e394
Merge branch 'develop' into sabau/web/1833-deploy-prerequisites
sabau Feb 5, 2019
70feb28
Update app/src/renderer/vuex/store.js
faboweb Feb 5, 2019
32d91e2
subscribe logic
sabau Feb 8, 2019
200f406
custom image for voyager build / AWS deployment (#1942)
Feb 12, 2019
ea4d09e
test startApp
sabau Feb 12, 2019
88f6b4a
test route guard
sabau Feb 12, 2019
5bb6b87
comment e2e code in circleci, in this moment is not used, remove aws …
sabau Feb 12, 2019
bb6bd6c
Document build command with parameters, remove deploy bash script
sabau Feb 12, 2019
24ff2c4
patch for cosmos-sdk new mandatory parameter
sabau Feb 12, 2019
386e076
Update test/unit/specs/App.spec.js
faboweb Feb 13, 2019
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
67 changes: 67 additions & 0 deletions .aws/first.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to include .aws files? @cosmos/sre ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those are used by the current (temporary) node setup on EC2, until the real network boot on merge is ready


PASSWORD=1234567890
ACCOUNT=main_account
PORT=26657
API_PORT=8080
NETWORK=testnet
AMOUNT=100stake

# first of all remove old genesis, we do not want other node to boot with the wrong stuff
aws s3 rm s3://cosmos-gaia/genesis.json

# Initialize local node with an account name and a chain
./gaiad init --home . --moniker ${ACCOUNT} --chain-id ${NETWORK}
sabau marked this conversation as resolved.
Show resolved Hide resolved
NODEID=$(./gaiad tendermint show-node-id --home .)

# Create our main account and add it to the genesis with a lot of money
echo ${PASSWORD} | ./gaiacli keys add ${ACCOUNT} --home . > main_node.log
./gaiad add-genesis-account $(./gaiacli keys show ${ACCOUNT} --home . --address) 150000stake,100000photino,123cococoin --home .

echo ${PASSWORD} | ./gaiad gentx --name ${ACCOUNT} --home . --home-client .
./gaiad collect-gentxs --home .

# Make our genesis avaialable to the secondary nodes
aws s3 cp config/genesis.json s3://cosmos-gaia/genesis.json

# boot proper nodes in reachable detached sessions
screen -dmS gaia ./gaiad start --home .
screen -dmS rest ./gaiacli rest-server --laddr tcp://0.0.0.0:${API_PORT} --home . --node http://localhost:${PORT} --chain-id ${NETWORK} --trust-node true

# get my address to use it as source of richness for others
ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address)

while true
do
# Is anyone asking for money
LIST=$(aws s3 ls s3://cosmos-gaia/addresses/)
sabau marked this conversation as resolved.
Show resolved Hide resolved
if [[ -n "${LIST}" ]];
then
# TODO: SRE team is working on a clean solution.
# This hacky version is temporary and will be replaced by a stargate running on a separate machine
# Remove this logic as soon as we put back the deploy-gaia automation

# Check if a stargate is locally running
PID=$(lsof -ti tcp:${API_PORT})
jbibla marked this conversation as resolved.
Show resolved Hide resolved
if [[ -n "${PID}" ]];
then
# we cannot use gaiacli while the rest server is running, it locks the resources
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in theory we could have a second gaiacli instance where we import the main key which performs the action

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct! @mircea-c told me something like this will become true in their infrastructure + stargate will be on a separate machine, so for now I left the hacky solution, but I'll add a TODO to remember that when we'll adopt the real network deployment this PID stuff has to be removed, sounds ok?

kill -9 ${PID}
fi

echo ${LIST} | while IFS= read -r row || [[ -n "$row" ]]; do
# for every file in the list pick the address and give money to it, then delete the file
DESTINATION=$(echo $row | awk '{print $4}')

# Just in case we were running this command with rest-server switched on, get again the address
ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address)
echo ${PASSWORD} | ./gaiacli tx send --home . --from ${ADDRESS} --amount=${AMOUNT} --to=${DESTINATION} --chain-id=${NETWORK}

# Remove this address from the ones that needs money
aws s3 rm s3://cosmos-gaia/addresses/${DESTINATION}
done

#restore the rest server
screen -dmS rest ./gaiacli rest-server --laddr tcp://0.0.0.0:${API_PORT} --home . --node http://localhost:${PORT} --chain-id ${NETWORK} --trust-node true
fi
done
50 changes: 50 additions & 0 deletions .aws/others.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

PASSWORD=1234567890
ACCOUNT=operator_account
PORT=26656
# TODO: hardcoded temporary, this will become a parameter coming from the first ECS instance
MAINNODEID=d08c69fa85969f3d0173f23aadc40268559d0f66
MAINNODEIP=172.31.35.89
MAINACCOUNT=main_account
NETWORK=testnet
VALIDATOR_AMOUNT=10stake

# Initialize local node with a secondary account
./gaiad init --home . --moniker ${ACCOUNT} --chain-id ${NETWORK}

GENESIS=`aws s3 ls s3://cosmos-gaia/genesis.json | grep genesis.json`
while [[ -z "$GENESIS" ]]; do
sleep 3s
ISTHERE=`aws s3 ls s3://cosmos-gaia/genesis.json | grep genesis.json`
done
aws s3 cp s3://cosmos-gaia/genesis.json config/genesis.json

# GET Genesis file into config/genesis.json
NODEID=$(./gaiad tendermint show-node-id --home .)

# boot referring to the remote node
screen -dmS gaia ./gaiad start --home . --p2p.laddr=tcp://0.0.0.0:$((PORT)) --address=tcp://0.0.0.0:$((PORT+1)) --rpc.laddr=tcp://0.0.0.0:$((PORT+2)) --p2p.persistent_peers="$MAINNODEID@$MAINNODEIP:$((PORT))"

# get the key to make my node validator
PUBKEY=$(./gaiad tendermint show-validator --home .)
echo ${PASSWORD} | ./gaiacli keys add ${ACCOUNT} --home . > secondary_node.log
ADDRESS=$(./gaiacli keys show ${ACCOUNT} --home . --address)
echo ${PUBKEY} > ./${ADDRESS}

# ask money by declaring my node
aws s3 cp ${ADDRESS} s3://cosmos-gaia/addresses/${ADDRESS}

poor=true
sabau marked this conversation as resolved.
Show resolved Hide resolved
while ${poor}
do
# query my account to check if I'm still poor
ACCOUNT_INFO=$(./gaiacli query account ${ADDRESS} --chain-id ${NETWORK} --trust-node --home .)
if [[ ${ACCOUNT_INFO} == *"auth/Account"* ]]; then
echo "Address funded, thanks main node!"
poor=false
fi
sleep 3s
done

echo ${PASSWORD} | ./gaiacli tx staking create-validator --home . --from ${ACCOUNT} --amount=${VALIDATOR_AMOUNT} --pubkey=${PUBKEY} --address-delegator=${ADDRESS} --moniker=${ACCOUNT} --chain-id=${NETWORK} --commission-max-change-rate=0 --commission-max-rate=0 --commission-rate=0 --min-self-delegation=1 -json
Loading