Skip to content

Commit 8f547ba

Browse files
committed
remove support to multiple archs
1 parent 0ff314c commit 8f547ba

16 files changed

+34
-1522
lines changed

.github/workflows/code_coverage.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ jobs:
5656
run: |
5757
python3 -m pip install --upgrade pip
5858
pip install -r requirements.txt
59-
pip install -r requirements-dev.txt
60-
pip install .
59+
pip install .[dev]
6160
6261
- name: Retrieve ari knowledge base from s3
6362
run: |

.github/workflows/pip_audit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
- .github/workflows/pip_audit.yml
1111
- ansible_ai_connect/**
1212
- pyproject.toml
13-
- requirements*.txt
13+
- requirements.txt
1414
pull_request:
1515
branches:
1616
- main
1717
paths:
1818
- .github/workflows/pip_audit.yml
1919
- ansible_ai_connect/**
2020
- pyproject.toml
21-
- requirements*.txt
21+
- requirements.txt
2222
permissions:
2323
contents: read
2424

.github/workflows/pip_compile.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ on:
88
- ansible_ai_connect/**
99
- requirements.in
1010
- requirements.txt
11-
- requirements-x86_64.txt
12-
- requirements-aarch64.txt
13-
- requirements-dev.in
14-
- requirements-dev.txt
15-
- requirements-dev-x86_64.txt
16-
- requirements-dev-aarch64.txt
1711
- Makefile
1812
pull_request:
1913
branches:
@@ -22,12 +16,6 @@ on:
2216
- ansible_ai_connect/**
2317
- requirements.in
2418
- requirements.txt
25-
- requirements-x86_64.txt
26-
- requirements-aarch64.txt
27-
- requirements-dev.in
28-
- requirements-dev.txt
29-
- requirements-dev-x86_64.txt
30-
- requirements-dev-aarch64.txt
3119
- Makefile
3220
permissions:
3321
contents: read
@@ -41,13 +29,9 @@ jobs:
4129
uses: actions/setup-python@v4
4230
with:
4331
python-version: 3.12
44-
- name: Identify arch
45-
run: |
46-
echo "ARCH=$(uname -m)" >> "$GITHUB_ENV"
4732
- name: install
4833
run: |
4934
pip install --upgrade "pip<24.1"
5035
pip install pip-tools
51-
pip-compile --quiet -o requirements-${{ env.ARCH }}.txt requirements.in
52-
pip-compile --quiet -o requirements-dev-${{ env.ARCH }}.txt -c requirements-${{ env.ARCH }}.txt requirements-dev.in
53-
git diff --exit-code -- requirements-${{ env.ARCH }}.txt requirements-dev-${{ env.ARCH }}.txt
36+
pip-compile --quiet -o requirements.txt requirements.in
37+
git diff --exit-code -- requirements.txt

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Install dependencies
3636
run: |
3737
python -m pip install --upgrade pip
38-
pip install pre-commit
38+
pip install .[dev]
3939
4040
- name: Run pre-commit
4141
uses: pre-commit/action@v3.0.0

.github/workflows/security_report.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
run: |
1818
python3 -m pip install --upgrade pip
1919
pip install -r requirements.txt
20-
pip install -r requirements-dev.txt
2120
pip install .
2221
2322
- name: Monitor project and report vulnerabilities

Makefile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,14 @@ update-openapi-schema:
9999
docker-compose-clean:
100100
${COMPOSE_RUNTIME} -f ${PWD}/tools/docker-compose/compose.yaml down
101101

102-
.PHONY: pip-compile-x86_64
103-
pip-compile-x86_64:
102+
.PHONY: pip-compile
103+
pip-compile:
104104
${CONTAINER_RUNTIME} run --arch amd64 --os linux \
105105
--volume $(PWD):/var/www/wisdom:Z \
106106
--workdir /var/www/wisdom \
107107
registry.access.redhat.com/ubi9/ubi:latest \
108108
/var/www/wisdom/tools/scripts/pip-compile.sh
109109

110-
.PHONY: pip-compile-aarch64
111-
pip-compile-aarch64:
112-
${CONTAINER_RUNTIME} run --arch arm64 --os linux \
113-
--volume $(PWD):/var/www/wisdom:Z \
114-
--workdir /var/www/wisdom \
115-
registry.access.redhat.com/ubi9/ubi:latest \
116-
/var/www/wisdom/tools/scripts/pip-compile.sh
117-
118-
.PHONY: pip-compile
119-
pip-compile: pip-compile-x86_64 pip-compile-aarch64
120-
121110
# DEPRECATED: Please use create-superuser-containerized instead
122111
docker-create-superuser: create-superuser-containerized DEPRECATED
123112

README.md

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Pre-commit should be used before pushing a new PR.
176176
To use pre-commit, you need to first install the pre-commit package and its dependencies by running:
177177

178178
```bash
179-
pip install -r requirements-dev.txt
179+
pip install .
180180
```
181181

182182
To install pre-commit into your git hooks and run the checks on every commit, run the following each time you clone this
@@ -194,58 +194,26 @@ pre-commit autoupdate && pre-commit run -a
194194

195195
## Updating the Python dependencies
196196

197-
We are now using pip-compile in order to manage our Python
198-
dependencies for the x86_64 and ARM64/AArch64 architectures.
197+
We are using pip-compile in order to manage our Python dependencies.
199198

200-
In order to generate requirements.txt files for both architectures,
201-
you must use a multi-arch capable virtual machine emulator (like QEMU)
202-
and enable multi-arch support.
203-
204-
To enable multi-arch support, run the instructions for your container
205-
engine and emulator from this table:
206-
207-
<table>
208-
<tr>
209-
<td>Container Engine</td>
210-
<td>Emulator</td>
211-
<td>Instructions</td>
212-
</tr>
213-
<tr>
214-
<td>podman</td>
215-
<td>QEMU</td>
216-
<td>
217-
218-
```bash
219-
podman machine ssh
220-
sudo rpm-ostree install qemu-user-static
221-
sudo systemctl reboot
222-
```
223-
224-
</td>
225-
</tr>
226-
</table>
227-
228-
The specification of what packages we need now live in the
229-
requirements.in and requirements-dev.in files. Use your preferred
230-
editor to make the needed changes in those files, then run
199+
The specification of what packages we need lives in the
200+
`requirements.in` file. Use your preferred editor to make the needed
201+
changes in that file, then run:
231202

232203
```bash
233204
make pip-compile
234205
```
235206

236-
This will spin up a container and run the equivalent of these commands
237-
to generate the updated files:
207+
This will spin up a container and run the equivalent of:
238208

239209
```bash
240210
pip-compile requirements.in
241-
pip-compile requirements-dev.in
242211
```
243212

244-
These commands will produce fully populated and pinned requirements.txt and
245-
requirements-dev.txt files, containing all of the dependencies of
246-
our dependencies involved. Due to differences in architecture and
247-
version of Python between developers' machines, we do not recommend
248-
running the pip-compile commands directly.
213+
This command will produce a fully populated and pinned `requirements.txt`
214+
file, containing all of the dependencies of our dependencies.
215+
Due to differences in architecture and version of Python between
216+
developers' machines, we do not recommend running pip-compile directly.
249217

250218
### Use of `pyproject.toml`
251219

@@ -493,8 +461,7 @@ have backend services (Postgres, Prometheus and Grafana) running.
493461
is one handy way for that requirement.
494462
495463
For getting the unit test code coverage,
496-
install the `coverage` module, which is included
497-
in `requirements-dev.txt` with the instructions in the
464+
install the `coverage` module with the instructions in the
498465
[Using pre-commit](#using-pre-commit) section.
499466
500467
### Use make

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ classifiers = [
6161
"Programming Language :: Python :: 3",
6262
]
6363

64+
[project.optional-dependencies]
65+
dev = [
66+
'black~=24.3.0',
67+
'coverage~=7.2.1',
68+
'flake8~=6.0.0',
69+
'grpcio-tools~=1.68.1',
70+
'isort~=5.10.1',
71+
'pip-tools',
72+
'pre-commit',
73+
'responses~=0.24.1',
74+
'torch-model-archiver',
75+
'virtualenv>=20.28.0',
76+
]
77+
6478
[project.urls]
6579
Homepage = "https://github.com/ansible/ansible-ai-connect-service"
6680

0 commit comments

Comments
 (0)