When GitLab 14 was updated, the official gave a very high evaluation of this version, which made me very curious, so in order to explore the changes in the new version, I did a trial comparison of GitLab community version and Polar Fox version.

Writing in the front

As a longtime GitLab user, I’ve been using it since 2013, and over the past four years, I’ve written more than a dozen articles about GitLab, explaining how to make it easier to use and maintain GitLab in a container environment, and how to migrate data.

In the release update announcement for the official release, the comments on the update were very high: the future of GitLab, and the future of DevOps.

Even more than that, GitLab 14 represents the future of GitLab, and the future of DevOps.

So, what’s new with this release? Aroused my intense curiosity.

In addition, I saw the official interview with the Polar Fox team and learned that the project has been underway since the end of last year. Some improvements have been made in the localization feature, so I am very curious about the differences in this version for the Chinese market over the past seven months. If I use GitLab as a collaboration tool, will I be able to get directly into the localized version of Polar Fox?

Preparing the Container Environment

In order to ensure the test process is relatively smooth, here can use the official image of the software, directly use the official image. As for the polar Fox version, which does not provide mirroring for the time being, I will try to mirror the container based on the official mirror to avoid any confusion as much as possible.

If you also want a quick experience, use the following script to initialize the Docker environment (the repository github.com/soulteary/l…) :

curl -o- https://raw.githubusercontent.com/soulteary/linux-scripts/main/docker-with-mirror.sh | bash

curl -o- https://raw.githubusercontent.com/soulteary/linux-scripts/main/docker-compose.sh | bash
Copy the code

After installing the Docker environment, you can start to try out the new version of the software.

Use containers to experience GitLab 14 Community Edition

Using the container to start GitLab 14 Community edition, it is relatively easy:

version: "3"

services:
  gitlab:
    restart: always
    image: Gitlab/gitlab - ce: 14.0.2 - ce. 0
    container_name: gitlab
    hostname: gitlab.soulteary.com
    ports:
      - "80:80"
      - "443:443"
      - "2222:22"
    volumes:
      - ./config:/etc/gitlab
      - ./data:/var/opt/gitlab
    environment:
      TZ: Asia/Shanghai
      GITLAB_OMNIBUS_CONFIG: | external_url 'http://gitlab.soulteary.com' gitlab_rails['lfs_enabled'] = true gitlab_rails['time_zone'] = 'Asia/Shanghai'Copy the code

Save the above as docker-compose. Yml and start the service with docker-compose up -d.

Wait a moment, and visit the site using an IP or domain name, and you’ll see the familiar GitLab login screen.

However, a few versions ago, GitLab did away with the initial administrator password boot after installation. So, at this point, we will not be able to log in without knowing the administrator’s initial password.

Reset the GitLab user password

In the “Install GitLab using Docker Swarm Mode” section of the official document, “compose secrets” is used for handling the administrator password at the first login.

In fact, there is an easier way to solve the problem of not knowing the administrator password and not being able to log in to GitLab for the first time. The official document describes how to reset the password. Based on the above configuration, run the following command to quickly reset the password of an administrator account:

docker exec -it gitlab gitlab-rake "gitlab:password:reset[root]"

Enter password: 
Confirm password: 

Password successfully updated for user with username root.
Copy the code

Simple view GitLab V14 interface functions

After entering the same password twice more than 8 characters in length, we can log in to the system using the administrator account root and the password we just changed.

You can see that the interface is not very different from before, perhaps because I have been using Gitea recently, the overall feeling of GitLab 14 interface size is slightly tweaked.

Compared with the old version, the obvious change is at the top of the navigation of the folded together, although the official says this is more efficient, but as the development of several cloud platform interface in the case of the front, I personally feel although looks simple, but the high frequency button or take out is more obviously “efficiency”, simply the pursuit of visual and concise, In terms of efficiency tool scenario design, it is “backwards” behavior.

Open a “default repository” provided by the system, and you can see that the sidebar has been “enriched,” with many features removed from the previous CI. In contrast to previous releases, this version of GitLab creates a new project by default, reusing the Prometheus Grafana provided in the container to monitor the health of the GitLab instance itself. This design is clever and deserves a compliment.

If you do not need the item or feature, turn on the admin background and the repository will be automatically deleted.

In the interface of personal preference setting, you can see that the official language switching function is provided, and you can see that Chinese is the most completed language, so you can switch it. Click to save the Settings, the page will prompt “Preferences saved.” After refreshing, you can see that the interface has changed to some Chinese characters. Go back to the default project and scroll next to the project sidebar to see what changes happen: it does seem that half of the content has been translated into Chinese, as the translation suggests, and nothing else has changed, including interface features and typography.

When I open the default project again, I can see that “Security Compliance” has been upgraded to the level 1 menu, but all the features except for the first item have to be paid for, preventing me from exploring further.

In V13, GitLab introduced deployment environment management, which enables small-scale deployment testing by adjusting the dynamic versioning function switch. However, this feature is limited to 200 feature tags in the free version. In addition, this feature is not zero-threshold and needs to be associated with a K8S cluster. For small teams, the pricing of this feature may directly affect how deeply the development process is tied to GitLab. After all, if the price is cheap, well below the cost of hiring, it should smell good.

As mentioned earlier, GitLab is integrated with Prometheus by default. In this release, kanban can be easily created and customized to provide one-stop monitoring of business status.

This Kanban contains not only regular QPS/performance metrics, but also your own custom business metrics. However, I suggest that if you want to monitor services, you should give priority to the PaaS service provided by the platform, or estimate the resource usage according to your own business volume and build your own. After all, in single-machine deployment mode, the CPU and disk I/O are limited. As for the GitLab high availability mode, the ability to provide production-level monitoring services remains to be verified.

In terms of infrastructure, there is currently support for AWS EKS and Google GKE’s K8S cluster, the Serverless platform supports its own “GitLab First Look” and The Terraform feature provided by HashCorp. The official added a shopping guide link in the interface of cluster configuration. The copywriter said that in cooperation with GCP, you can get a certain amount of free trial quota by registering through this address.

Compared to self-built repositories, such as Nexus, Harbor, and Registry, GitLab has built-in software package repositories that support multiple languages, which is easier than user-built repositories. However, it is still the previous concern. In the case of single machine, the guarantee commitment of storage reliability, system upgrade, data reliability of backup and restoration, and overall service stability needs to be clarified. As for multi-machine version, it needs to be further explored.

“Value stream analysis” is one of my favorite features, and if it were implemented, it would be possible to do the entire software development ecosystem in GitLab without a bunch of project management software. With Phabricator officially out of maintenance, perhaps GitLab will move up a bit on the open source list.

Finally, I wanted to take a look at some new applications for GitLab 14 system integration, but unfortunately I didn’t see any new “guys”.

Let’s move on to the Polar Fox version of GitLab.

Experience GitLab 14 Polar Fox edition using containers

The GitLab download page of Polar Fox version does not provide Docker container for the time being, so we need to package an image. In order to maintain objectivity, we directly reuse the container environment of The English version for experience.

Encapsulate images based on the community edition environment

The English version of GitLab image is currently built on Ubuntu 20.04, so here we need to download the Polar Fox GitLab package first:

Wget HTTP: / / https://omnibus.gitlab.cn/ubuntu/focal/gitlab-jh_14.0.1-jh.0_amd64.debCopy the code

Check the file value:

C4ae070ac043c33b665ca42380dfc5ef473410e1cc6a5aa6f4a6177e432f6d66 gitlab - jh_14. 0.1 - jh. 0 _amd64. DebCopy the code

Since Polar Fox is 14.0.1, we will try to use the 14.0.1 community version of the mirror as the base environment, using the deb package directly to overlay the installation, to reuse as much of the “original” mirror environment as possible.

FROM gitlab/gitlab-ce:14.0.1-ce.0

COPY gitlab-jh_14.0.1-jh.0_amd64.deb /tmp/

RUN  dpkg -i /tmp/gitlab-jh_14.0.1-jh.0_amd64.deb && \
     rm /tmp/gitlab-jh_14.0.1-jh.0_amd64.deb
Copy the code

To save the above content as a Dockerfile, use docker build-t Soulteary /gitlab: 14.0.1-jH.0. Do a mirror build and, unsurprisingly, you’ll see something like this:

Sending Build Context to Docker Daemon 1.027GB FROM gitlab/ gitlab-CE: 14.0.1-CE.0 --> F85D08F83476 Removing Intermediate Container B6F7F5E13D10 --> 3a1E7F9792AC Step COPY gitlab-jh_14.0.1-jh.0_amd64.deb/TMP / --> 95dd6ee6b868 Step 3: RUN DPKG -i/TMP/gitlab-jh_14.0.1-jH.0_amd64.deb && rm/TMP/gitlab-jH_14.0.1-jH.0_amd64.deb --> Runningin f3e874f1a980
Selecting previously unselected package gitlab-jh.
dpkg: considering removing gitlab-ce in favour of gitlab-jh ...
dpkg: yes, will remove gitlab-ce infavour of gitlab-jh (Reading database ... 87432 files and directories currently installed.) Preparing to unpack ... / gitlab - jh_14. 0.1 - jh. 0 _amd64. Deb... Unpacking gitlab - jh (14.0.1 - jh. 0)... Setting up gitlab-JH (14.0.1-JH.0)... Setting up Gitlab-JH (14.0.1-JH.0)... It looks like GitLab has not been configured yet; skipping the upgrade script. *. *. *** *** ***** ***** .****** ******* ******** ******** ,,,,,,,,,***********,,,,,,,,, ,,,,,,,,,,,,,,, * * * * * * * * *,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, * * * * * * *,,,,,,,,,,,,,,,,,,,,,,,,,,,,, * * * * *,,,,,,,,,,,,,,,,,,,,, * * * *,,,,,,,,,,,, * * *,,,, , *,.... __ __ __ / ____ (_) / __ / / ____ _ / _ / / __ / / / / / (` / __ / / / _ / / / / _ / / ___ / / _ _ - / / / / / \____/_/\__/_____/\__,_/_.___/ Thank youfor installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, letus know how we did with a 1 minute survey: https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=14-0 Removing intermediate container f3e874f1a980 ---> a9861f84aa94 Successfully built a9861f84aa94 Successfully tagged Soulteary/gitlab: 14.0.1 - jh. 0Copy the code

Once the image is built, the configuration file, which is almost the same, is ready to start the service :(changed the image name)

version: "3"

services:
  gitlab:
    restart: always
    image: Soulteary/gitlab: 14.0.1 - jh. 0
    container_name: gitlab
    hostname: gitlab.soulteary.com
    ports:
      - "80:80"
      - "443:443"
      - "2222:22"
    volumes:
      - ./config:/etc/gitlab
      - ./data:/var/opt/gitlab
    environment:
      TZ: Asia/Shanghai
      GITLAB_OMNIBUS_CONFIG: | external_url 'http://gitlab.soulteary.com' gitlab_rails['lfs_enabled'] = true gitlab_rails['time_zone'] = 'Asia/Shanghai'Copy the code

After the service is started, it is found that the system cannot run due to an error:

gitlab    | Relevant File Content:
gitlab    | ----------------------
gitlab    | /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:
gitlab    | 
gitlab    |  97:      # rubocop:enable Metrics/PerceivedComplexity
gitlab    |  98:  
gitlab    |  99:      def parse_external_url
gitlab    | 100:        return unless Gitlab['external_url']
gitlab    | 101:  
gitlab    | 102:        uri = URI(Gitlab['external_url'].to_s)
gitlab    | 103:  
gitlab    | 104>>       raise "GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/" unless uri.host
gitlab    | 105:  
gitlab    | 106:        Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
gitlab    | 107:        Gitlab['gitlab_rails']['gitlab_host'] = uri.host
gitlab    | 108:        Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
gitlab    | 109:  
gitlab    | 110:        case uri.scheme
gitlab    | 111:        when "http"
gitlab    | 112:          Gitlab['gitlab_rails']['gitlab_https'] = false
gitlab    | 113:          Nginx.parse_proxy_headers('nginx', false)
gitlab    | 
Copy the code

Looking back at the official community, I found that the problem should have been fixed as early as three years ago in V10.1.4, although in this post, there is no mention of how it was fixed, but it is not difficult for users who have been using GitLab for N years.

Edit config/gitlab.rb and change external_url ‘GENERATED_EXTERNAL_URL’ to external_url=’GENERATED_EXTERNAL_URL’ Use docker-compose down && Docker-compose up -d again to start the image, the first time will appear an error, execute the command again, you will see the program to fix the error content, pour a drink and wait for a moment, you will see the polar fox version of the login interface.

Simply browse the GitLab features of polar Fox

Compared with the community version, the interface of this version is changed to Chinese by default. We reset the password of the root user in the same way, and try to log in and experience the software functions.

The first thing I noticed when I logged in was that it didn’t seem to be any different from the community version except for the Logo in the upper left corner. Scrolling through the top navigation menu and the sidebar of the monitoring repository created by the system by default, I found that it was exactly the same as the community version.

Perhaps the interface functions will be different after the language switch. In the hope of fantasy, use the same language switch function in the user’s “preferences” to switch the interface language: switch the language to Chinese.

However, before switching the language interface, I saw that the progress of Chinese translation was the same as the community version.

After switching languages, I revisited the site and found that it was not much different from the community version.

To further experience, click on the “Start GitLab Ultimate trial” button in the “Security and Compliance” function in the default warehouse, or open the administration background and click to buy a license.

Open the background page, we will see the “ASAP” prompt above the version, this is probably GitLab official version checking interface is not ready yet? This version is already the latest Chinese release.

In fact, for users, the above are small problems, if the local version in the integration added to adapt to the national conditions of the nail, wechat, flying book, this version will be a more fragrant choice, after all, there are official team maintenance.

However, when I opened the application integration interface of the management background, I found no difference from the previous community version…

Encapsulate images based on the enterprise edition environment

Seeing the above results, I was left wondering if it was because I was using the community version of the mirror as the base operating environment. What about the enterprise version mirror?

In order to avoid the impact of the original software in the image on the test this time, although GitLab supports the replacement installation with deb package, I first uninstall the original software and then install the software.

FROM gitlab/gitlab-ee:14.0.3-ee.0 RUN DPKG -p gitlab-ee RUN rm -rf /opt/gitlab/sv/ SSHD/COPY Gitlab-jh_14.0.1-jh.0_amd64.deb/TMP/RUN DPKG -i/TMP/gitlab-jh_14.0.1-jH.0_amd64.deb && \ rm / TMP/gitlab - jh_14. 0.1 - jh. 0 _amd64. DebCopy the code

Build and start the image using the same configuration as above. The GitLab external URL must include a schema and FQDN. The solution is to modify the gitlab.rb configuration file and restart GitLab until GitLab is running successfully.

However, once built again based on the enterprise edition image, the software doesn’t seem to make much difference. Even open the management background, the software version check display or the above mentioned “update as soon as possible” prompt, here in order to confirm whether I encapsulate the container environment problem, or the official service problem, enter the container under the specific implementation of the software:

# cat ./embedded/service/gitlab-rails/lib/version_check.rb
# frozen_string_literal: true

require "base64"

# This class is used to build image URL to
# check if it is a new version for update
class VersionCheck
  def self.data
    { version: Gitlab::VERSION }
  end

  def self.url
    encoded_data = Base64.urlsafe_encode64(data.to_json)

    "#{host}/check.svg? gitlab_info=#{encoded_data}"
  end

  def self.host
    'https://version.gitlab.com'
  end
end

VersionCheck.prepend_mod
Copy the code

The browser sees the actual page call address as follows:

https://version.gitlab.cn/check.svg?gitlab_info=eyJ2ZXJzaW9uIjoiMTQuMC4xLWpoIn0=
Copy the code

In combination with the above implementation, base64 decode for the request parameter can get the version: {\”version\”:\”14.0.1-jh\”}. The reason for this problem has nothing to do with the encapsulation of the software image. Perhaps the official staff has not updated the version number on the page, and the localization function has not been arranged.

other

Polar Foxofficial reminds software download users to prepare more than 4GB of resources to prepare to run GitLab and test the current version. If configuration adjustment is not made, at least 6GB to 7GB of memory space is required. Therefore, for domestic users, maybe some quick configuration adjustment should be made on GitLab official version. Get the software up and running with as few resources as possible.

The last

To be honest, there were some surprises with the new GitLab 14 release, because the barriers to fully DevOps are now lower for non-leading developers, and the cost of building a “development work platform” is much lower for companies. However, there are many disappointed places, such as the cloud service binding, SaaS binding, eliminate a lot of technology architecture innovation, and is not good for rapid integration with internal systems. I was even more disappointed to see that the Chinese version of GitLab, which I thought was already available, was still in its very early stages.

In any case, as a regular user, I will still be full of expectations for GitLab when I see that the authorities begin to attach importance to and recognize the Chinese market and set up an independent company for operation. I hope that GitLab and The Chinese version will be better and better in the future.

–EOF


If you think the content is still practical, welcome to share with your friends, thank you here.


We have a little toss group, which gathered hundreds of people like to toss.

Without advertising, we would talk about hardware and software, HomeLab, programming issues, and occasionally share information about technical salons in the group.

Like to toss friends welcome to scan code to add friends. (Add friends, please note the real name, indicate the source and purpose, otherwise it will not be approved)

All that stuff about being in a group


This article is licensed under a “CC BY 4.0” license. You are welcome to reprint or modify this article, but the source must be noted. 4.0 International (CC BY 4.0)

By Su Yang

Creation time: July 08, 2021 statistical word count: 11871 words reading time: 24 minutes to read this article links: soulteary.com/2021/07/08/…