Skip to content

Commit e2e12de

Browse files
authored
Project compliance (#270)
* Shift pyproject.toml
1 parent d05d1d3 commit e2e12de

File tree

17 files changed

+142
-141
lines changed

17 files changed

+142
-141
lines changed

.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Copyright (c) 2024, 2025, Oracle and/or its affiliates.
2+
## Licensed under the Universal Permissive License v1.0 as shown at http://oss.oracle.com/licenses/upl.
3+
4+
# Ignore everything
5+
**
6+
7+
# Keep the src directory and pyproject.toml file
8+
!src/
9+
!pyproject.toml
10+
11+
# Inside src, ignore specific things
12+
src/**/Dockerfile*
13+
src/**/__pycache__/
14+
src/**/.pytest_cache/
15+
src/**/tns_admin/
16+
src/**/.oci/
17+
src/**/.*
18+
src/**/*.sh
19+
src/**/*.log
20+
21+
# But explicitly keep these
22+
!src/.streamlit
23+
!src/client/spring_ai/templates/env.sh
24+
!src/entrypoint.sh

.github/workflows/image_smoke.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@ jobs:
2626
matrix:
2727
build:
2828
- name: aio
29-
dockerfile: Dockerfile
30-
context: src
29+
dockerfile: src/Dockerfile
3130
- name: client
32-
dockerfile: client/Dockerfile
33-
context: src
31+
dockerfile: src/client/Dockerfile
3432
- name: server
35-
dockerfile: server/Dockerfile
36-
context: src
33+
dockerfile: src/server/Dockerfile
3734

3835
name: ${{ matrix.build.name }}
3936
steps:
@@ -58,17 +55,15 @@ jobs:
5855
docker buildx build \
5956
--cache-from=type=local,src=/tmp/.buildx-cache \
6057
--cache-to=type=local,dest=/tmp/.buildx-cache-new \
61-
--file ${{ matrix.build.context }}/${{ matrix.build.dockerfile }} \
58+
--file ${{ matrix.build.dockerfile }} \
6259
--tag ${{ matrix.build.name }}:${{ github.sha }} \
63-
--load \
64-
${{ matrix.build.context }}
60+
--load .
6561
else
6662
docker buildx build \
6763
--cache-from=type=local,src=/tmp/.buildx-cache \
6864
--cache-to=type=local,dest=/tmp/.buildx-cache-new \
69-
--file ${{ matrix.build.context }}/${{ matrix.build.dockerfile }} \
70-
--output=type=cacheonly \
71-
${{ matrix.build.context }}
65+
--file ${{ matrix.build.dockerfile }} \
66+
--output=type=cacheonly .
7267
fi
7368
7469
- name: Move Cache for Reuse

.github/workflows/pytest.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ jobs:
4848
4949
- name: Install dependencies
5050
run: |
51-
cd src/
52-
python -m pip install --upgrade pip wheel setuptools
53-
pip install torch==2.8.0+cpu -f https://download.pytorch.org/whl/cpu/torch
54-
pip install -e ".[all-test]"
51+
python -m pip install --upgrade pip wheel setuptools uv
52+
uv pip install torch==2.8.0+cpu -f https://download.pytorch.org/whl/cpu/torch --system
53+
uv pip install -e ".[all-test]" --system
5554
5655
- name: Run All Tests
5756
run: pytest

.github/workflows/releases.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ jobs:
5151

5252
- name: Build and Push Source
5353
run: |
54-
cd src
55-
zip -r $RUNNER_TEMP/${{ env.SRC }}.zip .
56-
tar -czf "$RUNNER_TEMP/${{ env.SRC }}.tar.gz" .
54+
zip -r $RUNNER_TEMP/${{ env.SRC }}.zip src pyproject.toml .dockerignore
55+
tar -czf "$RUNNER_TEMP/${{ env.SRC }}.tar.gz" src pyproject.toml .dockerignore
5756
gh release upload ${{github.event.release.tag_name}} "$RUNNER_TEMP/${{ env.SRC }}.zip" --clobber
5857
gh release upload ${{github.event.release.tag_name}} "$RUNNER_TEMP/${{ env.SRC }}.tar.gz" --clobber
5958
env:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ __pycache__/
3939
.pytest_cache
4040
*.py[cod]
4141
*$py.class
42-
*/*.egg-info
42+
**/*.egg-info
4343
**/build/
4444

4545
##############################################################################

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,21 @@ To run the application on bare-metal; download the [source](https://github.com/o
4141
1. Create and activate a Python Virtual Environment:
4242

4343
```bash
44-
cd src/
4544
python3.11 -m venv .venv --copies
4645
source .venv/bin/activate
47-
pip3.11 install --upgrade pip wheel setuptools
46+
pip3.11 install --upgrade pip wheel setuptools uv
4847
```
4948

5049
1. Install the Python modules:
5150

5251
```bash
53-
pip3.11 install -e ".[all]"
54-
source .venv/bin/activate
52+
uv pip install -e ".[all]"
5553
```
5654

5755
1. Start Streamlit:
5856

5957
```bash
58+
cd src/
6059
streamlit run launch_client.py --server.port 8501
6160
```
6261

@@ -70,11 +69,10 @@ To run the application in a container; download the [source](https://github.com/
7069

7170
1. Build the all-in-one image.
7271

73-
From the `src/` directory, build image:
72+
_Note:_ MacOS Silicon users may need to specify `--arch amd64`
7473

7574
```bash
76-
cd src/
77-
podman build -t ai-optimizer-aio .
75+
podman build -f src/Dockerfile -t ai-optimizer-aio .
7876
```
7977

8078
1. Start the Container:

docs/content/_index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ To run the application on bare-metal, download the latest release:
6969
cd ai-optimizer
7070
python3.11 -m venv .venv
7171
source .venv/bin/activate
72-
pip3.11 install --upgrade pip wheel
72+
pip3.11 install --upgrade pip wheel uv
7373
```
7474

7575
1. Install the Python modules:
7676

7777
```bash
78-
pip3.11 install -e ".[all]"
78+
uv pip install -e ".[all]"
7979
```
8080

8181
1. Start Streamlit:
@@ -108,8 +108,10 @@ To run the application in a container, download the latest release:
108108

109109
1. Build the *ai-optimizer-aio* image.
110110

111+
_Note:_ MacOS Silicon users may need to specify `--arch amd64`
112+
111113
```bash
112-
podman build -t ai-optimizer-aio .
114+
podman build -f src/Dockerfile -t ai-optimizer-aio .
113115
```
114116

115117
1. Start the Container:

docs/content/advanced/helm.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ You will need to build the {{< short_app_ref >}} container images and stage them
3939
```
4040

4141
1. Build the {{< short_app_ref >}} images:
42+
43+
_Note:_ Depending on the Kubernetes worker node architecture, you may need to specify `--arch amd64` or `--arch aarm64`
4244

43-
From the code source `src/` directory:
4445
```bash
45-
podman build --arch amd64 -f client/Dockerfile -t ai-optimizer-client:latest .
46+
podman build -f src/client/Dockerfile -t ai-optimizer-client:latest .
4647

47-
podman build --arch amd64 -f server/Dockerfile -t ai-optimizer-server:latest .
48+
podman build -f src/server/Dockerfile -t ai-optimizer-server:latest .
4849
```
4950

5051
1. Tag the {{< short_app_ref >}} images:

docs/content/walkthrough/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,11 @@ The {{< short_app_ref >}} provides an easy to use front-end for experimenting wi
145145

146146
1. Build the Container Image
147147

148+
_Note:_ MacOS Silicon users may need to specify `--arch amd64`
149+
148150
```bash
149151
cd ai-optimizer
150-
podman build --arch amd64 -t localhost/ai-optimizer-aio:latest .
152+
podman build -f src/Dockerfile -t localhost/ai-optimizer-aio:latest .
151153
```
152154

153155
1. Start the {{< short_app_ref >}}:

opentofu/modules/kubernetes/templates/k8s_manifest.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ spec:
136136
- --local
137137
- context=/workspace
138138
- --local
139-
- dockerfile=/workspace/server
139+
- dockerfile=/workspace/src/server
140140
- --output
141141
- type=image,name=${repository_server}:latest,push=true
142142
securityContext:
@@ -172,7 +172,7 @@ spec:
172172
- --local
173173
- context=/workspace
174174
- --local
175-
- dockerfile=/workspace/client
175+
- dockerfile=/workspace/src/client
176176
- --output
177177
- type=image,name=${repository_client}:latest,push=true
178178
securityContext:

0 commit comments

Comments
 (0)