-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Use Terraform for System Testing #9009
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Absolutely! |
HashiCorp recently added a clause to their term of evaluation that forbids the usage of their enterprise software in China. While this may or may not affect this proposal, it does pose potential legal risk to contributors in China. Update: |
In my opinion it depends... Is creating a single GCS bucket worth adding terraform? However, I fully support the idea for usting terraform to setup complex environment. |
Fully Agree with Tomek. Especially with some setup/teardown that is quick and can be repeated for each test every time, using terraform makes no sense. But when you have longer setup that is more complex and takes quite some time, this might be definitely worthwhile. The usual scenario for that will be a) create the environment -> terraform script b) iterate on the tests d) tear-down the environment (using terraform script to delete the environment). This already pretty much reflects our complex "helpers" for system tests - basically when we really need a helper, seems that terraform scripts might to better job. |
So what I have in mind is that the What we could also do would be only running the terraform init for
@turbaszek in my opinion we should do it consistenly for all example_dags. Do you think it would be slow or just superfluous? Or what is your concern? |
I like this idea!
My main concern is that normally I would never use terraform to create single bucket. But it's not a strong opinion. I'm in favor of unified and opinionated approach 👌
Theoretically |
I have a question: When I am adding terraform to airflow and I want it through docker like it was done here what volumes should I mount? I need to mount the .aws, .azure, etc. folder but also the folders containing the .tf files. How should I do it? Mount the whole airflow dir? WDYT? @potiuk @turbaszek :) |
Yeah. Airflow sources are best. But for that, you will need to create a HOST_AIRFLOW_SOURCES variable (similarly as I do with HOST_HOME) as an environment variable and mount it as |
And BTW. IT would be great to also add this mapping -v ${HOST_ARIFLOW_SOURCES}:/opt/airflow also to the other commands. We might wan to upload stuff to gcloud/aws as well. |
Terraform was introduced during #8877 For further integration i.e. automatisation of system tests we can also use terraform but that should be a separate issue. |
Description
As @ashb @potiuk and me already shortly discussed in a slack thread..
We could use terraform for testing Airflow integrations with real services from providers.
Key benefits:
I didn't think about the implementation details (pytest + terraform) yet, but I think it would make it a lot easier using terraform instead of having to write a lot of system helper classes in python.
EDIT:
Some interesting resources:
The text was updated successfully, but these errors were encountered: