Skip to content

Commit

Permalink
Merge pull request #1166 from exadel-inc/1.2.x-to-master
Browse files Browse the repository at this point in the history
1.2.x to master
  • Loading branch information
pospielov authored Sep 21, 2023
2 parents 04e6523 + a8e9d81 commit f125e0c
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 88 deletions.
10 changes: 5 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
56 changes: 46 additions & 10 deletions .github/workflows/Release-Push-Single-Image-to-Dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
62 changes: 27 additions & 35 deletions .github/workflows/Release-default.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: (Release) Build and Push Default CompreFace version

on:
on:
workflow_dispatch:
inputs:
version:
Expand All @@ -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
10 changes: 5 additions & 5 deletions custom-builds/FaceNet/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions custom-builds/Mobilenet-gpu/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions custom-builds/Mobilenet/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions custom-builds/Single-Docker-File/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 28 additions & 5 deletions custom-builds/Single-Docker-File/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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/ {
Expand All @@ -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;
}
}
4 changes: 2 additions & 2 deletions custom-builds/Single-Docker-File/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions custom-builds/SubCenter-ArcFace-r100-gpu/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions custom-builds/SubCenter-ArcFace-r100/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions ui/src/app/features/login-form/login-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -46,6 +47,7 @@ export class LoginFormComponent implements OnInit, OnDestroy {
constructor(private store: Store<AppState>, 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() {
Expand Down
2 changes: 2 additions & 0 deletions ui/src/app/features/model-info/model-info.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@

@include desktop-lg {
.service {
height: 90%;
overflow-y: auto;
&__container {
display: block;
padding: 0;
Expand Down

0 comments on commit f125e0c

Please sign in to comment.