add runpod envs to .bashrc, fix bnb env (#316)
Browse files* hopper support for base dockerfile, add runpod envs to .bashrc
* set BNB_CUDA_VERSION env for latest bnb
* don't support hopper yet w 118
- .github/workflows/main.yml +7 -6
- docker/Dockerfile +2 -0
- scripts/runpod-entrypoint.sh +15 -4
.github/workflows/main.yml
CHANGED
|
@@ -69,22 +69,22 @@ jobs:
|
|
| 69 |
strategy:
|
| 70 |
matrix:
|
| 71 |
include:
|
| 72 |
-
- cuda:
|
| 73 |
cuda_version: 11.8.0
|
| 74 |
python_version: "3.9"
|
| 75 |
pytorch: 2.0.1
|
| 76 |
axolotl_extras:
|
| 77 |
-
- cuda:
|
| 78 |
cuda_version: 11.8.0
|
| 79 |
python_version: "3.10"
|
| 80 |
pytorch: 2.0.1
|
| 81 |
axolotl_extras:
|
| 82 |
-
- cuda:
|
| 83 |
cuda_version: 11.8.0
|
| 84 |
python_version: "3.9"
|
| 85 |
pytorch: 2.0.1
|
| 86 |
axolotl_extras: gptq
|
| 87 |
-
- cuda:
|
| 88 |
cuda_version: 11.7.1
|
| 89 |
python_version: "3.9"
|
| 90 |
pytorch: 1.13.1
|
|
@@ -110,8 +110,9 @@ jobs:
|
|
| 110 |
with:
|
| 111 |
context: .
|
| 112 |
build-args: |
|
| 113 |
-
BASE_TAG=${{ github.ref_name }}-py${{ matrix.python_version }}
|
|
|
|
| 114 |
file: ./docker/Dockerfile-runpod
|
| 115 |
push: ${{ github.event_name != 'pull_request' }}
|
| 116 |
-
tags: ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}
|
| 117 |
labels: ${{ steps.metadata.outputs.labels }}
|
|
|
|
| 69 |
strategy:
|
| 70 |
matrix:
|
| 71 |
include:
|
| 72 |
+
- cuda: 118
|
| 73 |
cuda_version: 11.8.0
|
| 74 |
python_version: "3.9"
|
| 75 |
pytorch: 2.0.1
|
| 76 |
axolotl_extras:
|
| 77 |
+
- cuda: 118
|
| 78 |
cuda_version: 11.8.0
|
| 79 |
python_version: "3.10"
|
| 80 |
pytorch: 2.0.1
|
| 81 |
axolotl_extras:
|
| 82 |
+
- cuda: 118
|
| 83 |
cuda_version: 11.8.0
|
| 84 |
python_version: "3.9"
|
| 85 |
pytorch: 2.0.1
|
| 86 |
axolotl_extras: gptq
|
| 87 |
+
- cuda: 117
|
| 88 |
cuda_version: 11.7.1
|
| 89 |
python_version: "3.9"
|
| 90 |
pytorch: 1.13.1
|
|
|
|
| 110 |
with:
|
| 111 |
context: .
|
| 112 |
build-args: |
|
| 113 |
+
BASE_TAG=${{ github.ref_name }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
|
| 114 |
+
CUDA=${{ matrix.cuda }}
|
| 115 |
file: ./docker/Dockerfile-runpod
|
| 116 |
push: ${{ github.event_name != 'pull_request' }}
|
| 117 |
+
tags: ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
|
| 118 |
labels: ${{ steps.metadata.outputs.labels }}
|
docker/Dockerfile
CHANGED
|
@@ -3,6 +3,8 @@ FROM winglian/axolotl-base:$BASE_TAG
|
|
| 3 |
|
| 4 |
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
| 5 |
ARG AXOLOTL_EXTRAS=""
|
|
|
|
|
|
|
| 6 |
|
| 7 |
RUN apt-get update && \
|
| 8 |
apt-get install -y vim curl
|
|
|
|
| 3 |
|
| 4 |
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
| 5 |
ARG AXOLOTL_EXTRAS=""
|
| 6 |
+
ARG CUDA="118"
|
| 7 |
+
ENV BNB_CUDA_VERSION=$CUDA
|
| 8 |
|
| 9 |
RUN apt-get update && \
|
| 10 |
apt-get install -y vim curl
|
scripts/runpod-entrypoint.sh
CHANGED
|
@@ -1,10 +1,21 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Execute the passed arguments (CMD)
|
| 10 |
exec "$@"
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# Export specific ENV variables to /etc/rp_environment
|
| 4 |
+
echo "Exporting environment variables..."
|
| 5 |
+
printenv | grep -E '^RUNPOD_|^PATH=|^_=' | sed 's/^\(.*\)=\(.*\)$/export \1="\2"/' >> /etc/rp_environment
|
| 6 |
+
echo 'source /etc/rp_environment' >> ~/.bashrc
|
| 7 |
|
| 8 |
+
if [[ $PUBLIC_KEY ]]
|
| 9 |
+
then
|
| 10 |
+
mkdir -p ~/.ssh
|
| 11 |
+
chmod 700 ~/.ssh
|
| 12 |
+
echo $PUBLIC_KEY >> ~/.ssh/authorized_keys
|
| 13 |
+
chmod 700 -R ~/.ssh
|
| 14 |
+
# Start the SSH service in the background
|
| 15 |
+
service ssh start
|
| 16 |
+
else
|
| 17 |
+
echo "No PUBLIC_KEY ENV variable provided, not starting openSSH daemon"
|
| 18 |
+
fi
|
| 19 |
|
| 20 |
# Execute the passed arguments (CMD)
|
| 21 |
exec "$@"
|