자바스크립트를 활성화 해주세요

d096 openstack keystone을 windows에서 구동시켜본 적이 있습니다

 ·  ☕ 12 min read

2018년 qiita라고 하는 일본의 개발자 커뮤니티에서 글을 기재한 적이 있는데, OpenStack keystoneをwindowsで構築してみた 에서 keystone을 윈도우즈에서 구동시켜 본 경험을 적어본 것이었습니다.

왜 했을까.. 뭔가 이유가 있었는데, 한 동안 관계된 일을 하지 않아서 잊고 있었습니다.

윈도우즈에 구축한 이유는 회사에서 지급된 컴퓨터였기 때문에 (늘 사용하는 환경이기 때문에) 윈도우즈를 사용했었던 것 같고, 구동해본 이유는 identity v3의 사양을 확인하기 위해서 였나? 그랬던 것 같습니다.

conda 환경을 사용했고, pycharm으로 break point를 잡아서 디버깅 해 본 겅험입니다.

keystone 설치

처음부터 다시 해봤습니다.

PS C:\temp\keystone> conda create -n openstack
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\tkim20201124\scoop\apps\miniconda3\current\envs\openstack



Proceed ([y]/n)?

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate openstack
#
# To deactivate an active environment, use
#
#     $ conda deactivate

PS C:\temp\keystone> conda activate openstack
PS C:\temp\keystone> pip install -e .
Obtaining file:///C:/temp/keystone
Collecting pbr!=2.1.0,>=2.0.0
  Using cached pbr-5.6.0-py2.py3-none-any.whl (111 kB)
Collecting WebOb>=1.7.1
  Downloading WebOb-1.8.7-py2.py3-none-any.whl (114 kB)
     |████████████████████████████████| 114 kB 6.4 MB/s
Collecting Flask!=0.11,>=1.0.2
  Downloading Flask-2.0.1-py3-none-any.whl (94 kB)
     |████████████████████████████████| 94 kB 1.6 MB/s
Collecting Flask-RESTful>=0.3.5
  Downloading Flask_RESTful-0.3.9-py2.py3-none-any.whl (25 kB)
Requirement already satisfied: cryptography>=2.7 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from keystone==20.0.0.0rc2.dev3) (3.4.7)
Collecting SQLAlchemy>=1.3.0
  Downloading SQLAlchemy-1.4.25-cp39-cp39-win_amd64.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
Collecting sqlalchemy-migrate>=0.13.0
  Downloading sqlalchemy_migrate-0.13.0-py2.py3-none-any.whl (109 kB)
     |████████████████████████████████| 109 kB 6.4 MB/s
Collecting stevedore>=1.20.0
  Downloading stevedore-3.4.0-py3-none-any.whl (49 kB)
     |████████████████████████████████| 49 kB 2.7 MB/s
Collecting passlib>=1.7.0
  Downloading passlib-1.7.4-py2.py3-none-any.whl (525 kB)
     |████████████████████████████████| 525 kB 6.4 MB/s
Collecting python-keystoneclient>=3.8.0
  Downloading python_keystoneclient-4.3.0-py3-none-any.whl (397 kB)
     |████████████████████████████████| 397 kB 6.4 MB/s
Collecting keystonemiddleware>=7.0.0
  Downloading keystonemiddleware-9.3.0-py3-none-any.whl (119 kB)
     |████████████████████████████████| 119 kB ...
Collecting bcrypt>=3.1.3
  Downloading bcrypt-3.2.0-cp36-abi3-win_amd64.whl (28 kB)
Collecting scrypt>=0.8.0
  Downloading scrypt-0.8.18-cp39-cp39-win_amd64.whl (42 kB)
     |████████████████████████████████| 42 kB 641 kB/s
Collecting oslo.cache>=1.26.0
  Downloading oslo.cache-2.8.1-py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 2.5 MB/s
Collecting oslo.config>=6.8.0
  Downloading oslo.config-8.7.1-py3-none-any.whl (128 kB)
     |████████████████████████████████| 128 kB 6.4 MB/s
Collecting oslo.context>=2.22.0
  Downloading oslo.context-3.3.1-py3-none-any.whl (19 kB)
Collecting oslo.messaging>=5.29.0
  Downloading oslo.messaging-12.9.1-py3-none-any.whl (250 kB)
     |████████████████████████████████| 250 kB ...
