-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor fix to ros-images and added pytorch image for r36.3.0
- Loading branch information
1 parent
075fb3e
commit be6486c
Showing
6 changed files
with
168 additions
and
4 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
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,70 @@ | ||
name: Jetson Pytorch 2.4.0 r36.3.0 | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/r3630-pytorch204.yml" | ||
- "pytorch-images/r3630.204.Dockerfile" | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/workflows/r3630-pytorch204.yml" | ||
- "pytorch-images/r3630.204.Dockerfile" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
OWNER: kalanaratnayake | ||
IMAGE_NAME: jetson-pytorch | ||
|
||
# https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
run: | | ||
docker login --username ${{ env.OWNER }} --password ${{ secrets.GH_PAT }} ghcr.io | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# registry: ${{ env.REGISTRY }} | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- | ||
name: Build and Push image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./pytorch-images/r3630.204.Dockerfile | ||
push: true | ||
platforms: linux/arm64 | ||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:r3630-2-4-buildcache | ||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:r3630-2-4-buildcache,mode=max | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:2.4-r36.3.0 |
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,65 @@ | ||
#--------------------------------------------------------------------------------------------------------------------------- | ||
#---- | ||
#---- Start base image | ||
#---- | ||
#--------------------------------------------------------------------------------------------------------------------------- | ||
|
||
FROM nvcr.io/nvidia/l4t-base:r36.2.0 AS base | ||
|
||
WORKDIR / | ||
|
||
###################################################################################### | ||
## Install dependencies | ||
###################################################################################### | ||
|
||
RUN apt-get update -y | ||
RUN apt-get install -y --no-install-recommends python3-pip \ | ||
libpython3-dev \ | ||
libjpeg-dev \ | ||
libopenblas-dev \ | ||
libopenmpi-dev \ | ||
libomp-dev \ | ||
libavcodec-dev \ | ||
libavformat-dev \ | ||
libswscale-dev \ | ||
zlib1g-dev | ||
|
||
RUN python3 -m pip install --no-cache-dir future \ | ||
wheel \ | ||
mock \ | ||
pillow \ | ||
testresources \ | ||
setuptools==58.3.0 \ | ||
Cython \ | ||
gdown \ | ||
protobuf | ||
|
||
##################################################################################### | ||
## Install PyTorch 1.13.0 | ||
##################################################################################### | ||
|
||
RUN python3 -m pip install --no-cache-dir torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121 | ||
|
||
##################################################################################### | ||
## | ||
## Remove dev packages to reduce size | ||
## | ||
##################################################################################### | ||
|
||
RUN apt-get update -y | ||
|
||
RUN apt-get autoremove -y | ||
|
||
RUN rm -rf /var/lib/apt/lists/* | ||
RUN rm -rf /tmp/* | ||
RUN apt-get clean | ||
|
||
#--------------------------------------------------------------------------------------------------------------------------- | ||
#---- | ||
#---- Start final release image | ||
#---- | ||
#--------------------------------------------------------------------------------------------------------------------------- | ||
|
||
FROM scratch as final | ||
|
||
COPY --from=base / / |
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,29 @@ | ||
## jetson-pytorch:2.4-r36.3.0 | ||
|
||
### Pull or Build | ||
|
||
Pull the docker container | ||
```bash | ||
docker pull ghcr.io/kalanaratnayake/jetson-pytorch:2.4-r36.3.0 | ||
``` | ||
|
||
Build the docker container | ||
```bash | ||
docker buildx build --load --platform linux/arm64 -f pytorch-images/r3630.204.Dockerfile -t jetson-pytorch:2.4-r36.3.0 . | ||
``` | ||
|
||
### Start | ||
|
||
Start the docker container | ||
|
||
```bash | ||
docker run --rm -it --runtime nvidia --network host --gpus all -e DISPLAY ghcr.io/kalanaratnayake/jetson-pytorch:2.4-r36.3.0 bash | ||
``` | ||
|
||
### Test | ||
|
||
Run the following commands inside the docker container to confirm that the container is working properly. | ||
```bash | ||
python3 -c "import torch; print(torch.__version__)" | ||
python3 -c "import torchvision; print(torchvision.__version__)" | ||
``` |
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
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