Skip to content

Commit cf62cfd

Browse files
authored
add runpod envs to .bashrc, fix bnb env (axolotl-ai-cloud#316)
* 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
1 parent c5df969 commit cf62cfd

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

.github/workflows/main.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@ jobs:
6969
strategy:
7070
matrix:
7171
include:
72-
- cuda: cu118
72+
- cuda: 118
7373
cuda_version: 11.8.0
7474
python_version: "3.9"
7575
pytorch: 2.0.1
7676
axolotl_extras:
77-
- cuda: cu118
77+
- cuda: 118
7878
cuda_version: 11.8.0
7979
python_version: "3.10"
8080
pytorch: 2.0.1
8181
axolotl_extras:
82-
- cuda: cu118
82+
- cuda: 118
8383
cuda_version: 11.8.0
8484
python_version: "3.9"
8585
pytorch: 2.0.1
8686
axolotl_extras: gptq
87-
- cuda: cu117
87+
- cuda: 117
8888
cuda_version: 11.7.1
8989
python_version: "3.9"
9090
pytorch: 1.13.1
@@ -110,8 +110,9 @@ jobs:
110110
with:
111111
context: .
112112
build-args: |
113-
BASE_TAG=${{ github.ref_name }}-py${{ matrix.python_version }}-${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
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 }}
114115
file: ./docker/Dockerfile-runpod
115116
push: ${{ github.event_name != 'pull_request' }}
116-
tags: ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
117+
tags: ${{ steps.metadata.outputs.tags }}-py${{ matrix.python_version }}-cu${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
117118
labels: ${{ steps.metadata.outputs.labels }}

docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ FROM winglian/axolotl-base:$BASE_TAG
33

44
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
55
ARG AXOLOTL_EXTRAS=""
6+
ARG CUDA="118"
7+
ENV BNB_CUDA_VERSION=$CUDA
68

79
RUN apt-get update && \
810
apt-get install -y vim curl

scripts/runpod-entrypoint.sh

100644100755
+15-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
#!/bin/bash
22

3-
echo $PUBLIC_KEY >> ~/.ssh/authorized_keys
4-
chmod 700 -R ~/.ssh
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
57

6-
# Start the SSH service in the background
7-
service ssh start
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
819

920
# Execute the passed arguments (CMD)
1021
exec "$@"

0 commit comments

Comments
 (0)