Skip to content

Commit

Permalink
add drone config and custom Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
rostyslavhereha committed Jan 3, 2025
1 parent 35296a3 commit 5697f82
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
#######################################################################################################################
#######################################################################################################################
#######################################################################################################################
####################### Jobs below are used to build only #########################################
####################### master branches for all containers #########################################
####################### #########################################
#######################################################################################################################
#######################################################################################################################
#######################################################################################################################

# This pipeline would be used after each merge request to build mmpose latest docker images
kind: pipeline
type: docker
name: mmpose LS_mmpose_latest

platform:
arch: amd64
os: linux

trigger:
branch:
- main
event:
- push

clone:
depth: 1

steps:
- name: Build latest LS_mmpose docker image
image: plugins/docker:20.14
environment:
DOCKER_BUILDKIT: 1
settings:
dockerfile: docker/LabelStudio.Dockerfile
context: docker/
registry: quay.io
repo: quay.io/logivations/ml_all
privileged: true
build_args:
- BUILDKIT_INLINE_CACHE=1
cache_from: quay.io/logivations/ml_all:LS_mmpose_latest
tags:
- LS_mmpose_latest
- LS_mmpose_latest_${DRONE_COMMIT_SHA}
username:
from_secret: DOCKER_QUAY_USERNAME
password:
from_secret: DOCKER_QUAY_PASSWORD

#######################################################################################################################
#######################################################################################################################
#######################################################################################################################
####################### Jobs below are used to run #########################################
####################### pull request validation only #########################################
####################### #########################################
#######################################################################################################################
#######################################################################################################################
#######################################################################################################################

# 2. Build PR docker image for mmpose
---
kind: pipeline
type: docker
name: PR validation build mmpose images

platform:
arch: amd64
os: linux

trigger:
event:
include:
- pull_request

clone:
depth: 50

steps:
- name: Build LS_mmpose docker image for pull request
image: plugins/docker:20.14
environment:
DOCKER_BUILDKIT: 1
settings:
dockerfile: docker/LabelStudio.Dockerfile
context: docker/
registry: quay.io
repo: quay.io/logivations/ml_all
privileged: true
build_args:
- BUILDKIT_INLINE_CACHE=1
cache_from:
- quay.io/logivations/ml_all:LS_mmpose_latest
- quay.io/logivations/ml_all:LS_mmpose_pr${DRONE_PULL_REQUEST}
tags:
- LS_mmpose_pr${DRONE_PULL_REQUEST}
- LS_mmpose_pr${DRONE_PULL_REQUEST}_${DRONE_COMMIT_SHA}
username:
from_secret: DOCKER_QUAY_USERNAME
password:
from_secret: DOCKER_QUAY_PASSWORD
42 changes: 42 additions & 0 deletions docker/LabelStudio.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ARG PYTORCH="1.8.1"
ARG CUDA="10.2"
ARG CUDNN="7"

# TODO: Prepare logic for buildings aws image using this versions
ARG AWS_PYTORCH="1.9.0"
ARG AWS_CUDA="11.1"
ARG AWS_CUDNN="8"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"

# To fix GPG key error when running apt-get update
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub

RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install xtcocotools
RUN pip install cython
RUN pip install xtcocotools

# Install MMEngine and MMCV
RUN pip install openmim
RUN mim install mmengine "mmcv>=2.0.0"

# Install MMPose
RUN conda clean --all
RUN git clone https://github.com/open-mmlab/mmpose.git /mmpose
WORKDIR /mmpose
RUN git checkout main
ENV FORCE_CUDA="1"
RUN pip install -r requirements/build.txt
RUN pip install --no-cache-dir -e .
RUN mim install "mmdet>=3.1.0"
RUN pip install future tensorboard albumentations
RUN pip install setuptools==59.5.0

0 comments on commit 5697f82

Please sign in to comment.