From c5afddbfd0d58ae5dda96bc4818ef8cc06667611 Mon Sep 17 00:00:00 2001 From: Erik Stambaugh Date: Sat, 2 Mar 2024 17:39:53 -0800 Subject: [PATCH] adding feast --- .gitignore | 1 + Makefile | 30 ++++++++++++++++++++---------- docker-compose.yaml | 10 +++++++++- feast/Dockerfile | 15 +++++++++++++++ feast/feature_store.yaml | 6 ++++++ jupyter/Dockerfile | 2 -- 6 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 feast/Dockerfile create mode 100644 feast/feature_store.yaml diff --git a/.gitignore b/.gitignore index af704f7..27d4364 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ notebooks .*.sw* cuda.deb +feast/repo diff --git a/Makefile b/Makefile index 6007c4d..f22c820 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docker-compose.yaml b/docker-compose.yaml index 109fb35..19851a1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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 diff --git a/feast/Dockerfile b/feast/Dockerfile new file mode 100644 index 0000000..634f371 --- /dev/null +++ b/feast/Dockerfile @@ -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 + diff --git a/feast/feature_store.yaml b/feast/feature_store.yaml new file mode 100644 index 0000000..f7833fd --- /dev/null +++ b/feast/feature_store.yaml @@ -0,0 +1,6 @@ +project: repo +registry: data/registry.db +provider: local +online_store: + type: sqlite + path: data/online_store.db diff --git a/jupyter/Dockerfile b/jupyter/Dockerfile index b7f08e2..3bb4eb7 100644 --- a/jupyter/Dockerfile +++ b/jupyter/Dockerfile @@ -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" ]