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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connector development on Windows #13674

Open
LarsHanegraaf opened this issue Jun 10, 2022 · 5 comments
Open

Connector development on Windows #13674

LarsHanegraaf opened this issue Jun 10, 2022 · 5 comments
Labels
area/documentation Improvements or additions to documentation autoteam CDK Connector Development Kit community team/documentation type/enhancement New feature or request

Comments

@LarsHanegraaf
Copy link

Update the documentation to make development of connectors on Windows easier

Hi team,

First of all, credits to where the Airbyte product is so far! 馃帀

This week I went through the process of creating an Airbyte Source connector on a Windows PC (It's what our company works with 馃槈). I would like to report the things I have found and how the process could be improved for other people who go through a similar workflow. I'm willing to submit PRs for the documentation and Airbyte itself, but as it is the first time I contribute to an open-source project, I need some guidance on whether it will be helpful for Airbyte or not. Thanks!

Things I've found:

1. Documentation about developing a Python Source is complete, but scattered

The documentation to develop a Python Source is complete, but as there are multiple pages with different approaches, it can be confusing for a newcomer (at least within my team). I know that the process around building a connector is evolving, but I think more consistency would help to improve the Developer Experience.

Examples that could use more consistency:

2. Code generation scripts are tailored towards Unix

All scripts for generating Python boilerplate code are heavily geared towards Unix. I can reverse engineer the proposed working of a Bash script myself, so I can run it in Powershell or CMD, but maybe the process could be changed so it works for all platforms (or add steps to the documentation, I'm not sure what has priority in your opnion)

The steps I have taken to make it work:

  1. Have Python 3.9 (important, but not documented in the README of the CDK), and Node installed.
  2. Clone the Airbyte repo
  3. Go to the generator folder.
  4. Run npm install and npm run generate (Docker will also be possible, using the command in generate.sh, but this one is easier for me)
  5. Follow the instructions of the generator
  6. Go to the folder that is generated for you
  7. In that folder run python -m venv .venv
  8. When you're on Powershell, run .venv/Scripts/activate to activate the virtual environment.
  9. Install dependencies using python -m pip install -r requirements.txt
  10. Install the source-acceptance-test plugin by navigating to this folder with the virtual environment still activated and run python setup.py install
  11. Navigate back to the connector folder
  12. Run pip install '.[tests]'

3. Bugs in source-acceptance-test Pytest plugin when running on Windows

When you want to run the source acceptance tests on Windows, I was only able to get it working within the virtual environment (not in Docker, but unsure why).

In order to make the tests work in the virtual environment, I had to change to following things:

  • Change this line to streams_without_records = streams_without_records - set(allowed_empty_streams)
  • Change this line to run(["mkdir", "-p", LOG_DIR], shell=True).
  • Remove pytest-sugar as dependency, due to this bug on Windows. (using pip uninstall pytest-sugar)

It has become a bit longer than expected 馃槢 . So if I need to split it into multiple issues, just let me know!

Thanks!

@djongeb
Copy link

djongeb commented Jun 12, 2022

@LarsHanegraaf Thanks for this little writeup. I've been struggling to find information on how to develop your own connector whilst using windows. This has been very helpful and I would agree with you, that there could be more information on how to use windows! :D

@marcosmarxm marcosmarxm added CDK Connector Development Kit team/extensibility labels Jun 22, 2022
@marcosmarxm
Copy link
Member

@Amruta-Ranade + @arimbr maybe something we can bring to content team to work on?

@marcosmarxm
Copy link
Member

@LarsHanegraaf thanks for the suggestion probably this will help a large number of users of Airbyte.

@francesco-av
Copy link

@LarsHanegraaf Thanks for this little writeup. I've been struggling to find information on how to develop your own connector whilst using windows. This has been very helpful and I would agree with you, that there could be more information on how to use windows! :D

@djongeb I was wondering if you ever found clearer documentation / guides for Windows? I am struggling to execute several of the Linux commands and had to add the source manually for example.

@natikgadzhi
Copy link
Contributor

@LarsHanegraaf belated thank you for the writeup, it's excellent. I agree the docs are very scattered 鈥斅爓orking on them more now.

I'll keep the issue open to track any Windows-related questions. Windows workflow is not necessarily a priority right away.

If anyone recently made basic workflows work on Windows, and you had to tweak any tests to do that (they changed since 2022 very significantly) 鈥斅燾ontributions are very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation autoteam CDK Connector Development Kit community team/documentation type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants