Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
Browse files Browse the repository at this point in the history
…o feature/blob_connection_string
  • Loading branch information
suzusuzu committed Oct 13, 2022
2 parents 10fcd96 + 5936bc5 commit bd456b2
Show file tree
Hide file tree
Showing 395 changed files with 29,966 additions and 11,089 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
'.eslintrc.js',
'lint-staged.config.js',
],
plugins: ['@typescript-eslint', 'security', 'no-unsanitized', 'eslint-plugin-header', 'import'],
plugins: ['@typescript-eslint', 'security', 'no-unsanitized', 'import'],
extends: [
'eslint:recommended', 'plugin:security/recommended', 'plugin:no-unsanitized/DOM',
'airbnb-base', 'plugin:import/errors', 'plugin:import/warnings',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# If different modules use different Black configs,
# we need to run Black for each python component group separately.
# Otherwise, they all will use the same config.
ENABLED_DIRS=("cvat-sdk" "cvat-cli" "tests/python/sdk" "tests/python/cli")
ENABLED_DIRS=("cvat-sdk" "cvat-cli" "tests/python")
isValueIn () {
# Checks if a value is in an array
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Get branch name
id: get-ref
run: |
BRANCH=$(gh api /repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} | jq -r '.head.ref')
echo ::set-output name=ref::${BRANCH}
SHA=$(gh api /repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} | jq -r '.head.sha')
echo ::set-output name=ref::${SHA}
- name: Send comment. Test are executing
id: send-status
Expand Down
55 changes: 36 additions & 19 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Create image directory
- name: Create artifact directories
run: |
mkdir /tmp/cvat_server
mkdir /tmp/cvat_ui
mkdir /tmp/cvat_sdk
- name: CVAT server. Build
- name: CVAT server. Build and push
uses: docker/build-push-action@v3
with:
cache-from: type=local,src=/tmp/cvat_cache_server
Expand All @@ -78,7 +79,7 @@ jobs:
tags: cvat/server
outputs: type=docker,dest=/tmp/cvat_server/image.tar

- name: CVAT UI. Build
- name: CVAT UI. Build and push
uses: docker/build-push-action@v3
with:
cache-from: type=local,src=/tmp/cvat_cache_ui
Expand All @@ -87,6 +88,19 @@ jobs:
tags: cvat/ui
outputs: type=docker,dest=/tmp/cvat_ui/image.tar

- name: CVAT SDK. Build
run: |
docker load --input /tmp/cvat_server/image.tar
docker run --rm -v ${PWD}/cvat-sdk/schema/:/transfer \
--entrypoint /bin/bash -u root cvat/server \
-c 'python manage.py spectacular --file /transfer/schema.yml'
pip3 install --user -r cvat-sdk/gen/requirements.txt
cd cvat-sdk/
gen/generate.sh
cd ..
cp -r cvat-sdk/* /tmp/cvat_sdk/
- name: Upload CVAT server artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -99,6 +113,12 @@ jobs:
name: cvat_ui
path: /tmp/cvat_ui/image.tar

- name: Upload CVAT SDK artifact
uses: actions/upload-artifact@v3
with:
name: cvat_sdk
path: /tmp/cvat_sdk/

rest_api:
needs: build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -158,25 +178,23 @@ 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
docker load --input /tmp/cvat_ui/image.tar
docker tag cvat/server:latest cvat/server:dev
docker tag cvat/ui:latest cvat/server:dev
docker tag cvat/ui:latest cvat/ui:dev
docker image ls -a
- name: Running REST API and SDK tests
run: |
docker run --rm -v ${PWD}/cvat-sdk/schema/:/transfer \
--entrypoint /bin/bash -u root cvat/server \
-c 'python manage.py spectacular --file /transfer/schema.yml'
pip3 install --user -r cvat-sdk/gen/requirements.txt
cd cvat-sdk/
gen/generate.sh
cd ..
pip3 install --user cvat-sdk/
pip3 install --user /tmp/cvat_sdk/
pip3 install --user cvat-cli/
pip3 install --user -r tests/python/requirements.txt
pytest tests/python -s -v
Expand All @@ -193,11 +211,9 @@ jobs:
- name: Uploading "cvat" container logs as an artifact
if: failure()
uses: actions/upload-artifact@v2
env:
LOGS_DIR: "${{ github.workspace }}/rest_api"
with:
name: container_logs
path: $LOGS_DIR
path: "${{ github.workspace }}/rest_api"

unit_testing:
needs: build
Expand Down Expand Up @@ -307,6 +323,7 @@ jobs:
-f docker-compose.yml \
-f docker-compose.dev.yml \
-f components/serverless/docker-compose.serverless.yml \
-f tests/docker-compose.minio.yml \
-f tests/docker-compose.file_share.yml up -d
- name: Waiting for server
Expand All @@ -315,7 +332,7 @@ jobs:
run: |
max_tries=60
status_code=$(curl -s -o /tmp/server_response -w "%{http_code}" ${API_ABOUT_PAGE})
while [[ $status_code != "401" && max_tries -gt 0 ]]
while [[ $status_code != "200" && max_tries -gt 0 ]]
do
echo Number of attempts left: $max_tries
echo Status code of response: $status_code
Expand All @@ -339,13 +356,13 @@ jobs:
npx cypress run \
--headed \
--browser chrome \
--env coverage=false
--env coverage=false \
--config-file cypress_canvas3d.json \
--spec 'cypress/integration/${{ matrix.specs }}/**/*.js,cypress/integration/remove_users_tasks_projects_organizations.js'
else
npx cypress run \
--browser chrome \
--env coverage=false
--env coverage=false \
--spec 'cypress/integration/${{ matrix.specs }}/**/*.js,cypress/integration/remove_users_tasks_projects_organizations.js'
fi
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/github_pages.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Helm
on:
pull_request:
types: [edited, ready_for_review, opened, synchronize, reopened]
workflow_dispatch:

jobs:
check_changes:
runs-on: ubuntu-latest
outputs:
helm_dir_changed: ${{ steps.check_updates.outputs.helm_dir_changed }}
steps:
- uses: jitterbit/get-changed-files@v1
id: files
continue-on-error: true

- name: Run check
id: check_updates
env:
PR_FILES_AM: ${{ steps.files.outputs.added_modified }}
PR_FILES_RENAMED: ${{ steps.files.outputs.renamed }}
run: |
PR_FILES="$PR_FILES_AM $PR_FILES_RENAMED"
for FILE in $PR_FILES; do
if [[ $FILE == helm-chart/* ]] ; then
echo "::set-output name=helm_dir_changed::true"
break
fi
done
testing:
needs: check_changes
if: needs.check_changes.outputs.helm_dir_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Start minikube
uses: medyagh/setup-minikube@latest

- name: Try the cluster!
run: kubectl get pods -A

- name: Pull images
run: |
export SHELL=/bin/bash
eval $(minikube -p minikube docker-env)
docker pull cvat/server
docker pull cvat/ui
echo -n "verifying images:"
docker images
- uses: azure/setup-helm@v3
with:
version: 'v3.9.4'

- name: Deploy to minikube
run: |
printf "traefik:\n service:\n externalIPs:\n - $(minikube ip)\n" > helm-chart/values.override.yaml
find cvat/apps/iam/rules -name "*.rego" -and ! -name '*test*' -exec basename {} \; | tar -czf helm-chart/rules.tar.gz -C cvat/apps/iam/rules/ -T -
cd helm-chart
helm dependency update
cd ..
helm upgrade -n default cvat -i --create-namespace helm-chart -f helm-chart/values.yaml -f helm-chart/values.override.yaml
- name: Update test config
run: |
sed -i -e 's$http://localhost:8080$http://cvat.local:80$g' tests/python/shared/utils/config.py
find tests/python/shared/assets/ -type f -name '*.json' | xargs sed -i -e 's$http://localhost:8080$http://cvat.local$g'
echo "$(minikube ip) cvat.local" | sudo tee -a /etc/hosts
- name: Wait for CVAT to be ready
run: |
max_tries=30
while [[ $(kubectl get pods -l component=server -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" && max_tries -gt 0 ]]; do echo "waiting for CVAT pod" && (( max_tries-- )) && sleep 5; done
while [[ $(kubectl get pods -l app.kubernetes.io/name=postgresql -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" && max_tries -gt 0 ]]; do echo "waiting for DB pod" && (( max_tries-- )) && sleep 5; done
kubectl get pods
- name: Generate schema
run: |
mkdir cvat-sdk/schema
kubectl exec $(kubectl get pods -l component=server -o jsonpath='{.items[0].metadata.name}') -- /bin/bash -c "python manage.py spectacular --file /tmp/schema.yml"
kubectl cp $(kubectl get pods -l component=server -o jsonpath='{.items[0].metadata.name}'):/tmp/schema.yml cvat-sdk/schema/schema.yml
pip3 install --user -r cvat-sdk/gen/requirements.txt
cd cvat-sdk/
gen/generate.sh
cd ..
- name: Install test requrements
run: |
pip3 install --user cvat-sdk/
pip3 install --user cvat-cli/
pip3 install --user -r tests/python/requirements.txt
- name: REST API and SDK tests
run: |
pytest --platform=kube \
--ignore=tests/python/rest_api/test_cloud_storages.py \
--ignore=tests/python/rest_api/test_analytics.py \
--ignore=tests/python/rest_api/test_resource_import_export.py \
-k 'not create_task_with_cloud_storage_files' \
tests/python
2 changes: 1 addition & 1 deletion .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# If different modules use different isort configs,
# we need to run isort for each python component group separately.
# Otherwise, they all will use the same config.
ENABLED_DIRS=("cvat-sdk" "cvat-cli" "tests/python/sdk" "tests/python/cli")
ENABLED_DIRS=("cvat-sdk" "cvat-cli" "tests/python")
isValueIn () {
# Checks if a value is in an array
Expand Down
Loading

0 comments on commit bd456b2

Please sign in to comment.