Skip to content

Commit

Permalink
fix: all docker filepaths weights folders, use local weights
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaansehgal99 committed Oct 16, 2023
1 parent 4017ead commit 413d1ed
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/preset-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ jobs:
IFS=';' read -ra ADDR <<< "$FILES_MODIFIED"
for file in "${ADDR[@]}"; do
echo "Checking file: $file"
if [[ "$file" == pkg/presets/falcon/* ]] && [[ "$FALCON_MODIFIED" == false ]]; then
if [[ "$file" == presets/falcon/* ]] && [[ "$FALCON_MODIFIED" == false ]]; then
echo "File matches falcon path: $file"
FALCON_MODIFIED=true
elif [[ "$file" == pkg/presets/llama-2/* ]] && [[ "$LLAMA2_MODIFIED" == false ]]; then
elif [[ "$file" == presets/llama-2/* ]] && [[ "$LLAMA2_MODIFIED" == false ]]; then
echo "File matches llama-2 path: $file"
LLAMA2_MODIFIED=true
elif [[ "$file" == pkg/presets/llama-2-chat/* ]] && [[ "$LLAMA2_CHAT_MODIFIED" == false ]]; then
elif [[ "$file" == presets/llama-2-chat/* ]] && [[ "$LLAMA2_CHAT_MODIFIED" == false ]]; then
echo "File matches llama-2-chat path: $file"
LLAMA2_CHAT_MODIFIED=true
else
Expand Down Expand Up @@ -139,19 +139,19 @@ jobs:

- name: llama-2-7b
dockerfile: docker/presets/llama-2/Dockerfile
build_args: "--build-arg EXTERNAL_IP=__EXTERNAL_IP__ --build-arg EXTERNAL_PORT=__EXTERNAL_PORT__ --build-arg LLAMA_VERSION=llama-2-7b --build-arg SRC_DIR=pkg/presets/llama-2 --build-arg WEB_SERVER_AUTH_TOKEN=__WEB_SERVER_AUTH_TOKEN__"
build_args: "--build-arg LLAMA_VERSION=llama-2-7b --build-arg SRC_DIR=/home/presets/llama-2"

- name: llama-2-7b-chat
dockerfile: docker/presets/llama-2/Dockerfile
build_args: "--build-arg EXTERNAL_IP=__EXTERNAL_IP__ --build-arg EXTERNAL_PORT=__EXTERNAL_PORT__ --build-arg LLAMA_VERSION=llama-2-7b-chat --build-arg SRC_DIR=pkg/presets/llama-2-chat --build-arg WEB_SERVER_AUTH_TOKEN=__WEB_SERVER_AUTH_TOKEN__"
build_args: "--build-arg LLAMA_VERSION=llama-2-7b-chat --build-arg SRC_DIR=/home/presets/llama-2-chat"

- name: llama-2-13b
dockerfile: docker/presets/llama-2/Dockerfile
build_args: "--build-arg EXTERNAL_IP=__EXTERNAL_IP__ --build-arg EXTERNAL_PORT=__EXTERNAL_PORT__ --build-arg LLAMA_VERSION=llama-2-13b --build-arg SRC_DIR=pkg/presets/llama-2 --build-arg WEB_SERVER_AUTH_TOKEN=__WEB_SERVER_AUTH_TOKEN__"
build_args: "--build-arg LLAMA_VERSION=llama-2-13b --build-arg SRC_DIR=/home/presets/llama-2"

- name: llama-2-13b-chat
dockerfile: docker/presets/llama-2/Dockerfile
build_args: "--build-arg EXTERNAL_IP=__EXTERNAL_IP__ --build-arg EXTERNAL_PORT=__EXTERNAL_PORT__ --build-arg LLAMA_VERSION=llama-2-13b-chat --build-arg SRC_DIR=pkg/presets/llama-2-chat --build-arg WEB_SERVER_AUTH_TOKEN=__WEB_SERVER_AUTH_TOKEN__"
build_args: "--build-arg LLAMA_VERSION=llama-2-13b-chat --build-arg SRC_DIR=/home/presets/llama-2-chat"

include:
- name: falcon-7b
Expand Down Expand Up @@ -235,11 +235,11 @@ jobs:

- name: llama-2-70b
dockerfile: docker/presets/llama-2/Dockerfile
build_args: "--build-arg EXTERNAL_IP=__EXTERNAL_IP__ --build-arg EXTERNAL_PORT=__EXTERNAL_PORT__ --build-arg LLAMA_VERSION=llama-2-70b --build-arg SRC_DIR=/home/pkg/presets/llama-2 --build-arg WEB_SERVER_AUTH_TOKEN=__WEB_SERVER_AUTH_TOKEN__"
build_args: "--build-arg LLAMA_VERSION=llama-2-70b --build-arg SRC_DIR=/home/presets/llama-2"

- name: llama-2-70b-chat
dockerfile: docker/presets/llama-2/Dockerfile
build_args: "--build-arg EXTERNAL_IP=__EXTERNAL_IP__ --build-arg EXTERNAL_PORT=__EXTERNAL_PORT__ --build-arg LLAMA_VERSION=llama-2-70b-chat --build-arg SRC_DIR=/home/pkg/presets/llama-2-chat --build-arg WEB_SERVER_AUTH_TOKEN=__WEB_SERVER_AUTH_TOKEN__"
build_args: "--build-arg LLAMA_VERSION=llama-2-70b-chat --build-arg SRC_DIR=/home/presets/llama-2-chat"

include:
# TODO: Support large models
Expand Down Expand Up @@ -324,9 +324,6 @@ jobs:
retries=3
while [ $retries -gt 0 ]; do
BUILD_ARGS="${{ matrix.model.build_args }}"
BUILD_ARGS=${BUILD_ARGS/__EXTERNAL_IP__/${{ secrets.AZURE_WEB_SERVER_EXTERNAL_IP }}}
BUILD_ARGS=${BUILD_ARGS/__EXTERNAL_PORT__/${{ secrets.AZURE_WEB_SERVER_EXTERNAL_PORT }}}
BUILD_ARGS=${BUILD_ARGS/__WEB_SERVER_AUTH_TOKEN__/${{ secrets.WEB_SERVER_AUTH_TOKEN }}}
echo "Docker BUILD_ARGS: $BUILD_ARGS"
Expand Down
5 changes: 5 additions & 0 deletions docker/presets/download_script.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* This script allows you to download llama and falcon weights using parallel wget.
* Llama is to be downloaded via hosted web server.
* Falcon from public url.
*/
package main

import (
Expand Down
5 changes: 2 additions & 3 deletions docker/presets/falcon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ RUN pip install --no-cache-dir -r requirements.txt

ARG FALCON_MODEL_NAME

COPY /home/docker/presets/download_script.go /workspace/download_script.go
RUN go run /workspace/download_script.go "public" ${FALCON_MODEL_NAME} "/workspace/falcon/weights"

# Copy the entire model to the weights directory
COPY /falcon/${FALCON_MODEL_NAME} /workspace/falcon/weights
# Copy the entire 'presets/falcon' folder to the working directory
COPY /home/presets/falcon /workspace/falcon
14 changes: 7 additions & 7 deletions docker/presets/llama-2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ RUN pip install 'uvicorn[standard]'

ARG LLAMA_VERSION
ARG SRC_DIR
ARG EXTERNAL_IP
ARG EXTERNAL_PORT
ARG WEB_SERVER_AUTH_TOKEN
# ARG EXTERNAL_IP
# ARG EXTERNAL_PORT
# ARG WEB_SERVER_AUTH_TOKEN

ENV AUTH_TOKEN_ENV_VAR=${WEB_SERVER_AUTH_TOKEN}
# ENV AUTH_TOKEN_ENV_VAR=${WEB_SERVER_AUTH_TOKEN}

# Copy Go download script into the Docker image
COPY /home/docker/presets/download_script.go /workspace/download_script.go
# COPY /home/docker/presets/download_script.go /workspace/download_script.go

# Use Go download script to fetch model weights
RUN go run /workspace/download_script.go "private" ${LLAMA_VERSION} "/workspace/llama/llama-2/weights" ${EXTERNAL_IP} ${EXTERNAL_PORT}

# RUN go run /workspace/download_script.go "private" ${LLAMA_VERSION} "/workspace/llama/llama-2/weights" ${EXTERNAL_IP} ${EXTERNAL_PORT}
ADD /llama/${LLAMA_VERSION} /workspace/llama/llama-2/weights
ADD ${SRC_DIR} /workspace/llama/llama-2
6 changes: 6 additions & 0 deletions presets/k8s/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ spec:
mountPath: /home
- name: llama-volume
mountPath: /home/llama
- name: falcon-volume
mountPath: /home/falcon
volumes:
- name: host-volume
hostPath:
Expand All @@ -30,4 +32,8 @@ spec:
- name: llama-volume
hostPath:
path: /llama
type: Directory
- name: falcon-volume
hostPath:
path: /falcon
type: Directory

0 comments on commit 413d1ed

Please sign in to comment.