-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
4,665 additions
and
4,018 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
let Prelude = ../External/Prelude.dhall | ||
|
||
let Command = ./Base.dhall | ||
|
||
let Size = ./Size.dhall | ||
let RunInToolchain = ./RunInToolchain.dhall in | ||
|
||
{ step = \(dependsOn : List Command.TaggedKey.Type) -> | ||
Command.build | ||
Command.Config::{ | ||
commands = | ||
RunInToolchain.runInToolchainBullseye ([] : List Text) | ||
"./buildkite/scripts/check-graphql-schema.sh", | ||
label = "Check GraphQL Schema", | ||
key = "check-graphql-schema", | ||
target = Size.Large, | ||
depends_on = dependsOn | ||
} | ||
} | ||
let RunInToolchain = ./RunInToolchain.dhall | ||
|
||
in { step = | ||
\(dependsOn : List Command.TaggedKey.Type) | ||
-> Command.build | ||
Command.Config::{ | ||
, commands = | ||
RunInToolchain.runInToolchainBullseye | ||
([] : List Text) | ||
"./buildkite/scripts/check-graphql-schema.sh" | ||
, label = "Check GraphQL Schema" | ||
, key = "check-graphql-schema" | ||
, target = Size.Large | ||
, depends_on = dependsOn | ||
} | ||
} |
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 |
---|---|---|
@@ -1,32 +1,32 @@ | ||
let Prelude = ../External/Prelude.dhall | ||
let B = ../External/Buildkite.dhall | ||
|
||
let Command = ./Base.dhall | ||
let Docker = ./Docker/Type.dhall | ||
|
||
let Size = ./Size.dhall | ||
|
||
let B/SoftFail = B.definitions/commandStep/properties/soft_fail/Type | ||
|
||
let Cmd = ../Lib/Cmds.dhall in | ||
let Cmd = ../Lib/Cmds.dhall | ||
|
||
{ step = \(dependsOn : List Command.TaggedKey.Type) | ||
-> \(testnet : Text) | ||
-> \(wait_between_graphql_poll : Text) | ||
-> \(wait_before_final_check: Text ) | ||
-> \(soft_fail: B/SoftFail) | ||
-> Command.build | ||
Command.Config::{ | ||
commands = [ | ||
Cmd.runInDocker | ||
Cmd.Docker::{ | ||
image = (../Constants/ContainerImages.dhall).ubuntu2004 | ||
in { step = | ||
\(dependsOn : List Command.TaggedKey.Type) | ||
-> \(testnet : Text) | ||
-> \(wait_between_graphql_poll : Text) | ||
-> \(wait_before_final_check : Text) | ||
-> \(soft_fail : B/SoftFail) | ||
-> Command.build | ||
Command.Config::{ | ||
, commands = | ||
[ Cmd.runInDocker | ||
Cmd.Docker::{ | ||
, image = (../Constants/ContainerImages.dhall).ubuntu2004 | ||
} | ||
"./buildkite/scripts/connect-to-testnet.sh ${testnet} ${wait_between_graphql_poll} ${wait_before_final_check}" | ||
] | ||
, label = "Connect to ${testnet}" | ||
, soft_fail = Some soft_fail | ||
, key = "connect-to-${testnet}" | ||
, target = Size.Large | ||
, depends_on = dependsOn | ||
} | ||
"./buildkite/scripts/connect-to-testnet.sh ${testnet} ${wait_between_graphql_poll} ${wait_before_final_check}" | ||
], | ||
label = "Connect to ${testnet}", | ||
soft_fail = Some soft_fail, | ||
key = "connect-to-${testnet}", | ||
target = Size.Large, | ||
depends_on = dependsOn | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,63 +1,56 @@ | ||
let Prelude = ../External/Prelude.dhall | ||
|
||
let Command = ./Base.dhall | ||
|
||
let Size = ./Size.dhall | ||
|
||
let Cmd = ../Lib/Cmds.dhall | ||
|
||
let DeploySpec = | ||
{ Type = | ||
{ testnetLabel : Text | ||
, deployEnvFile : Text | ||
, workspace : Text | ||
, artifactPath : Text | ||
, postDeploy : Text | ||
, testnetDir : Text | ||
, deps : List Command.TaggedKey.Type | ||
} | ||
, default = | ||
{ testnetLabel = "ci-net" | ||
, deployEnvFile = "export-git-env-vars.sh" | ||
, workspace = "\\\${BUILDKITE_BRANCH//[_\\/]/-}" | ||
, artifactPath = "/tmp/artifacts" | ||
, postDeploy = "echo 'Deployment successfull!'" | ||
, testnetDir = "automation/terraform/testnets/ci-net" | ||
, deps = [] : List Command.TaggedKey.Type | ||
} | ||
} | ||
|
||
let DeploySpec = { | ||
Type = { | ||
testnetLabel: Text, | ||
deployEnvFile : Text, | ||
workspace: Text, | ||
artifactPath: Text, | ||
postDeploy: Text, | ||
testnetDir: Text, | ||
deps : List Command.TaggedKey.Type | ||
}, | ||
default = { | ||
testnetLabel = "ci-net", | ||
deployEnvFile = "export-git-env-vars.sh", | ||
workspace = "\\\${BUILDKITE_BRANCH//[_\\/]/-}", | ||
artifactPath = "/tmp/artifacts", | ||
postDeploy = "echo 'Deployment successfull!'", | ||
testnetDir = "automation/terraform/testnets/ci-net", | ||
deps = [] : List Command.TaggedKey.Type | ||
} | ||
} | ||
|
||
in | ||
|
||
{ | ||
step = \(spec : DeploySpec.Type) -> | ||
Command.build | ||
Command.Config::{ | ||
commands = [ | ||
Cmd.run "cd ${spec.testnetDir}", | ||
Cmd.run "terraform init", | ||
-- create separate workspace based on build branch to isolate infrastructure states | ||
Cmd.run "terraform workspace select ${spec.workspace} || terraform workspace new ${spec.workspace}", | ||
-- download deployment dependencies and ensure artifact DIR exists | ||
Cmd.run "mkdir -p ${spec.artifactPath}", | ||
Cmd.run "artifact-cache-helper.sh ${spec.deployEnvFile}", | ||
-- launch testnet based on deploy ENV and ensure auto-cleanup on `apply` failures | ||
Cmd.run "source ${spec.deployEnvFile}", | ||
Cmd.run ( | ||
"terraform apply -auto-approve" ++ | ||
" -var mina_image=gcr.io/o1labs-192920/mina-daemon:\\\$MINA_DOCKER_TAG" ++ | ||
" -var ci_artifact_path=${spec.artifactPath}" ++ | ||
" || (terraform destroy -auto-approve && exit 1)" | ||
), | ||
-- upload/cache testnet genesis_ledger | ||
Cmd.run "artifact-cache-helper.sh ${spec.artifactPath}/genesis_ledger.json --upload", | ||
-- execute post-deploy operation | ||
Cmd.run "${spec.postDeploy}" | ||
], | ||
label = "Deploy ${spec.testnetLabel}", | ||
key = "deploy-${spec.testnetLabel}", | ||
target = Size.Large, | ||
depends_on = spec.deps | ||
}, | ||
DeploySpec = DeploySpec | ||
} | ||
in { step = | ||
\(spec : DeploySpec.Type) | ||
-> Command.build | ||
Command.Config::{ | ||
, commands = | ||
[ Cmd.run "cd ${spec.testnetDir}" | ||
, Cmd.run "terraform init" | ||
, Cmd.run | ||
"terraform workspace select ${spec.workspace} || terraform workspace new ${spec.workspace}" | ||
, Cmd.run "mkdir -p ${spec.artifactPath}" | ||
, Cmd.run "artifact-cache-helper.sh ${spec.deployEnvFile}" | ||
, Cmd.run "source ${spec.deployEnvFile}" | ||
, Cmd.run | ||
( "terraform apply -auto-approve" | ||
++ " -var mina_image=gcr.io/o1labs-192920/mina-daemon:\\\$MINA_DOCKER_TAG" | ||
++ " -var ci_artifact_path=${spec.artifactPath}" | ||
++ " || (terraform destroy -auto-approve && exit 1)" | ||
) | ||
, Cmd.run | ||
"artifact-cache-helper.sh ${spec.artifactPath}/genesis_ledger.json --upload" | ||
, Cmd.run "${spec.postDeploy}" | ||
] | ||
, label = "Deploy ${spec.testnetLabel}" | ||
, key = "deploy-${spec.testnetLabel}" | ||
, target = Size.Large | ||
, depends_on = spec.deps | ||
} | ||
, DeploySpec = DeploySpec | ||
} |
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
Oops, something went wrong.