Page MenuHomePhabricator

spicerack: tox fails to install PyYAML using python 3.11 on bookworm
Closed, ResolvedPublic

Description

While building trying to test spicerack to day I hit an error related to PyYaml. The following fix worked for me

$ echo 'Cython < 3.0' > /tmp/constraint.txt
$ PIP_CONSTRAINT=/tmp/constraint.txt tox   

however we should consider a permanent fix e.g. bumping dependencies on pyyaml to >=6.0.1

The current dependency on 5.4.1 seems to be comming from elasticsearch-curator

$ .tox/py311-tests/bin/pipdeptree 
...
wikimedia-spicerack==7.2.2.dev4+gc28e116
...
├── elasticsearch-curator [required: ~=5.0, installed: 5.8.4]
...
│   ├── PyYAML [required: ==5.4.1, installed: 5.4.1]

Full pipdeptree output

Event Timeline

jbond triaged this task as Medium priority.Aug 31 2023, 11:30 AM
jbond created this task.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Also worth noting that version >= 6 are not currently working with spicerack (T328775)

Ran into this today trying to pip install wikimedia-spicerack (Python 3.11).

Worked around it with pip install "pyyaml<5" wikimedia-spicerack

@colewhite from your comment on on the elastic search restart cookbook can i assume that moving to the opensearch python packages would also allow us to drop this dependency from spicerack. i.e. we could use that package for the current search cookbooks and this new ones?

@colewhite from your comment on on the elastic search restart cookbook can i assume that moving to the opensearch python packages would also allow us to drop this dependency from spicerack. i.e. we could use that package for the current search cookbooks and this new ones?

Spicerack uses curator to change cluster routing settings (initial patch, code) which is an important step to doing rolling maintenance. To remove the dependency, I would either bring in the ClusterRouting class or reimplement the calls to change allocation settings using the OpenSearch client directly (client.cluster.put_settings()). Either option should be fairly simple to do.

I don't recommended using our fork of curator as we'd still have to contend with the dependencies.

opensearch-py should be compatible with our elasticsearch 7.x instances. It was forked from the 7.10 release of elasticsearch-py.

Hmm, elasticsearch-curator also tries to build and install pyyaml 3 if it's not there, and failing for me on python3.11. Note that I pinned pyyaml to 5.3.1, to overcome a cython bug (https://github.com/yaml/pyyaml/issues/601), but the last stack trace, is elascitsearch-curator trying to install pyyaml 3.13 and failing due to being unable to build the wheel :/

1dcaro@urcuchillay$ rm -rf .tox; tox -e py311-flake8
2py311-flake8: install_deps> python -I -m pip install '.[tests]'
3Processing /home/dcaro/Work/wikimedia/wmcs-cookbooks
4 Installing build dependencies ... done
5 Getting requirements to build wheel ... done
6 Installing backend dependencies ... done
7 Preparing metadata (pyproject.toml) ... done
8Collecting pyyaml==5.3.1 (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
9 Using cached PyYAML-5.3.1-cp311-cp311-linux_x86_64.whl
10Collecting wikimedia-spicerack>=6.0.0 (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
11 Obtaining dependency information for wikimedia-spicerack>=6.0.0 from https://files.pythonhosted.org/packages/a2/2c/e56a75670f89bd6cb7a04754bf30fb7980712a4a1e465bd5c5554399a29f/wikimedia_spicerack-7.4.1-py3-none-any.whl.metadata
12 Using cached wikimedia_spicerack-7.4.1-py3-none-any.whl.metadata (3.3 kB)
13Collecting defusedxml (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
14 Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
15Collecting requests[socks] (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
16 Obtaining dependency information for requests[socks] from https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl.metadata
17 Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
18Collecting bandit>=1.5.0 (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
19 Using cached bandit-1.7.5-py3-none-any.whl (123 kB)
20Collecting flake8>=3.2.1 (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
21 Obtaining dependency information for flake8>=3.2.1 from https://files.pythonhosted.org/packages/b0/24/bbf7175ffc47cb3d3e1eb523ddb23272968359dfcf2e1294707a2bf12fc4/flake8-6.1.0-py2.py3-none-any.whl.metadata
22 Using cached flake8-6.1.0-py2.py3-none-any.whl.metadata (3.8 kB)
23Collecting pytest>=6.1.0 (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
24 Obtaining dependency information for pytest>=6.1.0 from https://files.pythonhosted.org/packages/df/d0/e192c4275aecabf74faa1aacd75ef700091913236ec78b1a98f62a2412ee/pytest-7.4.2-py3-none-any.whl.metadata
25 Using cached pytest-7.4.2-py3-none-any.whl.metadata (7.9 kB)
26Collecting freezegun>=1.2.2 (from wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
27 Using cached freezegun-1.2.2-py3-none-any.whl (17 kB)
28Collecting GitPython>=1.0.1 (from bandit>=1.5.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
29 Obtaining dependency information for GitPython>=1.0.1 from https://files.pythonhosted.org/packages/8a/7e/20f7e45878b5aed34320fbeeae8f78acc806e7bd708d00b1c6e64b016f5b/GitPython-3.1.37-py3-none-any.whl.metadata
30 Using cached GitPython-3.1.37-py3-none-any.whl.metadata (12 kB)
31Collecting stevedore>=1.20.0 (from bandit>=1.5.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
32 Obtaining dependency information for stevedore>=1.20.0 from https://files.pythonhosted.org/packages/4b/68/e739fd061b0aba464bef8e8be48428b2aabbfb3f2f8f2f8ca257363ee6b2/stevedore-5.1.0-py3-none-any.whl.metadata
33 Using cached stevedore-5.1.0-py3-none-any.whl.metadata (2.2 kB)
34Collecting rich (from bandit>=1.5.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
35 Obtaining dependency information for rich from https://files.pythonhosted.org/packages/be/2a/4e62ff633612f746f88618852a626bbe24226eba5e7ac90e91dcfd6a414e/rich-13.6.0-py3-none-any.whl.metadata
36 Using cached rich-13.6.0-py3-none-any.whl.metadata (18 kB)
37Collecting mccabe<0.8.0,>=0.7.0 (from flake8>=3.2.1->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
38 Using cached mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB)
39Collecting pycodestyle<2.12.0,>=2.11.0 (from flake8>=3.2.1->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
40 Obtaining dependency information for pycodestyle<2.12.0,>=2.11.0 from https://files.pythonhosted.org/packages/b1/90/a998c550d0ddd07e38605bb5c455d00fcc177a800ff9cc3dafdcb3dd7b56/pycodestyle-2.11.1-py2.py3-none-any.whl.metadata
41 Using cached pycodestyle-2.11.1-py2.py3-none-any.whl.metadata (4.5 kB)
42Collecting pyflakes<3.2.0,>=3.1.0 (from flake8>=3.2.1->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
43 Obtaining dependency information for pyflakes<3.2.0,>=3.1.0 from https://files.pythonhosted.org/packages/00/e9/1e1fd7fae559bfd07704991e9a59dd1349b72423c904256c073ce88a9940/pyflakes-3.1.0-py2.py3-none-any.whl.metadata
44 Using cached pyflakes-3.1.0-py2.py3-none-any.whl.metadata (3.5 kB)
45Collecting python-dateutil>=2.7 (from freezegun>=1.2.2->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
46 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
47Collecting iniconfig (from pytest>=6.1.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
48 Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
49Collecting packaging (from pytest>=6.1.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
50 Obtaining dependency information for packaging from https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl.metadata
51 Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
52Collecting pluggy<2.0,>=0.12 (from pytest>=6.1.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
53 Obtaining dependency information for pluggy<2.0,>=0.12 from https://files.pythonhosted.org/packages/05/b8/42ed91898d4784546c5f06c60506400548db3f7a4b3fb441cba4e5c17952/pluggy-1.3.0-py3-none-any.whl.metadata
54 Using cached pluggy-1.3.0-py3-none-any.whl.metadata (4.3 kB)
55Collecting conftool>=1.0.1 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
56 Using cached conftool-1.1.4-py3-none-any.whl (77 kB)
57Collecting cumin>=3.0.2 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
58 Using cached cumin-4.2.0-py3-none-any.whl (67 kB)
59Collecting dnspython~=2.0.0 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
60 Using cached dnspython-2.0.0-py3-none-any.whl (208 kB)
61Collecting elasticsearch<7.15.0,>=5.0.0 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
62 Using cached elasticsearch-7.14.2-py2.py3-none-any.whl (363 kB)
63Collecting elasticsearch-curator~=5.0 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
64 Using cached elasticsearch_curator-5.8.4-py2.py3-none-any.whl (106 kB)
65Collecting kafka-python>=2.0.1 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
66 Using cached kafka_python-2.0.2-py2.py3-none-any.whl (246 kB)
67Collecting kubernetes==12.0.* (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
68 Using cached kubernetes-12.0.1-py2.py3-none-any.whl (1.7 MB)
69Collecting pymysql>=0.9.3 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
70 Obtaining dependency information for pymysql>=0.9.3 from https://files.pythonhosted.org/packages/e5/30/20467e39523d0cfc2b6227902d3687a16364307260c75e6a1cb4422b0c62/PyMySQL-1.1.0-py3-none-any.whl.metadata
71 Using cached PyMySQL-1.1.0-py3-none-any.whl.metadata (4.4 kB)
72Collecting pynetbox~=6.6 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
73 Using cached pynetbox-6.6.2-py3-none-any.whl (32 kB)
74Collecting python-etcd~=0.4.5 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
75 Using cached python_etcd-0.4.5-py3-none-any.whl
76Collecting redis<=4.1.3,>=3.5.3 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
77 Using cached redis-4.1.3-py3-none-any.whl (173 kB)
78Collecting wmflib (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
79 Obtaining dependency information for wmflib from https://files.pythonhosted.org/packages/53/c0/c669bee0997d300fc394c5a7450506b9c9974d4c7163f56fcd060ef7fdf8/wmflib-1.2.3-py3-none-any.whl.metadata
80 Using cached wmflib-1.2.3-py3-none-any.whl.metadata (2.8 kB)
81Collecting certifi>=14.05.14 (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
82 Obtaining dependency information for certifi>=14.05.14 from https://files.pythonhosted.org/packages/4c/dd/2234eab22353ffc7d94e8d13177aaa050113286e93e7b40eae01fbf7c3d9/certifi-2023.7.22-py3-none-any.whl.metadata
83 Using cached certifi-2023.7.22-py3-none-any.whl.metadata (2.2 kB)
84Collecting six>=1.9.0 (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
85 Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
86Requirement already satisfied: setuptools>=21.0.0 in ./.tox/py311-tests/lib/python3.11/site-packages (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016) (68.2.2)
87Collecting google-auth>=1.0.1 (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
88 Obtaining dependency information for google-auth>=1.0.1 from https://files.pythonhosted.org/packages/39/7c/2e4fa55a99f83ef9ef229ac5d59c44ceb90e2d0145711590c0fa39669f32/google_auth-2.23.3-py2.py3-none-any.whl.metadata
89 Using cached google_auth-2.23.3-py2.py3-none-any.whl.metadata (4.2 kB)
90Collecting websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
91 Obtaining dependency information for websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 from https://files.pythonhosted.org/packages/c4/3c/1892ce394828c43d4f65248ebdee3854114266b75d1f5915cb211155ad7b/websocket_client-1.6.4-py3-none-any.whl.metadata
92 Using cached websocket_client-1.6.4-py3-none-any.whl.metadata (7.7 kB)
93Collecting requests-oauthlib (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
94 Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
95Collecting urllib3>=1.24.2 (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
96 Obtaining dependency information for urllib3>=1.24.2 from https://files.pythonhosted.org/packages/26/40/9957270221b6d3e9a3b92fdfba80dd5c9661ff45a664b47edd5d00f707f5/urllib3-2.0.6-py3-none-any.whl.metadata
97 Using cached urllib3-2.0.6-py3-none-any.whl.metadata (6.6 kB)
98Collecting charset-normalizer<4,>=2 (from requests[socks]->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
99 Obtaining dependency information for charset-normalizer<4,>=2 from https://files.pythonhosted.org/packages/ff/b6/9222090f396f33cd58aa5b08b9bbf8871416b746a0c7b412a41a973674a5/charset_normalizer-3.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
100 Using cached charset_normalizer-3.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (32 kB)
101Collecting idna<4,>=2.5 (from requests[socks]->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
102 Using cached idna-3.4-py3-none-any.whl (61 kB)
103Collecting PySocks!=1.5.7,>=1.5.6 (from requests[socks]->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
104 Using cached PySocks-1.7.1-py3-none-any.whl (16 kB)
105Collecting jsonschema (from conftool>=1.0.1->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
106 Obtaining dependency information for jsonschema from https://files.pythonhosted.org/packages/0f/bf/a84bc75f069f4f156e1c0d9892fb7325945106c6ecaad9f29d24360872af/jsonschema-4.19.1-py3-none-any.whl.metadata
107 Using cached jsonschema-4.19.1-py3-none-any.whl.metadata (7.9 kB)
108Collecting clustershell<=1.9.99,>=1.8.1 (from cumin>=3.0.2->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
109 Using cached ClusterShell-1.9.2-py3-none-any.whl
110Collecting pyparsing<=3.99.0,>=2.2.0 (from cumin>=3.0.2->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
111 Obtaining dependency information for pyparsing<=3.99.0,>=2.2.0 from https://files.pythonhosted.org/packages/39/92/8486ede85fcc088f1b3dba4ce92dd29d126fd96b0008ea213167940a2475/pyparsing-3.1.1-py3-none-any.whl.metadata
112 Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
113Collecting tqdm>=4.19.4 (from cumin>=3.0.2->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
114 Obtaining dependency information for tqdm>=4.19.4 from https://files.pythonhosted.org/packages/00/e5/f12a80907d0884e6dff9c16d0c0114d81b8cd07dc3ae54c5e962cc83037e/tqdm-4.66.1-py3-none-any.whl.metadata
115 Using cached tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)
116Collecting urllib3>=1.24.2 (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
117 Obtaining dependency information for urllib3>=1.24.2 from https://files.pythonhosted.org/packages/48/fe/a5c6cc46e9fe9171d7ecf0f33ee7aae14642f8d74baa7af4d7840f9358be/urllib3-1.26.17-py2.py3-none-any.whl.metadata
118 Using cached urllib3-1.26.17-py2.py3-none-any.whl.metadata (48 kB)
119 Using cached urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
120Collecting boto3>=1.17.57 (from elasticsearch-curator~=5.0->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
121 Obtaining dependency information for boto3>=1.17.57 from https://files.pythonhosted.org/packages/c0/67/4d23a38313d7b37892a6d9c9260809f1a2f5a37feaf6f13da0aa27f57d6d/boto3-1.28.63-py3-none-any.whl.metadata
122 Using cached boto3-1.28.63-py3-none-any.whl.metadata (6.7 kB)
123Collecting requests-aws4auth>=1.0.1 (from elasticsearch-curator~=5.0->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
124 Using cached requests_aws4auth-1.2.3-py2.py3-none-any.whl (24 kB)
125Collecting click<8.0,>=7.0 (from elasticsearch-curator~=5.0->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
126 Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
127INFO: pip is looking at multiple versions of elasticsearch-curator to determine which version is compatible with other requirements. This could take a while.
128Collecting elasticsearch-curator~=5.0 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
129 Using cached elasticsearch_curator-5.8.3-py2.py3-none-any.whl (106 kB)
130Collecting elasticsearch<7.15.0,>=5.0.0 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
131 Using cached elasticsearch-7.1.0-py2.py3-none-any.whl (83 kB)
132Collecting urllib3>=1.24.2 (from kubernetes==12.0.*->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
133 Using cached urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
134Collecting click<7.0,>=6.7 (from elasticsearch-curator~=5.0->wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
135 Using cached click-6.7-py2.py3-none-any.whl (71 kB)
136Collecting elasticsearch-curator~=5.0 (from wikimedia-spicerack>=6.0.0->wmcs-cookbooks==0.1.dev1180+g7bdb7dc.d20231016)
137 Using cached elasticsearch_curator-5.8.2-py2.py3-none-any.whl (106 kB)
138 Using cached elasticsearch-curator-5.8.1.tar.gz (225 kB)
139 Preparing metadata (setup.py) ... error
140
141 error: subprocess-exited-with-error
142
143 × python setup.py egg_info did not run successfully.
144 │ exit code: 1
145 ╰─> [73 lines of output]
146 /home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
147 !!
148
149 ********************************************************************************
150 Requirements should be satisfied by a PEP 517 installer.
151 If you are using pip, you can try `pip install --use-pep517`.
152 ********************************************************************************
153
154 !!
155 dist.fetch_build_eggs(dist.setup_requires)
156 error: subprocess-exited-with-error
157
158 × python setup.py bdist_wheel did not run successfully.
159 │ exit code: 1
160 ╰─> [5 lines of output]
161 ext/_yaml.c:181:12: fatal error: longintrepr.h: No such file or directory
162 181 | #include "longintrepr.h"
163 | ^~~~~~~~~~~~~~~
164 compilation terminated.
165 error: command '/usr/bin/gcc' failed with exit code 1
166 [end of output]
167
168 note: This error originates from a subprocess, and is likely not a problem with pip.
169 ERROR: Failed building wheel for pyyaml
170 ERROR: Failed to build one or more wheels
171 Traceback (most recent call last):
172 File "/tmp/pip-install-2ir9hgha/elasticsearch-curator_c889dcd46dd84636bd095f0bb2c891f9/setup.py", line 39, in <module>
173 from cx_Freeze import setup, Executable
174 ModuleNotFoundError: No module named 'cx_Freeze'
175
176 During handling of the above exception, another exception occurred:
177
178 Traceback (most recent call last):
179 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
180 subprocess.check_call(cmd)
181 File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
182 raise CalledProcessError(retcode, cmd)
183 subprocess.CalledProcessError: Command '['/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmppu879_i4', '--quiet', 'pyyaml==3.13']' returned non-zero exit status 1.
184
185 The above exception was the direct cause of the following exception:
186
187 Traceback (most recent call last):
188 File "<string>", line 2, in <module>
189 File "<pip-setuptools-caller>", line 34, in <module>
190 File "/tmp/pip-install-2ir9hgha/elasticsearch-curator_c889dcd46dd84636bd095f0bb2c891f9/setup.py", line 144, in <module>
191 setup(
192 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/__init__.py", line 102, in setup
193 _install_setup_requires(attrs)
194 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/__init__.py", line 75, in _install_setup_requires
195 _fetch_build_eggs(dist)
196 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/__init__.py", line 80, in _fetch_build_eggs
197 dist.fetch_build_eggs(dist.setup_requires)
198 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/dist.py", line 662, in fetch_build_eggs
199 return _fetch_build_eggs(self, requires)
200 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
201 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
202 resolved_dists = pkg_resources.working_set.resolve(
203 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
204 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/pkg_resources/__init__.py", line 829, in resolve
205 dist = self._resolve_dist(
206 ^^^^^^^^^^^^^^^^^^^
207 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/pkg_resources/__init__.py", line 865, in _resolve_dist
208 dist = best[req.key] = env.best_match(
209 ^^^^^^^^^^^^^^^
210 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1135, in best_match
211 return self.obtain(req, installer)
212 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
213 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1147, in obtain
214 return installer(requirement)
215 ^^^^^^^^^^^^^^^^^^^^^^
216 File "/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/lib/python3.11/site-packages/setuptools/installer.py", line 103, in _fetch_build_egg_no_warn
217 raise DistutilsError(str(e)) from e
218 distutils.errors.DistutilsError: Command '['/home/dcaro/Work/wikimedia/wmcs-cookbooks/.tox/py311-tests/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmppu879_i4', '--quiet', 'pyyaml==3.13']' returned non-zero exit status 1.
219 [end of output]
220
221 note: This error originates from a subprocess, and is likely not a problem with pip.
222error: metadata-generation-failed
223
224× Encountered error while generating package metadata.
225╰─> See above for output.
226
227note: This is an issue with the package mentioned above, not pip.
228hint: See above for details.
229py311-flake8: exit 1 (5.49 seconds) /home/dcaro/Work/wikimedia/wmcs-cookbooks> python -I -m pip install '.[tests]' pid=2244328
230 py311-flake8: FAIL code 1 (5.59 seconds)
231 evaluation failed :( (5.67 seconds)

Even though that header is there:

dcaro@urcuchillay$ ls -la /usr/include/python3.11/cpython/longintrepr.h
-rw-r--r--. 1 root root 3817 Oct  2 15:29 /usr/include/python3.11/cpython/longintrepr.h

Change 966492 had a related patch set uploaded (by David Caro; author: David Caro):

[operations/software/spicerack@master] elasticsearch: move to opensearch client

https://gerrit.wikimedia.org/r/966492

This unblocked this issue and made tox pass:
https://gerrit.wikimedia.org/r/c/cloud/wmcs-cookbooks/+/967244

The move out of elasticsearch-curator is still nice, but does not block this anymore :)

Unfortunately, I think this specific bug still exists, because there's no Python 3.11 wheel in PyPI: https://pypi.org/project/PyYAML/5.4.1/#files

Tox is now working on the CI where we use Python 3.9, but if I try to run pip install wikimedia-spicerack on a clean Python 3.11 Docker image, it tries to build PyYAML 5.4.1 and it fails with the Cython error:

~ $ docker run --rm -it python:3.11 bash
root@84be1c63f10b:/# apt update
root@84be1c63f10b:/# apt install pip

...

Collecting pyyaml>=3.12 (from kubernetes==12.0.*->wikimedia-spicerack)
  Downloading PyYAML-5.4.1.tar.gz (175 kB)

...

      AttributeError: cython_sources

Running tox on the wmcs-cookbooks repo fails with the same error, if I run it from a clean python:3.11 Docker image.

Locally on my machine (without Docker), it works only because I have a cached wheel in my pip cache, that I built before Cython 3.0 was released.

yep, I tried a few combinations of elasticsearch-curator/pyyaml and such... it turns out that elasticseach-curator dependency on pyyaml is 3.13, until 5.8.4, where it jumps to pinning it to 5.4.1, and none of those have wheels for 3.11, it wasn't until pyyaml 6.x that they starting building those :/

Note that both elasticsearch-curator and pyyaml 5 are pretty old.

So yep, still blocked 😢

Currently the only workaround I've found (as we don't use elasticsearch itself) is to install in the local venv the spicerack with the patch (https://gerrit.wikimedia.org/r/c/operations/software/spicerack/+/966492/) applied

Note that as of jan 2024, you will need also to workaround that python-kafka<=2.0.2 does not work with python 3.12, 2.0.3 will have the fix but it's not released yet (https://github.com/dpkp/kafka-python/issues/2412), you can pip install git+https://github.com/dpkp/kafka-python.git (https://github.com/dpkp/kafka-python/pull/2398#issuecomment-1797123710)

fnegri added a subscriber: Volans.

I have updated the patch by @dcaro (https://gerrit.wikimedia.org/r/c/operations/software/spicerack/+/966492/) and it's now passing all tests.

@Volans @colewhite any remaining concerns before this can be merged?

@fnegri Thanks a lot for resuming this and taking care of it. As I've stated in the CR it looks good to me, but I would like an explicit approval from Search and some support in testing it after releasing it to make sure it all works fine.

fnegri changed the task status from Open to Stalled.Feb 27 2024, 4:27 PM
fnegri moved this task from Backlog to Blocked on the cloud-services-team (FY2023/2024-Q3-Q4) board.

@RKemper @brouberol could you please review this patch, and maybe run a test after it's merged?

@RKemper can I let you do it? You're much more familiar with both ES and our ES/Spicerack operations than I am I think.

@fnegri @brouberol Yeah, Brian and I will work on getting this tested and merged. Thanks for the heads up!

Hey @fnegri ! I posted a comment on the CR but just repeating it here.

Unfortunately, the blast radius is pretty big for us...we could lose the ability to do routine operations if the library doesn't work. CCing our software engineers @dcausse and @EBernhardson for awareness.

@Volans I sent you an invite next week to pair on this. Hopefully we should be able to figure this out before our offsite (starting 11 March).

@Volans I sent you an invite next week to pair on this. Hopefully we should be able to figure this out before our offsite (starting 11 March).

@bking what if we release spicerack with the change and upgrade it only cumin2002 for few days to allow your team to test and prepare any changes that might be needed to the related cookbooks? Would that be ok?

@bking thanks for having a look! No rush really, I was keen to get this unstuck but it's not a problem if it's not merged until after the offsite.

@bking what if we release spicerack with the change and upgrade it only cumin2002 for few days to allow your team to test and prepare any changes that might be needed to the related cookbooks? Would that be ok?

Sure, that works. Hit me up here or in IRC once it's upgraded and we'll test the cookbooks.

@fnegri no problem, thanks for keeping us in the loop! We'll do our best to get this tested when we can.

Unfortunately, the opensearch library already has at least one breaking change , and it's likely there will be more breaking changes to the opensearch client library. We think it would be better to break off a different library instead of changing "elasticsearch_cluster.py".

That being said, we may be able to fix this error by migrating to a newer version of the curator library. We'll give that a try and update this task.

We're going to upgrade curator (as well as its library) soon, as it's causing other problems (see T360697 ).

We're going to upgrade curator (as well as its library) soon, as it's causing other problems (see T345337 ).

The linked task is this same one. Did you meant to link another one?
What do you mean exactly by upgrading curator?

The linked task is this same one. Did you meant to link another one?

Yes, sorry about that...the correct task is T360697 . I've fixed it in my original comment.

What do you mean exactly by upgrading curator?

Per jbond's original comment, "The current dependency on 5.4.1 seems to be comming from elasticsearch-curator" . Curator is an elasticsearch utility that manages index lifecycles. As shown in the linked task, the version we're using is really old, and in fact does not work with our current version of Elasticsearch.

So the idea is to use a newer version of Curator from the 7.x branch. Using the new library should (hopefully) allow spicerack to use newer versions of PyYAML. Feel free to hit me up here or in IRC if you have any other questions about this.

Will you take care also of debian packaging it and any required dependencies?
Because spicerack is deployed with debian packages and upstream debian has 5.8.1 as the most recent release (not sure if has anything to do with the licencing) and 7.17.6 for python3-elasticsearch.

Sure, I'm happy to create a new package. Curator itself is still Apache 2.0 licensed, so I think this is more on us (as in my team) for not recognizing the problem and creating a new package earlier. I'll let you know when a new deb package is ready.

Per subtask, we no longer need to cut a custom package for elasticsearch-curator; the default version provided by Debian should be sufficient. Feel free to remove the pip dependencies for curator and try your build again.

@bking I'm not sure what do you mean. As mentioned earlier in T345337#9658807 Debian has v5.8.1 for python3-elasticsearch-curator and that's the current version used in production. The depedency in setup.py is defined as elasticsearch-curator~=5.0.

Oops, thank you for pointing that out. I'm discussing it further with my team, but we're leaning towards @colewhite 's suggestion here

...reimplement the [curator] calls to change allocation settings using the OpenSearch client directly (client.cluster.put_settings()).

Although in our case, it would be the Elastic client. To that end, I've created T361647 . If you have any other suggestions around implementation, let me know.

Change #1016855 had a related patch set uploaded (by Bking; author: Bking):

[operations/software/spicerack@master] WIP: remove elasticsearch-curator dependency

https://gerrit.wikimedia.org/r/1016855

Change #1016855 merged by jenkins-bot:

[operations/software/spicerack@master] elasticsearch: remove elasticsearch-curator dep

https://gerrit.wikimedia.org/r/1016855

Change #1019686 had a related patch set uploaded (by Volans; author: Volans):

[operations/software/spicerack@master] setup.py: remove dependency elasticsearch-curator

https://gerrit.wikimedia.org/r/1019686

Change #1019686 merged by jenkins-bot:

[operations/software/spicerack@master] setup.py: remove dependency elasticsearch-curator

https://gerrit.wikimedia.org/r/1019686

With the above patch I think the issue should be solved and we can resolve the task. Could some of the original reporters try to repro it again?

Works for me! 🎉

spicerack (master) $ docker run --rm -it -v $(pwd):/src python:3.11 bash

cd /src
pip install .

[...]

Successfully built wikimedia-spicerack python-etcd clustershell

pip install wikimedia-spicerack is also working fine in a Python 3.11 Docker container.

Resolving then, thanks all that contributed to the fix! Feel free to re-open if there is still any related issue for 3.11. For 3.12 we have a different one tracked in T354410.