Skip to content
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

Add E2E infra framework and test runner #1

Merged
merged 3 commits into from
Aug 5, 2022
Merged

Add E2E infra framework and test runner #1

merged 3 commits into from
Aug 5, 2022

Conversation

Callisto13
Copy link
Member

@Callisto13 Callisto13 commented Jul 29, 2022

3 commits adding the initial infra + runner for LM e2es.

Still to come in other PRs are:

Also will require liquidmetal-dev/cluster-api-provider-microvm#203 to be merged before this can start running automatically.

For now you can run this like so:

export METAL_AUTH_TOKEN=
export METAL_ORG_ID=
make all E2E_ARGS="--repo https://github.com/Callisto13/cluster-api-provider-microvm --branch e2e"

feat: Add terraform to create test infra

This commit duplicates some of the tf setup I had in my demo env. This
is fine for now, I will modularise this later so we don't have almost
the same thing twice but my priority right now is getting this merged
and running in CI.

The ./scripts/tf.sh has 3 options.

  • -v will produce a vars.json for subsequent terraform commands to
    use. It will check for a metro with capacity as well as some other
    validation.
  • -u (up) will run terraform apply with --auto-approve.
  • -d (down) will run terraform destroy with --auto-approve.

The infra which is created on Equinix is almost the same as that which I
use for my demos. The main change is that there is no VPN set up. This
is because the VPN I used required a manual step (clicking a button in
Tailscale to approve subnet routes) which would not work here as we want
everything automated. The VPN was needed in my demo so that CAPMVM
clusters could be created from a local workstation without a) exposing
the infra publicly, and b) without having to reserve a public address to
serve as workload clusters' VIP LB address.

There are likely other, automatable ways to do this here, but I decided
not to get into that right now. So the tests which will eventually be
run against these Equinix hosts will be running within an Equinix
machine themselves for the immediate future.


feat: Add tool to run E2Es on TF infra

This introduces a simple binary intended to be run after the terraform
infra has been provisioned which will:

  • Execute a remote command against one of the Equinix devices over
    SSH...
  • Clone CAPMVM onto that device at the repo/branch/version requested
  • Run the e2e tests, while streaming the output

Hopefully in the future it will be possible to run the e2es locally
while pointing at flintlocks running in Equinix, but I am punting that
networking stuff for a later date.


feat: Add Makefile

This adds a Makefile which ties it all together.

You can either run make all which will set-up, test, teardown all
in one, or you can make tf-up; make e2e; make tf-down separately (this
is useful if you want to reuse the same fl hosts between runs).

This commit duplicates some of the tf setup I had in my demo env. This
is fine for now, I will modularise this later so we don't have almost
the same thing twice but my priority right now is getting this merged
and running in CI.

The `./scripts/tf.sh` has 3 options.
- `-v` will produce a vars.json for subsequent terraform commands to
  use. It will check for a metro with capacity as well as some other
  validation.
- `-u` (up) will run `terraform apply` with `--auto-approve`.
- `-d` (down) will run `terraform destroy` with `--auto-approve`.

The infra which is created on Equinix is almost the same as that which I
use for my demos. The main change is that there is no VPN set up. This
is because the VPN I used required a manual step (clicking a button in
Tailscale to approve subnet routes) which would not work here as we want
everything automated. The VPN was needed in my demo so that CAPMVM
clusters could be created from a local workstation without a) exposing
the infra publicly, and b) without having to reserve a public address to
serve as workload clusters' VIP LB address.

There are likely other, automatable ways to do this here, but I decided
not to get into that right now. So the tests which will eventually be
run against these Equinix hosts will be running within an Equinix
machine themselves for the immediate future.
This introduces a simple binary intended to be run after the terraform
infra has been provisioned which will:
- Execute a remote command against one of the Equinix devices over
  SSH...
- Clone CAPMVM onto that device at the repo/branch/version requested
- Run the e2e tests, while streaming the output

Hopefully in the future it will be possible to run the e2es locally
while pointing at flintlocks running in Equinix, but I am punting that
networking stuff for a later date.
This adds a Makefile which ties it all together.

You can either run `make all` which will set-up, test, teardown all
in one, or you can `make tf-up; make e2e; make tf-down` separately (this
is useful if you want to reuse the same fl hosts between runs).
Copy link
Member

@richardcase richardcase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! ❤️ this

@Callisto13 Callisto13 merged commit 503cb37 into main Aug 5, 2022
@Callisto13 Callisto13 deleted the e2es branch August 5, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants