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

583 introduce full test suite with terraform #664

Merged
merged 214 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from 200 commits
Commits
Show all changes
214 commits
Select commit Hold shift + click to select a range
b978f86
Rename environment
rozhkovdmitrii Mar 7, 2022
d154dad
Print elf params
rozhkovdmitrii Mar 7, 2022
c8bdd2e
Reduce time waiting for proxy
rozhkovdmitrii Mar 7, 2022
737fb80
Merge remote-tracking branch 'origin/develop' into 583-introduce-full…
rozhkovdmitrii Mar 7, 2022
6c1089e
Remove extra things
rozhkovdmitrii Mar 7, 2022
ce87fc8
Remove extra things
rozhkovdmitrii Mar 7, 2022
2879c37
Add docker step into buildkite
rozhkovdmitrii Mar 8, 2022
2ea579b
Add full test suite step
rozhkovdmitrii Mar 8, 2022
f630013
Correct full test suite
rozhkovdmitrii Mar 8, 2022
f560e86
Correct full test suite again
rozhkovdmitrii Mar 8, 2022
2d84d4e
suppress deploy check
rozhkovdmitrii Mar 8, 2022
f67de2f
just echo if trigger_job
rozhkovdmitrii Mar 8, 2022
a7a2330
try to fix condition
rozhkovdmitrii Mar 8, 2022
a04ca0d
try to fix condition
rozhkovdmitrii Mar 8, 2022
ed96c90
Get rid off condition
rozhkovdmitrii Mar 8, 2022
bf9b694
if source == webhook
rozhkovdmitrii Mar 8, 2022
dbce4ed
Try again
rozhkovdmitrii Mar 8, 2022
b31cf83
Try again
rozhkovdmitrii Mar 8, 2022
90ef427
Enable full test suite )
rozhkovdmitrii Mar 8, 2022
2f1531e
Enable full test suite )
rozhkovdmitrii Mar 8, 2022
d1bc510
Turn off the condition
rozhkovdmitrii Mar 8, 2022
9f0a689
Introduce check threshold formula
rozhkovdmitrii Mar 8, 2022
88341ee
What's wrong
rozhkovdmitrii Mar 8, 2022
aa88704
Again
rozhkovdmitrii Mar 8, 2022
8f5615f
again and again
rozhkovdmitrii Mar 8, 2022
3af7ef1
again and again and again
rozhkovdmitrii Mar 8, 2022
2a3eed5
again and again and again
rozhkovdmitrii Mar 8, 2022
3d23ed5
unfold commands
rozhkovdmitrii Mar 8, 2022
62df1c4
unfold commands
rozhkovdmitrii Mar 8, 2022
7714aff
Bad results check
rozhkovdmitrii Mar 8, 2022
48f6026
Bad results check
rozhkovdmitrii Mar 8, 2022
000db50
Logging this check
rozhkovdmitrii Mar 8, 2022
03fd17c
Logging this check
rozhkovdmitrii Mar 8, 2022
efec5c1
Logging this check
rozhkovdmitrii Mar 8, 2022
e7e0489
Logging this check
rozhkovdmitrii Mar 8, 2022
9b4ea43
get rid of pipe to assign env
rozhkovdmitrii Mar 8, 2022
45dccf9
get rid of pipe to assign env
rozhkovdmitrii Mar 8, 2022
afe2a1a
get rid of pipe to assign env
rozhkovdmitrii Mar 8, 2022
f8b967b
get rid of pipe to assign env
rozhkovdmitrii Mar 8, 2022
888e865
get rid of pipe to assign env
rozhkovdmitrii Mar 8, 2022
24ea81c
get rid of pipe to assign env
rozhkovdmitrii Mar 8, 2022
e6848ac
uncomment test
rozhkovdmitrii Mar 8, 2022
d73eddc
uncomment test
rozhkovdmitrii Mar 8, 2022
a116345
uncomment test
rozhkovdmitrii Mar 8, 2022
fda5a2d
uncomment test
rozhkovdmitrii Mar 8, 2022
4586929
add docker compose
rozhkovdmitrii Mar 8, 2022
e920cf5
using tee
rozhkovdmitrii Mar 8, 2022
d4ba31e
Playing around output to stdout
rozhkovdmitrii Mar 8, 2022
e5fe7e4
Simplify
rozhkovdmitrii Mar 8, 2022
aa1fbd3
Remove with docker-compose
rozhkovdmitrii Mar 8, 2022
89cd3b5
merge pipes
rozhkovdmitrii Mar 8, 2022
4685136
Try to mix stderr and stdout
rozhkovdmitrii Mar 8, 2022
bce3e18
mode docker-compose-full-test-suite.yml into docker-compose
rozhkovdmitrii Mar 9, 2022
c217dcd
mode docker-compose-full-test-suite.yml into docker-compose
rozhkovdmitrii Mar 9, 2022
1aa8bcb
spit and polish
rozhkovdmitrii Mar 9, 2022
a0a1c03
rollback environment.py
rozhkovdmitrii Mar 9, 2022
330d240
rollback environment.py
rozhkovdmitrii Mar 9, 2022
2fb4fe2
rollback environment.py
rozhkovdmitrii Mar 9, 2022
0b0df91
rollback environment.py
rozhkovdmitrii Mar 9, 2022
446aa9b
rollback environment.py
rozhkovdmitrii Mar 9, 2022
b66cda7
uncoment code
rozhkovdmitrii Mar 9, 2022
2e480eb
get rid of extra calls
rozhkovdmitrii Mar 9, 2022
4c2b626
get rid of extra calls
rozhkovdmitrii Mar 9, 2022
9ae04ab
dynamic container name
rozhkovdmitrii Mar 9, 2022
b37e568
dynamic container name
rozhkovdmitrii Mar 9, 2022
5c84838
FTS_CONTAINER_NAME
rozhkovdmitrii Mar 9, 2022
4074fea
Move up the environments
rozhkovdmitrii Mar 9, 2022
ee05286
Play around environment
rozhkovdmitrii Mar 9, 2022
02e5cca
Play around environment
rozhkovdmitrii Mar 9, 2022
79fc4dd
${FTS_CONTAINER_NAME}.log
rozhkovdmitrii Mar 9, 2022
8e4e646
${FTS_CONTAINER_NAME}.log
rozhkovdmitrii Mar 9, 2022
9b903c4
docker logs
rozhkovdmitrii Mar 9, 2022
48e08f7
docker logs
rozhkovdmitrii Mar 9, 2022
d5b652a
docker logs
rozhkovdmitrii Mar 9, 2022
72c9e26
docker logs
rozhkovdmitrii Mar 9, 2022
3365f11
docker logs
rozhkovdmitrii Mar 9, 2022
e5f86f8
docker logs
rozhkovdmitrii Mar 9, 2022
e217d40
checkout to fts develop image
rozhkovdmitrii Mar 9, 2022
290d33e
back to fake
rozhkovdmitrii Mar 9, 2022
77e6f6c
bring fts to develop
rozhkovdmitrii Mar 9, 2022
d95ba7a
try the fts with wait-faucet
rozhkovdmitrii Mar 10, 2022
2b70a45
Merge branch 'develop' into 583-introduce-full-test-suite
rozhkovdmitrii Mar 10, 2022
8bb2241
Request ammount
rozhkovdmitrii Mar 10, 2022
a316493
Roll back
rozhkovdmitrii Mar 10, 2022
994620b
Roll back
rozhkovdmitrii Mar 10, 2022
ff4f3d6
Allure report error
rozhkovdmitrii Mar 10, 2022
7ee5e95
Increase request amount
rozhkovdmitrii Mar 10, 2022
d88a693
full_test_suite:583-full-test-suite
rozhkovdmitrii Mar 11, 2022
3ad49ab
uncoment condition
rozhkovdmitrii Mar 11, 2022
2ebfbf4
comment condition
rozhkovdmitrii Mar 11, 2022
0ec3c9e
intro
Mar 11, 2022
e78e360
Bring full_test_suite onto "testing" agent
rozhkovdmitrii Mar 11, 2022
9fb9fa7
upd creds
Mar 11, 2022
7ef74d6
fix
Mar 11, 2022
60124c2
wip
Mar 11, 2022
ebf8ea0
typo
Mar 11, 2022
432bac7
fix
Mar 11, 2022
dbe118d
wip
Mar 11, 2022
600d6ca
wip
Mar 11, 2022
cb18d20
wip
Mar 11, 2022
e9fd64c
wip
Mar 11, 2022
b37c3cb
wip
Mar 11, 2022
2f443c7
wip
Mar 11, 2022
885a0ad
upd SG
Mar 11, 2022
d35af72
enable tests
Mar 11, 2022
ba6750e
wip
Mar 11, 2022
332c031
wip
Mar 11, 2022
54de5ed
Use full_test_suite:develop
rozhkovdmitrii Mar 12, 2022
805e4ae
Merge branch '583-introduce-full-test-suite' into 583-introduce-full-…
Mar 12, 2022
9c9447b
wip
Mar 12, 2022
991cc46
wip
Mar 12, 2022
fde5590
wip
Mar 12, 2022
76b68aa
debug
Mar 14, 2022
db98d44
merge
Mar 14, 2022
69798e9
merge
Mar 14, 2022
ecb4831
remove unused port
Mar 14, 2022
92d207b
wip
Mar 14, 2022
38edd9a
wip
Mar 14, 2022
c677de9
wip
Mar 14, 2022
9e6af06
wip
Mar 14, 2022
509d49b
wip
Mar 14, 2022
c59129b
wip
Mar 14, 2022
b2144cc
change instance type
Mar 14, 2022
f959e82
wip
Mar 14, 2022
c11abaa
fix path
Mar 14, 2022
9b0b676
wip
Mar 14, 2022
5dd2ec9
wip
Mar 14, 2022
3dba0fd
wip
Mar 14, 2022
6a68eae
artifacts
Mar 15, 2022
6bd5b62
enable required step
Mar 15, 2022
8809fde
wip
Mar 15, 2022
cc853d1
wip
Mar 15, 2022
0045faa
proxy artefacts
Mar 15, 2022
82847a3
redirect stderr
Mar 15, 2022
77429f5
enable test step
Mar 15, 2022
3938e6a
typo
Mar 15, 2022
ea7b59f
typo
Mar 15, 2022
e8c9696
faucet
Mar 15, 2022
3d30b36
wip
Mar 15, 2022
a76732a
debug
Mar 15, 2022
0488307
wip
Mar 15, 2022
5f4f39e
Add SOLANA_COMMITMENT
Mar 15, 2022
cff0952
Enable cleaning step
Mar 16, 2022
86cecc7
wip
Mar 16, 2022
e7ddf25
wip
Mar 16, 2022
bda6d60
debug
Mar 16, 2022
cf72092
debug
Mar 16, 2022
9fa4281
testdrive
Mar 16, 2022
ab84e08
solana tune
Mar 16, 2022
94af2b5
debug
Mar 16, 2022
6f0322c
wip
Mar 16, 2022
fd0cb99
wip
Mar 16, 2022
fa3d60d
confirmed
Mar 16, 2022
9b950fc
test
Mar 17, 2022
a15be09
Revert "test"
Mar 17, 2022
831b378
Comment extra steps
rozhkovdmitrii Mar 18, 2022
2f7f154
Comment extra steps
rozhkovdmitrii Mar 18, 2022
03ffaea
refactoring
Mar 18, 2022
20b0c54
typo
Mar 18, 2022
7d90442
Merge branch 'develop' into 583-introduce-full-test-suite-tf
Mar 18, 2022
b43719e
enable basic logic
Mar 18, 2022
f118b79
add dependences
Mar 18, 2022
d9c5aa5
playground for if
Mar 18, 2022
e91b5c6
refactoring
Mar 22, 2022
6899c86
wip
Mar 22, 2022
2c57db5
wip
Mar 22, 2022
12e0d76
wip
Mar 22, 2022
aa33e0c
wip
Mar 22, 2022
79bcc2d
typo
Mar 22, 2022
2c54830
wip
Mar 22, 2022
d7442bf
update attrubites
Mar 22, 2022
92182eb
wip
Mar 22, 2022
395495a
Braces
Mar 22, 2022
f8e17fb
wip
Mar 22, 2022
6a96892
Revert "wip"
Mar 22, 2022
97fe37e
Revert "Braces"
Mar 22, 2022
e1c31dd
wip
Mar 22, 2022
9190857
typo
Mar 22, 2022
5d4a10c
wip
Mar 22, 2022
46da066
wip
Mar 22, 2022
0a69ab3
typo
Mar 22, 2022
825d7ed
rename
Mar 23, 2022
ec95ca3
wip
Mar 23, 2022
c79cb0c
wip
Mar 23, 2022
1e486b1
ports
Mar 23, 2022
0e910fb
force run
Mar 23, 2022
63bd6da
Remove unused artifacts
Mar 23, 2022
d104c0b
Show IPs
Mar 23, 2022
e0e3519
Revert "Remove unused artifacts"
Mar 23, 2022
e5eb73f
Remove unused artifacts
Mar 23, 2022
2a6ef90
Enable filter
Mar 23, 2022
f487a63
wip
Mar 23, 2022
9a6a338
Revert "wip"
Mar 23, 2022
0565fb0
Refactoring
Mar 23, 2022
3170eb0
small changes
Mar 23, 2022
ad2eeac
Renaming
rozhkovdmitrii Mar 23, 2022
4f05ffb
Get rid of useless tf variables
rozhkovdmitrii Mar 23, 2022
3e977e9
check generating keys
rozhkovdmitrii Mar 23, 2022
60580f6
rename variable USER_NUMBER, FTS_JOBS_NUMBER
rozhkovdmitrii Mar 23, 2022
71e3adc
Log reading elf params
rozhkovdmitrii Mar 23, 2022
dc421da
Merge branch 'develop' into 583-introduce-full-test-suite-tf
rozhkovdmitrii Mar 23, 2022
c5c540a
rename variable USER_NUMBER, FTS_JOBS_NUMBER
rozhkovdmitrii Mar 24, 2022
14da72f
Fix proxy revision
Mar 24, 2022
8dc8cb0
Merge branch '583-introduce-full-test-suite-tf' of github.com:neonlab…
Mar 24, 2022
6b73bb8
fix vars
Mar 24, 2022
199f296
var neon_evm_commit
Mar 24, 2022
05d58f9
Rename revision
Mar 24, 2022
6520610
Revert "Rename revision"
Mar 24, 2022
15c52a5
variables
Mar 24, 2022
79dea5c
debug
Mar 24, 2022
fcbd058
destroy
Mar 24, 2022
6099467
destroy
Mar 24, 2022
bcbdfd3
revision
Mar 24, 2022
95eda88
conditional
Mar 24, 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
52 changes: 50 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ steps:
- ".buildkite/steps/build-image.sh"
- ".buildkite/steps/upload-image.sh"

