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 note about TF_PLUGIN_CACHE_DIR #972

Merged
merged 3 commits into from Nov 14, 2022

Conversation

wiktorn
Copy link
Collaborator

@wiktorn wiktorn commented Nov 12, 2022

I noticed that tests on my laptop worked very slow, especially compared to GitHub workflows or my workstation.

For example, on my laptop (connected through medium bandwidth, high latency 3G connection) speedup is 26x :

pytest tests/blueprints
=============================== 41 passed, 1 warning in 4182.25s (1:09:42) ===============================

vs:

TF_PLUGIN_CACHE_DIR=/tmp/tfcache pytest tests/blueprints
=============================== 41 passed, 1 warning in 159.37s (0:02:39) ===============================

On my workstation, the speed up is not so drastic, but stil significant (1.58x faster):

/usr/bin/time  pytest tests/blueprints
=============================== 41 passed, 1 warning in 315.45s (0:05:15) ===============================
324.84user 75.50system 5:15.75elapsed 126%CPU (0avgtext+0avgdata 153676maxresident)k
0inputs+15606560outputs (17major+1854428minor)pagefaults 0swaps

vs:

TF_PLUGIN_CACHE_DIR=/tmp/tfcache /usr/bin/time pytest tests/blueprints/
=============================== 41 passed, 1 warning in 199.81s (0:03:19) ===============================
270.63user 37.29system 3:20.12elapsed 153%CPU (0avgtext+0avgdata 153336maxresident)k
0inputs+493496outputs (5major+1822243minor)pagefaults 0swaps

I think it is at least worth mentioning in the documentation or implementation in conftest.py. Any ideas which directory would be the best to use for this purpose?

@juliocc
Copy link
Collaborator

juliocc commented Nov 12, 2022

Thanks @wiktorn. Nice addition to the contributing guide.

FWIW I have this in my terraformrc

plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"

@ludoo
Copy link
Collaborator

ludoo commented Nov 12, 2022

Thanks @wiktorn. Nice addition to the contributing guide.

FWIW I have this in my terraformrc

plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"

same here :)

@wiktorn wiktorn merged commit 9292661 into GoogleCloudPlatform:master Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants