File tree Expand file tree Collapse file tree 3 files changed +76
-0
lines changed
Expand file tree Collapse file tree 3 files changed +76
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build TT SMI Docker image
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ image_name :
7+ description : " Docker image name"
8+ required : true
9+ default : " dstackai/tt-smi"
10+ tt_smi_version :
11+ description : " TT SMI version"
12+ required : true
13+ default : " 3.0.25"
14+
15+ jobs :
16+ build-tt-smi :
17+ defaults :
18+ run :
19+ working-directory : docker/tt-smi
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v4
24+ - name : Set up Docker Buildx
25+ uses : docker/setup-buildx-action@v3
26+ - name : Login to DockerHub
27+ uses : docker/login-action@v3
28+ with :
29+ username : ${{ secrets.DOCKERHUB_USERNAME }}
30+ password : ${{ secrets.DOCKERHUB_TOKEN }}
31+ - name : Build and upload to DockerHub
32+ run : |
33+ IMAGE_NAME=${{ inputs.image_name }}
34+ docker buildx build . \
35+ --load \
36+ --provenance=false \
37+ --platform linux/amd64 \
38+ --build-arg IMAGE_NAME=${IMAGE_NAME} \
39+ --build-arg TT_SMI_VERSION=${{ inputs.tt_smi_version }} \
40+ --build-arg BUILD_DATE=$(date --utc --iso-8601=seconds)Z \
41+ --tag ${IMAGE_NAME}:latest
42+ VERSION=$(docker inspect --format '{{ index .Config.Labels "org.opencontainers.image.version" }}' ${IMAGE_NAME})
43+ docker tag ${IMAGE_NAME}:latest ${IMAGE_NAME}:${VERSION}
44+ docker push ${IMAGE_NAME}:${VERSION}
45+ docker push ${IMAGE_NAME}:latest
Original file line number Diff line number Diff line change 1+ FROM ubuntu:20.04
2+
3+ ARG IMAGE_NAME
4+ ARG TT_SMI_VERSION
5+ ARG BUILD_DATE
6+
7+ ENV PATH="/root/.cargo/bin:${PATH}"
8+
9+ RUN \
10+ apt-get update && \
11+ apt-get install -y curl git python3 python3-pip && \
12+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
13+ pip3 install --no-cache-dir git+https://github.com/tenstorrent/tt-smi@v${TT_SMI_VERSION} && \
14+ apt-get clean && \
15+ rm -rf /var/lib/apt/lists/*
16+
17+ ENTRYPOINT ["/usr/local/bin/tt-smi" ]
18+ CMD ["--help" ]
19+
20+ LABEL org.opencontainers.image.title="${IMAGE_NAME}"
21+ LABEL org.opencontainers.image.version="${TT_SMI_VERSION}"
22+ LABEL org.opencontainers.image.created="${BUILD_DATE}"
Original file line number Diff line number Diff line change 1+ # dstack TT SMI
2+
3+ An Ubuntu-based image with [ TT SMI] ( https://github.com/tenstorrent/tt-smi/ ) preinstalled. Suitable for Tenstorrent GPU detection.
4+
5+ ## Usage
6+
7+ ``` shell
8+ docker run --device /dev/tenstorrent/ dstackai/tt-smi -s
9+ ```
You can’t perform that action at this time.
0 commit comments