Collecting oslo.db>=6.0.0
  Downloading oslo.db-11.0.0-py3-none-any.whl (176 kB)
     |████████████████████████████████| 176 kB 6.4 MB/s
Collecting oslo.i18n>=3.15.3
  Downloading oslo.i18n-5.1.0-py3-none-any.whl (46 kB)
     |████████████████████████████████| 46 kB 1.7 MB/s
Collecting oslo.log>=3.44.0
  Downloading oslo.log-4.6.0-py3-none-any.whl (71 kB)
     |████████████████████████████████| 71 kB ...
Collecting oslo.middleware>=3.31.0
  Downloading oslo.middleware-4.4.0-py3-none-any.whl (65 kB)
     |████████████████████████████████| 65 kB ...
Collecting oslo.policy>=3.7.0
  Downloading oslo.policy-3.8.2-py3-none-any.whl (86 kB)
     |████████████████████████████████| 86 kB 2.5 MB/s
Collecting oslo.serialization!=2.19.1,>=2.18.0
  Downloading oslo.serialization-4.2.0-py3-none-any.whl (25 kB)
Collecting oslo.upgradecheck>=1.3.0
  Downloading oslo.upgradecheck-1.4.0-py3-none-any.whl (14 kB)
Collecting oslo.utils>=3.33.0
  Downloading oslo.utils-4.10.0-py3-none-any.whl (101 kB)
     |████████████████████████████████| 101 kB 6.4 MB/s
Collecting oauthlib>=0.6.2
  Downloading oauthlib-3.1.1-py2.py3-none-any.whl (146 kB)
     |████████████████████████████████| 146 kB 6.8 MB/s
Collecting pysaml2>=5.0.0
  Downloading pysaml2-7.0.1-py2.py3-none-any.whl (398 kB)
     |████████████████████████████████| 398 kB ...
Collecting PyJWT>=1.6.1
  Downloading PyJWT-2.1.0-py3-none-any.whl (16 kB)
Collecting dogpile.cache>=1.0.2
  Downloading dogpile.cache-1.1.4-py3-none-any.whl (50 kB)
     |████████████████████████████████| 50 kB ...
Requirement already satisfied: jsonschema>=3.2.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from keystone==20.0.0.0rc2.dev3) (3.2.0)
Collecting pycadf!=2.0.0,>=1.1.0
  Downloading pycadf-3.1.1-py3-none-any.whl (39 kB)
Collecting msgpack>=0.5.0
  Downloading msgpack-1.0.2-cp39-cp39-win_amd64.whl (68 kB)
     |████████████████████████████████| 68 kB 4.8 MB/s
Collecting osprofiler>=1.4.0
  Downloading osprofiler-3.4.2-py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 2.6 MB/s
Collecting pytz>=2013.6
  Downloading pytz-2021.1-py2.py3-none-any.whl (510 kB)
     |████████████████████████████████| 510 kB ...
Requirement already satisfied: six>=1.4.1 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from bcrypt>=3.1.3->keystone==20.0.0.0rc2.dev3) (1.16.0)
Requirement already satisfied: cffi>=1.1 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from bcrypt>=3.1.3->keystone==20.0.0.0rc2.dev3) (1.14.6)
Requirement already satisfied: pycparser in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from cffi>=1.1->bcrypt>=3.1.3->keystone==20.0.0.0rc2.dev3) (2.20)
Requirement already satisfied: decorator>=4.0.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from dogpile.cache>=1.0.2->keystone==20.0.0.0rc2.dev3) (5.0.9)
Collecting Werkzeug>=2.0
  Downloading Werkzeug-2.0.1-py3-none-any.whl (288 kB)
     |████████████████████████████████| 288 kB 6.4 MB/s
Requirement already satisfied: click>=7.1.2 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from Flask!=0.11,>=1.0.2->keystone==20.0.0.0rc2.dev3) (8.0.1)
Collecting itsdangerous>=2.0
  Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Requirement already satisfied: Jinja2>=3.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from Flask!=0.11,>=1.0.2->keystone==20.0.0.0rc2.dev3) (3.0.1)
