-
Notifications
You must be signed in to change notification settings - Fork 724
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
30 changed files
with
1,672 additions
and
346 deletions.
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,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if ! [[ "$0" =~ scripts/build_xsvm_image.sh ]]; then | ||
echo "must be run from repository root" | ||
exit 255 | ||
fi | ||
|
||
# Directory above this script | ||
AVALANCHE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) | ||
|
||
# TODO(marun) This image name should be configurable | ||
DOCKER_IMAGE="localhost:5001/avalanchego" | ||
|
||
# Build the avalancehgo node image | ||
FORCE_TAG_LATEST=1 SKIP_BUILD_RACE=1 DOCKER_IMAGE="${DOCKER_IMAGE}" ./scripts/build_image.sh | ||
|
||
# TODO(marun) conditionally push the image to the registry | ||
GO_VERSION="$(go list -m -f '{{.GoVersion}}')" | ||
docker buildx build --build-arg GO_VERSION="${GO_VERSION}" --build-arg AVALANCHEGO_NODE_IMAGE="${DOCKER_IMAGE}" \ | ||
--push -t "${DOCKER_IMAGE}-xsvm" -f "${AVALANCHE_PATH}/vms/example/xsvm/Dockerfile" . |
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,54 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Run e2e tests against nodes deployed to a kind cluster. | ||
|
||
# TODO(marun) | ||
# - Support testing against a remote cluster | ||
# - Convert to golang to simplify reuse | ||
# - Make idempotent to simplify development and debugging | ||
|
||
if ! [[ "$0" =~ scripts/tests.e2e.kube.sh ]]; then | ||
echo "must be run from repository root" | ||
exit 255 | ||
fi | ||
|
||
./scripts/ensure_kube_cluster.sh | ||
|
||
KUBE_CONTEXT="${KUBE_CONTEXT:-kind-kind}" | ||
# TODO(marun) Make the namespace configurable | ||
NAMESPACE=tmpnet | ||
PATH="${PWD}/bin:$PATH" kubectl create namespace "${NAMESPACE}" || true | ||
|
||
if [[ -z "${SKIP_BUILD_IMAGE:-}" ]]; then | ||
bash -x ./scripts/build_xsvm_image.sh | ||
fi | ||
|
||
MONITORING_NAMESPACE=ci-monitoring | ||
PATH="${PWD}/bin:$PATH" kubectl create namespace "${MONITORING_NAMESPACE}" || true | ||
|
||
# Deploy promtail if credentials are available | ||
if [[ -n "${LOKI_USERNAME:-}" && -n "${LOKI_PASSWORD:-}" ]]; then | ||
kubectl --namespace="${MONITORING_NAMESPACE}" create secret generic loki-credentials \ | ||
--from-literal=username="${LOKI_USERNAME}" \ | ||
--from-literal=password="${LOKI_PASSWORD}" \ | ||
--dry-run=client -o yaml | kubectl apply -f - | ||
kubectl --namespace="${MONITORING_NAMESPACE}" apply -f ./tests/fixture/tmpnet/yaml/promtail-daemonset.yaml | ||
else | ||
echo "LOKI_USERNAME and LOKI_PASSWORD not set, skipping deployment of promtail" | ||
fi | ||
|
||
# Deploy prometheus agent if credentials are available | ||
if [[ -n "${PROMETHEUS_USERNAME:-}" && -n "${PROMETHEUS_PASSWORD:-}" ]]; then | ||
kubectl --namespace="${MONITORING_NAMESPACE}" create secret generic prometheus-credentials \ | ||
--from-literal=username="${PROMETHEUS_USERNAME}" \ | ||
--from-literal=password="${PROMETHEUS_PASSWORD}" \ | ||
--dry-run=client -o yaml | kubectl apply -f - | ||
kubectl --namespace="${MONITORING_NAMESPACE}" apply -f ./tests/fixture/tmpnet/yaml/prometheus-agent.yaml | ||
else | ||
echo "PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD not set, skipping deployment of prometheus agent" | ||
fi | ||
|
||
E2E_SERIAL=1 KUBECONFIG="${KUBECONFIG:-$HOME/.kube/config}" PATH="${PWD}/bin:$PATH" \ | ||
bash -x ./scripts/tests.e2e.sh --runtime=kube --image-name=localhost:5001/avalanchego-xsvm |
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
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
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.