Skip to content

Commit

Permalink
Merge pull request ava-labs#312 from ava-labs/everest-deployment
Browse files Browse the repository at this point in the history
Everest deployment
  • Loading branch information
StephenButtolph committed Aug 21, 2020
2 parents ac8a903 + 0ba1039 commit cc8dd96
Show file tree
Hide file tree
Showing 465 changed files with 30,670 additions and 17,707 deletions.
11 changes: 4 additions & 7 deletions .ci/after_success.sh
Expand Up @@ -4,11 +4,8 @@ set -ev

bash <(curl -s https://codecov.io/bash)

docker tag $DOCKERHUB_REPO:$COMMIT $DOCKERHUB_REPO:travis-$TRAVIS_BUILD_NUMBER
TRAVIS_TAG="$DOCKERHUB_REPO:travis-$TRAVIS_BUILD_NUMBER"
docker tag $DOCKERHUB_REPO:$COMMIT "$TRAVIS_TAG"

if [ "${TRAVIS_EVENT_TYPE}" == "push" ] && [ "${TRAVIS_BRANCH}" == "platform" ]; then
docker tag $DOCKERHUB_REPO:$COMMIT $DOCKERHUB_REPO:$TRAVIS_BRANCH
fi

echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker push $DOCKERHUB_REPO
echo "$DOCKER_PASS" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker push "$TRAVIS_TAG"
35 changes: 19 additions & 16 deletions .ci/run_e2e_tests.sh
Expand Up @@ -4,23 +4,26 @@ SRC_PATH=$(dirname "${SCRIPTS_PATH}")
bash "${SRC_PATH}"/scripts/build_image.sh
GECKO_IMAGE=$(docker image ls --format="{{.Repository}}" | head -n 1)

# login to AWS for byzantine images
export AWS_ACCESS_KEY_ID="${BYZ_REG_AWS_ID}"
export AWS_SECRET_ACCESS_KEY="${BYZ_REG_AWS_KEY}"
export AWS_DEFAULT_REGION="${BYZ_REG_AWS_REGION}"
aws ecr get-login-password --region "${AWS_DEFAULT_REGION}" | docker login --username AWS --password-stdin 964377072876.dkr.ecr.us-east-1.amazonaws.com
CHIT_SPAMMER_IMAGE="964377072876.dkr.ecr.us-east-1.amazonaws.com/gecko-byzantine:latest"
DOCKER_REPO="avaplatform"

docker pull "${CHIT_SPAMMER_IMAGE}"
echo "$DOCKER_PASS" | docker login --username "$DOCKER_USERNAME" --password-stdin

# Turn off GO111MODULE to pull e2e test source code in order to get run script.
git clone https://github.com/kurtosis-tech/ava-e2e-tests.git
cd ava-e2e-tests/ || exit
git checkout 0.6.0
TESTING_CONTROLLER_IMAGE="$DOCKER_REPO/avalanche-e2e-tests_controller:everest-latest"
BYZANTINE_IMAGE="$DOCKER_REPO/gecko-byzantine:everest-latest"

docker pull "$TESTING_CONTROLLER_IMAGE"
docker pull "${BYZANTINE_IMAGE}"


E2E_TESTING_REMOTE="https://github.com/ava-labs/avalanche-testing.git"
E2E_TAG="v0.8.2-dev"

mkdir -p "$E2E_TEST_HOME"
git clone "$E2E_TESTING_REMOTE" "$E2E_TEST_HOME"
cd "$E2E_TEST_HOME" || exit
git fetch origin --tags
git checkout "tags/$E2E_TAG" -b "$E2E_TAG"

go mod edit -replace github.com/ava-labs/gecko="$GECKO_HOME"
bash "./scripts/rebuild_initializer_binary.sh"
bash "./scripts/rebuild_controller_image.sh"
# TODO: Make the controller image label a parameter to rebuild_controller_image script
# Standard controller image label used by above scripts.
CONTROLLER_IMAGE="kurtosistech/ava-e2e-tests_controller:latest"
./build/ava-e2e-tests --gecko-image-name="${GECKO_IMAGE}" --test-controller-image-name="${CONTROLLER_IMAGE}" --chit-spammer-image-name="${CHIT_SPAMMER_IMAGE}"
./build/avalanche-e2e-tests --gecko-image-name="${GECKO_IMAGE}" --test-controller-image-name="${TESTING_CONTROLLER_IMAGE}" --byzantine-image-name="${BYZANTINE_IMAGE}"
8 changes: 4 additions & 4 deletions .ci/runscript_osx.sh
Expand Up @@ -2,8 +2,8 @@

set -ev

go get -d -t -v github.com/ava-labs/gecko/...

cd $GOPATH/src/github.com/ava-labs/gecko
./scripts/build_test.sh
# Note: On OSX, GOPATH is set before GECKO_HOME environment variable
# which leads to $GOPATH within GECKO_HOME to be empty.
cd "$GOPATH/$GECKO_HOME"
./scripts/build.sh
./scripts/build_test.sh
5 changes: 3 additions & 2 deletions .gitignore
Expand Up @@ -26,7 +26,6 @@ awscpu
.vscode*

*.pb*
*.ava

db*

Expand All @@ -51,4 +50,6 @@ keys/staker.*
!*.go
!*.proto

plugins/
plugins/

scripts/ansible/*inventory.yml
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -13,8 +13,8 @@ services:
env:
global:
- CODECOV_TOKEN="8c18c993-fc6e-4706-998b-01ddc7987804"
- GECKO_HOME=/go/src/github.com/ava-labs/gecko/
- E2E_TEST_HOME=/go/src/github.com/kurtosis-tech/ava-e2e-tests/
- GECKO_HOME=$GOPATH/src/github.com/$TRAVIS_REPO_SLUG/
- E2E_TEST_HOME=$GOPATH/src/github.com/ava-labs/avalanche-testing/
- COMMIT=${TRAVIS_COMMIT::8}
- DOCKERHUB_REPO=avaplatform/gecko
- secure: "L/A9+re0NEKP6EV6H9RcTGiDhX3WMvsiWrkRKDYKqnviqbjY30RK6EM4vvjrM4Lrw2QwsO3YKgnku3+zioE/TxEZFkpkbjNUXru0nYBrWAg1TKVsDXnYaIZkHUejfryST3E8N7F4Hx6zCtGEO0sEdUeKuT+MNUIuHezHooTgGzDjMogm70EWMFjQHc7VucTJu7dWU1RBPjovWQ0q9qflrtCpbrvXFIiihQQ1PQha1Q2C4wLakKuLbhhSafue90Mnyss0blaPHy/tyewcASJu4vsGTKRBn0DzttlkNTwuD6+nKrbmJY0ohunnkVFzYjrZAw1gyN+DCDb/lPbz4ZDItKPwrIUPEtL5xuUOrxUZPUh+0io3Q2d6rjaqkdGjd1KQXzbnW1mn0BxX3d3b2UpIqhBn9umYYjHBKnMuoRiTK33b7U9+LF3K84+tEvVDCPeHs/mw6Inp5jGRSravnM6yPQ6feGzogs4+3EMzZXxnkngKFKCsnd67Oe9xfV9amOU2aQAx4jaAwlPjEpBEkUa8YKx3lPznvmUk1QsNCUbLjdSl5JBaXojLJoiuPbj29hp4S5AXXgn+3Hvwk3ndcFCxi6/l1W9mjYSOtFqg3EAUdF4EgnA/ykQg9ZokkoKY0+qgOzG2bKOAYuCDWeGr7P1apToh00ccsQXL81nVPiq7uDw="
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Expand Up @@ -9,3 +9,5 @@ COPY . gecko

WORKDIR $GOPATH/src/github.com/ava-labs/gecko
RUN ./scripts/build.sh

RUN ln -sv $GOPATH/src/github.com/ava-labs/gecko/ /gecko
37 changes: 18 additions & 19 deletions README.md
Expand Up @@ -2,9 +2,9 @@

## Installation

AVA is an incredibly lightweight protocol, so the minimum computer requirements are quite modest.
Avalanche is an incredibly lightweight protocol, so the minimum computer requirements are quite modest.

- Hardware: 2 GHz or faster CPU, 3 GB RAM, 250 MB hard disk.
- Hardware: 2 GHz or faster CPU, 4 GB RAM, 2 GB hard disk.
- OS: Ubuntu >= 18.04 or Mac OS X >= Catalina.
- Software: [Go](https://golang.org/doc/install) version >= 1.13.X and set up [`$GOPATH`](https://github.com/golang/go/wiki/SettingGOPATH).
- Network: IPv4 or IPv6 network connection, with an open public port.
Expand All @@ -26,40 +26,39 @@ Build Gecko using the build script:
./scripts/build.sh
```

The Gecko binary, named `ava`, is in the `build` directory.
The Gecko binary, named `avalanche`, is in the `build` directory.

### Docker Install

- Make sure you have docker installed on your machine (so commands like `docker run` etc. are available).
- Build the docker image of latest gecko branch by `scripts/build_image.sh`.
- Check the built image by `docker image ls`, you should see some image tagged
`gecko-xxxxxxxx`, where `xxxxxxxx` is the commit id of the Gecko source it was built from.
- Test Gecko by `docker run -ti -p 9650:9650 -p 9651:9651 gecko-xxxxxxxx /gecko/build/ava
--public-ip=127.0.0.1 --snow-sample-size=1 --snow-quorum-size=1 --staking-tls-enabled=false`. (For a production deployment,
- Test Gecko by `docker run -ti -p 9650:9650 -p 9651:9651 gecko-xxxxxxxx /gecko/build/avalanche
--network-id=local --staking-enabled=false --snow-sample-size=1 --snow-quorum-size=1`. (For a production deployment,
you may want to extend the docker image with required credentials for
staking and TLS.)

## Running Gecko and Creating a Local Test Network
## Running Gecko

To create your own local test network, run:
### Connecting to Everest

To connect to the Everest Testnet, run:

```sh
./build/ava --public-ip=127.0.0.1 --snow-sample-size=1 --snow-quorum-size=1 --staking-tls-enabled=false
./build/avalanche
```

This launches an AVA network with one node.

You should see some pretty ASCII art and log messages.
You may see a few warnings. These are OK.

You can use `Ctrl + C` to kill the node.

If you want to specify your log level. You should set `--log-level` to one of the following values, in decreasing order of logging.
### Creating a Local Testnet

To create a single node testnet, run:

```sh
./build/avalanche --network-id=local --staking-enabled=false --snow-sample-size=1 --snow-quorum-size=1
```

- `--log-level=verbo`
- `--log-level=debug`
- `--log-level=info`
- `--log-level=warn`
- `--log-level=error`
- `--log-level=fatal`
- `--log-level=off`
This launches an Avalanche network with one node.
6 changes: 3 additions & 3 deletions api/admin/performance.go
Expand Up @@ -39,7 +39,7 @@ func (p *Performance) StartCPUProfiler() error {
return err
}
if err := pprof.StartCPUProfile(file); err != nil {
file.Close()
_ = file.Close() // Return the original error
return err
}
runtime.SetMutexProfileFraction(1)
Expand Down Expand Up @@ -68,7 +68,7 @@ func (p *Performance) MemoryProfile() error {
}
runtime.GC() // get up-to-date statistics
if err := pprof.WriteHeapProfile(file); err != nil {
file.Close()
_ = file.Close() // Return the original error
return err
}
return file.Close()
Expand All @@ -83,7 +83,7 @@ func (p *Performance) LockProfile() error {

profile := pprof.Lookup("mutex")
if err := profile.WriteTo(file, 1); err != nil {
file.Close()
_ = file.Close() // Return the original error
return err
}
return file.Close()
Expand Down

0 comments on commit cc8dd96

Please sign in to comment.