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

Parameterized Testnet #59

Merged
merged 195 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
04062a1
Code to deploy testnet onto gcp
shellvish Jun 14, 2022
34b9084
updated readme
shellvish Jun 14, 2022
179e42a
docker autobuild flow
shellvish Jun 15, 2022
978788f
build attempt 2
shellvish Jun 15, 2022
7a95ab4
attempt 3
shellvish Jun 15, 2022
42f72f7
attempt 4
shellvish Jun 15, 2022
6a526a4
attempt 5 - unignore a lot of files
shellvish Jun 15, 2022
5a39f7d
attempt 6
shellvish Jun 15, 2022
9a98726
attempt 7
shellvish Jun 15, 2022
354eb30
attempt 8
shellvish Jun 15, 2022
4cafe17
attempt 9.5 (see what happens)
shellvish Jun 15, 2022
7c34e81
attempt 10
shellvish Jun 15, 2022
dbc4bd4
attempt 11
shellvish Jun 15, 2022
5d40172
attempt 11.5
shellvish Jun 15, 2022
fe9957f
attempt 12
shellvish Jun 15, 2022
21d08f9
attempt 12.5
shellvish Jun 15, 2022
79981d1
attempt 12.6
shellvish Jun 15, 2022
d8e3034
attempt 12.7
shellvish Jun 15, 2022
29ee58d
attempt 12.8
shellvish Jun 15, 2022
3c3055b
attempt 12.9
shellvish Jun 15, 2022
c4dff45
real attempt 1
shellvish Jun 15, 2022
d88dd28
real attempt 2
shellvish Jun 15, 2022
334f0d5
real attempt 3
shellvish Jun 15, 2022
68f4abc
real attempt 3.1
shellvish Jun 15, 2022
d673cb6
updated tf state
shellvish Jun 15, 2022
0fe9ba9
testing actions from new branch
sampocs Jun 15, 2022
72255d0
testing actions from new branch
sampocs Jun 15, 2022
93f786e
removed state files
sampocs Jun 15, 2022
92654e3
build stride base image
sampocs Jun 15, 2022
f1346bf
used github action for creating base image
sampocs Jun 15, 2022
863e724
run testnet setup script from actions
sampocs Jun 15, 2022
39dab7b
debug directories
sampocs Jun 15, 2022
df601c7
attempt to run setup script
sampocs Jun 15, 2022
d4f12f1
tracing makefile
sampocs Jun 15, 2022
4f2104b
changed permissions on setup script
sampocs Jun 15, 2022
6d09837
running setup script from project root
sampocs Jun 15, 2022
f27f737
changed run command to use docker image
sampocs Jun 15, 2022
ef1a1e5
changed run command to use docker image
sampocs Jun 15, 2022
484a93d
changed run command to use docker image
sampocs Jun 15, 2022
ee921ed
debugging
sampocs Jun 15, 2022
1b94b99
debugging
sampocs Jun 15, 2022
7254a4b
added volume instead of docker compose
sampocs Jun 15, 2022
bc48e63
added volume instead of docker compose
sampocs Jun 15, 2022
edcdce0
added volume instead of docker compose
sampocs Jun 15, 2022
057fde4
creating directories
sampocs Jun 15, 2022
7097dde
creating directories
sampocs Jun 15, 2022
91a400a
debugging
sampocs Jun 15, 2022
6eab1ce
building outside of docker
sampocs Jun 15, 2022
3babd4b
building outside of docker
sampocs Jun 15, 2022
6d807f2
added in docker image build
sampocs Jun 15, 2022
ce949a6
debugging build image
sampocs Jun 15, 2022
de22d70
debugging
sampocs Jun 15, 2022
a1d1de4
debugging
sampocs Jun 15, 2022
319da8d
debugging
sampocs Jun 15, 2022
48f170d
debugging
sampocs Jun 15, 2022
acbde10
parameter net v0
shellvish Jun 16, 2022
987ebbe
add workflow name
shellvish Jun 16, 2022
31347ef
Configured tub testnet
shellvish Jun 16, 2022
9e63e26
pass in network name to docker build
shellvish Jun 16, 2022
cb8aff1
rephrase arg
shellvish Jun 16, 2022
2bc92f7
right dockerfile location
shellvish Jun 16, 2022
c70ce1b
addl docker logging
shellvish Jun 16, 2022
dd4ee60
try env variable
shellvish Jun 16, 2022
1a3b56d
quotes...
shellvish Jun 16, 2022
2fc3b6b
arg is tricky
shellvish Jun 16, 2022
5fbd132
add hermes build
shellvish Jun 16, 2022
2c400a2
untested setup script refactor to parameterize nodes
sampocs Jun 17, 2022
1f30161
fixed setup testnet script locally
sampocs Jun 17, 2022
6644169
added params to github workflow
sampocs Jun 17, 2022
52df5d6
fixed typo in docker build args
sampocs Jun 17, 2022
0166058
fixed typo in docker build args
sampocs Jun 17, 2022
15c364f
fixed typo in docker build args
sampocs Jun 17, 2022
3e8f7a5
fixed typo in docker build args
sampocs Jun 17, 2022
bbad9dd
dockerfile
sampocs Jun 17, 2022
05d3622
dockerfiles
sampocs Jun 17, 2022
0f26f00
for loop in github actions
sampocs Jun 17, 2022
0d1ecf1
for loop in github actions
sampocs Jun 17, 2022
ba0cff8
for loop in github actions
sampocs Jun 17, 2022
fe60d5e
for loop in github actions
sampocs Jun 17, 2022
cbb0fda
for loop in github actions
sampocs Jun 17, 2022
38bb0ef
for loop in github actions
sampocs Jun 17, 2022
5f270b7
for loop in github actions
sampocs Jun 17, 2022
9509905
for loop in github actions
sampocs Jun 17, 2022
740899f
for loop in github actions
sampocs Jun 17, 2022
7940416
init hermes setup
shellvish Jun 17, 2022
8b1841b
use cached hermes
shellvish Jun 17, 2022
3ddfb20
parameterize hermes
shellvish Jun 17, 2022
2c6f7f2
forgot to add hermes args
shellvish Jun 17, 2022
6816dab
add local files to gaia
shellvish Jun 17, 2022
b4abed3
oops wrong gaia dockerfile
shellvish Jun 17, 2022
5059300
fix hermes sh permissions
shellvish Jun 17, 2022
a6c62d9
fixed setup script
sampocs Jun 17, 2022
a4e756d
terraform checkpoint
sampocs Jun 17, 2022
5e5eeb5
switched docker container to metadata image
sampocs Jun 17, 2022
a723f51
dynamically pulling nodes from a list
sampocs Jun 17, 2022
3990533
connected node list to rest of terraform operations!
sampocs Jun 17, 2022
126fe26
updated persistent peers in peer nodes config
sampocs Jun 17, 2022
9d056a7
added DNS to terraform
sampocs Jun 17, 2022
a86969d
removed seed node from setup script
sampocs Jun 19, 2022
75dc2f1
removed seed node from setup script
sampocs Jun 19, 2022
105b19b
updated hermes script
shellvish Jun 20, 2022
52da268
inc hermes trust and wait
shellvish Jun 20, 2022
d1330ce
change trusting period
shellvish Jun 20, 2022
06b1898
hermes wait
shellvish Jun 20, 2022
7b53d9f
fix icq image
shellvish Jun 20, 2022
591ef9d
fix icq v2
shellvish Jun 20, 2022
981b421
rm unnecessary copy
shellvish Jun 20, 2022
0661c1f
final icq
shellvish Jun 20, 2022
b37a832
fix icq startup
shellvish Jun 20, 2022
c043dab
slight docker change
shellvish Jun 20, 2022
fab4fee
add icq terraform
shellvish Jun 21, 2022
969bca0
fixed dns name in terraform
sampocs Jun 22, 2022
7b7e8a0
added persistence step to github actions
sampocs Jun 23, 2022
ab72d68
added dependency in workflow
sampocs Jun 23, 2022
1cd702a
added dependency in workflow
sampocs Jun 23, 2022
863b7c9
updated github actions upload/download
sampocs Jun 23, 2022
9804e68
testing upload/download
sampocs Jun 23, 2022
cfb1df0
testing upload/download
sampocs Jun 23, 2022
da33fc8
testing upload/download
sampocs Jun 23, 2022
788fc5a
testing upload/download
sampocs Jun 23, 2022
8f91cd9
testing upload/download
sampocs Jun 23, 2022
92846b9
testing upload/download
sampocs Jun 23, 2022
0863854
testing upload/download
sampocs Jun 23, 2022
bc9ea47
testing upload/download with actual docker build
sampocs Jun 23, 2022
6e0c12d
testing upload/download with actual docker build
sampocs Jun 23, 2022
215270f
testing upload/download with actual docker build
sampocs Jun 23, 2022
9ab1949
testing actions array
sampocs Jun 23, 2022
8f8b9f8
testing actions array
sampocs Jun 23, 2022
c31c259
testing actions array
sampocs Jun 23, 2022
4b09c6e
testing actions array
sampocs Jun 23, 2022
4d4b5e8
testing actions array
sampocs Jun 23, 2022
feb9853
testing actions array
sampocs Jun 23, 2022
456e237
testing actions array
sampocs Jun 23, 2022
f275c69
testing actions array
sampocs Jun 23, 2022
4f67832
testing actions array
sampocs Jun 23, 2022
0f1fca4
testing actions array
sampocs Jun 23, 2022
f76f72d
testing actions array
sampocs Jun 23, 2022
4470983
testing actions array
sampocs Jun 23, 2022
ee4094f
testing actions array
sampocs Jun 23, 2022
ed7b5dc
connected dynamic array with build actions
sampocs Jun 23, 2022
458d269
connected dynamic array with build actions
sampocs Jun 23, 2022
1af82c1
cleaned up terraform script
sampocs Jun 23, 2022
268bd1b
renamed stride script
sampocs Jun 23, 2022
1890cd8
gitignore
sampocs Jun 23, 2022
7d05956
removed state files
sampocs Jun 24, 2022
e8ca4ef
removed state files
sampocs Jun 24, 2022
a039a99
Merge branch 'param-net' into launch-net-actions
sampocs Jun 24, 2022
3fa8318
converted hermes and gaia state inits so they can run on actions
sampocs Jun 24, 2022
9c7a426
modified actions to build gaia/icq/hermes
sampocs Jun 25, 2022
87ffb55
modified actions to build gaia/icq/hermes
sampocs Jun 25, 2022
d4b78a8
Merge branch 'TEST-95' into launch-net-actions
sampocs Jun 25, 2022
36227d4
cloning gaia instead of submodule
sampocs Jun 25, 2022
0ce379f
cloning gaia instead of submodule
sampocs Jun 25, 2022
0ac13b4
cloning gaia instead of submodule
sampocs Jun 25, 2022
d0f877e
cloning gaia instead of submodule
sampocs Jun 25, 2022
8691cd3
cloning gaia instead of submodule
sampocs Jun 25, 2022
de50646
cloning gaia instead of submodule
sampocs Jun 25, 2022
ca2480b
running init state from actions
sampocs Jun 25, 2022
ad8f8f7
running init state from actions
sampocs Jun 25, 2022
ab278a0
running init state from actions
sampocs Jun 25, 2022
fddfe3d
running init state from actions
sampocs Jun 25, 2022
31f58f8
running init state from actions
sampocs Jun 25, 2022
231f339
running init state from actions
sampocs Jun 25, 2022
2907143
running init state from actions
sampocs Jun 25, 2022
d303aa9
running init state from actions
sampocs Jun 25, 2022
38ffeb5
running init state from actions
sampocs Jun 25, 2022
0455fc1
running init state from actions
sampocs Jun 25, 2022
b74dcf1
added image build step
sampocs Jun 25, 2022
b6c4857
added image build step
sampocs Jun 25, 2022
ae60faa
added image build step
sampocs Jun 25, 2022
4fc3c5d
added image build step
sampocs Jun 25, 2022
239b7b9
added image build step
sampocs Jun 25, 2022
e4c9321
added image build step
sampocs Jun 25, 2022
b298a19
added image build step
sampocs Jun 25, 2022
eb3712f
added image build step
sampocs Jun 25, 2022
39113ac
added image build step
sampocs Jun 25, 2022
889c74c
added image build step
sampocs Jun 25, 2022
6b0ee9c
added image build step
sampocs Jun 25, 2022
5fe7737
added image build step
sampocs Jun 25, 2022
bb7aa01
switched to user 1000 in docker images
sampocs Jun 25, 2022
8cbb9f7
added gaia/hermes/icq to terraform
sampocs Jun 25, 2022
2e53ede
trimmed down icq image
sampocs Jun 25, 2022
63f14f9
changed home directory of stride/gaia to their default in the docker …
sampocs Jun 25, 2022
3975801
grouped dependency image builds in same job with loop
sampocs Jun 25, 2022
d4e943a
fixed icq docker image
sampocs Jun 25, 2022
237cff7
fixed icq docker image
sampocs Jun 25, 2022
800424c
fixed icq docker image
sampocs Jun 25, 2022
80ddd7b
polished terraform and workflow
sampocs Jun 26, 2022
4bf6bbd
fixed bug in hermes docker image
sampocs Jun 26, 2022
459f643
updated readme
sampocs Jun 26, 2022
559fd78
fixed bug in hermes docker image
sampocs Jun 26, 2022
cfa04e7
added sleep to hermes
sampocs Jun 27, 2022
2289738
removed unneeded folders and moved terraform stuff to a new directory
sampocs Jun 29, 2022
b44952c
Merge branch 'main' into launch-net-actions
sampocs Jun 29, 2022
78a7fbd
updated testnet readme
sampocs Jun 29, 2022
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
80 changes: 0 additions & 80 deletions .github/workflows/build-testnet.yml