- label: ":terraform: build infrastructure"
key: "create_infrastructure"
if: &is_fts_enabled |
(build.pull_request.base_branch == "develop" && !build.pull_request.draft) ||
(build.source == "trigger_job" && build.env("NEON_EVM_FULL_TEST_SUITE") == "true")
agents:
queue: "testing"
command:
- ".buildkite/steps/full_test_suite/terraform-build.sh"


- wait


- label: ":cop::skin-tone-2: deploy check"
command: ".buildkite/steps/deploy-test.sh"
timeout: 90
Expand All @@ -16,15 +28,51 @@ steps:
- "solana.log"
- "measurements.log"
- "evm_loader.log"
- "dbcreation.log"
Copy link
Contributor

Choose a reason for hiding this comment

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

why this has been dropped?

- "faucet.log"
- "airdropper.log"
- "indexer.log"


- label: ":coverage: full test suite (FTS)"
key: "full_test_suite"
if: *is_fts_enabled
commands:
- ".buildkite/steps/full_test_suite/run_full_test_suite.sh"
env:
FTS_THRESHOLD: 1700
FTS_CONTAINER_NAME: fts_${BUILDKITE_BUILD_NUMBER}
FTS_IMAGE: neonlabsorg/full_test_suite:develop
FTS_USERS_NUMBER: 15
FTS_JOBS_NUMBER: 8
NETWORK_NAME: full-test-suite-${BUILDKITE_BUILD_NUMBER}
NETWORK_ID: 111
REQUEST_AMOUNT: 20000
USE_FAUCET: true
agents:
queue: "testing"
artifact_paths:
- allure-reports.tar.gz
- fts_${BUILDKITE_BUILD_NUMBER}.log


