Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP refactor container and queuing system #206

Merged
merged 36 commits into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
57170cc
refactor microservices to machine-learning
alextran1502 Jun 5, 2022
7222a5a
Update tGithub issue template with correct task syntax
alextran1502 Jun 5, 2022
7205f74
Merge branch 'main' of github.com:alextran1502/immich into dev/refact…
alextran1502 Jun 6, 2022
e8dd37a
Added microservices container
alextran1502 Jun 6, 2022
df91961
Communicate between service based on queue system
alextran1502 Jun 6, 2022
812aa70
added dependency
alextran1502 Jun 6, 2022
b481d5c
Fixed problem with having to import BullQueue into the individual ser…
alextran1502 Jun 6, 2022
e536bd6
Added todo
alextran1502 Jun 6, 2022
96907f2
refactor server into monorepo with microservices
alextran1502 Jun 6, 2022
8ab8282
refactor database and entity to library
alextran1502 Jun 6, 2022
c076baa
added simple migration
alextran1502 Jun 6, 2022
c8ea615
Move migrations and database config to library
alextran1502 Jun 6, 2022
c0248e6
Migration works in library
alextran1502 Jun 6, 2022
7daf222
Cosmetic change in logging message
alextran1502 Jun 6, 2022
97001d0
resolve merge conflict
alextran1502 Jun 6, 2022
7937e16
added user dto
alextran1502 Jun 6, 2022
a6f7bab
Fixed issue with testing not able to find the shared library
alextran1502 Jun 6, 2022
5de0a73
Clean up library mapping path
alextran1502 Jun 6, 2022
5999230
Added webp generator to microservices
alextran1502 Jun 6, 2022
26d57d8
Update Github Action build latest
alextran1502 Jun 7, 2022
a162fce
Fixed issue NPM cannot install due to conflict witl Bull Queue
alextran1502 Jun 7, 2022
218f041
format project with prettier
alextran1502 Jun 7, 2022
edca328
Modified docker-compose file
alextran1502 Jun 7, 2022
aff209a
Add GH Action for Staging build:
alextran1502 Jun 7, 2022
8f26190
Fixed GH action job name
alextran1502 Jun 7, 2022
0f696f3
Modified GH Action to only build & push latest when pushing to main
alextran1502 Jun 7, 2022
61eab41
Added Test 2e2 Github Action
alextran1502 Jun 7, 2022
176f4af
Added Test 2e2 Github Action
alextran1502 Jun 7, 2022
111dfc7
Implemented microservice to extract exif
alextran1502 Jun 7, 2022
440a548
Added cronjob to scan and generate webp thumbnail at midnight
alextran1502 Jun 7, 2022
25cdd99
Refactor to ireduce hit time to database when running microservices
alextran1502 Jun 7, 2022
1fdd560
Added error handling to asset services that handle read file from disk
alextran1502 Jun 8, 2022
24cdec0
Added video transcoding queue to process one video at a time
alextran1502 Jun 8, 2022
6bba16b
Fixed loading spinner on web while loading covering the info panel
alextran1502 Jun 8, 2022
ce28e45
Add mechanism to show new release announcement to web and mobile app …
alextran1502 Jun 11, 2022
73f86ec
Up version for deployment to the app store
alextran1502 Jun 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Note: Please search to see if an issue already exists for the bug you encountere
A clear and concise description of what the bug is.

**Task List**
[ ] I have read thoroughly the README setup and installation instructions.
[ ] If my setup is different, I have included my docker-compose file.
[ ] I have included my redacted `.env` file.
[ ] I have included information on my machine, and environment.
- [ ] I have read thoroughly the README setup and installation instructions.
- [ ] If my setup is different, I have included my docker-compose file.
- [ ] I have included my redacted `.env` file.
- [ ] I have included information on my machine, and environment.

**To Reproduce**
Steps to reproduce the behavior:
Expand Down
27 changes: 12 additions & 15 deletions .github/workflows/build_push_docker_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build_and_push_server_latest:
# This image include both the server and microservices - the two containers can be slitted into separated
# service with its coressponding entry file.
build_and_push_server_monorepo_latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# ref: "main" # branch
fetch-depth: 0

- name: Set up QEMU
Expand All @@ -27,23 +26,22 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Immich
- name: Build and push Immich Mono Repo
uses: docker/[email protected]
with:
context: ./server
file: ./server/Dockerfile
platforms: linux/arm/v7,linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: |
altran1502/immich-server:latest

build_and_push_microservice_latest:
build_and_push_machine_learning_latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# ref: "main" # branch
fetch-depth: 0

- name: Set up QEMU
Expand All @@ -56,23 +54,22 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Microservices
- name: Build and Push Machine Learning
uses: docker/[email protected]
with:
context: ./microservices
file: ./microservices/Dockerfile
context: ./machine-learning
file: ./machine-learning/Dockerfile
platforms: linux/arm/v7,linux/amd64
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: |
altran1502/immich-microservices:latest
altran1502/immich-machine-learning:latest

