Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dacbd authored Oct 8, 2022
2 parents 9ab0fa0 + c83044e commit 974c274
Show file tree
Hide file tree
Showing 31 changed files with 658 additions and 754 deletions.
182 changes: 0 additions & 182 deletions .github/workflows/checkbot.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .github/workflows/gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ jobs:
services:
gitlab:
image: docker://gitlab/gitlab-ce
ports:
- 8000:8000
ports: ['8000:8000']
env:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost:8000/gitlab'
Expand All @@ -21,8 +20,7 @@ jobs:
}
'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Configure credentials
run: |
docker exec ${{ job.services.gitlab.id }} bin/gitlab-rails runner "
Expand Down Expand Up @@ -60,8 +58,7 @@ jobs:
--request GET \
| jq -r .id \
| xargs -0 printf "::set-output name=hash::%s"
- name: Install dependencies
run: npm ci
- run: npm ci
- name: Run cml-send-comment
run: |
node bin/cml.js send-comment \
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
on:
workflow_call:
inputs:
release:
required: true
type: boolean
jobs:
images:
runs-on: ubuntu-latest
strategy:
matrix:
dvc: [1, 2]
base: [0, 1]
gpu: [false, true]
include:
- base: 0
ubuntu: 18.04
python: 2.7
cuda: 10.1
cudnn: 7
- base: 1
ubuntu: 20.04
python: 3.8
cuda: 11.2.1
cudnn: 8
- latest: true # update the values below after introducing a new major version
base: 1
dvc: 2
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: Metadata
id: metadata
run: |
latest_tag=$(git describe --tags | cut -d- -f1)
cml_version=${latest_tag##v}
dvc_version=$(python3 -c '
from distutils.version import StrictVersion as Ver
from urllib.request import urlopen
from json import load
data = load(urlopen("https://pypi.org/pypi/dvc/json"))
ver_pre = "${{ matrix.dvc }}".rstrip(".") + "."
print(
max(
(i.strip() for i in data["releases"] if i.startswith(ver_pre)),
default="${{ matrix.dvc }}",
key=Ver
)
)')
echo ::set-output name=cache_tag::${cml_version}-${dvc_version}-${{ matrix.base }}-${{ matrix.gpu }}
echo ::set-output name=cml_version::$cml_version
tag=${cml_version//.*/}-dvc${{ matrix.dvc }}-base${{ matrix.base }}
if [[ ${{ matrix.gpu }} == true ]]; then
echo ::set-output name=base::nvidia/cuda:${{ matrix.cuda }}-cudnn${{ matrix.cudnn }}-runtime-ubuntu${{ matrix.ubuntu }}
tag=${tag}-gpu
else
echo ::set-output name=base::ubuntu:${{ matrix.ubuntu }}
fi
TAGS="$(
for registry in docker.io/{dvcorg,iterativeai} ghcr.io/iterative; do
if [[ "${{ matrix.latest }}" == "true" ]]; then
if [[ "${{ matrix.gpu }}" == "true" ]]; then
echo "${registry}/cml:latest-gpu"
else
echo "${registry}/cml:latest"
fi
fi
echo "${registry}/cml:${tag}"
done | head -c-1
)"
echo ::set-output name=tags::"${TAGS//$'\n'/'%0A'}"
- uses: docker/setup-buildx-action@v1
- uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key:
${{ runner.os }}-buildx-${{ steps.metadata.outputs.cache_tag }}-${{
github.sha }}
restore-keys:
${{ runner.os }}-buildx-${{ steps.metadata.outputs.cache_tag }}-
- uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- uses: docker/build-push-action@v2
with:
push:
${{ inputs.release || github.event_name == 'push' || github.event_name == 'schedule'
|| github.event_name == 'workflow_dispatch' }}
context: ./
file: ./Dockerfile
tags: |
${{ steps.metadata.outputs.tags }}
build-args: |
CML_VERSION=${{ steps.metadata.outputs.cml_version }}
DVC_VERSION=${{ matrix.dvc }}
PYTHON_VERSION=${{ matrix.python }}
BASE_IMAGE=${{ steps.metadata.outputs.base }}
pull: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Move cache
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release
on:
workflow_dispatch:
inputs:
bump:
type: choice
required: true
description: Bump version number
options: [major, minor, patch]
default: patch
pull_request:
types: [closed]
jobs:
bump:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
git config --global user.name Olivaw[bot]
git config --global user.email [email protected]
git checkout -b bump/$(npm version ${{ github.event.inputs.bump }})
git push --set-upstream origin HEAD
gh pr create --title "Bump version to $(git describe --tags)" --body "Approve me 🤖"
gh pr merge --auto --squash
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
release:
if: github.event.pull_request.merged && startsWith(github.head_ref, 'bump/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: >
gh release create
--target ${{ github.event.pull_request.merge_commit_sha }}
{--title=CML\ ,}$(basename ${{ github.head_ref }})
--generate-notes
--draft
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
package:
needs: release
secrets: inherit
uses: ./.github/workflows/test-deploy.yml
with:
release: true
Loading

0 comments on commit 974c274

Please sign in to comment.