Commit Graph

517 Commits

Author SHA1 Message Date
Robert Marshall e1dfa73551 Use Ubuntu 22.04 for license and manifest upload
- Updates the license and manifest upload jobs to use Ubuntu 22.04
  instead of Ubuntu 18.04. Ubuntu 18.04 reached end of standard support
  on May 31, 2023 and was deprecated in GitLab version 16.9.

Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8084

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8523

Signed-off-by: Robert Marshall <rmarshall@gitlab.com>
2024-05-07 11:01:16 +00:00
Stan Hu 38bd8dffec Use bundler to install Omnibus gems
Instead of calling `gem install <x>` many times, let's define the
`Gemfile` and `Gemfile.lock` and run `bundle install`. This ensures
dependencies are pinned and don't quietly move with a new invocation
of `gem install`. There is also a side benefit to using `bundler`: we
can later use the newly-introduced feature to include and verify
checksums (https://github.com/rubygems/rubygems/pull/6374).

`bundler` generally installs everything in the expected gem directory
 that is used by `ruby`, but for gems installed from a Git source,
`bundler` puts those gems in a special `bundler/gems` directory.
We don't use any gems from Git sources now--`gitlab-ruby-shadow`
is now used instead of `ruby-shadow`--there is no issue.

Also, note that if we want to ensure `gitlab-ctl` doesn't try to pull
in gems from GitLab Rails, we could invoke `bundler`, but this is a
slightly riskier change.

Relates to https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8368

Changelog: changed
2024-05-06 04:02:46 +00:00
Balasankar 'Balu' C 7eeb584a40
Fix RAT_FIPS_PACKAGE_URL not having fips suffix in path
While generating package information, specify fips argument for FIPS
package URLs. Also ensure the correct package folder is used in those
URLs.

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-19 15:11:51 +05:30
Balasankar 'Balu' C fecc1240f3
Make package info methods take fips as argument
Package related information can have different values for FIPS packages
and regular packages. For builds, USE_SYSTEM_SSL variable controls if
the FIPS specific information should be used. However, while generating
facts, we need to specifically retreive FIPS specific information too,
in addition to regular one. So, accept fips as an argument to the
relevant methods that can be specified while generating facts.

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-19 15:08:11 +05:30
Balasankar 'Balu' C ca02e0c220
Enable building arm64 images
Modify the Dockerfile and library code around Docker image builds to
support building multiarch images. The Dockerfile will download the
package for the correct architecture based on TARGETARCH variable.

Closes: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8470

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-19 08:40:38 +05:30
Balasankar 'Balu' C f8c71c7a9c
Use docker buildx to build Docker images
Move away from docker-api gem which does not have support for `docker
buildx`. Add a wrapper to execute `docker buildx` commands in the shell
and use that for Docker operations.

Closes: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8469

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-19 08:40:16 +05:30
Andrew Patterson 887df90300 Fix for missing branch_build_package_download_url
Use Build::Info::CI::package_download_url instead
of the no longer present
Build::Info::CI::branch_build_package_download_url
2024-04-18 08:04:04 -06:00
Balasankar 'Balu' C ff55a2fedc Pass DEV_BUILDER_IMAGE_REGISTRY variable to downstream pipeline
- Adds DEV_BUILDER_IMAGE_REGISTRY when invoking triggers to
  allow build-package-on-all-os jobs to work with SLES from
  the GitLab Omnibus Builder repository.

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-09 15:28:45 +00:00
Balasankar 'Balu' C 22ae898b24 Add Rubocop cop to enforce default_version in software definitions
Prevent empty build caches caused by a lack of default version.

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8476

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-08 16:29:41 +00:00
Reuben Pereira 5719d82182 Revert "Merge branch 'revert-cache-changes' into 'master'"
This reverts merge request !7521
2024-04-04 04:09:05 +00:00
Robert Marshall aea984c929 Revert recently introduced cache changes
- Recent pipeline jobs failed with strange cache issues. After review of
  recent changes, it is possible that changes from trigger based jobs to
  normal pipeline jobs may have introduced hidden behavioral changes that
  polluted the build caches. This reverts those changes as an attempt
  to unblock auto deploy while the team continues to investigate.
- https://dev.gitlab.org/gitlab/omnibus-gitlab/-/jobs/19887684
- https://dev.gitlab.org/gitlab/omnibus-gitlab/-/jobs/19883123
- https://gitlab.com/gitlab-org/omnibus-gitlab/-/jobs/6535645918

This reverts commit 373d38dc4f.
This reverts commit b7cb856e12.

Signed-off-by: Robert Marshall <rmarshall@gitlab.com>
2024-04-03 13:25:00 -04:00
Andrew Patterson 0550d3cce0 Merge branch 'deduplicate-package-build-jobs' into 'master'
Drop trigger build jobs in favor of normal branch build jobs

Closes #6333 and #7187

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7497

Merged-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Clemens Beck <cbeck@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Reviewed-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Reviewed-by: Clemens Beck <cbeck@gitlab.com>
Co-authored-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-02 04:24:21 +00:00
Balasankar 'Balu' C b7cb856e12 Drop trigger build jobs in favor of normal branch build jobs
- Control cache policy by variable.
- Drop trigger build jobs in favor of normal branch build jobs.

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-02 04:24:21 +00:00
Balasankar 'Balu' C 7159395339 Enable skopeo for container releases
- Adds option that enables container copies with skopeo
  instead of pull the image, re-tag, and then push it
- Retains current pull/re-tag/push behavior as default

Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5673

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-04-01 19:34:04 +00:00
Balasankar 'Balu' C 4b8ab3c2cb Ensure nightly pipelines are correctly detected in Canonical
- Ensures package is built for both branch pipelines and
  the nightly job
- Fixes package download URL calculations

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8451

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-03-28 01:09:18 +00:00
Ryan Egesdahl 062f88a7c6 Revert "Merge branch 'fix-nightly-in-canonical-rat' into 'master'"
This reverts merge request !7460 because the `Trigger:package` job
was not present.  Adding it would build the Ubuntu package twice, so
we chose to revert and determine if this can be done with the
package already built in the pipeline.
2024-03-09 02:55:55 +00:00
Balasankar 'Balu' C 7b2b58ba99 Ensure nightly pipelines are correctly detected in Canonical
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-03-08 22:41:25 +00:00
Balasankar 'Balu' C 65a8c2c5a6 Enable running nightly pipelines in Canonical repo
Modify workflow rules so that nightly pipelines can be run also in
Canonical project

Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2024-02-26 15:43:08 +00:00
Balasankar "Balu" C 6936df9e78
Cleanup requires across library files
* Ensure every library `require`s all the other libraries it needs for
  functioning.
* Ensure require statements come before require_relative ones
* Ensure require_relative statements doesn't end with `.rb` extension
    * Also enabled the Cop for that
* Use single quotes for require statements

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2024-01-30 10:41:53 +05:30
Balasankar "Balu" C 10db300868
Move Build::Info.log_level to Build.log_level
This information is used only during building. So it makes sense for it
to stay in the Build module.

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2024-01-30 10:41:51 +05:30
Balasankar "Balu" C 3b92f00698
Move GCP bucket related information to GCloudHelper
This information is used only in GCloudHelper and no where else. So, it
makes sense for it to stay in that class.

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2024-01-30 10:41:50 +05:30
Nailia Iskhakova 838c542918 Tag docker images from staging builds with CI_COMMIT_REF_SLUG also 2024-01-26 02:37:41 +00:00
Balasankar 'Balu' C db49c1a340
Fix triggering of deployer pipelines
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2023-12-19 21:45:39 +05:30
Robert Marshall 8cc3d81723 Merge branch 'split-info-deploy' into 'master'
Split Deploy related information to own class

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7238

Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Co-authored-by: Balasankar 'Balu' C <balasankar@gitlab.com>
2023-11-30 23:10:49 +00:00
Balasankar "Balu" C cd27448441
Handle MR branches in is_regular_branch? check
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-11-29 09:42:02 +05:30
Balasankar 'Balu' C 7677080d74
Split Deploy related information to own class
Move the following methods:
* `Build::Info.deploy_env_key` => `Build::Info::Deploy.environment_key`
* `Build::Info.deploy_env`     => `Build::Info::Deploy.environment`

Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8063

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-11-17 11:14:28 +05:30
Balasankar 'Balu' C b7b1ae9343 Refactor deploy rake task
- Drop auto-deploy pipeline code sections that are now handled
  by the Delivery team's co-ordinated pipelines
- Remove code relevant to Ubuntu 16.04 whose support was
  dropped some time ago
- Improves the deploy related rspec tests
- Exit deploy code earlier when possible similar to how
  logic gates are handled in other rake tasks

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-11-16 19:40:50 +00:00
Clemens Beck 1c713eb58b
Revert "Split Deploy related information to own class"
This reverts commit a17fa38140.
2023-10-25 11:26:34 +02:00
Balasankar 'Balu' C a17fa38140 Split Deploy related information to own class
Move the following methods:
* `Build::Info.deploy_env_key` => `Build::Info::Deploy.environment_key`
* `Build::Info.deploy_env`     => `Build::Info::Deploy.environment`

Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8063

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-10-25 07:23:44 +00:00
Robert Marshall e626f39420 Merge branch 'tag-docker-image-with-ref-slug' into 'master'
Tag docker images from triggered builds with CI_COMMIT_REF_SLUG also

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7176

Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Clemens Beck <cbeck@gitlab.com>
Reviewed-by: Clemens Beck <cbeck@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-10-13 21:29:41 +00:00
Balasankar 'Balu' C 6a9387a210 Tag container images with CI_COMMIT_REF_SLUG
- containers built in trigger builds are now
  tagged additionally with CI_COMMIT_REF_SLUG to
  enable local testing

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-10-13 21:29:40 +00:00
Robert Marshall 97dbb2fca7 Merge branch 'split-info-qa' into 'master'
Split QA related information to own class

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7012

Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-10-13 06:29:02 +00:00
Balasankar 'Balu' C 07aae13e59 Set max memory for node only on 32 bit OSs
Prevent out of memory errors when compiling node assets
on 32-bit operating systems.

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8207

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-10-12 03:52:03 +00:00
Balasankar "Balu" C fd2e273b52
Split QA related information to own class
Move the following method:
* `Build::Info.qa_image` => `Build::Info::QA.image`

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-09-30 08:47:22 +05:30
Robert Marshall 429bdb1b22 Merge branch 'split-info-docker' into 'master'
Split Docker related information to own class

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7011

Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-09-30 02:44:23 +00:00
Balasankar 'Balu' C 023730007b Split Docker related information to own class
Move the following methods:
* `Build::Info.docker_tag`            => `Build::Info::Docker.tag`
* `Build::Info.release_file_contents` => `Build::Info::Docker.release_file_contents`

Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8063

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-09-30 02:44:23 +00:00
Balasankar 'Balu' C a263339d5d Use google-cloud-storage gem for uploading packages to GCS
- Replace google cloud SDK with the google-cloud-storage gem
  thereby reducing the total footprint size of the builders

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8088

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-09-29 22:08:40 +00:00
Robert Marshall 6f3d4a4bd1
Merge branch 'stop-syncing-packages-to-s3' into 'master'
Stop syncing packages to S3 bucket

Closes https://gitlab.com/gitlab-org/security/omnibus-gitlab/-/issues/3

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7057

Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-09-07 06:21:02 +00:00
Balasankar 'Balu' C cd5e9fe8c8
Stop syncing packages to S3
- Removes package sync to S3 now that GCP sync is established
  and stable

Closes https://gitlab.com/gitlab-org/security/omnibus-gitlab/-/issues/3

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-09-07 06:21:02 +00:00
Balasankar 'Balu' C 727229edf2
Split GitLab Rails related information to own class
Move the following methods:
* `Build::Info.gitlab_version`            => `Build::Info::Componets::GitLabRails.version`
* `Build::Info.gitlab_version_slug`       => `Build::Info::Componets::GitLabRails.version_slug`
* `Build::Info.gitlab_rails_ref`          => `Build::Info::Componets::GitLabRails.ref`
* `Build::Info.gitlab_rails_project_path` => `Build::Info::Componets::GitLabRails.project_path`
* `Build::Info.gitlab_rails_repo`         => `Build::Info::Componets::GitLabRails.repo`

Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8063

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-09-07 06:05:34 +00:00
Balasankar 'Balu' C d69e0fe903 Split Package related information to own class
Move the following methods:
* `Build::Info.package`             => `Build::Info::Package.name`
* `Build::Info.edition`             => `Build::Info::Package.edition`
* `Build::Info.semver_version`      => `Build::Info::Package.semver_version`
* `Build::Info.release_version`     => `Build::Info::Package.release_version`
* `Build::Info.package_list`        => `Build::Info::Package.file_list`
* `Build::Info.name_version`        => `Build::Info::Package.name_version`

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-08-08 18:25:00 +00:00
Balasankar 'Balu' C 35f377b955 Merge branch 'master-patch-49cd' into 'master'
Use allowlist and denylist

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7076

Merged-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Approved-by: Clemens Beck <cbeck@gitlab.com>
Approved-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Co-authored-by: Oscar Tovar <otovar@gitlab.com>
2023-08-08 10:10:59 +00:00
Oscar Tovar 48075935cb Use allowlist and denylist 2023-08-08 10:10:59 +00:00
Balasankar 'Balu' C d282fbb708 Remove old code used for AMI builds
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-08-04 16:18:30 +00:00
DJ Mountney 9ff9301b07 Merge branch 'split-info-git' into 'master'
Split Git related information to own class

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7008

Merged-by: DJ Mountney <dj@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: DJ Mountney <dj@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-07-20 15:01:16 +00:00
DJ Mountney 89fa8d4a50
Ensure package download url is based on CI tag variable
Rather than whether the git checkout is on a tag
This fixes an issue where we use the wrong job name on a branch pipeline
when the commit matches a git tag.
2023-07-19 11:58:10 -07:00
Balasankar "Balu" C 258569b544
Remove unused previous_version method
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-07-14 10:30:34 +05:30
Balasankar "Balu" C 5f3518a9c5
Add wrapper method for getting stdout from shell command
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-07-14 10:30:34 +05:30
Balasankar "Balu" C e718707876
Split Git related information to own class
Move the following methods:
* `Build::Info.branch_name`       => `Build::Info::Git.branch_name`
* `Build::Info.current_git_tag`   => `Build::Info::Git.tag_name`
* `Build::Info.commit_sha`        => `Build::Info::Git.commit_sha`
* `Build::Info.latest_tag`        => `Build::Info::Git.latest_tag`
* `Build::Info.latest_stable_tag` => `Build::Info::Git.latest_stable_tag`

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-07-14 10:29:11 +05:30
Balasankar "Balu" C 1a3db2921f
Use GitLab API interface for fetching artifacts
Use the dedicated library to fetch artifact files

Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
2023-07-05 08:08:43 +05:30