Skip to content

Commit

Permalink
Merge branch 'opendatacam:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vsaw authored Feb 2, 2023
2 parents f37c293 + 2e6f885 commit 6c40a35
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 10 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ on:
pull_request:
branches-ignore:
- 'gh-pages'
release:
types: [created]

jobs:
# Build docker images
#
# TODO: Publish docker images to dockerhub on changes in the development branch.
# We won't push major releases. But development previews are fine.
build-docker-and-publish:
runs-on: ubuntu-latest
# needs: build-and-test-code
env:
# Only publish to Docker Hub if we have a change in the development branch
DOCKERHUB_PUBLISH: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/development' || github.event.ref == 'refs/heads/master') && secrets.DOCKERHUB_USERNAME != '' }}
# Only publish to Docker Hub if the dockerhub username is set, and either happens
#
# - we have a change in the development branch
# - we have a new tag
DOCKERHUB_PUBLISH: ${{ (github.event_name == 'push' && (github.event.ref == 'refs/heads/development' || startsWith(github.event.ref, 'refs/tags/')) || github.event_name == 'release') && secrets.DOCKERHUB_USERNAME != '' }}
# In case we run a pull request, the secrets are not available to us. Therefore check first
# and assign a 'dummy' dockerhub username
DOCKERHUB_USERNAME: ${{ ( secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_USERNAME ) || 'dummy' }}
DOCKERHUB_TAG_SUFFIX: ${{ ( github.event.ref == 'refs/heads/development' && format('{0}-{1}', matrix.platform, 'development') ) || ( github.event.ref == 'refs/heads/master' && matrix.platform ) || format('{0}-{1}', matrix.platform, 'dummy') }}
strategy:
matrix:
include:
Expand All @@ -49,11 +50,22 @@ jobs:
# Use the secrets directly and not the validated environment DOCKERHUB_USERNAME
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Determine dockerhub tag
id: dockerhub-tag
# Determine the dockerhub tag based on if our current working tree points to a tag or not
# the tags will either be `<tag>-<platform>` or `development-<platform>`
run: |
GIT_TAG=$(git tag -l --points-at $(git log -n 1 --format=%H))
if [ ! -z $GIT_TAG ]; then
echo "::set-output name=dockerhub-tag::$GIT_TAG-${{ matrix.platform }}"
else
echo "::set-output name=dockerhub-tag::development-${{ matrix.platform }}"
fi
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./
file: docker/build/${{ matrix.platform }}/Dockerfile
platforms: ${{ matrix.docker-platform }}
push: ${{ env.DOCKERHUB_PUBLISH == 'true' }}
tags: ${{ env.DOCKERHUB_USERNAME }}/opendatacam-darknet-base:${{ env.DOCKERHUB_TAG_SUFFIX }}
tags: ${{ env.DOCKERHUB_USERNAME }}/opendatacam-darknet-base:${{ steps.dockerhub-tag.outputs.dockerhub-tag }}
11 changes: 10 additions & 1 deletion docker/build/desktop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ FROM opendatacam/base-desktop-nvidia-cuda-opencv-gstreamer:1.0

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y jq wget
# Update NVIDIA Signing key
# See also https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu1804-x86-64/212904/3
RUN apt-key del 7fa2af80 && \
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub

# Install commonly used dependencies
RUN apt-get update && \
apt-get install -y jq wget
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs

# Start Darknet Install
RUN git clone --depth 1 -b odc https://github.com/opendatacam/darknet /var/local/darknet
Expand Down
11 changes: 10 additions & 1 deletion docker/build/nano/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ FROM resinplayground/jetson-nano-cuda-cudnn-opencv:v0.2-slim

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y jq wget
# Update NVIDIA Signing key
# See also https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu1804-x86-64/212904/3
RUN apt-key del 7fa2af80 && \
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub

# Install commonly used dependencies
RUN apt-get update && \
apt-get install -y jq wget
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs

# Start Darknet Install
RUN git clone --depth 1 -b odc https://github.com/opendatacam/darknet /var/local/darknet
Expand Down
11 changes: 10 additions & 1 deletion docker/build/xavier/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ FROM resinplayground/jetson-nano-cuda-cudnn-opencv:v0.2-slim

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y jq wget
# Update NVIDIA Signing key
# See also https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu1804-x86-64/212904/3
RUN apt-key del 7fa2af80 && \
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub

# Install commonly used dependencies
RUN apt-get update && \
apt-get install -y jq wget
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs

# Start Darknet Install
RUN git clone --depth 1 -b odc https://github.com/opendatacam/darknet /var/local/darknet
Expand Down

0 comments on commit 6c40a35

Please sign in to comment.