Herramientas de usuario

Herramientas del sitio


gentoo:gitlab-ce

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
gentoo:gitlab-ce [2020/05/31 08:36] – [Upgrade the container] barrachigentoo:gitlab-ce [2024/05/01 16:57] (actual) – [Upgrade the container] barrachi
Línea 54: Línea 54:
 </code> </code>
  
-To see the logs of the gitlab docker:+To see the logs of a container while it is starting: 
 +<code bash> 
 +docker logs -f CONTAINER_ID 
 +</code> 
 + 
 +To see the logs of the gitlab container:
 <code bash> <code bash>
 docker exec gitlab gitlab-ctl tail docker exec gitlab gitlab-ctl tail
 </code> </code>
  
-To execute a bash inside the gitlab docker:+To execute a bash inside the gitlab container:
 <code bash> <code bash>
 docker exec -it gitlab /bin/bash docker exec -it gitlab /bin/bash
Línea 70: Línea 75:
  
  
-===== NFS caveats =====+More GitLab maintenance options in https://docs.gitlab.com/omnibus/maintenance/ 
 +===== Upgrade the container =====
  
-The NFS server and client can be fine tuned following the [[https://docs.gitlab.com/ee/administration/high_availability/nfs.html | GitLab NFS documentation]].+1. Check the current GitLab version x.y.z in the Administration dashboard.
  
-If '''/var/opt/gitlab' is not writable'' errors occur (which can be checked with ''docker exec gitlab gitlab-ctl tail''), these can be avoided after starting the gitlab docker by changing the owner of ''/var/opt/gitlab'' to ''git''. Also, the ''noac'' nfs4 mount option should be used on the NFS client to prevent attributes to be cached and, therefore, to allow the previous change to be accounted for as soon as possible. 
  
-This change can be made permanentpatching ''/opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb'' as follows::+2a. If it says that there is an update availablego to https://hub.docker.com/r/gitlab/gitlab-ce/tags and search the latest tag with the next subversionx.y+1.
  
-<code diff> +2b. Instead of going by one, check the migration path in https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/?current=14.6.6&distro=docker&edition=ce
---- /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb.orig     2019-10-03 13:39:21.826524552 +0000 +
-+++ /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb    2019-10-03 13:41:03.499281744 +0000 +
-@@ -45,+45,11 @@ +
-   action :create +
- end+
  
-+directory "/var/opt/gitlab" do 
-+  owner "git" 
-+  action :create 
-+end 
-+ 
- directory "Create /var/log/gitlab" do 
-   path "/var/log/gitlab" 
-   owner "root" 
-</code> 
  
-The '''/var/opt/gitlab' is not writable'' errors are caused when testing if the directory ''/var/opt/gitlab/.bundle'' is writable by the user ''git''. The ''stats()'' function says that is not writable unless its parent is also writable by that user. This can be tested with the following command+3Copy the pull command an execute it:
-<code bash> +
-docker exec gitlab su - git -c "[ -w /var/opt/gitlab/.bundle ] || echo 'no writable'" +
-</code> +
- +
- +
-===== Upgrade the container ===== +
- +
-1. Check the digest number of the current version with:+
  
 <code bash> <code bash>
-docker images --digests | grep gitlab-ce | grep latest | grep sha256:+docker pull gitlab/gitlab-ce:x.y+1.z-ce.0
 </code> </code>
  
-2Compare the first digits of the digest number with those of the lastes version in: <https://hub.docker.com/r/gitlab/gitlab-ce/tags>+4Optionally, tag the retrieved image as 'my-gitlab-cewith:
- +
-3. If there is a newer version, then pull the new version and continue with the next steps:+
  
 <code bash> <code bash>
-docker pull gitlab/gitlab-ce+docker tag gitlab/gitlab-ce:x.y+1.z-ce.0 my-gitlab-ce
 </code> </code>
  
-4. If an NFS mount point is used and the '''/var/opt/gitlab' is not writable'' error occurs, then apply the previously shown patch: 
  
-<code bash> +5. Stop and delete the current gitlab container, then create and start a new gitlab container from the newer image:
-# Run the image once using bash as entry point: +
-docker run -it --entrypoint bash gitlab/gitlab-ce +
-# Apply the previous patch on default.rb: +
-nano /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb +
-# Exit the image +
-exit +
-# Create new image from ID (it appears in the prompt, e.g. root@9ffa2bafe2bb:/#), +
-docker commit 9ffa2bafe2bb my-gitlab-ce +
-</code> +
- +
-5. Stop and delete the current image, then create and start a new container from the newer image+
  
 <code bash> <code bash>
Línea 142: Línea 111:
   --volume /srv/gitlab/logs:/var/log/gitlab \   --volume /srv/gitlab/logs:/var/log/gitlab \
   --volume /srv/gitlab/data:/var/opt/gitlab \   --volume /srv/gitlab/data:/var/opt/gitlab \
-  my-gitlab-ce # or gitlab/gitlab-ce:latest if there are no NFS problems+  my-gitlab-ce # or gitlab/gitlab-ce:x.y+1.z-ce.0
 </code> </code>
  
-6. Cleanup docker unused images, containers, networks and volumes:+6. Check that everything went Ok and monitor on the web interface the background migrations. **When all the background migrations have finished**, go to the Dashboard and check if there is a newer version available. If this is the caso, go again to the second step. 
 + 
 + 
 +7. Cleanup docker unused images, containers, networks and volumes:
  
 <code bash> <code bash>
Línea 151: Línea 123:
 </code> </code>
  
-7. Check that the backup procedure is working with the new version an delete previous versions backups.+7. Check that the backup procedure is working with the new version an delete the previous versions backups.
  
  
Línea 217: Línea 189:
 gitlab-ctl restart gitlab-ctl restart
 gitlab-rake gitlab:check SANITIZE=true gitlab-rake gitlab:check SANITIZE=true
 +</code>
 +
 +
 +
 +===== NFS caveats =====
 +
 +**DO NOT USE NFS WITH GITLAB-CE CONTAINER**
 +
 +If there are permission problems with your NFS configuration, it is better to no use it. What follows show how to avoid one of the problems, but another one raised when migrating from PostgreSQL 11 to 12.
 +
 +**DO NOT USE NFS WITH GITLAB-CE CONTAINER**
 +
 +The NFS server and client can be fine tuned following the [[https://docs.gitlab.com/ee/administration/high_availability/nfs.html | GitLab NFS documentation]].
 +
 +If '''/var/opt/gitlab' is not writable'' errors occur (which can be checked with ''docker exec gitlab gitlab-ctl tail''), these can be avoided after starting the gitlab docker by changing the owner of ''/var/opt/gitlab'' to ''git''. Also, the ''noac'' nfs4 mount option should be used on the NFS client to prevent attributes to be cached and, therefore, to allow the previous change to be accounted for as soon as possible.
 +
 +This change can be made permanent, patching ''/opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb'' as follows::
 +
 +<code diff>
 +--- /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb.orig     2019-10-03 13:39:21.826524552 +0000
 ++++ /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb    2019-10-03 13:41:03.499281744 +0000
 +@@ -45,6 +45,11 @@
 +   action :create
 + end
 +
 ++directory "/var/opt/gitlab" do
 ++  owner "git"
 ++  action :create
 ++end
 ++
 + directory "Create /var/log/gitlab" do
 +   path "/var/log/gitlab"
 +   owner "root"
 +</code>
 +
 +The '''/var/opt/gitlab' is not writable'' errors are caused when testing if the directory ''/var/opt/gitlab/.bundle'' is writable by the user ''git''. The ''stats()'' function says that is not writable unless its parent is also writable by that user. This can be tested with the following command:
 +<code bash>
 +docker exec gitlab su - git -c "[ -w /var/opt/gitlab/.bundle ] || echo 'no writable'"
 +</code>
 +
 +If an NFS mount point is used and the '''/var/opt/gitlab' is not writable'' error occurs, then apply the previously shown patch with:
 +
 +<code bash>
 +# Run the image once using bash as entry point:
 +docker run -it --entrypoint bash gitlab/gitlab-ce
 +# Apply the previous patch on default.rb:
 +nano /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb
 +# Exit the image
 +exit
 +# Create new image from ID (it appears in the prompt, e.g. root@9ffa2bafe2bb:/#),
 +docker commit 9ffa2bafe2bb my-gitlab-ce
 </code> </code>
  
gentoo/gitlab-ce.1590914169.txt.gz · Última modificación: 2020/05/31 08:36 por barrachi