diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /doc/architecture | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'doc/architecture')
5 files changed, 88 insertions, 0 deletions
diff --git a/doc/architecture/blueprints/cloud_native_build_logs/index.md b/doc/architecture/blueprints/cloud_native_build_logs/index.md index 25abfe36e88..f901a724653 100644 --- a/doc/architecture/blueprints/cloud_native_build_logs/index.md +++ b/doc/architecture/blueprints/cloud_native_build_logs/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers comments: false description: 'Next iteration of build logs architecture at GitLab' --- diff --git a/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md b/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md index 37e69d46ae1..27d2f1362e5 100644 --- a/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md +++ b/doc/architecture/blueprints/cloud_native_gitlab_pages/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers comments: false description: 'Making GitLab Pages a Cloud Native application - architecture blueprint.' --- diff --git a/doc/architecture/blueprints/feature_flags_development/index.md b/doc/architecture/blueprints/feature_flags_development/index.md index 0aeb2b51b39..76fb5f5c7db 100644 --- a/doc/architecture/blueprints/feature_flags_development/index.md +++ b/doc/architecture/blueprints/feature_flags_development/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers comments: false description: 'Internal usage of Feature Flags for GitLab development' --- diff --git a/doc/architecture/blueprints/image_resizing/index.md b/doc/architecture/blueprints/image_resizing/index.md new file mode 100644 index 00000000000..47e2ad24960 --- /dev/null +++ b/doc/architecture/blueprints/image_resizing/index.md @@ -0,0 +1,76 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +comments: false +description: 'Image Resizing' +--- + +# Image resizing for avatars and content images + +Currently, we are showing all uploaded images 1:1, which is of course not ideal. To improve performance greatly we will add image resizing to the backend. There are two main areas of image resizing to consider; avatars and content images. The MVC for this implementation will focus on Avatars. Avatars requests consist of approximately 70% of total image requests. There is an identified set of sizes we intend to support which makes the scope of this first MVC very narrow. Content image resizing has many more considerations for size and features. It is entirely possible that we have two separate development efforts with the same goal of increasing performance via image resizing. + +## MVC Avatar Resizing + +We will implement a dynamic image resizing solution. This means image should be resized and optimized on the fly so that if we define new targeted sizes later we can add them dynamically. This would mean a huge improvement in performance as some of the measurements suggest that we can save up to 95% of our current load size. Our initial investigations indicate that we have uploaded approximately 1.65 million avatars totaling approximately 80GB in size and averaging approximately 48kb each. Early measurements indicate we can reduce the most common avatar dimensions to between 1-3kb in size, netting us a greater than 90% size reduction. For the MVC we will not consider application level caching and rely purely on HTTP based caches as implemented in CDNs and browsers, but might revisit this decision later on. To easily mitigate performance issues with avatar resizing, especially in the case of self managed, an operations feature flag will be implemented to disable dynamic image resizing. + +```mermaid +sequenceDiagram + autonumber + Requester->>Workhorse: Incoming request + Workhorse->>RailsApp: Incoming request + alt All is true: 1.Avatar is requested, 2.Requested Width is allowed, 3.Feature is enabled + Note right of RailsApp: Width Allowlist: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/concerns/avatarable.rb#L10 + RailsApp->>Workhorse: `send-scaled-img:` request + Note right of RailsApp: Set `send-scaled-img:` Header + Workhorse->>Workhorse: Image resizing using Go lib + Workhorse->>Requester: Serve the resized image + else All other cases + RailsApp->>Workhorse: Usual request scenario + Workhorse->>Requester: Usual request scenario + end +``` + +## Content Image Resizing + +Content image resizing is a more complex problem to tackle. There are no set size restrictions and there are additional features or requirements to consider. + +- Dynamic WebP support - the WebP format typically achieves an average of 30% more compression than JPEG without the loss of image quality. More details [here](https://developers.google.com/speed/webp/docs/c_study) +- Extract first image of GIF's so we can prevent from loading 10MB pixels +- Check Device Pixel Ratio to deliver nice images on High DPI screens +- Progressive image loading, similar to what is described [here](https://www.sitepoint.com/how-to-build-your-own-progressive-image-loader/) +- Resizing recommendations (size, clarity, etc.) +- Storage + +The MVC Avatar resizing implementation is integrated into Workhorse. With the extra requirements for content image resizing, this may require further use of GraphicsMagik (GM) or a similar library and breaking it out of Workhorse. + +## Iterations + +1. ✓ POC on different image resizing solutions +1. ✓ Review solutions with security team +1. ✓ Implement avatar resizing MVC +1. Deploy, measure, monitor +1. Clarify features for content image resizing +1. Weigh options between using current implementation of image resizing vs new solution +1. Implement content image resizing MVC +1. Deploy, measure, monitor + +## Who + +Proposal: + +| Role | Who +|------------------------------|-------------------------| +| Author | Craig Gomes | +| Architecture Evolution Coach | Kamil Trzciński | +| Engineering Leader | Tim Zallmann | +| Domain Expert | Matthias Kaeppler | +| Domain Expert | Aleksei Lipniagov | + +DRIs: + +| Role | Who +|------------------------------|------------------------| +| Product | Josh Lambert | +| Leadership | Craig Gomes | +| Engineering | Matthias Kaeppler | diff --git a/doc/architecture/index.md b/doc/architecture/index.md index 0a2ade6b7b0..0cac646ea83 100644 --- a/doc/architecture/index.md +++ b/doc/architecture/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers comments: false description: 'Architecture Practice at GitLab' --- |