diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-09 11:45:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-09 11:45:55 +0300 |
commit | c92e9b9e7d524ee8e6205557b72fc96bb3ab1cda (patch) | |
tree | 8319a607997b7c493e291019f2d32a6a7b477dfd /qa | |
parent | b93d3501fdc450018adae442f3a2bcb514b136b9 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-ee
Diffstat (limited to 'qa')
-rw-r--r-- | qa/gdk/Dockerfile.gdk | 135 | ||||
-rw-r--r-- | qa/gdk/Dockerfile.gdk.dockerignore | 21 |
2 files changed, 64 insertions, 92 deletions
diff --git a/qa/gdk/Dockerfile.gdk b/qa/gdk/Dockerfile.gdk index 51e058a7088..0926883d00f 100644 --- a/qa/gdk/Dockerfile.gdk +++ b/qa/gdk/Dockerfile.gdk @@ -1,99 +1,66 @@ -# Multi-stage Dockerfile for packaging gdk as executable docker image -# Each stage can be executed in parallel and cached separately based on changes for respective component -# Caches are cleaned for each stage to reduce the footprint of exported cache layers - -ARG BASE_TAG=master - -FROM registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-slim-ruby-3.1-golang-1.19-rust-1.65-node-16.14-postgresql-13:rubygems-3.4-git-2.36-lfs-2.9-yarn-1.22 as gdk-base - -RUN set -eux; \ - groupadd gdk -g 1000; \ - useradd gdk -m -s /bin/bash -u 1000 -g 1000 - -ENV GEM_HOME=/home/gdk/.gem \ - GEM_PATH=/home/gdk/.gem \ - PATH=$PATH:/home/gdk/.gem/bin - -WORKDIR /home/gdk - -# Reinstall libpcre2 and install postgresql -# See: https://gitlab.com/gitlab-org/gitaly/-/issues/4085 -RUN set -eux; \ - rm -f /usr/lib/libpcre2*; \ - apt-get update && apt-get install -y --reinstall --no-install-recommends \ - libpcre2-16-0 \ - libpcre2-32-0 \ - libpcre2-8-0 \ - libpcre2-dev \ - libpcre2-posix2 \ - && apt-get install -y --no-install-recommends postgresql-13; \ - apt-get autoclean -y - -# Clone GDK and install system dependencies, purge system git -ARG GDK_SHA -ENV GDK_SHA=${GDK_SHA:-main} -RUN set -eux; \ - git -c advice.detachedHead=false clone --depth 1 https://gitlab.com/gitlab-org/gitlab-development-kit.git; \ - git -C gitlab-development-kit fetch --depth 1 origin ${GDK_SHA}; \ - git -C gitlab-development-kit -c advice.detachedHead=false checkout ${GDK_SHA}; \ - mkdir -p gitlab-development-kit/gitlab && chown -R gdk:gdk gitlab-development-kit; \ - apt-get update && apt-get install -y --no-install-recommends $(grep -o '^[^#]*' gitlab-development-kit/packages_debian.txt); \ - apt-get remove -y git git-lfs; \ - apt-get autoclean -y && apt-get autoremove -y +FROM registry.gitlab.com/gitlab-org/gitlab-development-kit/asdf-bootstrapped-verify:main@sha256:14fa752a80df21f840fc48f4be8561bee21b78886ac718652582fdd788d34c32 + +ENV GITLAB_LICENSE_MODE=test \ + GDK_KILL_CONFIRM=true # Allow passwordless /etc/hosts update by gdk user +USER root RUN echo "gdk ALL=(ALL) NOPASSWD: /usr/bin/tee -a /etc/hosts" >> /etc/sudoers USER gdk -WORKDIR /home/gdk/gitlab-development-kit -# Install GDK and gem dependencies -ARG GDK_VERSION -ENV GDK_VERSION=${GDK_VERSION:-0.2.16} -RUN set -eux; \ - gem install gitlab-development-kit -v ${GDK_VERSION} && touch .gitlab-gdk-gem; \ - bundle install; \ - rm -rf ${GEM_HOME}/cache +# Clone GDK at specific sha and bootstrap packages +# +ARG GDK_SHA=747ab64be815f5c239d5d63209527a42bd838e83 +ARG GEM_CACHE=/home/gdk/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/cache +RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \ + set -eux; \ + git clone --depth 1 https://gitlab.com/gitlab-org/gitlab-development-kit.git && cd gitlab-development-kit; \ + git fetch --depth 1 origin ${GDK_SHA} && git -c advice.detachedHead=false checkout ${GDK_SHA}; \ + mkdir gitlab && make bootstrap -COPY --chown=gdk:gdk qa/gdk/gdk.yml ./ +WORKDIR /home/gdk/gitlab-development-kit -# Build gitaly -# -COPY --chown=gdk:gdk GITALY_SERVER_VERSION ./gitlab/ -RUN set -eux; \ - make gitaly-setup; \ - rm -rf gitaly/_build/cache \ - gitaly/_build/deps/git/source \ - gitaly/_build/deps/libgit2/source \ - gitaly/_build/deps \ - gitaly/_build/intermediate \ - ${GEM_HOME}/cache \ - && go clean -cache +COPY --chown=gdk:gdk qa/gdk/gdk.yml ./ # Build gitlab-shell # COPY --chown=gdk:gdk GITLAB_SHELL_VERSION ./gitlab/ -RUN set -eux; \ - make gitlab-shell-setup; \ - rm -rf ${GEM_HOME}/cache \ - && go clean -cache +RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \ + set -eux; \ + make gitlab-shell-setup \ + && cd gitlab-shell && go clean -cache -modcache -r # Build gitlab-workhorse # COPY --chown=gdk:gdk VERSION GITLAB_WORKHORSE_VERSION ./gitlab/ COPY --chown=gdk:gdk workhorse ./gitlab/workhorse -RUN set -eux; \ - make gitlab-workhorse-setup \ - && mv gitlab/workhorse ./; \ - rm -rf ${GEM_HOME}/cache \ - && go clean -cache +RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \ + set -eux; \ + make gitlab-workhorse-setup && mv gitlab/workhorse ./ \ + && cd workhorse && go clean -cache -modcache -r + +# Build gitaly +# +COPY --chown=gdk:gdk GITALY_SERVER_VERSION ./gitlab/ +RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \ + set -eux; \ + make gitaly-setup; \ + cd gitaly \ + && go clean -cache -modcache -r \ + && rm -rf _build/cache \ + _build/deps/git/source \ + _build/deps/libgit2/source \ + _build/deps \ + _build/intermediate # Install gitlab gem dependencies # COPY --chown=gdk:gdk Gemfile Gemfile.lock ./gitlab/ COPY --chown=gdk:gdk vendor/gems/ ./gitlab/vendor/gems/ COPY --chown=gdk:gdk gems/ ./gitlab/gems/ -RUN make .gitlab-bundle && rm -rf ${GEM_HOME}/cache +RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \ + make .gitlab-bundle # Install gitlab npm dependencies # @@ -101,13 +68,6 @@ COPY --chown=gdk:gdk package.json yarn.lock ./gitlab/ COPY --chown=gdk:gdk scripts/frontend/postinstall.js ./gitlab/scripts/frontend/postinstall.js RUN make .gitlab-yarn && yarn cache clean -# Executable gdk image -# -FROM registry.gitlab.com/gitlab-org/gitlab/gitlab-qa-gdk-base:${BASE_TAG} as gdk - -ENV GITLAB_LICENSE_MODE=test \ - GDK_KILL_CONFIRM=true - # Copy code COPY --chown=gdk:gdk ./ ./gitlab/ COPY --chown=gdk:gdk qa/gdk/entrypoint ../ @@ -117,18 +77,9 @@ RUN mkdir -p gitlab/tmp/pids \ && rsync -a --remove-source-files workhorse/ gitlab/workhorse/ # Set up GDK -RUN make \ - redis/redis.conf \ - all \ - && gdk kill \ - && rm -rf ${GEM_HOME}/cache \ - gitaly/_build/cache \ - gitaly/_build/deps/git/source \ - gitaly/_build/deps/libgit2/source \ - gitaly/_build/deps \ - gitaly/_build/intermediate \ - && go clean -modcache \ - && go clean -cache +RUN SKIP_WORKHORSE_SETUP=true SKIP_GITLAB_SHELL_SETUP=true SKIP_GITALY_SETUP=true \ + make redis/redis.conf all \ + && gdk kill ENTRYPOINT [ "/home/gdk/entrypoint" ] CMD [ "gdk", "tail" ] diff --git a/qa/gdk/Dockerfile.gdk.dockerignore b/qa/gdk/Dockerfile.gdk.dockerignore index ef1074ed833..26062339c21 100644 --- a/qa/gdk/Dockerfile.gdk.dockerignore +++ b/qa/gdk/Dockerfile.gdk.dockerignore @@ -1,4 +1,10 @@ .bundle/ +.gitlab/ +.lefthook/ +.rubocop_todo/ +.vscode/ +builds/ +changelogs/ danger/ doc/ log/*.log @@ -6,6 +12,21 @@ node_modules/ rubocop/ tmp/* +.eslint* +.gitlab-ci.yml +.haml-lint* +.prettier* +.rubocop* +.stylelintrc +.yamllint +docker-compose.yml +Dockerfile.assets +jest* +lefthook.yml +tests.yml + +*.md + db/fixtures/ !db/fixtures/development/01_admin.rb !db/fixtures/development/02_application_settings.rb |