adding feast

This commit is contained in:
Erik Stambaugh 2024-03-02 17:39:53 -08:00
parent d3bd07dcc6
commit c5afddbfd0
6 changed files with 51 additions and 13 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
notebooks
.*.sw*
cuda.deb
feast/repo

View file

@ -4,29 +4,39 @@ default: up
up: run
run: build
run: build setup
docker compose up
build: jupyter/Dockerfile
build: jupyter/Dockerfile feast/Dockerfile
docker compose build --progress plain
down:
docker compose down
# all of this assumes there's a single Nvidia GPU
precheck:
echo hihi
lspci | grep -i nvidia | head | awk '{ print $1 }'
DEVICE := $(shell lspci | grep -i nvidia | head | awk '{ print $1 }')
FILE := /sys/bus/pci/devices/0000:${DEVICE}/numa_node
NUMA_STATE := $(shell cat ${FILE})
if [[ ${NUMA_STATE} -ne 0 ]]; then \
check_numa:
@lspci | grep -i nvidia | head | awk '{ print $1 }'
@DEVICE := $(shell lspci | grep -i nvidia | head | awk '{ print $1 }')
@FILE := /sys/bus/pci/devices/0000:${DEVICE}/numa_node
@NUMA_STATE := $(shell cat ${FILE})
@if [[ ${NUMA_STATE} -ne 0 ]]; then \
echo "NUMA is not connected to your GPU. Try:"; \
echo " echo 0 | sudo tee ${FILE}"; \
exit 1; \
fi
setup: build feast/repo/feature_store.yaml feast/repo/data
.PHONY: default up run down build precheck
feast/repo/data:
docker compose run --rm -t feast bash -c 'cd /repo && feast apply'
feast/repo/feature_store.yaml: feast/repo
docker compose run --rm -t feast feast init repo
cp feast/feature_store.yaml feast/repo
feast/repo:
mkdir -p feast/repo
.PHONY: default up run down build check_numa setup

View file

@ -34,5 +34,13 @@ services:
count: all
capabilities: [gpu]
feast:
container_name: feast
build:
context: ./feast
dockerfile: Dockerfile
ports:
- 0.0.0.0:8086:8086
volumes:
- ./feast/repo:/repo

15
feast/Dockerfile Normal file
View file

@ -0,0 +1,15 @@
FROM ubuntu:23.10
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
python3-pip \
&& pip3 install --break-system-packages \
feast \
&& apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /repo
CMD feast serve -p 8086 -h 0.0.0.0

6
feast/feature_store.yaml Normal file
View file

@ -0,0 +1,6 @@
project: repo
registry: data/registry.db
provider: local
online_store:
type: sqlite
path: data/online_store.db

View file

@ -21,8 +21,6 @@ RUN pip3 install \
keras-tuner \
&& /bin/true # as above
#RUN find / -name jupyter && echo $PATH && /bin/false
ENV LD_LIBRARY_PATH /usr/local/cuda-12.0/compat:/usr/local/cuda-12.0/targets/x86_64-linux/lib/:$LD_LIBRARY_PATH
CMD ["/usr/local/bin/jupyter", "lab", "--ip", "0.0.0.0", "--port", "9001", "--no-browser", "--allow-root", "--LabApp.token=''", "--notebook-dir=/notebooks", "--ResourceUseDisplay.track_cpu_percent=True" ]