Skip to content

Commit 6e2fb53

Browse files
Merge branch 'master' into EFRS-1342_link_is_not_a_link
2 parents a8d674c + 79c79e9 commit 6e2fb53

File tree

211 files changed

+615
-1145
lines changed

Some content is hidden

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

211 files changed

+615
-1145
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: (Azure) Сompreface AIB image
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version (e.g., 1.0.0)
8+
required: true
9+
env:
10+
RESOURCE_GROUP_NAME: compreFaceGallery-RG
11+
MANAGED_IDENTITY: compreFace-MI
12+
GALLERY_NAME: compreFaceGallery
13+
IMAGE_NAME: compreFace
14+
VERSION: ${{ github.event.inputs.version }}
15+
jobs:
16+
build-image:
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- name: Login via Az module
21+
uses: azure/login@v1
22+
with:
23+
creds: ${{secrets.AZURE_CREDENTIALS}}
24+
25+
- name: Build custom VM image
26+
id: imageBuilder
27+
uses: azure/build-vm-image@v0
28+
with:
29+
resource-group-name: "${{ env.RESOURCE_GROUP_NAME }}"
30+
managed-identity: "${{ env.MANAGED_IDENTITY }}"
31+
location: 'eastus'
32+
source-os-type: 'linux'
33+
source-image-type: 'PlatformImage'
34+
source-image: Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest
35+
vm-size: 'Standard_B2s'
36+
dist-type: 'SharedImageGallery'
37+
dist-resource-id: "/subscriptions/${{secrets.AZURE_SUBSCRIPTION_ID}}/resourceGroups/${{ env.RESOURCE_GROUP_NAME }}/providers/Microsoft.Compute/galleries/${{ env.GALLERY_NAME }}/images/${{ env.IMAGE_NAME }}/versions/${{ env.VERSION }}"
38+
dist-location: 'eastus'
39+
customizer-script: |
40+
apt update
41+
apt upgrade -y
42+
apt install -y docker.io unzip
43+
docker version
44+
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
45+
chmod +x /usr/local/bin/docker-compose
46+
docker-compose version
47+
wget -q -O tmp.zip "https://github.com/exadel-inc/CompreFace/releases/download/v${{ env.VERSION }}/CompreFace_${{ env.VERSION }}.zip" && unzip tmp.zip && rm tmp.zip
48+
chmod 666 /var/run/docker.sock
49+
docker-compose pull --quiet
50+
docker-compose up -d

embedding-calculator/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ flasgger==0.9.5
55
Flask==1.1.2
66
itsdangerous==2.0.1 # itsdangerous is a Flask dependency, update it with Flask
77
jinja2<3.1.0 # jinja2 is a Flask dependency, update it with Flask
8-
gdown~=4.3.0
8+
gdown~=4.5.4
99
Werkzeug==1.0.1
1010
PyYAML==5.4.1
1111

java/admin/src/main/java/com/exadel/frs/FrsApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public class FrsApplication {
2727
public static void main(String[] args) {
2828
SpringApplication.run(FrsApplication.class, args);
2929
}
30-
}
30+
}

java/admin/src/main/java/com/exadel/frs/controller/AppController.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@
1616

1717
package com.exadel.frs.controller;
1818

19-
import com.exadel.frs.commonservice.annotation.CollectStatistics;
2019
import com.exadel.frs.commonservice.enums.AppRole;
21-
import com.exadel.frs.commonservice.enums.StatisticsType;
22-
import com.exadel.frs.dto.ui.*;
20+
import com.exadel.frs.dto.AppCreateDto;
21+
import com.exadel.frs.dto.AppResponseDto;
22+
import com.exadel.frs.dto.AppUpdateDto;
23+
import com.exadel.frs.dto.UserInviteDto;
24+
import com.exadel.frs.dto.UserRoleResponseDto;
25+
import com.exadel.frs.dto.UserRoleUpdateDto;
2326
import com.exadel.frs.helpers.SecurityUtils;
2427
import com.exadel.frs.mapper.AppMapper;
2528
import com.exadel.frs.mapper.UserAppRoleMapper;

java/admin/src/main/java/com/exadel/frs/controller/AppStatusController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import static com.exadel.frs.commonservice.enums.AppStatus.NOT_READY;
55
import static com.exadel.frs.commonservice.enums.AppStatus.OK;
66
import com.exadel.frs.commonservice.enums.AppStatus;
7-
import com.exadel.frs.dto.ui.AppStatusResponseDto;
7+
import com.exadel.frs.dto.AppStatusResponseDto;
88
import io.swagger.annotations.ApiOperation;
99
import java.sql.Connection;
1010
import java.sql.SQLException;

java/admin/src/main/java/com/exadel/frs/controller/ConfigController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.exadel.frs.controller;
22

33
import static com.exadel.frs.system.global.Constants.ADMIN;
4-
import com.exadel.frs.dto.ui.ConfigDto;
4+
import com.exadel.frs.dto.ConfigDto;
55
import io.swagger.annotations.ApiOperation;
66
import lombok.RequiredArgsConstructor;
77
import org.springframework.core.env.Environment;

