Don't compile assets for auto-deploy builds
Continuing a discussion I'm having with @marin at gitlab-com/gl-infra/delivery#1209 (comment 444282568), apparently asset compilation is one of the slowest pieces of building an auto-deploy package.
I'm wondering if we can leverage the gitlab-ee-assets
images in order to speed this up.
For the sake of example, let's take a look at the version currently on production: 13.6.202011061720-020b2709668.369643686fb
:
-
The EE commit is https://gitlab.com/gitlab-org/security/gitlab/commit/020b2709668
-
That commit's pipeline included the
build-assets-image
job, which pushed an image to the registry at https://gitlab.com/gitlab-org/security/gitlab/container_registry:~ % glapi GET 'projects/gitlab-org%2Fsecurity%2Fgitlab/registry/repositories/1139716/tags/020b2709668e1e604e6536f767b3b9514a7e27a5' { "created_at": "2020-11-06T16:46:09.087+00:00", "digest": "sha256:80928ee3b409fb7fe6ddac054c5df7646456abfa85f2c9d8a5888b77e0166e88", "location": "registry.gitlab.com/gitlab-org/security/gitlab/gitlab-assets-ee:020b2709668e1e604e6536f767b3b9514a7e27a5", "name": "020b2709668e1e604e6536f767b3b9514a7e27a5", "path": "gitlab-org/security/gitlab/gitlab-assets-ee:020b2709668e1e604e6536f767b3b9514a7e27a5", "revision": "7ad36bae5055b346e1d4b6a9c45846609baf07f7b2de2fd9533a355ec7c89554", "short_revision": "7ad36bae5", "total_size": 160419044 }
It should be noted that we had to expand the short
020b2709668
SHA from the tag into the full020b2709668e1e604e6536f767b3b9514a7e27a5
SHA used by the registry tag. -
We don't actually use this image when building the package -- see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/98468b447f831c18e02a69395205fe8a5de95739/gitlab-ci-config/dev-gitlab-org.yml#L259-267
That comment is basically explaining that we don't want to wait for EE to build assets on the auto-deploy tag (e.g.,
13.6.202011061720-020b2709668.369643686fb
). But if we can translate the short gitlab-rails SHA to its full one, can't we pull the commit's image that was already built before we created the auto-deploy tag?