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

🎉 Source Oracle: Added support for connection via SSH tunnels #6356

Merged
merged 11 commits into from
Sep 24, 2021

Conversation

etsybaev
Copy link
Contributor

@etsybaev etsybaev commented Sep 21, 2021

What

The goal of this PR is to add SSH only for the Oracle Source. It does not try to deal with how it can be reused for other sources or destinations.
Took the concept of My PR for Oracle source

How

Handles injecting the SSH tunnel in the check, discover, read methods of Oracle source directly. This makes it relatively straightforward to inject without worrying about touching other jdbc dbs.

Tested with AWS EC2 bastion and RDS Oracle + test normal connection.

Got 2 new options to connect via SSH (with key or pass)
Selection_042
Selection_043

Here is what was in the source DB
Selection_044
Selection_046

Here is the result of data migration via SSH
Selection_045

Also checked that direct connection to DB still works:
Selection_047

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and 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.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions
  • Connector added to connector index like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and 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.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here

Connector Generator

  • 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.

@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Sep 21, 2021
@etsybaev etsybaev linked an issue Sep 21, 2021 that may be closed by this pull request
@jrhizor jrhizor temporarily deployed to more-secrets September 21, 2021 18:23 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 22, 2021 11:58 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 22, 2021 12:46 Inactive
@etsybaev etsybaev requested a review from sherifnada September 22, 2021 13:15
@etsybaev etsybaev changed the title [DRAFT_PR]🎉 Source Oracle: Added support for connection via SSH tunnels 🎉 Source Oracle: Added support for connection via SSH tunnels Sep 22, 2021
@etsybaev etsybaev marked this pull request as ready for review September 22, 2021 14:05
@etsybaev etsybaev temporarily deployed to more-secrets September 22, 2021 15:02 Inactive
@sherifnada
Copy link
Contributor

sherifnada commented Sep 22, 2021

/test connector=connectors/source-oracle

🕑 connectors/source-oracle https://github.com/airbytehq/airbyte/actions/runs/1262601110
❌ connectors/source-oracle https://github.com/airbytehq/airbyte/actions/runs/1262601110
🐛 https://gradle.com/s/wo54vxekbols6

@jrhizor jrhizor temporarily deployed to more-secrets September 22, 2021 16:18 Inactive
@@ -100,6 +100,23 @@ Your database user should now be ready for use with Airbyte.

Case sensitive. Defaults to the upper-cased user if empty. If the user does not have access to the configured schemas, no tables will be discovered.

## Connection to Oracle via an SSH Tunnel
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Connection to Oracle via an SSH Tunnel
## Connection via an SSH Tunnel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, thanks

5. `SSH Login Username` is the username that Airbyte should use when connection to the bastion server. This is NOT the Oracle username.
6. If you are using `Password Authentication`, then `SSH Login Username` should be set to the password of the User from the previous step. If you are using `SSH Key Authentication` leave this blank. Again, this is not the Oracle password, but the password for the OS-user that Airbyte is using to perform commands on the bastion.
7. If you are using `SSH Key Authentication`, then `SSH Private Key` should be set to the RSA Private Key that you are using to create the SSH connection. This should be the full contents of the key file starting with `-----BEGIN RSA PRIVATE KEY-----` and ending with `-----END RSA PRIVATE KEY-----`.


## Changelog
Copy link
Contributor

Choose a reason for hiding this comment

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

we should update changelog too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Sherif.
Sure, I was going to to update versions, changelog and secrets before publishing


@Override
public Path getConfigFilePath() {
return Path.of("secrets/ssh-pwd-config.json");
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this secret be injected in ci_credentials.sh? where is it being inserted in CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Sherif.
Sure, I was going to update versions, changelog, and secrets before publishing. Secrets themselves are already added to LastPass and GitHub like ORACLE_SSH_KEY_TEST_CREDS и ORACLE_SSH_PWD_TEST_CREDS.
For json file name, I just follow the pattern of how it was done in other connectors

@sherifnada
Copy link
Contributor

btw, great work on the screenshots! makes it very easy to see what's happening

@etsybaev etsybaev temporarily deployed to more-secrets September 22, 2021 17:08 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 22, 2021 17:27 Inactive
@github-actions github-actions bot added the CDK Connector Development Kit label Sep 22, 2021
@etsybaev etsybaev temporarily deployed to more-secrets September 22, 2021 17:43 Inactive
@etsybaev
Copy link
Contributor Author

etsybaev commented Sep 22, 2021

/test connector=connectors/source-oracle

🕑 connectors/source-oracle https://github.com/airbytehq/airbyte/actions/runs/1262916956
✅ connectors/source-oracle https://github.com/airbytehq/airbyte/actions/runs/1262916956
No Python unittests run

@jrhizor jrhizor temporarily deployed to more-secrets September 22, 2021 18:03 Inactive
@github-actions github-actions bot removed the CDK Connector Development Kit label Sep 23, 2021
@etsybaev etsybaev temporarily deployed to more-secrets September 23, 2021 06:38 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 23, 2021 08:35 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 23, 2021 09:04 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 23, 2021 11:15 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 23, 2021 14:50 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 24, 2021 07:39 Inactive
@etsybaev etsybaev temporarily deployed to more-secrets September 24, 2021 17:01 Inactive
@etsybaev
Copy link
Contributor Author

etsybaev commented Sep 24, 2021

/publish connector=connectors/source-oracle

🕑 connectors/source-oracle https://github.com/airbytehq/airbyte/actions/runs/1270785025
✅ connectors/source-oracle https://github.com/airbytehq/airbyte/actions/runs/1270785025

@jrhizor jrhizor temporarily deployed to more-secrets September 24, 2021 17:40 Inactive
@etsybaev etsybaev merged commit 6658ecd into master Sep 24, 2021
@etsybaev etsybaev deleted the etsybaev/5968-source-oracle-added-connection-via-ssh branch September 24, 2021 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support & test cases for Oracle Source via SSH tunnels
4 participants