Skip to content

Commit

Permalink
Merge pull request #4 from esgf-nimbus/adds_minimal_gpu
Browse files Browse the repository at this point in the history
Adds minimal gpu container
  • Loading branch information
jasonb5 authored Jul 27, 2023
2 parents 096807b + 4ded026 commit 271ad77
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ jobs:
- id: get-version
run: |
pip install tbump
echo "version=$(tbump -C dockerfiles/${{ matrix.directories }} current-version)" >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@v4
with:
push: ${{ github.event_name == 'push' }}
context: dockerfiles/${{ matrix.directories }}
tags: jasonb87/${{ matrix.directories }}:${{ steps.get-version.outputs.version }}
- run: |
pushd dockerfiles/${{ matrix.directories }}
export DOCKER_BUILDKIT=1
make build
if [[ "${{ github.event_name }}" == "push" ]]; then
make push
fi
2 changes: 1 addition & 1 deletion dockerfiles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NAMESPACE ?= ghcr.io/esgf-nimbus
build push run: REPOSITORY = $(lastword $(subst /, ,$(PWD)))

build:
docker build $(ARG) -t $(NAMESPACE)/$(REPOSITORY):$(VERSION) .
docker build $(ARGS) -t $(NAMESPACE)/$(REPOSITORY):$(VERSION) .

push:
docker push $(NAMESPACE)/$(REPOSITORY):$(VERSION)
Expand Down
12 changes: 12 additions & 0 deletions dockerfiles/minimal-notebook-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG TAG
FROM ghcr.io/esgf-nimbus/minimal-notebook:${TAG}

USER root

RUN --mount=type=cache,target=/opt/conda/pkgs \
mamba install -y \
rapids \
cupy && \
chown -R ${NB_UID}:${NB_GID} /home/jovyan

USER $NB_USER
7 changes: 7 additions & 0 deletions dockerfiles/minimal-notebook-gpu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DEFAULT_GOAL = build

VERSION = 0.1.0

build: ARGS = --build-arg TAG=$(shell tbump -C ../minimal-notebook current-version)

include ../Makefile
18 changes: 18 additions & 0 deletions dockerfiles/minimal-notebook-gpu/tbump.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[version]
current = "0.1.0"

regex = '''
(?P<major>\d+)
\.
(?P<minor>\d+)
\.
(?P<patch>\d+)
'''

[git]
message_template = "Bump to {new_version}"
tag_template = "v{new_version}"

[[file]]
src = "Makefile"
search = "VERSION = {current_version}"

0 comments on commit 271ad77

Please sign in to comment.