-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bff4d2
commit 1a0c426
Showing
4 changed files
with
51 additions
and
33 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
REPO_DIR=$(realpath $SCRIPT_DIR/../..) | ||
|
||
ORIGIN_DOCKERFILE=${REPO_DIR}/Dockerfile | ||
BASE_DOCKERFILE=${SCRIPT_DIR}/Dockerfile | ||
|
||
BASE_IMAGE=$(cat $ORIGIN_DOCKERFILE | grep FROM | head -1 | awk '{print $2}') | ||
echo FROM $BASE_IMAGE > $BASE_DOCKERFILE | ||
|
||
echo ENV INSTALL_OPTIONAL=TRUE >> $BASE_DOCKERFILE | ||
echo ENV FLASH_ATTENTION_FORCE_BUILD=TRUE >> $BASE_DOCKERFILE | ||
|
||
echo RUN apt-get update >> $BASE_DOCKERFILE | ||
echo 'RUN DEBIAN_FRONTEND="noninteractive" TZ=Etc/UTC apt-get install -y git python3 python3-pip python3-packaging && rm -rf /var/lib/{apt,dpkg,cache,log}' >> $BASE_DOCKERFILE | ||
|
||
TORCH_STR=$(cat $ORIGIN_DOCKERFILE | grep torch==) | ||
|
||
echo ${TORCH_STR} >> $BASE_DOCKERFILE | ||
echo RUN pip install ninja >> $BASE_DOCKERFILE | ||
|
||
REQUIREMENTS=$(cat $SCRIPT_DIR/requirements.txt) | ||
IFS=$'\n' read -rd '' -a REQUIREMENTS <<<"$REQUIREMENTS" | ||
|
||
for requirement in "${REQUIREMENTS[@]}" | ||
do | ||
echo "RUN MAX_JOBS=8 pip install -v $requirement" >> $BASE_DOCKERFILE | ||
done | ||
|
||
docker buildx build --platform linux/amd64 -t ghcr.io/smallcloud/refact_base_image:latest --push -f $BASE_DOCKERFILE $REPO_DIR |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#/bin/bash | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
REPO_DIR=$(realpath $SCRIPT_DIR/../..) | ||
|
||
ORIGIN_DOCKERFILE=${REPO_DIR}/Dockerfile | ||
BASE_IMAGE=$(cat $ORIGIN_DOCKERFILE | grep FROM | head -1 | awk '{print $2}') | ||
|
||
CACHE_IMAGE="ghcr.io/smallcloud/refact_base_image:latest" | ||
|
||
sed -i "s!${BASE_IMAGE}!${CACHE_IMAGE}!" ${ORIGIN_DOCKERFILE} | ||
|
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
git+https://github.com/smallcloudai/flash-attention@feat/alibi | ||
git+https://github.com/smallcloudai/vllm@refact_model_deps |
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