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

implementation to run kube acceptance tests on GKE #4961

Merged
merged 24 commits into from
Jul 27, 2021

Conversation

subodh1810
Copy link
Contributor

@subodh1810 subodh1810 commented Jul 23, 2021

Issue : #4884
Tech spec: https://docs.google.com/document/d/170JgBmRJwkuGWNZxy41bkyd6z4hAkhuKbNhZtxFtaJo/edit#

Pre-merge Checklist

Expand the checklist which is relevant for this PR.

Connector checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • Secrets are annotated with airbyte_secret in the connector's spec
  • Credentials added to Github CI if needed and not already present. instructions for injecting secrets into CI.
  • Unit & integration tests added as appropriate (and are passing)
    • Community members: please provide proof of this succeeding locally e.g: screenshot or copy-paste acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • /test connector=connectors/<name> command as documented here is passing.
    • Community members can skip this, Airbyters will run this for you.
  • Code reviews completed
  • Documentation updated
    • README.md
    • docs/SUMMARY.md if it's a new connector
    • Created or updated reference docs in docs/integrations/<source or destination>/<name>.
    • Changelog in the appropriate page in docs/integrations/.... See changelog example
    • docs/integrations/README.md contains a reference to the new connector
    • Build status added to build page
  • Build is successful
  • Connector version bumped like described here
  • New Connector version released on Dockerhub by running the /publish command described here
  • No major blockers
  • PR merged into master branch
  • Follow up tickets have been created
  • Associated tickets have been closed & stakeholders notified

Connector Generator checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed.

@subodh1810 subodh1810 self-assigned this Jul 23, 2021
@subodh1810 subodh1810 requested review from davinchia and jrhizor July 23, 2021 23:04
@subodh1810 subodh1810 marked this pull request as ready for review July 23, 2021 23:04
@subodh1810 subodh1810 changed the title Run acceptance tests on gke implementation to run kube acceptance tests on GKE Jul 23, 2021
Copy link
Contributor

@davinchia davinchia left a comment

Choose a reason for hiding this comment

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

Looks good! Some minor comments.

This is currently configured to run on every build now. One thing to call out is our tiny GKE cluster probably won't support more than 3 tests running in parallel. I think this is fine if we are going to merge in on demand testing in the next few days. If not we should probably either make this scheduled instead of every build or merge in the on-demand command with this PR.

sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

# Set up kustomize
- name: Set up Kustomize
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to install Kustomize separately? shouldn't this come with Kubectl?

}

@AfterAll
public static void end() {
sourcePsql.stop();
if (IS_GKE && !IS_KUBE) {
throw new RuntimeException("KUBE Flag should also be enabled if GKE flag is enabled");
Copy link
Contributor

Choose a reason for hiding this comment

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

should this check be in the @BeforeAll method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes!


kubectl port-forward svc/postgres-destination-svc 3000:5432 --namespace=$NAMESPACE &

sleep 10s
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this sleep for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is cause I observed that even after starting the port-forwarding, it was taking a couple of seconds to re-route the traffic so I put 10 seconds just to be safe

}
return Jsons.jsonNode(dbConfig);
} catch (Exception e) {
throw new RuntimeException(e);
Copy link
Contributor

Choose a reason for hiding this comment

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

curious, why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@davinchia Oh no this was not removed, I just refactored methods and broke this into two. The new method localConfig returns a map and the JSON conversion is done in getDbConfig

@@ -487,3 +487,116 @@ jobs:
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
label: ${{ needs.start-kube-acceptance-test-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-kube-acceptance-test-runner.outputs.ec2-instance-id }}

start-gke-kube-acceptance-test-runner:
Copy link
Contributor

Choose a reason for hiding this comment

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

something that will go away once we move to on demand testing - running this on every build might overload the tiny GKE cluster we have now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh am going to add the master and cron condition in here. I have not added it cause I wanted to run this on the CI and see how it goes

@subodh1810
Copy link
Contributor Author

@davinchia I wanted to run the test on the CI thats why I have not made this scheduled yet. I plan to make this scheduled and only run on master branch

This is currently configured to run on every build now. One thing to call out is our tiny GKE cluster probably won't support more than 3 tests running in parallel. I think this is fine if we are going to merge in on demand testing in the next few days. If not we should probably either make this scheduled instead of every build or merge in the on-demand command with this PR.

@subodh1810 subodh1810 requested a review from davinchia July 27, 2021 08:09
@subodh1810 subodh1810 merged commit 13bc08c into master Jul 27, 2021
@subodh1810 subodh1810 deleted the run-acceptance-tests-on-gke branch July 27, 2021 08:47
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.

3 participants