Skip to content

Commit 462a023

Browse files
committed
Add Docker image and JupyterLab docker compose.
1 parent 901f60e commit 462a023

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'build/dockerfile'
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Log in to GitHub Container Registry
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Build and push docker image
26+
uses: docker/build-push-action@v5
27+
with:
28+
context: ./
29+
dockerfile: build/dockerfile
30+
push: true
31+
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
32+
tags: ghcr.io/${{ github.repository }}:latest

build/dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM rapidsai/devcontainers:25.10-cpp-cuda12.9
2+
3+
WORKDIR /pyhpc-tutorial
4+
5+
COPY . /pyhpc-tutorial
6+
7+
RUN pip install --root-user-action ignore -r build/requirements.txt
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: '3.8'
2+
3+
services:
4+
backend:
5+
image: ghcr.io/pyhpc/pyhpc-tutorial:latest
6+
pull_policy: always
7+
ulimits:
8+
memlock: -1
9+
stack: 67108864
10+
shm_size: 1g
11+
deploy:
12+
resources:
13+
reservations:
14+
devices:
15+
driver: nvidia
16+
count: all
17+
capabilities: [gpu]
18+
ports:
19+
"0.0.0.0:8888:8888" # JupyterLab
20+
volumes:
21+
/home/ubuntu/pyhpc-tutorial:/pyhpc-tutorial
22+
user: root
23+
working_dir: /pyhpc-tutorial/notebooks
24+
command: >
25+
python -m jupyter lab
26+
--allow-root
27+
--ip=0.0.0.0
28+
--no-browser
29+
--NotebookApp.token=''
30+
--NotebookApp.password=''
31+
--NotebookApp.default_url=''
32+
restart: unless-stopped

build/requirements.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
numpy
2+
3+
# Scientific/numeric
4+
scipy
5+
matplotlib
6+
opencv-python
7+
8+
# CUDA
9+
cuda-python == 12.9.1 # cuda.{core, bindings, cooperative, parallel}, numba.cuda
10+
nvmath-python[cu12]
11+
cupy-cuda12x
12+
numba-cuda
13+
14+
# NVIDIA devtools
15+
nvtx
16+
nsightful[notebook] @ git+https://github.com/brycelelbach/nsightful.git
17+
18+
# Distributed programming
19+
mpi4py

0 commit comments

Comments
 (0)