Skip to content

Commit a8cc364

Browse files
authored
Merge branch 'master' into no-envars
2 parents 7ceeaf0 + dc6749c commit a8cc364

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+13666
-7990
lines changed

.devcontainer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:16",
3+
"postCreateCommand": "npm ci && npm install --location=global",
4+
"hostRequirements": {
5+
"cpus": 4,
6+
"memory": "8gb",
7+
"storage": "32gb"
8+
}
9+
}

.eslintrc.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@ module.exports = {
22
env: {
33
browser: true,
44
commonjs: true,
5-
es6: true
5+
es6: true,
6+
jest: true
67
},
78
extends: ['standard', 'prettier'],
89
globals: {
910
Atomics: 'readonly',
1011
SharedArrayBuffer: 'readonly'
1112
},
1213
parserOptions: {
13-
ecmaVersion: 2018
14+
ecmaVersion: 2020
1415
},
1516
ignorePatterns: ['assets/', 'dist/', 'node_modules/'],
1617
rules: {
1718
camelcase: [1, { properties: 'never' }],
1819
'prettier/prettier': 'error'
1920
},
20-
plugins: ['prettier'],
21-
env: {
22-
jest: true
23-
}
21+
plugins: ['prettier']
2422
};

.github/workflows/checkbot.yml

Lines changed: 0 additions & 170 deletions
This file was deleted.

.github/workflows/images.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
test:
5+
required: false
6+
type: boolean
7+
jobs:
8+
images:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
dvc: [1, 2]
13+
base: [0, 1]
14+
gpu: [false, true]
15+
include:
16+
- base: 0
17+
ubuntu: 18.04
18+
python: 2.7
19+
cuda: 10.1
20+
cudnn: 7
21+
- base: 1
22+
ubuntu: 20.04
23+
python: 3.8
24+
cuda: 11.2.1
25+
cudnn: 8
26+
- latest: true # update the values below after introducing a new major version
27+
base: 1
28+
dvc: 2
29+
steps:
30+
- uses: actions/checkout@v2
31+
with:
32+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
33+
fetch-depth: 0
34+
- name: Metadata
35+
id: metadata
36+
run: |
37+
latest_tag=$(git describe --tags | cut -d- -f1)
38+
cml_version=${latest_tag##v}
39+
dvc_version=$(python3 -c '
40+
from distutils.version import StrictVersion as Ver
41+
from urllib.request import urlopen
42+
from json import load
43+
data = load(urlopen("https://pypi.org/pypi/dvc/json"))
44+
ver_pre = "${{ matrix.dvc }}".rstrip(".") + "."
45+
print(
46+
max(
47+
(i.strip() for i in data["releases"] if i.startswith(ver_pre)),
48+
default="${{ matrix.dvc }}",
49+
key=Ver
50+
)
51+
)')
52+
echo ::set-output name=cache_tag::${cml_version}-${dvc_version}-${{ matrix.base }}-${{ matrix.gpu }}
53+
echo ::set-output name=cml_version::$cml_version
54+
tag=${cml_version//.*/}-dvc${{ matrix.dvc }}-base${{ matrix.base }}
55+
if [[ ${{ matrix.gpu }} == true ]]; then
56+
echo ::set-output name=base::nvidia/cuda:${{ matrix.cuda }}-cudnn${{ matrix.cudnn }}-runtime-ubuntu${{ matrix.ubuntu }}
57+
tag=${tag}-gpu
58+
else
59+
echo ::set-output name=base::ubuntu:${{ matrix.ubuntu }}
60+
fi
61+
62+
TAGS="$(
63+
for registry in docker.io/{dvcorg,iterativeai} ghcr.io/iterative; do
64+
if [[ "${{ matrix.latest }}" == "true" ]]; then
65+
if [[ "${{ matrix.gpu }}" == "true" ]]; then
66+
echo "${registry}/cml:latest-gpu"
67+
else
68+
echo "${registry}/cml:latest"
69+
fi
70+
fi
71+
echo "${registry}/cml:${tag}"
72+
done | head -c-1
73+
)"
74+
echo ::set-output name=tags::"${TAGS//$'\n'/'%0A'}"
75+
- uses: docker/setup-buildx-action@v1
76+
- uses: actions/cache@v2
77+
with:
78+
path: /tmp/.buildx-cache
79+
key:
80+
${{ runner.os }}-buildx-${{ steps.metadata.outputs.cache_tag }}-${{
81+
github.sha }}
82+
restore-keys:
83+
${{ runner.os }}-buildx-${{ steps.metadata.outputs.cache_tag }}-
84+
- uses: docker/login-action@v1
85+
with:
86+
registry: docker.io
87+
username: ${{ secrets.DOCKERHUB_USERNAME }}
88+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
89+
- uses: docker/login-action@v1
90+
with:
91+
registry: ghcr.io
92+
username: ${{ github.repository_owner }}
93+
password: ${{ github.token }}
94+
- uses: docker/build-push-action@v2
95+
with:
96+
push:
97+
${{ github.event_name == 'push' || github.event_name == 'schedule'
98+
|| github.event_name == 'workflow_dispatch' }}
99+
context: ./
100+
file: ./Dockerfile
101+
tags: |
102+
${{ steps.metadata.outputs.tags }}
103+
build-args: |
104+
CML_VERSION=${{ steps.metadata.outputs.cml_version }}
105+
DVC_VERSION=${{ matrix.dvc }}
106+
PYTHON_VERSION=${{ matrix.python }}
107+
BASE_IMAGE=${{ steps.metadata.outputs.base }}
108+
pull: true
109+
cache-from: type=local,src=/tmp/.buildx-cache
110+
cache-to: type=local,dest=/tmp/.buildx-cache-new
111+
- name: Move cache
112+
# https://github.com/docker/build-push-action/issues/252
113+
# https://github.com/moby/buildkit/issues/1896
114+
run: |
115+
rm -rf /tmp/.buildx-cache
116+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
bump:
6+
type: choice
7+
required: true
8+
description: Bump version number
9+
options: [major, minor, patch]
10+
default: patch
11+
pull_request:
12+
types: [closed]
13+
jobs:
14+
bump:
15+
if: github.event_name == 'workflow_dispatch'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- run: |
20+
git config --global user.name Olivaw[bot]
21+
git config --global user.email 64868532+iterative-olivaw@users.noreply.github.com
22+
git checkout -b bump/$(npm version ${{ github.event.inputs.bump }})
23+
git push --set-upstream origin --follow-tags HEAD
24+
gh pr create --title "Bump version to $(git describe --tags)" --body "Approve me 🤖"
25+
gh pr merge --squash --auto
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
28+
release:
29+
if: github.event.pull_request.merged && startsWith(github.head_ref, 'bump/')
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
- run:
34+
gh release create --generate-notes {--title=CML\ ,}$(basename ${{
35+
github.head_ref }})
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)