Skip to content

Commit

Permalink
Merge pull request #14347 from MinaProtocol/dkijania/fix-develop-comp…
Browse files Browse the repository at this point in the history
…atibility-job

Add timeout to check-compatibility bootstrap phase
  • Loading branch information
dkijania authored Oct 23, 2023
2 parents f16e20a + a2ff9eb commit b155452
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
21 changes: 12 additions & 9 deletions buildkite/scripts/check-compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,20 @@ function boot_and_sync {
REST_SERVER="http://127.0.0.1:$REST_PORT/graphql"

while [ $SYNCED -eq 0 ]; do
SYNC_STATUS=$(docker container exec -it $DAEMON_CONTAINER \
curl -g -X POST -H "Content-Type: application/json" -d '{"query":"query { syncStatus }"}' ${REST_SERVER})
SYNC_STATUS=$(docker container exec -it $DAEMON_CONTAINER \
curl -g -X POST -H "Content-Type: application/json" -d '{"query":"query { syncStatus }"}' ${REST_SERVER})

# "connection refused" until GraphQL server up
GOT_SYNC_STATUS=$(echo ${SYNC_STATUS} | grep "syncStatus")
if [ ! -z $GOT_SYNC_STATUS ]; then
echo "Sync status:" $GOT_SYNC_STATUS
fi
# print logs
docker container logs $DAEMON_CONTAINER --tail 10

# "connection refused" until GraphQL server up
GOT_SYNC_STATUS=$(echo ${SYNC_STATUS} | grep "syncStatus")
if [ ! -z $GOT_SYNC_STATUS ]; then
echo $(date +'%Y-%m-%d %H:%M:%S') ". Sync status:" $GOT_SYNC_STATUS
fi

SYNCED=$(echo ${SYNC_STATUS} | grep -c "SYNCED")
sleep 5
SYNCED=$(echo ${SYNC_STATUS} | grep -c "SYNCED")
sleep 5
done
}

Expand Down
5 changes: 3 additions & 2 deletions buildkite/src/Command/Base.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ let Config =
, soft_fail : Optional B/SoftFail
, skip: Optional B/Skip
, `if` : Optional B/If
, timeout_in_minutes : Optional Natural
, timeout_in_minutes : Optional Integer
}
, default =
{ depends_on = [] : List TaggedKey.Type
Expand All @@ -119,7 +119,7 @@ let Config =
, soft_fail = None B/SoftFail
, skip = None B/Skip
, `if` = None B/If
, timeout_in_minutes = None Natural
, timeout_in_minutes = None Integer
}
}

Expand Down Expand Up @@ -156,6 +156,7 @@ let build : Config.Type -> B/Command.Type = \(c : Config.Type) ->
else Some (B/ArtifactPaths.String (SelectFiles.compile c.artifact_paths)),
key = Some c.key,
label = Some c.label,
timeout_in_minutes = c.timeout_in_minutes,
retry =
Some {
-- we only consider automatic retries
Expand Down
1 change: 1 addition & 0 deletions buildkite/src/Constants/DebianVersions.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ let minimalDirtyWhen = [
S.exactly "scripts/rebuild-deb" "sh",
S.exactly "scripts/release-docker" "sh",
S.exactly "buildkite/scripts/build-artifact" "sh",
S.exactly "buildkite/scripts/check-compatibility" "sh",
-- Snark profiler dirtyWhen
S.exactly "buildkite/src/Jobs/Test/RunSnarkProfiler" "dhall",
S.exactly "buildkite/scripts/run-snark-transaction-profiler" "sh",
Expand Down
3 changes: 2 additions & 1 deletion buildkite/src/Jobs/Test/BerkeleyCompatibility.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ in Pipeline.build Pipeline.Config::{
key = "berkeley-compatibilty-test",
target = Size.XLarge,
docker = None Docker.Type,
depends_on = dependsOn
depends_on = dependsOn,
timeout_in_minutes = Some +60
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion buildkite/src/Jobs/Test/DevelopCompatibility.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ in Pipeline.build Pipeline.Config::{
key = "develop-compatibilty-test",
target = Size.XLarge,
docker = None Docker.Type,
depends_on = dependsOn
depends_on = dependsOn,
timeout_in_minutes = Some +60
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion buildkite/src/Jobs/Test/Libp2pUnitTest.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Pipeline.build
key = "libp2p-bs-qc",
target = Size.Large,
docker = None Docker.Type,
timeout_in_minutes = Some 45
timeout_in_minutes = Some +45

}
]
Expand Down

0 comments on commit b155452

Please sign in to comment.