Skip to content

Commit

Permalink
Merge branch 'develop' into zm/honey-pot-server
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max authored Jun 12, 2023
2 parents f80fbe0 + 5fa11c9 commit 0e122a9
Show file tree
Hide file tree
Showing 29 changed files with 327 additions and 192 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[run]
branch = true
# relative_files = true # does not work?

source =
cvat/apps/
Expand Down
21 changes: 21 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
comment:
layout: "header, diff, components"

component_management:
individual_components:
- component_id: cvat-ui
name: cvat-ui
paths:
- cvat-canvas/**
- cvat-canvas3d/**
- cvat-core/**
- cvat-data/**
- cvat-ui/**
- component_id: cvat-server
name: cvat-server
paths:
- cvat/**
- cvat-cli/**
- cvat-sdk/**
- utils/**

36 changes: 28 additions & 8 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@ jobs:
- name: CVAT server. Build and push
uses: docker/build-push-action@v3
with:
build-args: |
"COVERAGE_PROCESS_START=.coveragerc"
cache-from: type=local,src=/tmp/cvat_cache_server
context: .
file: Dockerfile
tags: cvat/server
outputs: type=docker,dest=/tmp/cvat_server/image.tar

- name: Instrumentation of the code then rebuilding the CVAT UI
run: |
yarn --frozen-lockfile
yarn run coverage
- name: CVAT UI. Build and push
uses: docker/build-push-action@v3
with:
Expand Down Expand Up @@ -154,11 +161,20 @@ jobs:

- name: Running REST API and SDK tests
id: run_tests
env:
COVERAGE_PROCESS_START: ".coveragerc"
run: |
pip3 install --user '/tmp/cvat_sdk/[pytorch]'
pip3 install --user cvat-cli/
pip3 install --user -r tests/python/requirements.txt
pytest tests/python/ -s -v
pip3 install -r cvat-sdk/gen/requirements.txt
./cvat-sdk/gen/generate.sh
pip3 install -r ./tests/python/requirements.txt
pip3 install -e ./cvat-sdk
pip3 install -e ./cvat-cli
pytest tests/python/ --cov --cov-report xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

- name: Creating a log file from cvat containers
if: failure() && steps.run_tests.conclusion == 'failure'
Expand Down Expand Up @@ -218,10 +234,13 @@ jobs:
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health?bundles) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done
docker compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \
-c 'python manage.py test cvat/apps -v 2'
-c 'coverage run -a manage.py test cvat/apps && coverage json && mv coverage.json ${CONTAINER_COVERAGE_DATA_DIR}'
docker compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \
-c 'yarn --frozen-lockfile --ignore-scripts && yarn workspace cvat-core run test'
-c 'yarn --frozen-lockfile --ignore-scripts && yarn workspace cvat-core run test && mv cvat-core/reports/coverage/coverage-final.json ${CONTAINER_COVERAGE_DATA_DIR}'
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

- name: Creating a log file from cvat containers
if: failure()
Expand Down Expand Up @@ -317,16 +336,17 @@ jobs:
npx cypress run \
--headed \
--browser chrome \
--env coverage=false \
--config-file cypress_canvas3d.config.js \
--spec 'cypress/e2e/${{ matrix.specs }}/**/*.js,cypress/e2e/remove_users_tasks_projects_organizations.js'
else
npx cypress run \
--browser chrome \
--env coverage=false \
--spec 'cypress/e2e/${{ matrix.specs }}/**/*.js,cypress/e2e/remove_users_tasks_projects_organizations.js'
fi
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

- name: Creating a log file from "cvat" container logs
if: failure()
run: |
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3

- name: Start minikube
uses: medyagh/setup-minikube@master
uses: medyagh/setup-minikube@latest
with:
cpus: max
memory: max
Expand All @@ -44,7 +44,7 @@ jobs:

- name: Deploy to minikube
run: |
printf "traefik:\n service:\n externalIPs:\n - $(minikube ip)\n" >> tests/values.test.yaml
printf " service:\n externalIPs:\n - $(minikube ip)\n" >> tests/values.test.yaml
cd helm-chart
helm dependency update
cd ..
Expand Down Expand Up @@ -83,3 +83,22 @@ jobs:
run: |
kubectl cp tests/mounted_file_share/images $(kubectl get pods -l component=server -o jsonpath='{.items[0].metadata.name}'):/home/django/share
pytest --timeout 30 --platform=kube -m "not with_external_services" tests/python --log-cli-level DEBUG
- name: Creating a log file from "cvat" container logs
if: failure()
env:
LOGS_DIR: "${{ github.workspace }}/rest_api_testing"
run: |
mkdir ${LOGS_DIR}
kubectl logs $(kubectl get pods -l component=server -o 'jsonpath={.items[0].metadata.name}') >${LOGS_DIR}/cvat_server.log
kubectl logs $(kubectl get pods -l component=worker-import -o 'jsonpath={.items[0].metadata.name}') >${LOGS_DIR}/cvat_worker_import.log
kubectl logs $(kubectl get pods -l component=worker-export -o 'jsonpath={.items[0].metadata.name}') >${LOGS_DIR}/cvat_worker_export.log
kubectl logs $(kubectl get pods -l component=worker-webhooks -o 'jsonpath={.items[0].metadata.name}') >${LOGS_DIR}/cvat_worker_webhooks.log
kubectl logs $(kubectl get pods -l app.kubernetes.io/name=traefik -o 'jsonpath={.items[0].metadata.name}') >${LOGS_DIR}/traefik.log
- name: Uploading "cvat" container logs as an artifact
if: failure()
uses: actions/[email protected]
with:
name: rest_api_container_logs
path: "${{ github.workspace }}/rest_api_testing"
43 changes: 28 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@ jobs:
- name: CVAT server. Build and push
uses: docker/build-push-action@v3
with:
build-args: |
"COVERAGE_PROCESS_START=.coveragerc"
cache-from: type=local,src=/tmp/cvat_cache_server
context: .
file: Dockerfile
tags: cvat/server
outputs: type=docker,dest=/tmp/cvat_server/image.tar

- name: Instrumentation of the code then rebuilding the CVAT UI
run: |
yarn --frozen-lockfile
yarn run coverage
- name: CVAT UI. Build and push
uses: docker/build-push-action@v3
with:
Expand Down Expand Up @@ -130,12 +137,6 @@ jobs:
name: cvat_ui
path: /tmp/cvat_ui/

- name: Download CVAT SDK package
uses: actions/download-artifact@v3
with:
name: cvat_sdk
path: /tmp/cvat_sdk/

- name: Load Docker images
run: |
docker load --input /tmp/cvat_server/image.tar
Expand All @@ -144,7 +145,6 @@ jobs:
docker tag cvat/ui:latest cvat/ui:${CVAT_VERSION}
docker image ls -a
- name: Upload expected schema as an artifact
if: failure() && steps.verify_schema.conclusion == 'failure'
uses: actions/[email protected]
Expand All @@ -154,11 +154,20 @@ jobs:

- name: Running REST API and SDK tests
id: run_tests
env:
COVERAGE_PROCESS_START: ".coveragerc"
run: |
pip3 install --user '/tmp/cvat_sdk/[pytorch]'
pip3 install --user cvat-cli/
pip3 install --user -r tests/python/requirements.txt
pytest tests/python/ -s -v
pip3 install -r cvat-sdk/gen/requirements.txt
./cvat-sdk/gen/generate.sh
pip3 install -r ./tests/python/requirements.txt
pip3 install -e ./cvat-sdk
pip3 install -e ./cvat-cli
pytest tests/python/ --cov --cov-report xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

- name: Creating a log file from cvat containers
if: failure() && steps.run_tests.conclusion == 'failure'
Expand Down Expand Up @@ -216,10 +225,13 @@ jobs:
while [[ $(curl -s -o /dev/null -w "%{http_code}" localhost:8181/health?bundles) != "200" && max_tries -gt 0 ]]; do (( max_tries-- )); sleep 5; done
docker compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \
-c 'python manage.py test cvat/apps -v 2'
-c 'coverage run -a manage.py test cvat/apps && coverage json && mv coverage.json ${CONTAINER_COVERAGE_DATA_DIR}'
docker compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml run cvat_ci /bin/bash \
-c 'yarn --frozen-lockfile --ignore-scripts && yarn workspace cvat-core run test'
-c 'yarn --frozen-lockfile --ignore-scripts && yarn workspace cvat-core run test && mv cvat-core/reports/coverage/coverage-final.json ${CONTAINER_COVERAGE_DATA_DIR}'
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

- name: Creating a log file from cvat containers
if: failure()
Expand Down Expand Up @@ -313,16 +325,17 @@ jobs:
npx cypress run \
--headed \
--browser chrome \
--env coverage=false \
--config-file cypress_canvas3d.config.js \
--spec 'cypress/e2e/${{ matrix.specs }}/**/*.js,cypress/e2e/remove_users_tasks_projects_organizations.js'
else
npx cypress run \
--browser chrome \
--env coverage=false \
--spec 'cypress/e2e/${{ matrix.specs }}/**/*.js,cypress/e2e/remove_users_tasks_projects_organizations.js'
fi
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

- name: Creating a log file from "cvat" container logs
if: failure()
run: |
Expand Down
Loading

0 comments on commit 0e122a9

Please sign in to comment.