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

Create test-deploy.yml #530

Merged
merged 17 commits into from
May 17, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dependancron

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/dependancron.yml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/release.yml

This file was deleted.

146 changes: 146 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Test & Deploy
on:
schedule:
- cron: 0 0 * * *
release:
types: [published]
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm ci
- run: npm run lint
test:
environment:
${{ (github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository) &&
'test-external' || 'test-internal' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-python@v2
- run: pip install tensorboard
- run: npm ci
- run: npm run test
env:
GITHUB_TOKEN: ${{ github.token }}
TEST_GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
TEST_GITHUB_REPO: https://github.com/iterative/cml_qa_tests_dummy
TEST_GITHUB_SHA: 62edc8b3f46a60b3fe1e5c08fd3e0046d350ee29
TEST_GITLAB_TOKEN: ${{ secrets.TEST_GITLAB_TOKEN }}
TEST_GITLAB_REPO: https://gitlab.com/iterative.ai/cml_qa_tests_dummy
TEST_GITLAB_SHA: c4c13286e78dc252dd2611f31a755f10d343fbd4
TEST_BBCLOUD_TOKEN: ${{ secrets.TEST_BBCLOUD_TOKEN }}
TEST_BBCLOUD_REPO: https://bitbucket.org/iterative-ai/cml-qa-tests-dummy
TEST_BBCLOUD_SHA: 9bb9131ce0af294fe1c6eedca1f2bce3983e80bd
packages:
needs: [lint, test]
0x2b3bfa0 marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org
- run: npm install
- run:
npm ${{ github.event_name == 'release' && 'publish' || 'publish
--dry-run' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
images:
runs-on: ubuntu-latest
needs: packages
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.0.3
cudnn: 8
steps:
- uses: actions/checkout@v2
with:
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
if [[ ${{ matrix.gpu }} == true ]]; then
echo ::set-output name=base::nvidia/cuda:${{ matrix.cuda }}-cudnn${{ matrix.cudnn }}-runtime-ubuntu${{ matrix.ubuntu }}
echo ::set-output name=tag::${cml_version//.*/}-dvc${{ matrix.dvc }}-base${{ matrix.base }}-gpu
else
echo ::set-output name=base::ubuntu:${{ matrix.ubuntu }}
echo ::set-output name=tag::${cml_version//.*/}-dvc${{ matrix.dvc }}-base${{ matrix.base }}
fi
- uses: docker/setup-buildx-action@v1
- uses: actions/cache@v2
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:
${{ github.event_name == 'release' || github.event_name ==
'schedule' }}
context: ./
file: ./Dockerfile
tags: |
docker.io/dvcorg/cml:${{ steps.metadata.outputs.tag }}
ghcr.io/iterative/cml:${{ steps.metadata.outputs.tag }}
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
0x2b3bfa0 marked this conversation as resolved.
Show resolved Hide resolved
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ RUN cd /etc/apt/sources.list.d \
# INSTALL CML
ARG CML_VERSION=0
RUN npm config set user 0 \
&& npm install --global "git+https://github.com/iterative/cml"
&& npm install --global "@dvcorg/cml@${CML_VERSION}"

# INSTALL VEGA
RUN add-apt-repository universe --yes \
Expand Down