Internal releases - Dedicated: Adapt Instrumentor to deploy internal packages

Context

Part of Implement the changes necessary for dedicated to deploy internal packages . This issue focuses on the changes required for instrumentor

The adaption of Dedicated includes three parts for tenant-model-schema, Instrumentor and Switchboard.

flowchart RL
    A[Switchboard] -->|Define parameters and trigger| B[Instrumentor]
    B -->|Use schema| C[tenant-model-schema]

Proposal

Instrumentor is the key component that provision and configure GitLab on dedicated tenants, it wraps also GET which is responsible for deploying the regular packages from public registries/channels. It has few places for the pre-release that we might need to adapt to deploy internal releases:

local imageTag(gitlab_prerelease_version) =
  local dotParts = std.split(gitlab_prerelease_version, '.');
  if preReleaseVersionIsTagged(gitlab_prerelease_version) then
    std.join('-', dotParts[0:3])
  else
    std.join('-', dotParts[0:2]) + '-stable';

local packageBaseName(gitlab_prerelease_version) =
  if preReleaseVersionIsTagged(gitlab_prerelease_version) then
    gitlab_prerelease_version
  else
    gitlab_prerelease_version + '-ee.0';

https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/instrumentor/-/blob/main/common/jsonnet/gitlab-release-utils.libsonnet?ref_type=heads#L22-33

We need to adapt these to accept the new internal release notation, while maintaining backward compatibility.

Please refer to the sandbox from @ahyield for an overview: https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/instrumentor/-/merge_requests/4181

Or

Adapt the GET variables to account for internal releases when -internal is detected in gitlab_version in the tenant model schema:

https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/instrumentor/-/blob/main/get/ansible/roles/common_vars/defaults/main.yml?ref_type=heads#L75-88

Important points to consider

Exit Criteria

  • Instrumentor can fetch the internal packages without raising issues.
  • Dedicated team reviews this change.

Clean up

For testing, we upload some test packages that need to be cleaned up afterward:

Edited by Dat Tang