- wait


- label: ":floppy_disk: publish image"
command: ".buildkite/steps/publish-image.sh"
if: |
build.branch =~ /^(master|develop|^ci-.+|v[0-9]+\.[0-9]+\..+)$$/ &&
(build.env("EVM_LOADER_BRANCH") == "develop" || build.env("EVM_LOADER_BRANCH") == null)
(build.env("NEON_EVM_BRANCH") == "develop" || build.env("NEON_EVM_BRANCH") == null)

- label: ":terraform: destroy infrastructure"
agents:
queue: "testing"
if: *is_fts_enabled
command:
- ".buildkite/steps/full_test_suite/terraform-destroy.sh"
depends_on:
- "full_test_suite"
- "create_infrastructure"
allow_dependency_failure: true
artifact_paths:
- ".buildkite/steps/full_test_suite/logs/*"
6 changes: 3 additions & 3 deletions .buildkite/steps/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ set -euo pipefail
REVISION=$(git rev-parse HEAD)

set ${SOLANA_REVISION:=v1.8.12-testnet}
set ${EVM_LOADER_REVISION:=latest}
set ${NEON_EVM_COMMIT:=latest}

# Refreshing neonlabsorg/solana:latest image is required to run .buildkite/steps/build-image.sh locally
docker pull neonlabsorg/solana:${SOLANA_REVISION}

# Refreshing neonlabsorg/evm_loader:latest image is required to run .buildkite/steps/build-image.sh locally
docker pull neonlabsorg/evm_loader:${EVM_LOADER_REVISION}
docker pull neonlabsorg/evm_loader:${NEON_EVM_COMMIT}

docker build -t neonlabsorg/proxy:${REVISION} \
--build-arg SOLANA_REVISION=${SOLANA_REVISION} \
--build-arg EVM_LOADER_REVISION=${EVM_LOADER_REVISION} \
--build-arg NEON_EVM_COMMIT=${NEON_EVM_COMMIT} \
rozhkovdmitrii marked this conversation as resolved.
Show resolved Hide resolved
--build-arg PROXY_REVISION=${REVISION} \
.
194 changes: 194 additions & 0 deletions .buildkite/steps/full_test_suite/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}

backend "s3" {
// Must be set from environment
}
}

provider "aws" {
region = "us-east-2"
}

data "aws_vpc" "default" {
default = true
}

data "aws_key_pair" "ci-stands" {
key_name = "ci-stands"
}

data "template_file" "solana_init" {
template = file("solana_init.sh")

vars = {
branch = "${var.branch}"
}
}

data "template_file" "proxy_init" {
template = file("proxy_init.sh")

vars = {
branch = "${var.branch}"
revision = "latest"
solana_ip = aws_instance.solana.private_ip
}
}

resource "random_id" "test-stand-solana" {
byte_length = 4
prefix = "test-stand-solana-"
}

resource "aws_security_group" "test-stand-solana" {
name = random_id.test-stand-solana.hex
description = "set of rules allow incoming traffic from ci test agents for OZ tests"
vpc_id = data.aws_vpc.default.id

ingress {
description = "allow incoming from ci test agent to SOLANA"
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = var.allow_list
}

ingress {
description = "allow incoming from world to SOLANA"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}

egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}

tags = {
Name = "${var.branch}-test-stand-solana"
purpose = "ci-oz-full-tests"
}
}

resource "random_id" "test-stand-proxy" {
byte_length = 4
prefix = "test-stand-proxy-"
}

resource "aws_security_group" "test-stand-proxy" {
name = random_id.test-stand-proxy.hex
description = "set of rules allow incoming traffic from ci test agents for OZ tests"
vpc_id = data.aws_vpc.default.id

ingress {
description = "allow incoming from ci test agent to PROXY"
from_port = 9090
to_port = 9091
protocol = "tcp"
cidr_blocks = var.allow_list
}

ingress {
description = "allow incoming from ci test agent to FAUCET"
from_port = 3333
to_port = 3334
protocol = "tcp"
cidr_blocks = var.allow_list
}

ingress {
description = "allow incoming from world to PROXY"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}

egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}

tags = {
Name = "${var.branch}-test-stand-proxy"
purpose = "ci-oz-full-tests"
}
}


resource "aws_instance" "solana" {
instance_type = var.solana_instance_type
ami = var.ami
key_name = data.aws_key_pair.ci-stands.key_name
vpc_security_group_ids = [aws_security_group.test-stand-solana.id]
subnet_id = var.aws_subnet

ebs_block_device {
device_name = "/dev/sda1"
volume_size = 50
}

user_data = data.template_file.solana_init.rendered

tags = {
Name = "${var.branch}-test-stand-solana"
purpose = "ci-oz-full-tests"
}
}

resource "aws_instance" "proxy" {
instance_type = var.proxy_instance_type
ami = var.ami
key_name = data.aws_key_pair.ci-stands.key_name
vpc_security_group_ids = [aws_security_group.test-stand-proxy.id]
subnet_id = var.aws_subnet
ebs_block_device {
device_name = "/dev/sda1"
volume_size = 50
}

tags = {
Name = "${var.branch}-test-stand-proxy"
purpose = "ci-oz-full-tests"
}

depends_on = [
aws_instance.solana
]

connection {
type = "ssh"
user = "ubuntu"
host = aws_instance.proxy.public_ip
private_key = file("~/.ssh/ci-stands")
}

provisioner "file" {
content = data.template_file.proxy_init.rendered
destination = "/tmp/proxy_init.sh"
}

provisioner "remote-exec" {
inline = [
"echo '${aws_instance.solana.private_ip}' > /tmp/solana_host",
"chmod a+x /tmp/proxy_init.sh",
"sudo /tmp/proxy_init.sh"
]
}
}


11 changes: 11 additions & 0 deletions .buildkite/steps/full_test_suite/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
output "solana_ip" {
value = aws_instance.solana.public_ip
}

output "proxy_ip" {
value = aws_instance.proxy.public_ip
}

output "branch" {
value = var.branch
}
95 changes: 95 additions & 0 deletions .buildkite/steps/full_test_suite/proxy_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/bin/bash


# Install docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get -y install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io


# Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose


# Get docker-compose file
cd /opt
curl -O https://raw.githubusercontent.com/neonlabsorg/proxy-model.py/${branch}/proxy/docker-compose-test.yml


# Set required environment variables
export REVISION=${revision}
export SOLANA_URL=http:\/\/${solana_ip}:8899


# Generate docker-compose override file
cat > docker-compose-test.override.yml <<EOF
version: "3"

services:
evm_loader:
container_name: evm_loader
environment:
- SOLANA_URL=$SOLANA_URL
networks:
- net
command: bash -c "create-test-accounts.sh 1 && deploy-evm.sh && /opt/spl-token create-account HPsV9Deocecw3GeZv1FkAPNCBRfuVyfw9MMwjwRe1xaU && /opt/spl-token mint HPsV9Deocecw3GeZv1FkAPNCBRfuVyfw9MMwjwRe1xaU 1000000000 --owner /opt/evm_loader-keypair.json -- HX14J4Pp9CgSbWP13Dtpm8VLJpNxMYffLtRCRGsx7Edv"
proxy:
environment:
- SOLANA_URL=$SOLANA_URL
ports:
- 9091:9090
faucet:
image: neonlabsorg/faucet:latest
environment:
- FAUCET_RPC_BIND=0.0.0.0
- FAUCET_RPC_PORT=3333
- SOLANA_URL=$SOLANA_URL
- NEON_ETH_MAX_AMOUNT=50000
- EVM_LOADER=53DfF883gyixYNXnM7s5xhdeyV8mVk9T4i2hGV9vG9io
- NEON_TOKEN_MINT=HPsV9Deocecw3GeZv1FkAPNCBRfuVyfw9MMwjwRe1xaU
- FAUCET_RPC_ALLOWED_ORIGINS=["https://neonswap.live"]
- FAUCET_WEB3_ENABLE=false
- FAUCET_SOLANA_ENABLE=true
- NEON_TOKEN_MINT_DECIMALS=9
- NEON_OPERATOR_KEYFILE=/opt/faucet/id.json
- SOLANA_COMMITMENT=confirmed
ports:
- 3333:3333
entrypoint: /opt/faucet/faucet --config /opt/proxy/faucet.conf run
airdropper:
environment:
- SOLANA_URL=$SOLANA_URL
indexer:
environment:
- SOLANA_URL=$SOLANA_URL
EOF


# Get list of services
SERVICES=$(docker-compose -f docker-compose-test.yml config --services | grep -v "solana")


# Check if Solana is available, max attepts is 100(each for 2 seconds)
CHECK_COMMAND=`curl $SOLANA_URL -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getHealth"}'`
MAX_COUNT=100
CURRENT_ATTEMPT=1
while [[ "$CHECK_COMMAND" != "{\"jsonrpc\":\"2.0\",\"result\":\"ok\",\"id\":1}" && $CURRENT_ATTEMPT -gt $MAX_COUNT ]]
do
CHECK_COMMAND=`curl $SOLANA_URL -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getHealth"}'`
echo $CHECK_COMMAND >> /tmp/output.txt
echo "attempt: $CURRENT_ATTEMPT"
((CURRENT_ATTEMPT=CURRENT_ATTEMPT+1))
sleep 2
done;


# Up all services
docker-compose -f docker-compose-test.yml -f docker-compose-test.override.yml up -d $SERVICES

# Remove unused(solana is required by evm_loader in docker-compose file)
docker rm -f solana
Loading