Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -226,30 +226,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

-------------------------------

contrib/hamilton/contrib/user/skrawcz/customize_embeddings/__init__.py is copied
from https://github.com/openai/openai-cookbook and is licensed under the MIT License.

MIT License

Copyright (c) 2025 OpenAI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions hamilton/dataflows/template/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
# Purpose of this module


Expand Down
19 changes: 19 additions & 0 deletions hamilton/dataflows/template/author.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# {github_username}

Hi I'm ...
Expand Down
14 changes: 11 additions & 3 deletions ui/backend/Dockerfile.backend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference, there are ways to optimize the Docker build process such that it uses the host's local uv cache when building Python dependencies inside the container. This can lead to significant speed improvement in dev

example: https://github.com/astral-sh/uv-docker-example/blob/main/multistage.Dockerfile

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim
FROM python:3.9-slim

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand All @@ -10,9 +10,17 @@ RUN apt-get update && apt-get install -y \
gcc \
libc-dev \
libffi-dev \
curl \
&& rm -rf /var/lib/apt/lists/*

COPY server/requirements.txt /code/
RUN pip install -r /code/requirements.txt
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Copy dependency files
COPY server/requirements-locked.txt /code/server/

# Install dependencies using uv
RUN cd /code/server && uv pip install --system --no-cache -r requirements-locked.txt

# Copy application code
COPY . /code/
14 changes: 9 additions & 5 deletions ui/backend/Dockerfile.backend-prod
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
FROM python:3.8-slim
FROM python:3.9-slim

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /code

# Install system dependencies
# Install system dependencies and uv
RUN apt-get update && apt-get install -y \
gcc \
libc-dev \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*
curl \
&& rm -rf /var/lib/apt/lists/* \
&& curl -LsSf https://astral.sh/uv/install.sh | sh

ENV PATH="/root/.local/bin:$PATH"

COPY . /code/
COPY server/requirements.txt /code/
COPY server/requirements-locked.txt /code/

RUN pip install -r /code/requirements.txt
RUN uv pip install --system -r /code/requirements-locked.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that Dockerfile.backend and Dockerfile.backend-prod already existed, but it seems they were identical except the additional line 15 (origin) in backend-prod?

I have a few questions:

  • why are two files needed?
  • why use the frozen requirements-locked.txt in backend-prod? This just seems like a weaker uv.lock. Are there any particular trade-offs?
  • In backend-prod, the line COPY . /code/ appears twice (line 15 and line 20 in origin). Is this intended?


COPY . /code/
30 changes: 30 additions & 0 deletions ui/backend/server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[project]
name = "hamilton-ui-backend"
version = "0.1.0"
description = "Hamilton UI Backend Server"
requires-python = ">=3.9"
dependencies = [
"aioboto3",
"aiobotocore",
"aiofiles",
"aiohttp",
"colorlog",
"ddtrace",
"django",
"django-extensions",
"django-ninja>=1.1.0",
"passlib",
"propelauth-py",
"psycopg2-binary",
"pydantic",
"sf-hamilton",
]

[project.optional-dependencies]
test = [
"pytest",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
205 changes: 205 additions & 0 deletions ui/backend/server/requirements-locked.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# This file was autogenerated by uv via the following command:
# uv export --no-hashes --no-emit-package hamilton-ui-backend
aioboto3==15.2.0
# via hamilton-ui-backend
aiobotocore==2.24.2
# via
# aioboto3
# hamilton-ui-backend
aiofiles==24.1.0
# via
# aioboto3
# hamilton-ui-backend
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.15
# via
# aiobotocore
# hamilton-ui-backend
aioitertools==0.12.0
# via aiobotocore
aiosignal==1.4.0
# via aiohttp
annotated-types==0.7.0
# via pydantic
anyio==4.11.0
# via httpx
asgiref==3.10.0
# via django
async-timeout==5.0.1 ; python_full_version < '3.11'
# via aiohttp
attrs==25.3.0
# via aiohttp
boto3==1.40.18
# via aiobotocore
botocore==1.40.18
# via
# aiobotocore
# boto3
# s3transfer
bytecode==0.17.0
# via ddtrace
certifi==2025.10.5
# via
# httpcore
# httpx
# requests
cffi==2.0.0 ; platform_python_implementation != 'PyPy'
# via cryptography
charset-normalizer==3.4.3
# via requests
colorama==0.4.6 ; sys_platform == 'win32'
# via colorlog
colorlog==6.9.0
# via hamilton-ui-backend
cryptography==46.0.2
# via pyjwt
ddtrace==3.15.0
# via hamilton-ui-backend
django==4.2.25 ; python_full_version < '3.10'
# via
# django-extensions
# django-ninja
# hamilton-ui-backend
django==5.2.7 ; python_full_version >= '3.10'
# via
# django-extensions
# django-ninja
# hamilton-ui-backend
django-extensions==4.1
# via hamilton-ui-backend
django-ninja==1.4.3
# via hamilton-ui-backend
envier==0.6.1
# via ddtrace
exceptiongroup==1.3.0 ; python_full_version < '3.11'
# via anyio
frozenlist==1.7.0
# via
# aiohttp
# aiosignal
h11==0.16.0
# via httpcore
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via propelauth-py
idna==3.10
# via
# anyio
# httpx
# requests
# yarl
importlib-metadata==8.7.0
# via opentelemetry-api
jmespath==1.0.1
# via
# aiobotocore
# boto3
# botocore
legacy-cgi==2.6.3 ; python_full_version >= '3.13'
# via ddtrace
multidict==6.6.4
# via
# aiobotocore
# aiohttp
# yarl
mypy-extensions==1.1.0
# via typing-inspect
numpy==2.0.2 ; python_full_version < '3.10'
# via
# pandas
# sf-hamilton
numpy==2.2.6 ; python_full_version == '3.10.*'
# via
# pandas
# sf-hamilton
numpy==2.3.3 ; python_full_version >= '3.11'
# via
# pandas
# sf-hamilton
opentelemetry-api==1.37.0
# via ddtrace
pandas==2.3.3
# via sf-hamilton
passlib==1.7.4
# via hamilton-ui-backend
propcache==0.4.0
# via
# aiohttp
# yarl
propelauth-py==4.2.8
# via hamilton-ui-backend
protobuf==6.32.1
# via ddtrace
psycopg2-binary==2.9.10
# via hamilton-ui-backend
pycparser==2.23 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy'
# via cffi
pydantic==2.11.10
# via
# django-ninja
# hamilton-ui-backend
pydantic-core==2.33.2
# via pydantic
pyjwt==2.10.1
# via propelauth-py
python-dateutil==2.9.0.post0
# via
# aiobotocore
# botocore
# pandas
pytz==2025.2
# via pandas
requests==2.32.5
# via propelauth-py
s3transfer==0.13.1
# via boto3
sf-hamilton==1.88.0
# via hamilton-ui-backend
six==1.17.0
# via python-dateutil
sniffio==1.3.1
# via anyio
sqlparse==0.5.3
# via django
typing-extensions==4.15.0
# via
# aioitertools
# aiosignal
# anyio
# asgiref
# bytecode
# cryptography
# exceptiongroup
# multidict
# opentelemetry-api
# pydantic
# pydantic-core
# sf-hamilton
# typing-inspect
# typing-inspection
typing-inspect==0.9.0
# via sf-hamilton
typing-inspection==0.4.2
# via pydantic
tzdata==2025.2
# via
# django
# pandas
urllib3==1.26.20 ; python_full_version < '3.10'
# via
# botocore
# requests
urllib3==2.5.0 ; python_full_version >= '3.10'
# via
# botocore
# requests
wrapt==1.17.3
# via
# aiobotocore
# ddtrace
yarl==1.20.1
# via aiohttp
zipp==3.23.0
# via importlib-metadata
Loading
Loading