kapitan icon indicating copy to clipboard operation
kapitan copied to clipboard

Kapitan depends on azure.keyvault.v2016_10_01 explicitly

Open sodul opened this issue 3 years ago • 3 comments

Describe the bug/feature The Azure SDK ships with copies of the SDKs all the back to 2015, this makes the Azure directory under site-packages to be close to 700MB, and growing. In most case these very old directories are useless and cause docker images to be needlessly very large. Most projects do not pin to specific version of the obsolete SDKs, but kapitan does.

To Reproduce Steps to reproduce the behavior:

  1. Delete the site-packages/azure/keyvault/v2016_10_01 directory.
  2. run kapitan -h
  3. Stacktrace
Traceback (most recent call last):
  File "/Users/me/.pyenv/versions/3.9.6/bin/kapitan", line 5, in <module>
    from kapitan.cli import main
  File "/Users/me/.pyenv/versions/3.9.6/lib/python3.9/site-packages/kapitan/cli.py", line 24, in <module>
    from kapitan.refs.cmd_parser import handle_refs_command
  File "/Users/me/.pyenv/versions/3.9.6/lib/python3.9/site-packages/kapitan/refs/cmd_parser.py", line 14, in <module>
    from kapitan.refs.secrets.azkms import AzureKMSSecret
  File "/Users/me/.pyenv/versions/3.9.6/lib/python3.9/site-packages/kapitan/refs/secrets/azkms.py", line 7, in <module>
    from azure.keyvault.keys.crypto import CryptographyClient, EncryptionAlgorithm
  File "/Users/me/.pyenv/versions/3.9.6/lib/python3.9/site-packages/azure/keyvault/__init__.py", line 25, in <module>
    from .key_vault_client import KeyVaultClient
  File "/Users/me/.pyenv/versions/3.9.6/lib/python3.9/site-packages/azure/keyvault/key_vault_client.py", line 22, in <module>
    from azure.keyvault.v2016_10_01.version import VERSION as v2016_10_01_VERSION
ModuleNotFoundError: No module named 'azure.keyvault.v2016_10_01'

Expected behavior Kapitan should not be pinned to an SDK from 2016. A workaround is to ln -s v7_0 v2016_10_01 so kapitan can run for us without having to make our docker images larger.

** If it's a bug (please complete the following information):**

  • python --version: Python 3.9.6
  • pip3 --version: pip 21.2.1
  • kapitan==0.29.5
  • Using pyenv

Additional context https://github.com/Azure/azure-sdk-for-python/issues/17801

sodul avatar Aug 05 '21 20:08 sodul

Hey @sodul thanks for opening the issue and sorry for the delay! I completely agree, this is largely outdated. I honestly don't use azure myself so it's not on top of my mind. I think it makes sense to move azkms (and others) as package extras instead. What do you think?

ramaro avatar Nov 28 '21 18:11 ramaro

Sounds good. I do not use the project that frequently myself so I would not be able to give the best advice.

sodul avatar Nov 28 '21 19:11 sodul