-
Notifications
You must be signed in to change notification settings - Fork 19
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
Changes from 200 commits
Commits
Show all changes
214 commits
Select commit
Hold shift + click to select a range
b978f86
Rename environment
rozhkovdmitrii d154dad
Print elf params
rozhkovdmitrii c8bdd2e
Reduce time waiting for proxy
rozhkovdmitrii 737fb80
Merge remote-tracking branch 'origin/develop' into 583-introduce-full…
rozhkovdmitrii 6c1089e
Remove extra things
rozhkovdmitrii ce87fc8
Remove extra things
rozhkovdmitrii 2879c37
Add docker step into buildkite
rozhkovdmitrii 2ea579b
Add full test suite step
rozhkovdmitrii f630013
Correct full test suite
rozhkovdmitrii f560e86
Correct full test suite again
rozhkovdmitrii 2d84d4e
suppress deploy check
rozhkovdmitrii f67de2f
just echo if trigger_job
rozhkovdmitrii a7a2330
try to fix condition
rozhkovdmitrii a04ca0d
try to fix condition
rozhkovdmitrii ed96c90
Get rid off condition
rozhkovdmitrii bf9b694
if source == webhook
rozhkovdmitrii dbce4ed
Try again
rozhkovdmitrii b31cf83
Try again
rozhkovdmitrii 90ef427
Enable full test suite )
rozhkovdmitrii 2f1531e
Enable full test suite )
rozhkovdmitrii d1bc510
Turn off the condition
rozhkovdmitrii 9f0a689
Introduce check threshold formula
rozhkovdmitrii 88341ee
What's wrong
rozhkovdmitrii aa88704
Again
rozhkovdmitrii 8f5615f
again and again
rozhkovdmitrii 3af7ef1
again and again and again
rozhkovdmitrii 2a3eed5
again and again and again
rozhkovdmitrii 3d23ed5
unfold commands
rozhkovdmitrii 62df1c4
unfold commands
rozhkovdmitrii 7714aff
Bad results check
rozhkovdmitrii 48f6026
Bad results check
rozhkovdmitrii 000db50
Logging this check
rozhkovdmitrii 03fd17c
Logging this check
rozhkovdmitrii efec5c1
Logging this check
rozhkovdmitrii e7e0489
Logging this check
rozhkovdmitrii 9b4ea43
get rid of pipe to assign env
rozhkovdmitrii 45dccf9
get rid of pipe to assign env
rozhkovdmitrii afe2a1a
get rid of pipe to assign env
rozhkovdmitrii f8b967b
get rid of pipe to assign env
rozhkovdmitrii 888e865
get rid of pipe to assign env
rozhkovdmitrii 24ea81c
get rid of pipe to assign env
rozhkovdmitrii e6848ac
uncomment test
rozhkovdmitrii d73eddc
uncomment test
rozhkovdmitrii a116345
uncomment test
rozhkovdmitrii fda5a2d
uncomment test
rozhkovdmitrii 4586929
add docker compose
rozhkovdmitrii e920cf5
using tee
rozhkovdmitrii d4ba31e
Playing around output to stdout
rozhkovdmitrii e5fe7e4
Simplify
rozhkovdmitrii aa1fbd3
Remove with docker-compose
rozhkovdmitrii 89cd3b5
merge pipes
rozhkovdmitrii 4685136
Try to mix stderr and stdout
rozhkovdmitrii bce3e18
mode docker-compose-full-test-suite.yml into docker-compose
rozhkovdmitrii c217dcd
mode docker-compose-full-test-suite.yml into docker-compose
rozhkovdmitrii 1aa8bcb
spit and polish
rozhkovdmitrii a0a1c03
rollback environment.py
rozhkovdmitrii 330d240
rollback environment.py
rozhkovdmitrii 2fb4fe2
rollback environment.py
rozhkovdmitrii 0b0df91
rollback environment.py
rozhkovdmitrii 446aa9b
rollback environment.py
rozhkovdmitrii b66cda7
uncoment code
rozhkovdmitrii 2e480eb
get rid of extra calls
rozhkovdmitrii 4c2b626
get rid of extra calls
rozhkovdmitrii 9ae04ab
dynamic container name
rozhkovdmitrii b37e568
dynamic container name
rozhkovdmitrii 5c84838
FTS_CONTAINER_NAME
rozhkovdmitrii 4074fea
Move up the environments
rozhkovdmitrii ee05286
Play around environment
rozhkovdmitrii 02e5cca
Play around environment
rozhkovdmitrii 79fc4dd
${FTS_CONTAINER_NAME}.log
rozhkovdmitrii 8e4e646
${FTS_CONTAINER_NAME}.log
rozhkovdmitrii 9b903c4
docker logs
rozhkovdmitrii 48e08f7
docker logs
rozhkovdmitrii d5b652a
docker logs
rozhkovdmitrii 72c9e26
docker logs
rozhkovdmitrii 3365f11
docker logs
rozhkovdmitrii e5f86f8
docker logs
rozhkovdmitrii e217d40
checkout to fts develop image
rozhkovdmitrii 290d33e
back to fake
rozhkovdmitrii 77e6f6c
bring fts to develop
rozhkovdmitrii d95ba7a
try the fts with wait-faucet
rozhkovdmitrii 2b70a45
Merge branch 'develop' into 583-introduce-full-test-suite
rozhkovdmitrii 8bb2241
Request ammount
rozhkovdmitrii a316493
Roll back
rozhkovdmitrii 994620b
Roll back
rozhkovdmitrii ff4f3d6
Allure report error
rozhkovdmitrii 7ee5e95
Increase request amount
rozhkovdmitrii d88a693
full_test_suite:583-full-test-suite
rozhkovdmitrii 3ad49ab
uncoment condition
rozhkovdmitrii 2ebfbf4
comment condition
rozhkovdmitrii 0ec3c9e
intro
e78e360
Bring full_test_suite onto "testing" agent
rozhkovdmitrii 9fb9fa7
upd creds
7ef74d6
fix
60124c2
wip
ebf8ea0
typo
432bac7
fix
dbe118d
wip
600d6ca
wip
cb18d20
wip
e9fd64c
wip
b37c3cb
wip
2f443c7
wip
885a0ad
upd SG
d35af72
enable tests
ba6750e
wip
332c031
wip
54de5ed
Use full_test_suite:develop
rozhkovdmitrii 805e4ae
Merge branch '583-introduce-full-test-suite' into 583-introduce-full-…
9c9447b
wip
991cc46
wip
fde5590
wip
76b68aa
debug
db98d44
merge
69798e9
merge
ecb4831
remove unused port
92d207b
wip
38edd9a
wip
c677de9
wip
9e6af06
wip
509d49b
wip
c59129b
wip
b2144cc
change instance type
f959e82
wip
c11abaa
fix path
9b0b676
wip
5dd2ec9
wip
3dba0fd
wip
6a68eae
artifacts
6bd5b62
enable required step
8809fde
wip
cc853d1
wip
0045faa
proxy artefacts
82847a3
redirect stderr
77429f5
enable test step
3938e6a
typo
ea7b59f
typo
e8c9696
faucet
3d30b36
wip
a76732a
debug
0488307
wip
5f4f39e
Add SOLANA_COMMITMENT
cff0952
Enable cleaning step
86cecc7
wip
e7ddf25
wip
bda6d60
debug
cf72092
debug
9fa4281
testdrive
ab84e08
solana tune
94af2b5
debug
6f0322c
wip
fd0cb99
wip
fa3d60d
confirmed
9b950fc
test
a15be09
Revert "test"
831b378
Comment extra steps
rozhkovdmitrii 2f7f154
Comment extra steps
rozhkovdmitrii 03ffaea
refactoring
20b0c54
typo
7d90442
Merge branch 'develop' into 583-introduce-full-test-suite-tf
b43719e
enable basic logic
f118b79
add dependences
d9c5aa5
playground for if
e91b5c6
refactoring
6899c86
wip
2c57db5
wip
12e0d76
wip
aa33e0c
wip
79bcc2d
typo
2c54830
wip
d7442bf
update attrubites
92182eb
wip
395495a
Braces
f8e17fb
wip
6a96892
Revert "wip"
97fe37e
Revert "Braces"
e1c31dd
wip
9190857
typo
5d4a10c
wip
46da066
wip
0a69ab3
typo
825d7ed
rename
ec95ca3
wip
c79cb0c
wip
1e486b1
ports
0e910fb
force run
63bd6da
Remove unused artifacts
d104c0b
Show IPs
e0e3519
Revert "Remove unused artifacts"
e5eb73f
Remove unused artifacts
2a6ef90
Enable filter
f487a63
wip
9a6a338
Revert "wip"
0565fb0
Refactoring
3170eb0
small changes
ad2eeac
Renaming
rozhkovdmitrii 4f05ffb
Get rid of useless tf variables
rozhkovdmitrii 3e977e9
check generating keys
rozhkovdmitrii 60580f6
rename variable USER_NUMBER, FTS_JOBS_NUMBER
rozhkovdmitrii 71e3adc
Log reading elf params
rozhkovdmitrii dc421da
Merge branch 'develop' into 583-introduce-full-test-suite-tf
rozhkovdmitrii c5c540a
rename variable USER_NUMBER, FTS_JOBS_NUMBER
rozhkovdmitrii 14da72f
Fix proxy revision
8dc8cb0
Merge branch '583-introduce-full-test-suite-tf' of github.com:neonlab…
6b73bb8
fix vars
199f296
var neon_evm_commit
05d58f9
Rename revision
6520610
Revert "Rename revision"
15c52a5
variables
79dea5c
debug
fcbd058
destroy
6099467
destroy
bcbdfd3
revision
95eda88
conditional
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?