-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/raae 9/repo upgrades #23
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5b77e36
restructure
tylerhutcherson 0453472
use gui
tylerhutcherson af3cc86
udpates to docker compose
tylerhutcherson fd5bd42
updates to reqs
tylerhutcherson 6870662
before pulling in redisvl changes
rbs333 e30513f
merge redisvl changes
rbs333 b6424a0
first working version
rbs333 904a21f
first working local tests
rbs333 e00858c
format, mypy, etc.
rbs333 4db2e2e
Readme updates
rbs333 dc96fc4
update branch name
rbs333 0b1d062
working docker and other cleanup
rbs333 553c11b
add default for testing
rbs333 05ee76c
more cleanup
rbs333 304b96f
feedback updates
rbs333 2e7e4ed
last cleanup
rbs333 e118b96
remove comment
rbs333 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Test Suite | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
name: Python ${{ matrix.python-version }} - ${{ matrix.connection }} [redis-stack ${{matrix.redis-stack-version}}] | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.11"] | ||
redis-stack-version: ['latest'] | ||
|
||
services: | ||
redis: | ||
image: redis/redis-stack-server:${{matrix.redis-stack-version}} | ||
ports: | ||
- 6379:6379 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Install dependencies | ||
working-directory: ./backend | ||
run: | | ||
poetry install --all-extras | ||
|
||
- name: Run tests | ||
working-directory: ./backend | ||
run: | | ||
poetry run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
*.egg-info | ||
build | ||
__pycache__ | ||
node_modules | ||
.DS_Store | ||
images | ||
.ipynb_checkpoints | ||
product_metadata.json | ||
product_vectors.json | ||
product_vectors.json | ||
data/ | ||
!backend/data | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python Debugger: FastAPI", | ||
"type": "debugpy", | ||
"cwd": "${workspaceFolder}/backend/", | ||
"env": { | ||
"PYTHONPATH": "${cwd}", | ||
"REDIS_HOST": "localhost", | ||
}, | ||
"request": "launch", | ||
"module": "uvicorn", | ||
"args": [ | ||
"productsearch.main:app", | ||
"--port=8888", | ||
"--reload" | ||
], | ||
"jinja": true, | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"python.testing.pytestArgs": [ | ||
"backend" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.cwd": "${workspaceFolder}/backend/", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,46 @@ | ||
FROM node:18.8-alpine AS ReactImage | ||
FROM node:22.0-alpine AS ReactImage | ||
|
||
WORKDIR /app/gui | ||
WORKDIR /app/frontend | ||
|
||
ENV NODE_PATH=/app/gui/node_modules | ||
ENV PATH=$PATH:/app/gui/node_modules/.bin | ||
ENV NODE_PATH=/app/frontend/node_modules | ||
ENV PATH=$PATH:/app/frontend/node_modules/.bin | ||
|
||
COPY ./gui/package.json ./ | ||
RUN yarn install --no-optional | ||
COPY ./frontend/package.json ./ | ||
RUN npm install | ||
|
||
ADD ./gui ./ | ||
RUN yarn build | ||
ADD ./frontend ./ | ||
RUN npm run build | ||
|
||
FROM python:3.8-slim-buster AS ApiImage | ||
FROM python:3.11-slim-buster AS ApiImage | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tylerhutcherson slim worked fine for this one so kept the smaller sizes |
||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
RUN python3 -m pip install --upgrade pip setuptools wheel | ||
|
||
WORKDIR /app/ | ||
COPY ./data/ ./data | ||
VOLUME [ "/data" ] | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \ | ||
cd /usr/local/bin && \ | ||
ln -s /opt/poetry/bin/poetry && \ | ||
poetry config virtualenvs.create false | ||
|
||
RUN mkdir -p /app/backend | ||
|
||
# copy deps first so we don't have to reload everytime | ||
COPY ./backend/poetry.lock ./backend/pyproject.toml ./backend/ | ||
|
||
WORKDIR /app/backend | ||
RUN poetry install --all-extras --no-interaction | ||
|
||
COPY ./app/ . | ||
RUN pip install -e . | ||
COPY ./backend/ . | ||
|
||
# add static react files to fastapi image | ||
COPY --from=ReactImage /app/gui/build /app/backend/vecsim_app/templates/build | ||
COPY --from=ReactImage /app/frontend/build /app/backend/productsearch/templates/build | ||
|
||
LABEL org.opencontainers.image.source https://github.com/RedisVentures/redis-product-search | ||
|
||
WORKDIR /app/backend/vecsim_app | ||
|
||
CMD ["sh", "./entrypoint.sh"] | ||
CMD ["poetry", "run", "start-app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the setup for vscode debugger. I like to check these in in case people want it for development purposes since it's a reference architecture.