build_and_push_web_latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# ref: "main" # branch
fetch-depth: 0
- name: Set up QEMU
uses: docker/[email protected]
Expand All @@ -91,6 +88,6 @@ jobs:
file: ./web/Dockerfile
platforms: linux/arm/v7,linux/amd64,linux/arm64
target: prod
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: |
altran1502/immich-web:latest
95 changes: 95 additions & 0 deletions .github/workflows/build_push_docker_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Build and Push Docker Image - Staging

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
# This image include both the server and microservices - the two containers can be slitted into separated
# service with its coressponding entry file.
build_and_push_server_monorepo_staging:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Immich Mono Repo
uses: docker/[email protected]
with:
context: ./server
file: ./server/Dockerfile
platforms: linux/arm/v7,linux/amd64,linux/arm64
push: ${{ github.event_name == 'pull_request' }}
tags: |
altran1502/immich-server:staging

build_and_push_machine_learning_staging:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Machine Learning
uses: docker/[email protected]
with:
context: ./machine-learning
file: ./machine-learning/Dockerfile
platforms: linux/arm/v7,linux/amd64
push: ${{ github.event_name == 'pull_request' }}
tags: |
altran1502/immich-machine-learning:staging

build_and_push_web_staging:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Web
uses: docker/[email protected]
with:
context: ./web
file: ./web/Dockerfile
platforms: linux/arm/v7,linux/amd64,linux/arm64
target: prod
push: ${{ github.event_name == 'pull_request' }}
tags: |
altran1502/immich-web:staging
30 changes: 25 additions & 5 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
build:
context: ../server
dockerfile: Dockerfile
command: npm run start:dev
command: npm run start:dev immich
expose:
- "3000"
volumes:
Expand All @@ -23,16 +23,35 @@ services:
networks:
- immich-network

immich-microservices:
image: immich-microservices-dev:1.9.0
immich-machine-learning:
image: immich-machine-learning-dev:1.9.0
build:
context: ../microservices
context: ../machine-learning
dockerfile: Dockerfile
command: npm run start:dev
expose:
- "3001"
volumes:
- ../microservices:/usr/src/app
- ../machine-learning:/usr/src/app
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /usr/src/app/node_modules
env_file:
- .env
environment:
- NODE_ENV=development
depends_on:
- database
networks:
- immich-network

immich-microservices:
image: immich-microservices:1.9.0
build:
context: ../server
dockerfile: Dockerfile
command: npm run start:dev microservices
volumes:
- ../server:/usr/src/app
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /usr/src/app/node_modules
env_file:
Expand All @@ -44,6 +63,7 @@ services:
networks:
- immich-network


immich-web:
image: immich-web-dev:1.9.0
build:
Expand Down
35 changes: 27 additions & 8 deletions docker/docker-compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ version: "3.8"

services:
immich-server:
image: immich-server-staging:latest
image: immich-server:staging
build:
context: ../server
dockerfile: Dockerfile
entrypoint: ["/bin/sh", "./entrypoint.sh"]
entrypoint: ["/bin/sh", "./start-server.sh"]
expose:
- "3000"
volumes:
Expand All @@ -23,11 +23,11 @@ services:
restart: always

immich-microservices:
image: immich-microservices-staging:latest
image: immich-microservices:staging
build:
context: ../microservices
context: ../server
dockerfile: Dockerfile
entrypoint: ["/bin/sh", "./entrypoint.sh"]
entrypoint: ["/bin/sh", "./start-microservices.sh"]
expose:
- "3001"
volumes:
Expand All @@ -42,6 +42,27 @@ services:
- immich-network
restart: always

immich-machine-learning:
image: immich-machine-learning:staging
build:
context: ../machine-learning
dockerfile: Dockerfile
entrypoint: ["/bin/sh", "./entrypoint.sh"]
expose:
- "3001"
volumes:
- ../machine-learning:/usr/src/app
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /usr/src/app/node_modules
env_file:
- .env
environment:
- NODE_ENV=development
depends_on:
- database
networks:
- immich-network

immich-web:
image: immich-web-staging:latest
entrypoint: ["/bin/sh", "./entrypoint.sh"]
Expand All @@ -57,14 +78,12 @@ services:
- immich-network
restart: always


redis:
container_name: immich_redis
image: redis:6.2
networks:
- immich-network
restart: always


database:
container_name: immich_postgres
Expand Down Expand Up @@ -102,4 +121,4 @@ services:
networks:
immich-network:
volumes:
pgdata:
pgdata:
26 changes: 20 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.8"
services:
immich-server:
image: altran1502/immich-server:latest
entrypoint: ["/bin/sh", "./entrypoint.sh"]
entrypoint: ["/bin/sh", "./start-server.sh"]
expose:
- "3000"
volumes:
Expand All @@ -20,7 +20,23 @@ services:
restart: always

immich-microservices:
image: altran1502/immich-microservices:latest
image: altran1502/immich-server:latest
entrypoint: ["/bin/sh", "./start-microservices.sh"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
env_file:
- .env
environment:
- NODE_ENV=production
depends_on:
- redis
- database
networks:
- immich-network
restart: always

immich-machine-learning:
image: altran1502/immich-machine-learning:latest
entrypoint: ["/bin/sh", "./entrypoint.sh"]
expose:
- "3001"
Expand All @@ -47,14 +63,12 @@ services:
- immich-network
restart: always


redis:
container_name: immich_redis
image: redis:6.2
networks:
- immich-network
restart: always


database:
container_name: immich_postgres
Expand All @@ -73,7 +87,7 @@ services:
networks:
- immich-network
restart: always

nginx:
container_name: proxy_nginx
image: nginx:latest
Expand All @@ -93,4 +107,4 @@ services:
networks:
immich-network:
volumes:
pgdata:
pgdata:
File renamed without changes.
File renamed without changes.
Loading