Requirement already satisfied: colorama in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from click>=7.1.2->Flask!=0.11,>=1.0.2->keystone==20.0.0.0rc2.dev3) (0.4.4)
Collecting aniso8601>=0.82
  Downloading aniso8601-9.0.1-py2.py3-none-any.whl (52 kB)
     |████████████████████████████████| 52 kB 621 kB/s
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from Jinja2>=3.0->Flask!=0.11,>=1.0.2->keystone==20.0.0.0rc2.dev3) (2.0.1)
Requirement already satisfied: pyrsistent>=0.14.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from jsonschema>=3.2.0->keystone==20.0.0.0rc2.dev3) (0.18.0)
Requirement already satisfied: attrs>=17.4.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from jsonschema>=3.2.0->keystone==20.0.0.0rc2.dev3) (21.2.0)
Requirement already satisfied: setuptools in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from jsonschema>=3.2.0->keystone==20.0.0.0rc2.dev3) (52.0.0.post20210125)
Requirement already satisfied: requests>=2.14.2 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from keystonemiddleware>=7.0.0->keystone==20.0.0.0rc2.dev3) (2.26.0)
Collecting keystoneauth1>=3.12.0
  Downloading keystoneauth1-4.4.0-py3-none-any.whl (314 kB)
     |████████████████████████████████| 314 kB ...
Collecting os-service-types>=1.2.0
  Downloading os_service_types-1.7.0-py2.py3-none-any.whl (24 kB)
Collecting iso8601>=0.1.11
  Downloading iso8601-0.1.16-py2.py3-none-any.whl (10 kB)
Collecting rfc3986>=1.2.0
  Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
Collecting PyYAML>=5.1
  Downloading PyYAML-5.4.1-cp39-cp39-win_amd64.whl (213 kB)
     |████████████████████████████████| 213 kB ...
Collecting debtcollector>=1.2.0
  Downloading debtcollector-2.3.0-py3-none-any.whl (23 kB)
Collecting netaddr>=0.7.18
  Downloading netaddr-0.8.0-py2.py3-none-any.whl (1.9 MB)
     |████████████████████████████████| 1.9 MB 6.4 MB/s
Collecting wrapt>=1.7.0
  Downloading wrapt-1.12.1.tar.gz (27 kB)
Collecting testscenarios>=0.4
  Downloading testscenarios-0.5.0-py2.py3-none-any.whl (21 kB)
Collecting testresources>=2.0.0
  Downloading testresources-2.0.1-py2.py3-none-any.whl (36 kB)
Collecting alembic>=0.9.6
  Downloading alembic-1.7.3-py3-none-any.whl (208 kB)
     |████████████████████████████████| 208 kB ...
Collecting Mako
  Downloading Mako-1.1.5-py2.py3-none-any.whl (75 kB)
     |████████████████████████████████| 75 kB 2.0 MB/s
Requirement already satisfied: python-dateutil>=2.7.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from oslo.log>=3.44.0->keystone==20.0.0.0rc2.dev3) (2.8.2)
Collecting cachetools>=2.0.0
  Downloading cachetools-4.2.4-py3-none-any.whl (10 kB)
Collecting oslo.metrics>=0.2.1
  Downloading oslo.metrics-0.3.0-py3-none-any.whl (13 kB)
Collecting futurist>=1.2.0
  Downloading futurist-2.4.0-py3-none-any.whl (37 kB)
Collecting kombu>=4.6.6
  Downloading kombu-5.1.0-py3-none-any.whl (187 kB)
     |████████████████████████████████| 187 kB ...
Collecting oslo.service!=1.28.1,>=1.24.0
  Downloading oslo.service-2.6.0-py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 2.8 MB/s
Collecting amqp>=2.5.2
  Downloading amqp-5.0.6-py3-none-any.whl (53 kB)
     |████████████████████████████████| 53 kB 970 kB/s
Collecting vine==5.0.0
  Downloading vine-5.0.0-py2.py3-none-any.whl (9.4 kB)
Requirement already satisfied: prometheus-client>=0.6.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from oslo.metrics>=0.2.1->oslo.messaging>=5.29.0->keystone==20.0.0.0rc2.dev3) (0.11.0)
Collecting statsd>=3.2.1
  Downloading statsd-3.3.0-py2.py3-none-any.whl (11 kB)
Collecting Routes>=2.3.1
  Downloading Routes-2.5.1-py2.py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB ...
Collecting greenlet>=0.4.15
  Downloading greenlet-1.1.2-cp39-cp39-win_amd64.whl (101 kB)
     |████████████████████████████████| 101 kB 6.8 MB/s
Collecting PasteDeploy>=1.5.0
  Downloading PasteDeploy-2.1.1-py2.py3-none-any.whl (17 kB)
