Skip to content

Commit c7033a7

Browse files
author
Nikita Manovich
committed
Merge branch 'release-1.3.0'
2 parents b260661 + d1a4cfb commit c7033a7

File tree

444 files changed

+43838
-19283
lines changed

Some content is hidden

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

444 files changed

+43838
-19283
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ branch = true
55
source =
66
cvat/apps/
77
utils/cli/
8+
utils/dataset_manifest
89

910
omit =
1011
cvat/settings/*

.eslintrc.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2018-2020 Intel Corporation
1+
// Copyright (C) 2018-2021 Intel Corporation
22
//
33
// SPDX-License-Identifier: MIT
44

@@ -16,8 +16,8 @@ module.exports = {
1616
extends: ['eslint:recommended', 'prettier'],
1717
rules: {
1818
'header/header': [2, 'line', [{
19-
pattern: ' {1}Copyright \\(C\\) (?:20\\d{2}-)?2020 Intel Corporation',
20-
template: ' Copyright (C) 2020 Intel Corporation'
19+
pattern: ' {1}Copyright \\(C\\) (?:20\\d{2}-)?2021 Intel Corporation',
20+
template: ' Copyright (C) 2021 Intel Corporation'
2121
}, '', ' SPDX-License-Identifier: MIT']],
2222
},
2323
};

.github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!---
2-
Copyright (C) 2020 Intel Corporation
2+
Copyright (C) 2020-2021 Intel Corporation
33
44
SPDX-License-Identifier: MIT
55
-->
@@ -45,7 +45,7 @@ If you're unsure about any of these, don't hesitate to ask. We're here to help!
4545
- [ ] I have updated the license header for each file (see an example below)
4646

4747
```python
48-
# Copyright (C) 2020 Intel Corporation
48+
# Copyright (C) 2021 Intel Corporation
4949
#
5050
# SPDX-License-Identifier: MIT
5151
```

.github/workflows/bandit.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Linter
2+
on: pull_request
3+
jobs:
4+
Bandit:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
9+
- name: Run checks
10+
run: |
11+
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
12+
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename')
13+
for files in $PR_FILES; do
14+
extension="${files##*.}"
15+
if [[ $extension == 'py' ]]; then
16+
changed_files_bandit+=" ${files}"
17+
fi
18+
done
19+
20+
if [[ ! -z ${changed_files_bandit} ]]; then
21+
sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv
22+
python3 -m venv .env
23+
. .env/bin/activate
24+
pip install -U pip wheel setuptools
25+
pip install bandit
26+
mkdir -p bandit_report
27+
28+
echo "Bandit version: "`bandit --version | head -1`
29+
echo "The files will be checked: "`echo ${changed_files_bandit}`
30+
bandit ${changed_files_bandit} --exclude '**/tests/**' -a file --ini ./.bandit -f html -o ./bandit_report/bandit_checks.html
31+
deactivate
32+
else
33+
echo "No files with the \"py\" extension found"
34+
fi
35+
36+
- name: Upload artifacts
37+
if: failure()
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: bandit_report
41+
path: bandit_report

.github/workflows/eslint.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Linter
2+
on: pull_request
3+
jobs:
4+
ESLint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-node@v2
9+
with:
10+
node-version: 12
11+
12+
- name: Run checks
13+
run: |
14+
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
15+
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename')
16+
for files in $PR_FILES; do
17+
extension="${files##*.}"
18+
if [[ $extension == 'js' || $extension == 'ts' || $extension == 'jsx' || $extension == 'tsx' ]]; then
19+
changed_files_eslint+=" ${files}"
20+
fi
21+
done
22+
23+
if [[ ! -z ${changed_files_eslint} ]]; then
24+
for package_files in `find -maxdepth 2 -name "package.json" -type f`; do
25+
cd $(dirname $package_files) && npm ci && cd ${{ github.workspace }}
26+
done
27+
npm install eslint-detailed-reporter --save-dev
28+
mkdir -p eslint_report
29+
30+
echo "ESLint version: "`npx eslint --version`
31+
echo "The files will be checked: "`echo ${changed_files_eslint}`
32+
npx eslint ${changed_files_eslint} -f node_modules/eslint-detailed-reporter/lib/detailed.js -o ./eslint_report/eslint_checks.html
33+
else
34+
echo "No files with the \"js|ts|jsx|tsx\" extension found"
35+
fi
36+
37+
- name: Upload artifacts
38+
if: failure()
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: eslint_report
42+
path: eslint_report

.github/workflows/main.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- 'master'
6+
- 'develop'
7+
pull_request:
8+
branches:
9+
- '*'
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 12
18+
- name: Build CVAT
19+
env:
20+
HOST_COVERAGE_DATA_DIR: ${{ github.workspace }}
21+
CONTAINER_COVERAGE_DATA_DIR: '/coverage_data'
22+
DJANGO_SU_NAME: 'admin'
23+
DJANGO_SU_EMAIL: '[email protected]'
24+
DJANGO_SU_PASSWORD: '12qwaszx'
25+
run: |
26+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml build
27+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'coverage run -a manage.py test cvat/apps utils/cli && mv .coverage ${CONTAINER_COVERAGE_DATA_DIR}'
28+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'cd cvat-data && npm ci && cd ../cvat-core && npm ci && npm run test && mv ./reports/coverage/lcov.info ${CONTAINER_COVERAGE_DATA_DIR} && chmod a+rwx ${CONTAINER_COVERAGE_DATA_DIR}/lcov.info'
29+
docker-compose up -d
30+
docker exec -i cvat /bin/bash -c "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_SU_NAME}', '${DJANGO_SU_EMAIL}', '${DJANGO_SU_PASSWORD}')\" | python3 ~/manage.py shell"
31+
- name: Code instrumentation
32+
run: |
33+
npm ci
34+
npm run coverage
35+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build
36+
- name: End-to-end testing
37+
run: |
38+
cd ./tests
39+
npm ci
40+
npx cypress run --headless --browser chrome
41+
- name: Uploading cypress screenshots as an artifact
42+
if: failure()
43+
uses: actions/upload-artifact@v2
44+
with:
45+
name: cypress_screenshots
46+
path: ${{ github.workspace }}/tests/cypress/screenshots
47+
- name: Collect coverage data
48+
env:
49+
HOST_COVERAGE_DATA_DIR: ${{ github.workspace }}
50+
CONTAINER_COVERAGE_DATA_DIR: "/coverage_data"
51+
COVERALLS_SERVICE_NAME: github
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
run: |
54+
mv ./tests/.nyc_output ./
55+
npx nyc report --reporter=text-lcov >> ${HOST_COVERAGE_DATA_DIR}/lcov.info
56+
docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'cd ${CONTAINER_COVERAGE_DATA_DIR} && coveralls-lcov -v -n lcov.info > ${CONTAINER_COVERAGE_DATA_DIR}/coverage.json'
57+
docker-compose -f docker-compose.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'ln -s ${CONTAINER_COVERAGE_DATA_DIR}/.git . && ln -s ${CONTAINER_COVERAGE_DATA_DIR}/.coverage . && ln -s ${CONTAINER_COVERAGE_DATA_DIR}/coverage.json . && coveralls --merge=coverage.json'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Publish Docker images
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
build_and_push_to_registry:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: 12
14+
15+
- name: Build images
16+
run: |
17+
CLAM_AV=yes INSTALL_SOURCES=yes docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml build
18+
19+
- name: Run unit tests
20+
env:
21+
HOST_COVERAGE_DATA_DIR: ${{ github.workspace }}
22+
CONTAINER_COVERAGE_DATA_DIR: '/coverage_data'
23+
DJANGO_SU_NAME: 'admin'
24+
DJANGO_SU_EMAIL: '[email protected]'
25+
DJANGO_SU_PASSWORD: '12qwaszx'
26+
run: |
27+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'coverage run -a manage.py test cvat/apps utils/cli'
28+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash -c 'cd cvat-data && npm ci && cd ../cvat-core && npm ci && npm run test'
29+
docker-compose up -d
30+
docker exec -i cvat /bin/bash -c "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_SU_NAME}', '${DJANGO_SU_EMAIL}', '${DJANGO_SU_PASSWORD}')\" | python3 ~/manage.py shell"
31+
32+
- name: Run end-to-end tests
33+
run: |
34+
cd ./tests
35+
npm ci
36+
npm run cypress:run:chrome
37+
- name: Uploading cypress screenshots as an artifact
38+
if: failure()
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: cypress_screenshots
42+
path: ${{ github.workspace }}/tests/cypress/screenshots
43+
44+
- name: Login to Docker Hub
45+
uses: docker/login-action@v1
46+
with:
47+
username: ${{ secrets.DOCKERHUB_USERNAME }}
48+
password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
- name: Push to Docker Hub
50+
env:
51+
DOCKERHUB_WORKSPACE: 'openvino'
52+
SERVER_IMAGE_REPO: 'cvat_server'
53+
UI_IMAGE_REPO: 'cvat_ui'
54+
run: |
55+
docker tag "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:latest" "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:${{ github.event.release.tag_name }}"
56+
docker push "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:${{ github.event.release.tag_name }}"
57+
docker push "${DOCKERHUB_WORKSPACE}/${SERVER_IMAGE_REPO}:latest"
58+
59+
docker tag "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:latest" "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:${{ github.event.release.tag_name }}"
60+
docker push "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:${{ github.event.release.tag_name }}"
61+
docker push "${DOCKERHUB_WORKSPACE}/${UI_IMAGE_REPO}:latest"

.github/workflows/pylint.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Linter
2+
on: pull_request
3+
jobs:
4+
PyLint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
9+
- name: Run checks
10+
run: |
11+
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
12+
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename')
13+
for files in $PR_FILES; do
14+
extension="${files##*.}"
15+
if [[ $extension == 'py' ]]; then
16+
changed_files_pylint+=" ${files}"
17+
fi
18+
done
19+
20+
if [[ ! -z ${changed_files_pylint} ]]; then
21+
sudo apt-get --no-install-recommends install -y build-essential curl python3-dev python3-pip python3-venv
22+
python3 -m venv .env
23+
. .env/bin/activate
24+
pip install -U pip wheel setuptools
25+
pip install pylint-json2html
26+
pip install $(egrep "pylint.*" ./cvat/requirements/development.txt)
27+
pip install $(egrep "Django.*" ./cvat/requirements/base.txt)
28+
mkdir -p pylint_report
29+
30+
echo "Pylint version: "`pylint --version | head -1`
31+
echo "The files will be checked: "`echo ${changed_files_pylint}`
32+
pylint ${changed_files_pylint} --output-format=json > ./pylint_report/pylint_checks.json || exit_code=`echo $?` || true
33+
pylint-json2html -o ./pylint_report/pylint_checks.html ./pylint_report/pylint_checks.json
34+
deactivate
35+
exit ${exit_code}
36+
else
37+
echo "No files with the \"py\" extension found"
38+
fi
39+
40+
- name: Upload artifacts
41+
if: failure()
42+
uses: actions/upload-artifact@v2
43+
with:
44+
name: pylint_report
45+
path: pylint_report

.github/workflows/schedule.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI-nightly
2+
on:
3+
schedule:
4+
- cron: '0 22 * * *'
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: 12
14+
- name: Build CVAT
15+
env:
16+
DJANGO_SU_NAME: "admin"
17+
DJANGO_SU_EMAIL: "[email protected]"
18+
DJANGO_SU_PASSWORD: "12qwaszx"
19+
API_ABOUT_PAGE: "localhost:8080/api/v1/server/about"
20+
run: |
21+
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f ./tests/docker-compose.email.yml up -d --build
22+
/bin/bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${API_ABOUT_PAGE})" != "401" ]]; do sleep 5; done'
23+
docker exec -i cvat /bin/bash -c "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_SU_NAME}', '${DJANGO_SU_EMAIL}', '${DJANGO_SU_PASSWORD}')\" | python3 ~/manage.py shell"
24+
- name: End-to-end testing
25+
run: |
26+
cd ./tests
27+
npm ci
28+
npm run cypress:run:firefox
29+
- name: Uploading cypress screenshots as an artifact
30+
if: failure()
31+
uses: actions/upload-artifact@v2
32+
with:
33+
name: cypress_screenshots
34+
path: ${{ github.workspace }}/tests/cypress/screenshots

.remarkrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exports.settings = { bullet: '*', paddedTable: false };
33
exports.plugins = [
44
'remark-preset-lint-recommended',
55
'remark-preset-lint-consistent',
6-
['remark-preset-lint-markdown-style-guide', 'mixed'],
6+
['remark-lint-list-item-indent', 'space'],
77
['remark-lint-no-dead-urls', { skipOffline: true }],
88
['remark-lint-maximum-line-length', 120],
99
['remark-lint-maximum-heading-length', 120],

.travis.yml

-57
This file was deleted.

0 commit comments

Comments
 (0)