This file was deleted.

15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
#
# This type of prelease is useful to make your bleeding-edge binaries available to advanced users.
#
# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your
# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your
# default branch.
on: push
on:
push:
branches:
- main

jobs:
might_release:
Expand All @@ -22,12 +25,12 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare Release Variables

- name: Prepare Release Variables
id: vars
uses: ignite-hq/cli/actions/release/vars@develop

- name: Issue Release Assets
- name: Issue Release Assets
uses: ignite-hq/cli/actions/cli@develop
if: ${{ steps.vars.outputs.should_release == 'true' }}
with:
Expand All @@ -48,6 +51,6 @@ jobs:
with:
tag_name: ${{ steps.vars.outputs.tag_name }}
files: release/*
prerelease: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
194 changes: 194 additions & 0 deletions .github/workflows/testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
on:
workflow_dispatch:
# inputs:
# deployment_name:
# description: Testnet that you want to launch (e.g. droplet)
# required: true

env:
deployment_name: testnet
network_name: stride
num_stride_nodes: 3

jobs:
get-node-names:
runs-on: ubuntu-latest
steps:
- id: set-output
run: |
node_names_array=""
for (( i=1; i <= $num_stride_nodes; i++ )); do
node_names_array+="\"${network_name}-node${i}\","
done
echo "::set-output name=node-names::[${node_names_array}]"
outputs:
node-names: ${{ steps.set-output.outputs.node-names }}

compile-stride:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build Stride
run: make build

- name: Store Stride Executable
uses: actions/upload-artifact@v3
with:
name: strided
path: ./build/strided
retention-days: 1

compile-gaia:
runs-on: ubuntu-latest
steps:
- name: Checkout Stride
uses: actions/checkout@v3

- name: Build Gaia
run: |
git clone https://github.com/Stride-Labs/gaia --branch v7.0.2-stride-second-attempt-5
mkdir build
cd gaia
go build -mod=readonly -trimpath -o ../build ./...

- name: Store Gaia Executable
uses: actions/upload-artifact@v3
with:
name: gaiad
path: ./build/gaiad
retention-days: 1

initialize-state:
runs-on: ubuntu-latest
needs: [compile-stride, compile-gaia]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download Strided
uses: actions/download-artifact@v3
with:
name: strided
path: ./build

- name: Download Gaiad
uses: actions/download-artifact@v3
with:
name: gaiad
path: ./build

- name: Initialize State
shell: bash
run: |
chmod +x -R ./build
./scripts/testnet/setup_testnet_state.sh ${deployment_name} ${num_stride_nodes}

- name: Persist State Files
uses: actions/upload-artifact@v3
with:
name: state
path: ./scripts/testnet/state
retention-days: 1

build-stride-images:
needs: [get-node-names, initialize-state]
runs-on: ubuntu-latest
strategy:
matrix:
node-name: ${{ fromJson(needs.get-node-names.outputs.node-names) }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Restore State Files
uses: actions/download-artifact@v3
with:
name: state
path: ./state

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up gcloud Cloud SDK environment
uses: google-github-actions/setup-gcloud@v0.6.0
with:
version: "389.0.0"
service_account_key: ${{ secrets.GCP_KEY }}
project_id: ${{ secrets.GCP_NODES_PROJECT }}
export_default_credentials: true

- name: GCloud Configure Docker
run: |
gcloud auth configure-docker

- name: Build Stride Node Images
uses: docker/build-push-action@v3
with:
context: .
file: "scripts/testnet/dockerfiles/Dockerfile.stride"
build-args: |
node_name=${{ matrix.node-name }}
push: true
platforms: linux/amd64
tags: |
stridelabs/nodes-${{ env.deployment_name }}:${{ matrix.node-name }}
gcr.io/stride-nodes/${{ env.deployment_name }}:${{ matrix.node-name }}

build-dep-images:
needs: [initialize-state]
runs-on: ubuntu-latest
strategy:
matrix:
dep-name:
- gaia
- hermes
- icq
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Restore State Files
uses: actions/download-artifact@v3
with:
name: state
path: ./state

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up gcloud Cloud SDK environment
uses: google-github-actions/setup-gcloud@v0.6.0
with:
version: "389.0.0"
service_account_key: ${{ secrets.GCP_KEY }}
project_id: ${{ secrets.GCP_NODES_PROJECT }}
export_default_credentials: true

- name: GCloud Configure Docker
run: |
gcloud auth configure-docker

- name: Construct Image
shell: bash
run: |
hub_tag=stridelabs/nodes-${{ env.deployment_name }}:${{ matrix.dep-name }}
gcr_tag=gcr.io/stride-nodes/${{ env.deployment_name }}:${{ matrix.dep-name }}

docker build -t $hub_tag -f scripts/testnet/dockerfiles/Dockerfile.${{ matrix.dep-name }} .
docker push $hub_tag
docker tag $hub_tag $gcr_tag
docker push $gcr_tag
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
*.so
*.dylib

# Stride files
launch.sh
# auto-generated go files


scripts/testnet/state/keys.txt
# build
launch.sh
build/*
state/*
.state.backup
scripts/state/*
scripts/testnet/*/state/keys.txt
scripts/testnet/state/*
scripts/testnet/certs/*

scripts/logs/*.log
scripts/logs/*/*.log
scripts-local/state
Expand All @@ -36,5 +35,6 @@ vue/*
# vendor/

# vscode
.vscode/*
.vscode
.DS_Store
.terraform
2 changes: 1 addition & 1 deletion Dockerfile.gaia
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN gaiad init test --home /gaia/.gaiad
# set minimum-gas-prices in app.toml for gaia

EXPOSE 26656 26657 1317 9090
CMD ["gaiad", "start", "--home", "/gaia/.gaiad"]]
CMD ["gaiad", "start", "--home", "/gaia/.gaiad"]


# # Add to a distroless container
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile.stride
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ COPY go.mod go.sum* ./
RUN go mod download
COPY . .

RUN apk add --no-cache make git gcc musl-dev openssl-dev linux-headers
RUN make build
RUN apk add --no-cache make git gcc musl-dev openssl-dev linux-headers \
&& make build

# Add to a distroless container
FROM alpine:3.15
COPY --from=golang /src/app/build/strided /usr/local/bin/strided
RUN adduser -S -h /stride -D stride -u 1000
RUN addgroup -g 1000 stride \
&& adduser -S -h /stride -D stride -u 1000 -G stride
USER stride

RUN strided init test
Expand Down
Loading