java/admin/src/main/java/com/exadel/frs/controller/ModelController.java

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
import static com.exadel.frs.system.global.Constants.GUID_EXAMPLE;
2121
import static org.springframework.http.HttpStatus.CREATED;
2222
import com.exadel.frs.commonservice.entity.Model;
23-
import com.exadel.frs.commonservice.entity.ModelStatisticProjection;
23+
import com.exadel.frs.commonservice.projection.ModelStatisticProjection;
2424
import com.exadel.frs.commonservice.exception.IncorrectModelTypeException;
25-
import com.exadel.frs.dto.ui.ModelCloneDto;
26-
import com.exadel.frs.dto.ui.ModelCreateDto;
27-
import com.exadel.frs.dto.ui.ModelResponseDto;
28-
import com.exadel.frs.dto.ui.ModelUpdateDto;
25+
import com.exadel.frs.dto.ModelCloneDto;
26+
import com.exadel.frs.dto.ModelCreateDto;
27+
import com.exadel.frs.dto.ModelResponseDto;
28+
import com.exadel.frs.dto.ModelUpdateDto;
2929
import com.exadel.frs.helpers.SecurityUtils;
3030
import com.exadel.frs.mapper.MlModelMapper;
3131
import com.exadel.frs.service.ModelService;
@@ -96,20 +96,12 @@ public ModelResponseDto createModel(
9696
@RequestBody
9797
final ModelCreateDto modelCreateDto
9898
) {
99-
Model model;
100-
switch (modelCreateDto.getType()) {
101-
case DETECTION:
102-
model = modelService.createDetectionModel(modelCreateDto, appGuid, SecurityUtils.getPrincipalId());
103-
break;
104-
case RECOGNITION:
105-
model = modelService.createRecognitionModel(modelCreateDto, appGuid, SecurityUtils.getPrincipalId());
106-
break;
107-
case VERIFY:
108-
model = modelService.createVerificationModel(modelCreateDto, appGuid, SecurityUtils.getPrincipalId());
109-
break;
110-
default:
111-
throw new IncorrectModelTypeException(modelCreateDto.getType());
112-
}
99+
Model model = switch (modelCreateDto.getType()) {
100+
case DETECTION -> modelService.createDetectionModel(modelCreateDto, appGuid, SecurityUtils.getPrincipalId());
101+
case RECOGNITION -> modelService.createRecognitionModel(modelCreateDto, appGuid, SecurityUtils.getPrincipalId());
102+
case VERIFY -> modelService.createVerificationModel(modelCreateDto, appGuid, SecurityUtils.getPrincipalId());
103+
default -> throw new IncorrectModelTypeException(modelCreateDto.getType());
104+
};
113105

114106
return modelMapper.toResponseDto(model, appGuid);
115107
}

java/admin/src/main/java/com/exadel/frs/controller/UserController.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
import com.exadel.frs.commonservice.enums.GlobalRole;
2727
import com.exadel.frs.commonservice.enums.Replacer;
2828
import com.exadel.frs.commonservice.exception.DemoNotAvailableException;
29-
import com.exadel.frs.dto.ui.ChangePasswordDto;
30-
import com.exadel.frs.dto.ui.ForgotPasswordDto;
31-
import com.exadel.frs.dto.ui.ResetPasswordDto;
32-
import com.exadel.frs.dto.ui.UserAutocompleteDto;
33-
import com.exadel.frs.dto.ui.UserCreateDto;
34-
import com.exadel.frs.dto.ui.UserDeleteDto;
35-
import com.exadel.frs.dto.ui.UserResponseDto;
36-
import com.exadel.frs.dto.ui.UserRoleResponseDto;
37-
import com.exadel.frs.dto.ui.UserRoleUpdateDto;
38-
import com.exadel.frs.dto.ui.UserUpdateDto;
29+
import com.exadel.frs.dto.ChangePasswordDto;
30+
import com.exadel.frs.dto.ForgotPasswordDto;
31+
import com.exadel.frs.dto.ResetPasswordDto;
32+
import com.exadel.frs.dto.UserAutocompleteDto;
33+
import com.exadel.frs.dto.UserCreateDto;
34+
import com.exadel.frs.dto.UserDeleteDto;
35+
import com.exadel.frs.dto.UserResponseDto;
36+
import com.exadel.frs.dto.UserRoleResponseDto;
37+
import com.exadel.frs.dto.UserRoleUpdateDto;
38+
import com.exadel.frs.dto.UserUpdateDto;
3939
import com.exadel.frs.exception.AccessDeniedException;
4040
import com.exadel.frs.exception.UserDoesNotExistException;
4141
import com.exadel.frs.helpers.SecurityUtils;

java/admin/src/main/java/com/exadel/frs/dto/AccessToken.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

java/admin/src/main/java/com/exadel/frs/dto/ui/AppCreateDto.java renamed to java/admin/src/main/java/com/exadel/frs/dto/AppCreateDto.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* permissions and limitations under the License.
1515
*/
1616

17-
package com.exadel.frs.dto.ui;
17+
package com.exadel.frs.dto;
1818

1919
import static com.exadel.frs.commonservice.system.global.RegExConstants.ALLOWED_SPECIAL_CHARACTERS;
2020
import javax.validation.constraints.NotBlank;

0 commit comments

Comments
 (0)