Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockers for GPU testing #21

Merged
merged 9 commits into from Jan 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/dockers.yml
@@ -0,0 +1,42 @@
name: Building dockers

on: # Trigger the workflow on push or pull request, but only for the master branch
Borda marked this conversation as resolved.
Show resolved Hide resolved
push:
branches: [main]
pull_request:
branches: [main]
paths:
- "actions/**"

# based on https://github.com/pypa/gh-action-pypi-publish
jobs:

docker-build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
pytorch_version: ["1.8.1", "1.9.1"]

steps:
- name: Checkout
uses: actions/checkout@v2

- uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: ${{ github.repository_owner == 'PyTorchLightning' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Publish Docker Hub
# publish master/release
Borda marked this conversation as resolved.
Show resolved Hide resolved
uses: docker/build-push-action@v2
with:
build-args: |
PYTORCH_VERSION=${{ matrix.pytorch_version }}
file: actions/Dockerfile
push: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
tags: pytorchlightning/ecosystem-ci:pt${{ matrix.pytorch_version }}
timeout-minutes: 25
42 changes: 42 additions & 0 deletions actions/Dockerfile
@@ -0,0 +1,42 @@
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG PYTORCH_VERSION=1.8.1
ARG CUDA_VERSION=11.1

# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
#FROM nvcr.io/nvidia/pytorch:${PYTORCH_VERSION}-py3
Borda marked this conversation as resolved.
Show resolved Hide resolved
FROM pytorch/pytorch:${PYTORCH_VERSION}-cuda${CUDA_VERSION}-cudnn8-runtime

LABEL maintainer="PyTorchLightning <https://github.com/PyTorchLightning>"

RUN apt-get update -qq --fix-missing && \
apt-get install -y --no-install-recommends \
sudo \
build-essential \
pkg-config \
cmake \
git \
wget \
curl \
unzip \
ca-certificates \
software-properties-common \
tree \
&& \

# Cleaning
apt-get autoremove -y && \
apt-get clean && \
rm -rf /root/.cache