Skip to content

[ci] Add test binary and image to support bootstrap testing #3352

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

Merged
merged 32 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1a7490a
[testing] Add bootstrap monitor to enable continuous bootstrap testing
maru-ava Sep 4, 2024
79e951f
fixup: More cleanup
maru-ava Sep 10, 2024
20d4c31
fixup: Still more cleanup
maru-ava Sep 10, 2024
f8c9e1b
fixup: Switch to zap logging for consistency with avalanchego
maru-ava Sep 11, 2024
f001ab8
fixup: Cleanup common.go
maru-ava Sep 11, 2024
50cd35c
fixup: Cleanup wait.go
maru-ava Sep 11, 2024
f6d9a84
fixup: Cleanup init.go
maru-ava Sep 11, 2024
5869b08
fixup: Fix description for init command
maru-ava Sep 11, 2024
0fe3dfc
fixup: Update logger to dump to stdout
maru-ava Sep 11, 2024
82d7b89
fixup: Remove redundant README content
maru-ava Sep 11, 2024
eeee2e1
fixup: Address lint failure
maru-ava Sep 11, 2024
94a5996
fixup: README cleanup
maru-ava Sep 12, 2024
afb8f5f
fixup: s/kubeConfig/kubeconfig/
maru-ava Sep 12, 2024
68be8af
fixup: Add arch section to README
maru-ava Sep 12, 2024
c587bdf
fixup: Add explanatory paragraph
maru-ava Sep 12, 2024
af739f4
fixup: s/sidepod/sidecar/
maru-ava Sep 12, 2024
d168ad1
fixup: Add config.EnvVarName
maru-ava Sep 14, 2024
0e7eba5
fixup: Add bootstrap test configuration
maru-ava Sep 14, 2024
6128424
fixup: Include duration and disk usage in completion log
maru-ava Sep 14, 2024
fcdf0e4
fixup: Add json field names to BootstrapTestConfig struct
maru-ava Sep 16, 2024
75acdaa
fixup: Finalize README
maru-ava Sep 17, 2024
f4e2fa4
fixup: More README cleanup
maru-ava Sep 17, 2024
fcfec8e
fixup: Address README inconsistency
maru-ava Sep 17, 2024
2286e2d
fixup: Update node container name to match deployed name
maru-ava Sep 20, 2024
bf16abe
fixup: Respond to review feedback
maru-ava Oct 1, 2024
91e9170
Update tests/fixture/bootstrapmonitor/cmd/main.go
maru-ava Oct 1, 2024
953b96b
Update tests/fixture/bootstrapmonitor/bootstrap_test_config.go
maru-ava Oct 1, 2024
f8c927b
Update tests/fixture/bootstrapmonitor/bootstrap_test_config.go
maru-ava Oct 1, 2024
7da8fdd
Update tests/fixture/bootstrapmonitor/e2e/e2e_test.go
maru-ava Oct 1, 2024
49b788d
fixup: Respond to review feedback
maru-ava Oct 1, 2024
398c43e
fixup: README cleanup
maru-ava Oct 1, 2024
1f997f0
fixup: Ensure correct format directive for error
maru-ava Oct 1, 2024
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
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,12 @@ jobs:
run: bash -x scripts/tests.build_antithesis_images.sh
env:
TEST_SETUP: xsvm
e2e_bootstrap_monitor:
name: Run bootstrap monitor e2e tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- name: Run e2e tests
shell: bash
run: bash -x ./scripts/tests.e2e.bootstrap_monitor.sh
8 changes: 8 additions & 0 deletions .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ jobs:
DOCKER_USERNAME: ${{ secrets.docker_username }}
DOCKER_PASS: ${{ secrets.docker_pass }}
DOCKER_IMAGE: ${{ secrets.docker_repo }}
BUILD_MULTI_ARCH: 1
run: scripts/build_image.sh
- name: Build and publish bootstrap-monitor image to DockerHub
env:
DOCKER_USERNAME: ${{ secrets.docker_username }}
DOCKER_PASS: ${{ secrets.docker_pass }}
DOCKER_IMAGE: avaplatform/bootstrap-monitor
BUILD_MULTI_ARCH: 1
run: scripts/build_bootstrap_monitor_image.sh
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ RUN [ -d ./build ] && rm -rf ./build/* || true
# Build avalanchego. The build environment is configured with build_env.sh from the step
# enabling cross-compilation.
ARG RACE_FLAG=""
ARG BUILD_SCRIPT=build.sh
RUN . ./build_env.sh && \
echo "{CC=$CC, TARGETPLATFORM=$TARGETPLATFORM, BUILDPLATFORM=$BUILDPLATFORM}" && \
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
./scripts/build.sh ${RACE_FLAG}
./scripts/${BUILD_SCRIPT} ${RACE_FLAG}

# Create this directory in the builder to avoid requiring anything to be executed in the
# potentially emulated execution container.
Expand Down
5 changes: 5 additions & 0 deletions config/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const EnvPrefix = "avago"

var DashesToUnderscores = strings.NewReplacer("-", "_")

func EnvVarName(prefix string, key string) string {
// e.g. MY_PREFIX, network-id -> MY_PREFIX_NETWORK_ID
return strings.ToUpper(prefix + "_" + DashesToUnderscores.Replace(key))
}

// BuildViper returns the viper environment from parsing config file from
// default search paths and any parsed command line flags
func BuildViper(fs *pflag.FlagSet, args []string) (*viper.Viper, error) {
Expand Down
29 changes: 28 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/rpc v1.2.0
github.com/gorilla/websocket v1.4.2
github.com/gorilla/websocket v1.5.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/holiman/uint256 v1.2.4
github.com/huin/goupnp v1.3.0
Expand Down Expand Up @@ -69,6 +69,10 @@ require (
google.golang.org/protobuf v1.34.2
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)

require (
Expand Down Expand Up @@ -96,6 +100,7 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/frankban/quicktest v1.14.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand All @@ -105,30 +110,44 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/pointerstructure v1.2.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
Expand Down Expand Up @@ -156,11 +175,19 @@ require (
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading
Loading