Skip to content

Commit

Permalink
bump version v0.3.8, merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed May 10, 2021
2 parents 89d16b3 + 6a67200 commit 25f2ad3
Show file tree
Hide file tree
Showing 20 changed files with 318 additions and 392 deletions.
81 changes: 33 additions & 48 deletions .github/workflows/checkbot.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,57 @@
name: checkbot

on:
issue_comment:
types: [created]

env:
repo_token: ${{ secrets.TEST_GITHUB_TOKEN }}

jobs:
# check that CML container builds properly
build-container:
if: contains(github.event.comment.body, '/tests')
runs-on: [ubuntu-18.04]

steps:
- uses: actions/checkout@v2

- name: Build test image and publish
run: |
- name: Build & Publish test image
run: |
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker build -t dvcorg/cml -f ./docker/Dockerfile .
docker build -t dvcorg/cml-py3 -f ./docker/Dockerfile-py3 .
docker tag dvcorg/cml dvcorg/cml-test
docker push dvcorg/cml-test
docker build \
--build-arg "CML_VERSION=$CML_VERSION" \
--build-arg "DVC_VERSION=$DVC_VERSION" \
--build-arg "PYTHON_VERSION=$PYTHON_VERSION" \
--build-arg "BASE_IMAGE=$BASE_IMAGE" \
-t dvcorg/cml-test .
docker run --name runner --rm \
-e "repo_token=$repo_token" \
-e "REPO_TOKEN=${{ secrets.TEST_GITHUB_TOKEN }}" \
-e "RUNNER_REPO=https://github.com/${GITHUB_REPOSITORY}" \
-e "RUNNER_LABELS=cml-docker" \
-e "RUNNER_IDLE_TIMEOUT=10" \
dvcorg/cml-test
env:
CML_VERSION: 0
DVC_VERSION: 2
PYTHON_VERSION: 3.8
BASE_IMAGE: 'ubuntu:20.04'
# test container all CML features, vega and actions with issues in the past
check-container:
needs: build-container
runs-on: [ubuntu-18.04]
container: dvcorg/cml-test

steps:
- uses: actions/checkout@v2

- uses: hashicorp/setup-terraform@v1
with:
terraform_version: 0.14.3

- uses: r-lib/actions/setup-r@master

- uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: "CML test"
- name: CML test
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
REPO_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}
run: |
echo 'Check container!' > report.md
vl2svg assets/vega-lite.json | cml-publish --md >> report.md
Expand All @@ -81,52 +74,45 @@ jobs:
--cloud-type g2.2xlarge \
--idle-timeout 3600 \
--labels cml-runner-aws-gpu
test_machine_aws:
needs: check-container
runs-on: [self-hosted,cml-runner-aws-gpu]
runs-on: [self-hosted, cml-runner-aws-gpu]
steps:
- name: "tests"
run: |
nvidia-smi
- name: tests
run: |
nvidia-smi
test_container_aws:
needs: check-container
runs-on: [self-hosted,cml-runner-aws-gpu]
runs-on: [self-hosted, cml-runner-aws-gpu]
container:
image: docker://dvcorg/cml-test
options: --gpus all
steps:
- name: "tests"
run: |
nvidia-smi
- name: tests
run: |
nvidia-smi
test_machine_az:
needs: check-container
runs-on: [self-hosted,cml-runner-az-gpu]
runs-on: [self-hosted, cml-runner-az-gpu]
steps:
- name: "tests"
run: |
nvidia-smi
- name: tests
run: |
nvidia-smi
test_container_az:
needs: check-container
runs-on: [self-hosted,cml-runner-az-gpu]
runs-on: [self-hosted, cml-runner-az-gpu]
container:
image: docker://dvcorg/cml-test
options: --gpus all
steps:
- name: "tests"
run: |
nvidia-smi
- name: tests
run: |
nvidia-smi
chatbot:
if: contains(github.event.comment.body, '/cml-')
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: chatops
id: chatops
uses: actions/github-script@v1
Expand All @@ -142,7 +128,6 @@ jobs:
}).then( (pr) => {
console.log(`::set-output name=COMMAND::${process.env.COMMAND}`)
})
- name: chatactions
run: |
npm ci
Expand Down
64 changes: 31 additions & 33 deletions .github/workflows/dependancron.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
name: "Update dependencies"

name: Update dependencies
on:
schedule:
# runs every six hours
# every six hours
- cron: 0 */6 * * *

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
dependancron:
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: "Check dependencies"
id: check
run: |
sudo wget https://dvc.org/deb/dvc.list -O /etc/apt/sources.list.d/dvc.list
sudo apt update && sudo apt -y install dvc
CML_VER=$(docker run dvcorg/cml:latest dvc --version)
DVC_VER=$(dvc --version)
UPDATE=false
MESSAGE="Updating DVC from $CML_VER to $DVC_VER"
if [ $CML_VER != $DVC_VER ]; then
UPDATE=true
echo "$DVC_VER" > .dependancron
fi
echo "::set-output name=update::${UPDATE}"
echo "::set-output name=comment::${MESSAGE}"
- uses: actions/checkout@v2
- name: Check dependencies
id: check
run: |
sudo wget https://dvc.org/deb/dvc.list -O /etc/apt/sources.list.d/dvc.list
sudo apt update && sudo apt -y install dvc
CML_VER=$(docker run dvcorg/cml:latest dvc --version)
DVC_VER=$(dvc --version)
UPDATE=false
MESSAGE="Updating DVC from $CML_VER to $DVC_VER"
if [ $CML_VER != $DVC_VER ]; then
UPDATE=true
echo "$DVC_VER" > .dependancron
fi
- name: Create Pull Request
if: steps.check.outputs.update == 'true'
uses: peter-evans/create-pull-request@v3
with:
title: 'chore: dependancron update dependencies'
body: ${{ steps.check.outputs.comment }}
branch: 'dependancron-update-dependencies'
echo "::set-output name=update::${UPDATE}"
echo "::set-output name=comment::${MESSAGE}"
- name: Create Pull Request
if: steps.check.outputs.update == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: 'chore: dependancron update dependencies'
body: ${{ steps.check.outputs.comment }}
branch: dependancron-update-dependencies
commit-message: ${{ steps.check.outputs.comment }}
author:
'Olivaw[bot] <[email protected]>'
committer:
'Olivaw[bot] <[email protected]>'
61 changes: 28 additions & 33 deletions .github/workflows/gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ on:
workflow_dispatch:
pull_request:
push:

jobs:
test:
runs-on: ubuntu-latest
services:
gitlab:
gitlab:
image: docker://gitlab/gitlab-ce
ports:
- 8000:8000
Expand All @@ -26,9 +25,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Configure credentials
run: >-
run: |
docker exec ${{ job.services.gitlab.id }} bin/gitlab-rails runner "
; user = User.find_by_username('root')
; user.password = '${{ github.token }}'
Expand All @@ -38,42 +36,39 @@ jobs:
; token.set_token('${{ github.token }}')
; token.save!
"
- name: Create test project
run: >-
curl "http://localhost:8000/gitlab/api/v4/projects"
--header "PRIVATE-TOKEN: ${{ github.token }}"
--request POST
--get
run: |
curl "http://localhost:8000/gitlab/api/v4/projects" \
--header "PRIVATE-TOKEN: ${{ github.token }}" \
--request POST \
--get \
--data "name=test"
- name: Create test commit
run: >-
curl "http://localhost:8000/gitlab/api/v4/projects/root%2Ftest/repository/files/README.md"
--header "PRIVATE-TOKEN: ${{ github.token }}"
--request POST
--get
--data "author_email=test@test"
--data "author_name=Test"
--data "branch=main"
--data "commit_message=Create%20README.md"
run: |
curl "http://localhost:8000/gitlab/api/v4/projects/root%2Ftest/repository/files/README.md" \
--header "PRIVATE-TOKEN: ${{ github.token }}" \
--request POST \
--get \
--data "author_email=test@test" \
--data "author_name=Test" \
--data "branch=main" \
--data "commit_message=Create%20README.md" \
--data "content=Test"
- name: Get last commit
id: commit
run: >-
curl "http://localhost:8000/gitlab/api/v4/projects/root%2Ftest/repository/commits/main"
--header "PRIVATE-TOKEN: ${{ github.token }}"
--request GET | jq -r .id | xargs -0 printf "::set-output name=hash::%s"
run: |
curl "http://localhost:8000/gitlab/api/v4/projects/root%2Ftest/repository/commits/main" \
--header "PRIVATE-TOKEN: ${{ github.token }}" \
--request GET \
| jq -r .id \
| xargs -0 printf "::set-output name=hash::%s"
- name: Install dependencies
run: npm ci

- name: Run cml-send-comment
run: >-
node bin/cml-send-comment.js
--token=${{ github.token }}
--repo=http://localhost:8000/gitlab/root/test
--commit-sha=${{ steps.commit.outputs.hash }}
--driver=gitlab
run: |
node bin/cml-send-comment.js \
--token=${{ github.token }} \
--repo=http://localhost:8000/gitlab/root/test \
--commit-sha=${{ steps.commit.outputs.hash }} \
--driver=gitlab \
<(echo message)
Loading

0 comments on commit 25f2ad3

Please sign in to comment.