-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from bettersg/housekeeping-dev-setup
Housekeeping for improved dev setup
- Loading branch information
Showing
2,942 changed files
with
752 additions
and
240,274 deletions.
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 |
---|---|---|
@@ -1,9 +1,182 @@ | ||
# Initially taken from Github's Python gitignore file | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# tests and logs | ||
tests/fixtures/cached_*_text.txt | ||
logs/ | ||
lightning_logs/ | ||
lang_code_data/ | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# vscode | ||
.vs | ||
.vscode | ||
|
||
# Pycharm | ||
.idea | ||
|
||
# TF code | ||
tensorflow_code | ||
|
||
# Models | ||
proc_data | ||
|
||
# examples | ||
runs | ||
/runs_old | ||
/wandb | ||
/examples/runs | ||
/examples/**/*.args | ||
/examples/rag/sweep | ||
|
||
# data | ||
/data | ||
serialization_dir | ||
|
||
# emacs | ||
*.*~ | ||
debug.env | ||
|
||
# vim | ||
.*.swp | ||
|
||
#ctags | ||
tags | ||
|
||
# pre-commit | ||
.pre-commit* | ||
|
||
# .lock | ||
*.lock | ||
|
||
# DS_Store (MacOS) | ||
.DS_Store | ||
|
||
# ruff | ||
.ruff_cache | ||
|
||
|
||
backend/.env | ||
backend/ml_logic/schemesv2-torch-allmpp-model | ||
backend/ml_logic/schemesv2-torch-allmpp-model/config.json | ||
backend/ml_logic/schemesv2-torch-allmpp-model/model.safetensors | ||
backend/ml_logic/schemesv2-torch-allmpp-tokenizer | ||
backend/ml_logic/schemesv2-torch-allmpp-tokenizer/special_tokens_map.json | ||
backend/ml_logic/schemesv2-torch-allmpp-tokenizer/tokenizer_config.json | ||
backend/ml_logic/schemesv2-torch-allmpp-tokenizer/tokenizer.json | ||
backend/ml_logic/schemesv2-torch-allmpp-tokenizer/tokenizer_config.json | ||
backend/ml_logic/schemesv2-torch-allmpp-tokenizer/vocab.txt | ||
backend/ml_logic/schemesv2-your_embeddings.npy | ||
backend/ml_logic/schemesv2-your_index.faiss | ||
backend/ml_logic/schemesv2-your_index.faiss |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,17 +1,41 @@ | ||
FROM python:3.10.6-buster | ||
# Use a lightweight official Python image as a parent image | ||
FROM python:3.9-slim-buster | ||
|
||
# Set environment variables to ensure that Python outputs everything in the container and doesn't buffer stdout/stderr | ||
ENV PYTHONUNBUFFERED=1 \ | ||
POETRY_VERSION=1.8.3 \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_NO_INTERACTION=1 \ | ||
KMP_DUPLICATE_LIB_OK=TRUE | ||
|
||
# Install Poetry and create a non-root user | ||
RUN apt-get update && apt-get install --no-install-recommends -y curl \ | ||
&& curl -sSL https://install.python-poetry.org | python3 - \ | ||
&& ln -s $HOME/.local/bin/poetry /usr/local/bin/poetry \ | ||
&& apt-get purge -y --auto-remove curl \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& useradd --create-home appuser | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
# Copy only the necessary files to install dependencies | ||
COPY --chown=appuser:appuser pyproject.toml poetry.lock /app/ | ||
|
||
COPY . . | ||
# Install production dependencies only | ||
RUN poetry install --only main --no-root | ||
|
||
# require download spacy en core web sm.run | ||
# Copy the rest of the application code and set ownership to the non-root user | ||
COPY --chown=appuser:appuser . /app | ||
|
||
# Download the spaCy model | ||
RUN python -m spacy download en_core_web_sm | ||
|
||
# might face issue with library version conflict. run: | ||
# export KMP_DUPLICATE_LIB_OK=TRUE | ||
# Switch to non-root user | ||
USER appuser | ||
|
||
# Expose the port (optional: you can set the port via an environment variable) | ||
EXPOSE $PORT | ||
|
||
# You can add --port $PORT if you need to set PORT as a specific env variable | ||
CMD uvicorn fast_api.api:app --host 0.0.0.0 --port $PORT | ||
# Run the application with Uvicorn using shell form to expand environment variables | ||
CMD uvicorn fast_api.api:app --host 0.0.0.0 --port ${PORT:-8000} |
Oops, something went wrong.