Collecting fixtures>=3.0.0
  Downloading fixtures-3.0.0-py2.py3-none-any.whl (67 kB)
     |████████████████████████████████| 67 kB 2.8 MB/s
Collecting eventlet>=0.25.2
  Downloading eventlet-0.32.0-py2.py3-none-any.whl (225 kB)
     |████████████████████████████████| 225 kB ...
Collecting oslo.concurrency>=3.25.0
  Downloading oslo.concurrency-4.4.1-py3-none-any.whl (47 kB)
     |████████████████████████████████| 47 kB 3.4 MB/s
Collecting Yappi>=1.0
  Downloading yappi-1.3.2.tar.gz (58 kB)
     |████████████████████████████████| 58 kB 4.1 MB/s
Collecting Paste>=2.0.2
  Downloading Paste-3.5.0-py2.py3-none-any.whl (593 kB)
     |████████████████████████████████| 593 kB ...
Collecting dnspython>=1.15.0
  Downloading dnspython-2.1.0-py3-none-any.whl (241 kB)
     |████████████████████████████████| 241 kB ...
Collecting testtools>=0.9.22
  Downloading testtools-2.5.0-py3-none-any.whl (181 kB)
     |████████████████████████████████| 181 kB ...
Collecting fasteners>=0.7.0
  Downloading fasteners-0.16.3-py2.py3-none-any.whl (28 kB)
Collecting PrettyTable>=0.7.1
  Downloading prettytable-2.2.1-py3-none-any.whl (23 kB)
Collecting netifaces>=0.10.4
  Downloading netifaces-0.11.0.tar.gz (30 kB)
Requirement already satisfied: pyparsing>=2.1.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from oslo.utils>=3.33.0->keystone==20.0.0.0rc2.dev3) (2.4.7)
Requirement already satisfied: packaging>=20.4 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from oslo.utils>=3.33.0->keystone==20.0.0.0rc2.dev3) (21.0)
Requirement already satisfied: wcwidth in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from PrettyTable>=0.7.1->oslo.upgradecheck>=1.3.0->keystone==20.0.0.0rc2.dev3) (0.2.5)
Requirement already satisfied: pyOpenSSL in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from pysaml2>=5.0.0->keystone==20.0.0.0rc2.dev3) (20.0.1)
Collecting importlib-resources
  Downloading importlib_resources-5.2.2-py3-none-any.whl (27 kB)
Collecting xmlschema>=1.2.1
  Downloading xmlschema-1.8.0-py3-none-any.whl (262 kB)
     |████████████████████████████████| 262 kB 6.8 MB/s
Requirement already satisfied: defusedxml in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from pysaml2>=5.0.0->keystone==20.0.0.0rc2.dev3) (0.7.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from requests>=2.14.2->keystonemiddleware>=7.0.0->keystone==20.0.0.0rc2.dev3) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from requests>=2.14.2->keystonemiddleware>=7.0.0->keystone==20.0.0.0rc2.dev3) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from requests>=2.14.2->keystonemiddleware>=7.0.0->keystone==20.0.0.0rc2.dev3) (3.2)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from requests>=2.14.2->keystonemiddleware>=7.0.0->keystone==20.0.0.0rc2.dev3) (2.0.4)
Collecting repoze.lru>=0.3
  Downloading repoze.lru-0.7-py3-none-any.whl (10 kB)
Collecting sqlparse
  Downloading sqlparse-0.4.2-py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 3.2 MB/s
Collecting Tempita>=0.4
  Downloading Tempita-0.5.2-py3-none-any.whl (12 kB)
Collecting extras>=1.0.0
  Downloading extras-1.0.0-py2.py3-none-any.whl (7.3 kB)
Collecting elementpath<3.0.0,>=2.2.2
  Downloading elementpath-2.3.2-py3-none-any.whl (155 kB)
     |████████████████████████████████| 155 kB ...
