diff --git a/.env b/.env index deac330a6f..7a07475f28 100644 --- a/.env +++ b/.env @@ -19,8 +19,8 @@ uwsgi_processes=2 uwsgi_threads=1 connection_timeout=10000 read_timeout=60000 -ADMIN_VERSION=1.1.0 -API_VERSION=1.1.0 -FE_VERSION=1.1.0 -CORE_VERSION=1.1.0 -POSTGRES_VERSION=1.1.0 +ADMIN_VERSION=1.2.0 +API_VERSION=1.2.0 +FE_VERSION=1.2.0 +CORE_VERSION=1.2.0 +POSTGRES_VERSION=1.2.0 diff --git a/.github/workflows/Release-Push-Single-Image-to-Dockerhub.yml b/.github/workflows/Release-Push-Single-Image-to-Dockerhub.yml index 2379cf4114..58b3e559cf 100644 --- a/.github/workflows/Release-Push-Single-Image-to-Dockerhub.yml +++ b/.github/workflows/Release-Push-Single-Image-to-Dockerhub.yml @@ -12,7 +12,14 @@ jobs: steps: - name: Check Out Repo uses: actions/checkout@v2 - - name: Build images + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_LOGIN }} + password: ${{ secrets.DOCKER_HUB_PWD }} + + - name: Build facenet images env: VERSION: ${{ github.event.inputs.version }} APPERY_API_KEY: ${{ secrets.APPERY_API_KEY }} @@ -21,17 +28,46 @@ jobs: docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION} --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:latest ./../.. docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION} --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION} ./../.. docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION}-facenet --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION}-facenet ./../.. - docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION}-arcface-r100 --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION}-arcface-r100 ./../.. - docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION}-arcface-r100-gpu --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION}-arcface-r100-gpu ./../.. + docker images + - name: Push facenet images to Docker Hub + working-directory: ./custom-builds/Single-Docker-File/ + run: | + docker push --all-tags exadel/compreface + + - name: clean docker + working-directory: ./custom-builds/Single-Docker-File/ + run: | + docker system prune --force + + - name: Build insightface cpu images + env: + VERSION: ${{ github.event.inputs.version }} + APPERY_API_KEY: ${{ secrets.APPERY_API_KEY }} + working-directory: ./custom-builds/Single-Docker-File/ + run: | docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION}-mobilenet --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION}-mobilenet ./../.. + docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION}-arcface-r100 --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION}-arcface-r100 ./../.. + docker images + - name: Push insightface cpu images to Docker Hub + working-directory: ./custom-builds/Single-Docker-File/ + run: | + docker push --all-tags exadel/compreface + + - name: clean docker + working-directory: ./custom-builds/Single-Docker-File/ + run: | + docker system prune --force + + - name: Build insightface gpu images + env: + VERSION: ${{ github.event.inputs.version }} + APPERY_API_KEY: ${{ secrets.APPERY_API_KEY }} + working-directory: ./custom-builds/Single-Docker-File/ + run: | docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION}-mobilenet-gpu --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION}-mobilenet-gpu ./../.. - docker images - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_LOGIN }} - password: ${{ secrets.DOCKER_HUB_PWD }} - - name: Push images to Docker Hub + docker build -f Dockerfile --build-arg BASE_IMAGE=exadel/compreface-core:${VERSION}-arcface-r100-gpu --build-arg VERSION=${VERSION} --build-arg APPERY_API_KEY=${APPERY_API_KEY} -t exadel/compreface:${VERSION}-arcface-r100-gpu ./../.. + docker images + - name: Push insightface gpu images to Docker Hub working-directory: ./custom-builds/Single-Docker-File/ run: | docker push --all-tags exadel/compreface diff --git a/.github/workflows/Release-default.yml b/.github/workflows/Release-default.yml index 1cc9121bb0..55f3fb82bc 100644 --- a/.github/workflows/Release-default.yml +++ b/.github/workflows/Release-default.yml @@ -1,6 +1,6 @@ name: (Release) Build and Push Default CompreFace version -on: +on: workflow_dispatch: inputs: version: @@ -10,37 +10,29 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Check Out Repo - uses: actions/checkout@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_HUB_LOGIN }} - password: ${{ secrets.DOCKER_HUB_PWD }} - - # Set up buildx for multi platform images build - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - platforms: linux/amd64,linux/arm64 - - - name: Build and Push images - env: - VERSION: ${{ github.event.inputs.version }} - APPERY_API_KEY: ${{ secrets.APPERY_API_KEY }} - working-directory: ./dev/ - # The option --push was added in version 2.16.0, so we are additionally updating docker compose - # https://docs.docker.com/compose/release-notes/#2160 - run: | - sudo curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 \ - -o /usr/local/bin/docker-compose - sed -i 's/registry=/registry=exadel\//g' .env - docker-compose -f docker-compose.yml -f docker-compose.multiplatform.yml build \ - --push \ - --build-arg APPERY_API_KEY=${APPERY_API_KEY} - sed -i 's/latest/${VERSION}/g' .env - docker-compose -f docker-compose.yml -f docker-compose.multiplatform.yml build \ - --push \ - --build-arg APPERY_API_KEY=${APPERY_API_KEY} - + - name: Check Out Repo + uses: actions/checkout@v2 + - name: Build images + env: + VERSION: ${{ github.event.inputs.version }} + APPERY_API_KEY: ${{ secrets.APPERY_API_KEY }} + working-directory: ./dev/ + run: | + sed -i 's/registry=/registry=exadel\//g' .env + docker-compose build --build-arg APPERY_API_KEY=${APPERY_API_KEY} + sed -i 's/latest/${VERSION}/g' .env + docker-compose build --build-arg APPERY_API_KEY=${APPERY_API_KEY} + docker images + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_LOGIN }} + password: ${{ secrets.DOCKER_HUB_PWD }} + - name: Push images to Docker Hub + working-directory: ./dev/ + env: + VERSION: ${{ github.event.inputs.version }} + run: | + docker-compose push + sed -i 's/${VERSION}/latest/g' .env + docker-compose push \ No newline at end of file diff --git a/custom-builds/FaceNet/.env b/custom-builds/FaceNet/.env index a41a045b5c..7e69c10384 100644 --- a/custom-builds/FaceNet/.env +++ b/custom-builds/FaceNet/.env @@ -19,8 +19,8 @@ uwsgi_processes=2 uwsgi_threads=1 connection_timeout=10000 read_timeout=60000 -ADMIN_VERSION=1.1.0 -API_VERSION=1.1.0 -FE_VERSION=1.1.0 -CORE_VERSION=1.1.0-facenet -POSTGRES_VERSION=1.1.0 +ADMIN_VERSION=1.2.0 +API_VERSION=1.2.0 +FE_VERSION=1.2.0 +CORE_VERSION=1.2.0-facenet +POSTGRES_VERSION=1.2.0 diff --git a/custom-builds/Mobilenet-gpu/.env b/custom-builds/Mobilenet-gpu/.env index 246a62afa0..43fadd0ae5 100644 --- a/custom-builds/Mobilenet-gpu/.env +++ b/custom-builds/Mobilenet-gpu/.env @@ -19,8 +19,8 @@ uwsgi_processes=1 uwsgi_threads=1 connection_timeout=10000 read_timeout=60000 -ADMIN_VERSION=1.1.0 -API_VERSION=1.1.0 -FE_VERSION=1.1.0 -CORE_VERSION=1.1.0-mobilenet-gpu -POSTGRES_VERSION=1.1.0 +ADMIN_VERSION=1.2.0 +API_VERSION=1.2.0 +FE_VERSION=1.2.0 +CORE_VERSION=1.2.0-mobilenet-gpu +POSTGRES_VERSION=1.2.0 diff --git a/custom-builds/Mobilenet/.env b/custom-builds/Mobilenet/.env index 1487a49cff..cf3197aa9b 100644 --- a/custom-builds/Mobilenet/.env +++ b/custom-builds/Mobilenet/.env @@ -19,8 +19,8 @@ uwsgi_processes=2 uwsgi_threads=1 connection_timeout=10000 read_timeout=60000 -ADMIN_VERSION=1.1.0 -API_VERSION=1.1.0 -FE_VERSION=1.1.0 -CORE_VERSION=1.1.0-mobilenet -POSTGRES_VERSION=1.1.0 +ADMIN_VERSION=1.2.0 +API_VERSION=1.2.0 +FE_VERSION=1.2.0 +CORE_VERSION=1.2.0-mobilenet +POSTGRES_VERSION=1.2.0 diff --git a/custom-builds/Single-Docker-File/Dockerfile b/custom-builds/Single-Docker-File/Dockerfile index 124a3f04ca..8a99c3ef12 100644 --- a/custom-builds/Single-Docker-File/Dockerfile +++ b/custom-builds/Single-Docker-File/Dockerfile @@ -60,12 +60,9 @@ ENV PYTHON_URL=http://localhost:3000 ENV MAX_FILE_SIZE=5MB ENV MAX_REQUEST_SIZE=10MB -RUN apt-get update \ - && apt-get install -y wget apt-transport-https gnupg \ - && wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - \ - && echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list \ - && apt-get install -y temurin-17-jdk \ - && rm -rf /var/lib/apt/lists/* +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:17.0.8_7-jdk-jammy $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" COPY --from=admin /home/app.jar /app/admin/app.jar ARG APPERY_API_KEY diff --git a/custom-builds/Single-Docker-File/nginx.conf b/custom-builds/Single-Docker-File/nginx.conf index db53a3236a..8542683800 100644 --- a/custom-builds/Single-Docker-File/nginx.conf +++ b/custom-builds/Single-Docker-File/nginx.conf @@ -6,6 +6,10 @@ upstream frsapi { server localhost:8080 fail_timeout=10s max_fails=5; } +upstream frscore { + server localhost:3000 fail_timeout=10s max_fails=5; +} + server { listen 80; error_log stderr; @@ -21,11 +25,7 @@ server { } location /admin/ { - proxy_pass http://frsadmin/; - } - - location /swagger/ { - proxy_pass http://frsapi/; + proxy_pass http://frsadmin/admin/; } location /api/v1/ { @@ -49,4 +49,27 @@ server { proxy_pass http://frsapi/api/v1/; } + + location /core/ { + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE'; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,x-api-key'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + + add_header 'Access-Control-Allow-Origin' '*' always; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,x-api-key' always; + + proxy_pass http://frscore/; + } + + location ~ ^/(api|admin)/(swagger-ui.html|webjars|swagger-resources|v2/api-docs)(.*) { + proxy_set_header 'Host' $http_host; + proxy_pass http://frs$1/$2$3$is_args$args; + } } diff --git a/custom-builds/Single-Docker-File/supervisord.conf b/custom-builds/Single-Docker-File/supervisord.conf index c9558a5d35..e5f5a53771 100644 --- a/custom-builds/Single-Docker-File/supervisord.conf +++ b/custom-builds/Single-Docker-File/supervisord.conf @@ -40,7 +40,7 @@ stdout_logfile_maxbytes=0 redirect_stderr=true [program:compreface-admin] -command=/usr/bin/java %(ENV_ADMIN_JAVA_OPTS)s -jar /app/admin/app.jar +command=java %(ENV_ADMIN_JAVA_OPTS)s -jar /app/admin/app.jar directory=/app/admin startsecs=0 priority=2 @@ -53,7 +53,7 @@ stdout_logfile_maxbytes=0 redirect_stderr=true [program:compreface-api] -command=/usr/bin/java %(ENV_API_JAVA_OPTS)s -jar /app/api/app.jar +command=java %(ENV_API_JAVA_OPTS)s -jar /app/api/app.jar directory=/app/api startsecs=0 priority=2 diff --git a/custom-builds/SubCenter-ArcFace-r100-gpu/.env b/custom-builds/SubCenter-ArcFace-r100-gpu/.env index 8edcfab952..ceabb1458e 100644 --- a/custom-builds/SubCenter-ArcFace-r100-gpu/.env +++ b/custom-builds/SubCenter-ArcFace-r100-gpu/.env @@ -19,8 +19,8 @@ uwsgi_processes=2 uwsgi_threads=1 connection_timeout=10000 read_timeout=60000 -ADMIN_VERSION=1.1.0 -API_VERSION=1.1.0 -FE_VERSION=1.1.0 -CORE_VERSION=1.1.0-arcface-r100-gpu -POSTGRES_VERSION=1.1.0 +ADMIN_VERSION=1.2.0 +API_VERSION=1.2.0 +FE_VERSION=1.2.0 +CORE_VERSION=1.2.0-arcface-r100-gpu +POSTGRES_VERSION=1.2.0 diff --git a/custom-builds/SubCenter-ArcFace-r100/.env b/custom-builds/SubCenter-ArcFace-r100/.env index b3128f14b6..e44c43cf38 100644 --- a/custom-builds/SubCenter-ArcFace-r100/.env +++ b/custom-builds/SubCenter-ArcFace-r100/.env @@ -19,8 +19,8 @@ uwsgi_processes=2 uwsgi_threads=1 connection_timeout=10000 read_timeout=60000 -ADMIN_VERSION=1.1.0 -API_VERSION=1.1.0 -FE_VERSION=1.1.0 -CORE_VERSION=1.1.0-arcface-r100 -POSTGRES_VERSION=1.1.0 +ADMIN_VERSION=1.2.0 +API_VERSION=1.2.0 +FE_VERSION=1.2.0 +CORE_VERSION=1.2.0-arcface-r100 +POSTGRES_VERSION=1.2.0 diff --git a/ui/src/app/features/login-form/login-form.component.ts b/ui/src/app/features/login-form/login-form.component.ts index e0c10fb0d1..e777a3724e 100644 --- a/ui/src/app/features/login-form/login-form.component.ts +++ b/ui/src/app/features/login-form/login-form.component.ts @@ -29,6 +29,7 @@ import { AppState } from '../../store'; import { logIn, recoveryPassword, resetErrorMessage } from '../../store/auth/action'; import { selectLoadingState } from '../../store/auth/selectors'; import { PasswordRecoveryDialogComponent } from '../password-recovery-dialog/password-recovery.component'; +import { getMailServiceStatus } from 'src/app/store/mail-service/actions'; @Component({ selector: 'app-login-form', @@ -46,6 +47,7 @@ export class LoginFormComponent implements OnInit, OnDestroy { constructor(private store: Store, private dialog: MatDialog) { this.isLoading$ = this.store.select(selectLoadingState); this.isEmailServiceAvailable$ = this.store.select(selectMailStatus).pipe(map(res => res.mailServiceEnabled)); + this.store.dispatch(getMailServiceStatus()); } ngOnInit() { diff --git a/ui/src/app/features/model-info/model-info.component.scss b/ui/src/app/features/model-info/model-info.component.scss index ddd041da7f..5c94f0a29c 100644 --- a/ui/src/app/features/model-info/model-info.component.scss +++ b/ui/src/app/features/model-info/model-info.component.scss @@ -114,6 +114,8 @@ @include desktop-lg { .service { + height: 90%; + overflow-y: auto; &__container { display: block; padding: 0;