Requirement already satisfied: zipp>=3.1.0 in c:\users\tkim20201124\scoop\apps\miniconda3\4.10.3\lib\site-packages (from importlib-resources->pysaml2>=5.0.0->keystone==20.0.0.0rc2.dev3) (3.5.0)
Building wheels for collected packages: netifaces, wrapt, Yappi
  Building wheel for netifaces (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\tkim20201124\scoop\apps\miniconda3\current\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\\setup.py'"'"'; __file__='"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\tkim20201124\AppData\Local\Temp\2\pip-wheel-yt5v1d_q'
       cwd: C:\Users\tkim20201124\AppData\Local\Temp\2\pip-install-j_hj21vp\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\
  Complete output (5 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'netifaces' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for netifaces
  Running setup.py clean for netifaces
  Building wheel for wrapt (setup.py) ... done
  Created wheel for wrapt: filename=wrapt-1.12.1-py3-none-any.whl size=19553 sha256=c1a91a6a8d4d1ce8c0c068672e707e8fe02f8e62d26f6aeaa22c6451e54d8db9
  Stored in directory: c:\users\tkim20201124\appdata\local\pip\cache\wheels\98\23\68\efe259aaca055e93b08e74fbe512819c69a2155c11ba3c0f10
  Building wheel for Yappi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\tkim20201124\scoop\apps\miniconda3\current\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\yappi_0f36ebff25e843b3a408e3f2281139a4\\setup.py'"'"'; __file__='"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\yappi_0f36ebff25e843b3a408e3f2281139a4\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\tkim20201124\AppData\Local\Temp\2\pip-wheel-35rgo4vu'
       cwd: C:\Users\tkim20201124\AppData\Local\Temp\2\pip-install-j_hj21vp\yappi_0f36ebff25e843b3a408e3f2281139a4\
  Complete output (9 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  copying yappi\yappi.py -> build\lib.win-amd64-3.9
  running build_ext
  building '_yappi' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for Yappi
  Running setup.py clean for Yappi
Successfully built wrapt
Failed to build netifaces Yappi
Installing collected packages: wrapt, pbr, pytz, oslo.i18n, netifaces, netaddr, iso8601, debtcollector, stevedore, rfc3986, PyYAML, oslo.utils, msgpack, extras, vine, testtools, repoze.lru, oslo.serialization, oslo.context, oslo.config, os-service-types, greenlet, fixtures, fasteners, dnspython, Yappi, Werkzeug, WebOb, Tempita, statsd, sqlparse, SQLAlchemy, Routes, PasteDeploy, Paste, oslo.log, oslo.concurrency, Mako, keystoneauth1, itsdangerous, eventlet, elementpath, dogpile.cache, bcrypt, amqp, xmlschema, testscenarios, testresources, sqlalchemy-migrate, python-keystoneclient, pycadf, PrettyTable, oslo.service, oslo.policy, oslo.middleware, oslo.metrics, oslo.cache, kombu, importlib-resources, futurist, Flask, cachetools, aniso8601, alembic, scrypt, pysaml2, PyJWT, passlib, osprofiler, oslo.upgradecheck, oslo.messaging, oslo.db, oauthlib, keystonemiddleware, Flask-RESTful, keystone
    Running setup.py install for netifaces ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\tkim20201124\scoop\apps\miniconda3\current\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\\setup.py'"'"'; __file__='"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tkim20201124\AppData\Local\Temp\2\pip-record-toavpd79\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\tkim20201124\scoop\apps\miniconda3\current\Include\netifaces'
         cwd: C:\Users\tkim20201124\AppData\Local\Temp\2\pip-install-j_hj21vp\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\
    Complete output (5 lines):
    running install
    running build
    running build_ext
    building 'netifaces' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\tkim20201124\scoop\apps\miniconda3\current\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\\setup.py'"'"'; __file__='"'"'C:\\Users\\tkim20201124\\AppData\\Local\\Temp\\2\\pip-install-j_hj21vp\\netifaces_7ef1ccdc85de4643a7fe1a9fc15b0f4a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tkim20201124\AppData\Local\Temp\2\pip-record-toavpd79\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\tkim20201124\scoop\apps\miniconda3\current\Include\netifaces' Check the logs for full command output.
PS C:\temp\keystone>

Building wheels for collected packages: netifaces, Yappi

이 패키지를 설치하는 데 실패했습니다. visual c++ 모듈을 필요로 하는 것 같은데요 혹시 conda로 설치할 수 있는 지 해봈습니다.
직접 visual c++ 빌드 툴을 설치하는 방법이 있습니다만, conda 에는 많은 패키지가 바이너리로 빌드되어 준비되어 있는 경우가 많습니다. 그래서 우선 conda를 통해서 설치를 시도해 봤습니다.

conda install -c conda-forge netifaces Yappi

설치가 되네요. 캡춰하려고 했는데, 아웃풋이 사라져 버렸습니다.

다시 pip install -e . 를 실시했더니 성공했습니다.

마지막 부분의 아웃풋만 다시 실펴보면 다음과 같습니다.

Successfully installed Flask-2.0.1 Flask-RESTful-0.3.9 Jinja2-3.0.1 Mako-1.1.5 MarkupSafe-2.0.1 Paste-3.5.0 PasteDeploy-2.1.1 PrettyTable-2.2.1 PyJWT-2.1.0 PyYAML-5.4.1 Routes-2.5.1 SQLAlchemy-1.4.25 Tempita-0.5.2 WebOb-1.8.7 Werkzeug-2.0.1 alembic-1.7.3 amqp-5.0.6 aniso8601-9.0.1 attrs-21.2.0 bcrypt-3.2.0 cachetools-4.2.4 certifi-2021.5.30 cffi-1.14.6 charset-normalizer-2.0.6 click-8.0.1 colorama-0.4.4 cryptography-35.0.0 debtcollector-2.3.0 decorator-5.1.0 defusedxml-0.7.1 dnspython-2.1.0 dogpile.cache-1.1.4 elementpath-2.3.2 eventlet-0.32.0 extras-1.0.0 fasteners-0.16.3 fixtures-3.0.0 futurist-2.4.0 greenlet-1.1.2 idna-3.2 importlib-resources-5.2.2 iso8601-0.1.16 itsdangerous-2.0.1 jsonschema-4.0.1 keystone-20.0.0.0rc2.dev3 keystoneauth1-4.4.0 keystonemiddleware-9.3.0 kombu-5.1.0 msgpack-1.0.2 netaddr-0.8.0 oauthlib-3.1.1 os-service-types-1.7.0 oslo.cache-2.8.1 oslo.concurrency-4.4.1 oslo.config-8.7.1 oslo.context-3.3.1 oslo.db-11.0.0 oslo.i18n-5.1.0 oslo.log-4.6.0 oslo.messaging-12.9.1 oslo.metrics-0.3.0 oslo.middleware-4.4.0 oslo.policy-3.8.2 oslo.serialization-4.2.0 oslo.service-2.6.0 oslo.upgradecheck-1.4.0 oslo.utils-4.10.0 osprofiler-3.4.2 packaging-21.0 passlib-1.7.4 pbr-5.6.0 prometheus-client-0.11.0 pyOpenSSL-21.0.0 pycadf-3.1.1 pycparser-2.20 pyparsing-2.4.7 pyrsistent-0.18.0 pysaml2-7.0.1 python-dateutil-2.8.2 python-keystoneclient-4.3.0 pytz-2021.1 repoze.lru-0.7 requests-2.26.0 rfc3986-1.5.0 scrypt-0.8.18 six-1.16.0 sqlalchemy-migrate-0.13.0 sqlparse-0.4.2 statsd-3.3.0 stevedore-3.4.0 testresources-2.0.1 testscenarios-0.5.0 testtools-2.5.0 urllib3-1.26.7 vine-5.0.0 wcwidth-0.2.5 wrapt-1.12.1 xmlschema-1.8.0 zipp-3.6.0

설치된 패키지

자세한 것은 살표볼 수 없지만, 어떤 역할을 하는 패키지인지 살펴보면 다음과 같습니다.
패키지에 대한 정보는 https://pypi.org/ 에서 찾았습니다.

아파치 설치 방법

오픈스택의 문서를 참조합니다.

wsgi scripts 수정

setup.cfg 파일을 보면 [entry_points] 라고 하는 부분이 있습니다. 윈도우즈의 환경에서 설치하면, console_scripts 에 해당하는 파일들이 생성됩니다만, wsgi_scripts 에 해당되는 파일들은 생성되어 있지 않습니다. 하지만, 리눅스 환경에서 보면 다음과 같이 설치가 되어 있거든요. 이 파일을 복사해 왔습니다.

d096_keystone_wsgi_scripts.png

그리고 윈도우즈에서 실행하려고 했습니다만, python interpreter가 conda완경에 있으므로 shebang을 변경해 놓습니다.
윈도우즈 환경으로 이렇게 python의 interpreter path가 다음과 같이 되어 있다면, 리눅스 식으로 고쳐서 적어 놓습니다.
C:\Users\tkim20201124\scoop\apps\miniconda3\current\envs\openstack\python.EXE

#!/Users/tkim20201124/scoop/apps/miniconda3/current/envs/openstack/python

다음은 수정한 keystone-wsgi-public.py의 파일입니다.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/Users/tkim20201124/scoop/apps/miniconda3/current/envs/openstack/python
#PBR Generated from 'wsgi_scripts'

import threading

from keystone.server.wsgi import initialize_public_application

if __name__ == "__main__":
    import argparse
    import socket
    import sys
    import wsgiref.simple_server as wss

    parser = argparse.ArgumentParser(
        description=initialize_public_application.__doc__,
        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        usage='%(prog)s [-h] [--port PORT] [--host IP] -- [passed options]')
    parser.add_argument('--port', '-p', type=int, default=8000,
                        help='TCP port to listen on')
    parser.add_argument('--host', '-b', default='',
                        help='IP to bind the server to')
    parser.add_argument('args',
                        nargs=argparse.REMAINDER,
                        metavar='-- [passed options]',
                        help="'--' is the separator of the arguments used "
                        "to start the WSGI server and the arguments passed "
                        "to the WSGI application.")
    args = parser.parse_args()
    if args.args:
        if args.args[0] == '--':
            args.args.pop(0)
        else:
            parser.error("unrecognized arguments: %s" % ' '.join(args.args))
    sys.argv[1:] = args.args
    server = wss.make_server(args.host, args.port, initialize_public_application())

    print("*" * 80)
    print("STARTING test server keystone.server.wsgi.initialize_public_application")
    url = "http://%s:%d/" % (server.server_name, server.server_port)
    print("Available at %s" % url)
    print("DANGER! For testing only, do not use in production")
    print("*" * 80)
    sys.stdout.flush()

    server.serve_forever()
else:
    application = None
    app_lock = threading.Lock()

    with app_lock:
        if application is None:
            application = initialize_public_application()

admin 스크립트는 public 의 것과 내용이 크게 다르지 않습니다.

d096_keystone_wsgi_scripts_diff_admin_and_public.png

Queens 버전 전에는 v2 버전에서 35357이라는 포트와 5000 포트로 나누어 실행할 필요가 있었습니다만, v3 이후로는 같은 포트로 5000번 하나만 사용하게 되어있습니다.

pycharm 설정

먼저 interpreter를 설정합니다. conda의 openstack env를 사용합니다. python.exe가 있는 경로를 설정하면 됩니다.
d096_pycharm_interpreter_setting.png

그 다음 run/debug configuraion을 설정합니다. 우리는 keystone-wsgi-public.py 를 실행할 것입니다.
d096_pycharm_debug_setting.png

실행을 해보면, 몇개의 패키지가 설치되어 있지 않다고 pycharm이 발견해 주었습니다.
d096_pycharm_found_package_not_installed.png

grp, pwd 는 리눅스의 패키지에는 기본적으로 설치되어 있습니다만, 윈도우즈용 파이썬에서는 설치되어 있지 않습니다.
d096_python_grp_pwd_module.png
d096_python_grp_pwd_module_on_windows.png

ide의 도움으로 사용하고 있는 함수를 보니, cli툴에서 사용하고 있는 uid, name 의 tuple과 gid, name의 tuple을 돌리고 있는 함수였습니다.
리눅스의 경우를 보니 다음과 같이 설정되어 있어서

tkim@dev-keystone-v110001:/home$ id keystone
uid=110(keystone) gid=117(keystone) groups=117(keystone)
tkim@dev-keystone-v110001:/home$

함수를 커스터 마이징 했습니다.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

# import grp
# import pwd

def get_unix_user(user=None):
    return 110, 'keystone'

def get_unix_group(group=None):
    return 117, 'keystone'

예전의 qiita에 기재했을 때는, document가 얘기하는 대로 mysql도 설치하고, apache24도 설치하고 mod_wsgi도 설치하고 해봤습니다만, 이번은 그냥 실행만 해봤습니다. 다음과 같이 breakpoint를 걸고, 멈추는 것 까지 확인했습니다.

d096_keystone_debugging_breakpoint.png

아마도 더 진행시키면 데이터베이스가 없어서 어딘가 에러가 발생하겠지만요.
여기까지 keystone을 windows에서 실행시켜본 이야기였습니다.

공유하기

tkim
글쓴이
tkim
Software Engineer