diff --git a/.gitpod.yml b/.gitpod.yml index 07cc7f2ecb6..3fb623b9fb6 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -5,6 +5,7 @@ tasks: - name: GDK command: | echo START_TIME_IN_SECONDS="$(date +%s)" | tee /workspace/gitpod_start_time.sh + gp sync-done gitpod-start gp sync-await gdk-copied && cd /workspace/gitlab-development-kit && gdk help - init: | @@ -35,9 +36,10 @@ tasks: ) command: | ( + gp sync-await gitpod-start set -e gp sync-done gdk-copied - source /workspace/gitpod_start_time.sh + [[ -f /workspace/gitpod_start_time.sh ]] && source /workspace/gitpod_start_time.sh SECONDS=0 cd /workspace/gitlab-development-kit # update GDK @@ -72,7 +74,7 @@ tasks: git checkout db/structure.sql cd /workspace/gitlab-development-kit # Waiting for GitLab ... - gp await-port 3000 + gp ports await 3000 printf "Waiting for GitLab at $(gp url 3000) ..." # Check /-/readiness which returns JSON, but we're only interested in the exit code # @@ -84,7 +86,7 @@ tasks: printf "$(date) – GitLab is up (took ~%.1f minutes)\n" "$((10*$SECONDS/60))e-1" | tee -a /workspace/startup.log gp preview $(gp url 3000) || true PREBUILD_LOG=(/workspace/.gitpod/prebuild-log-*) - printf "Took %.1f minutes from https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitpod.yml being executed through to completion %s\n" "$((10*(($(date +%s)-${START_TIME_IN_SECONDS}))/60))e-1" "$([[ -f "$PREBUILD_LOG" ]] && echo "With Prebuilds")" + [[ -f /workspace/gitpod_start_time.sh ]] && printf "Took %.1f minutes from https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitpod.yml being executed through to completion %s\n" "$((10*(($(date +%s)-${START_TIME_IN_SECONDS}))/60))e-1" "$([[ -f "$PREBUILD_LOG" ]] && echo "With Prebuilds")" ) ports: diff --git a/app/assets/javascripts/logs/components/log_control_buttons.vue b/app/assets/javascripts/logs/components/log_control_buttons.vue deleted file mode 100644 index e44b5394fa1..00000000000 --- a/app/assets/javascripts/logs/components/log_control_buttons.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/assets/javascripts/logs/components/log_simple_filters.vue b/app/assets/javascripts/logs/components/log_simple_filters.vue deleted file mode 100644 index 55bdd5f0088..00000000000 --- a/app/assets/javascripts/logs/components/log_simple_filters.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - {{ s__('Environments|Select pod') }} - - - - - {{ s__('Environments|No pods to display') }} - - - - {{ podName }} - - - - diff --git a/app/assets/javascripts/logs/components/tokens/token_with_loading_state.vue b/app/assets/javascripts/logs/components/tokens/token_with_loading_state.vue deleted file mode 100644 index 4e672c1d121..00000000000 --- a/app/assets/javascripts/logs/components/tokens/token_with_loading_state.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - {{ config.noOptionsText }} - - - - - diff --git a/app/assets/javascripts/logs/stores/mutation_types.js b/app/assets/javascripts/logs/stores/mutation_types.js deleted file mode 100644 index c1ed65ff48b..00000000000 --- a/app/assets/javascripts/logs/stores/mutation_types.js +++ /dev/null @@ -1,26 +0,0 @@ -export const SET_PROJECT_ENVIRONMENT = 'SET_PROJECT_ENVIRONMENT'; -export const SET_SEARCH = 'SET_SEARCH'; -export const SET_MANAGED_APP = 'SET_MANAGED_APP'; - -export const SET_TIME_RANGE = 'SET_TIME_RANGE'; -export const SHOW_TIME_RANGE_INVALID_WARNING = 'SHOW_TIME_RANGE_INVALID_WARNING'; -export const HIDE_TIME_RANGE_INVALID_WARNING = 'HIDE_TIME_RANGE_INVALID_WARNING'; - -export const SET_CURRENT_POD_NAME = 'SET_CURRENT_POD_NAME'; - -export const REQUEST_ENVIRONMENTS_DATA = 'REQUEST_ENVIRONMENTS_DATA'; -export const RECEIVE_ENVIRONMENTS_DATA_SUCCESS = 'RECEIVE_ENVIRONMENTS_DATA_SUCCESS'; -export const RECEIVE_ENVIRONMENTS_DATA_ERROR = 'RECEIVE_ENVIRONMENTS_DATA_ERROR'; -export const HIDE_REQUEST_ENVIRONMENTS_ERROR = 'HIDE_REQUEST_ENVIRONMENTS_ERROR'; - -export const REQUEST_LOGS_DATA = 'REQUEST_LOGS_DATA'; -export const RECEIVE_LOGS_DATA_SUCCESS = 'RECEIVE_LOGS_DATA_SUCCESS'; -export const RECEIVE_LOGS_DATA_ERROR = 'RECEIVE_LOGS_DATA_ERROR'; -export const REQUEST_LOGS_DATA_PREPEND = 'REQUEST_LOGS_DATA_PREPEND'; -export const RECEIVE_LOGS_DATA_PREPEND_SUCCESS = 'RECEIVE_LOGS_DATA_PREPEND_SUCCESS'; -export const RECEIVE_LOGS_DATA_PREPEND_ERROR = 'RECEIVE_LOGS_DATA_PREPEND_ERROR'; -export const HIDE_REQUEST_LOGS_ERROR = 'HIDE_REQUEST_LOGS_ERROR'; -export const REFRESH_POD_LOGS = 'REFRESH_POD_LOGS'; - -export const RECEIVE_PODS_DATA_SUCCESS = 'RECEIVE_PODS_DATA_SUCCESS'; -export const RECEIVE_PODS_DATA_ERROR = 'RECEIVE_PODS_DATA_ERROR'; diff --git a/app/assets/javascripts/logs/stores/mutations.js b/app/assets/javascripts/logs/stores/mutations.js deleted file mode 100644 index 6736d7204b4..00000000000 --- a/app/assets/javascripts/logs/stores/mutations.js +++ /dev/null @@ -1,110 +0,0 @@ -import { convertToFixedRange } from '~/lib/utils/datetime_range'; -import * as types from './mutation_types'; - -const mapLine = ({ timestamp, pod, message }) => ({ - timestamp, - pod, - message, -}); - -export default { - // Search Data - [types.SET_SEARCH](state, searchQuery) { - state.search = searchQuery; - }, - - // Time Range Data - [types.SET_TIME_RANGE](state, timeRange) { - state.timeRange.selected = timeRange; - state.timeRange.current = convertToFixedRange(timeRange); - }, - [types.SHOW_TIME_RANGE_INVALID_WARNING](state) { - state.timeRange.invalidWarning = true; - }, - [types.HIDE_TIME_RANGE_INVALID_WARNING](state) { - state.timeRange.invalidWarning = false; - }, - - // Environments Data - [types.SET_PROJECT_ENVIRONMENT](state, environmentName) { - state.environments.current = environmentName; - - // Clear current pod options - state.pods.current = null; - state.pods.options = []; - }, - [types.REQUEST_ENVIRONMENTS_DATA](state) { - state.environments.options = []; - state.environments.isLoading = true; - }, - [types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS](state, environmentOptions) { - state.environments.options = environmentOptions; - state.environments.isLoading = false; - }, - [types.RECEIVE_ENVIRONMENTS_DATA_ERROR](state) { - state.environments.options = []; - state.environments.isLoading = false; - state.environments.fetchError = true; - }, - [types.HIDE_REQUEST_ENVIRONMENTS_ERROR](state) { - state.environments.fetchError = false; - }, - - // Logs data - [types.REQUEST_LOGS_DATA](state) { - state.timeRange.current = convertToFixedRange(state.timeRange.selected); - - state.logs.lines = []; - state.logs.isLoading = true; - - // start pagination from the beginning - state.logs.cursor = null; - state.logs.isComplete = false; - }, - [types.RECEIVE_LOGS_DATA_SUCCESS](state, { logs = [], cursor }) { - state.logs.lines = logs.map(mapLine); - state.logs.isLoading = false; - state.logs.cursor = cursor; - - if (!cursor) { - state.logs.isComplete = true; - } - }, - [types.RECEIVE_LOGS_DATA_ERROR](state) { - state.logs.lines = []; - state.logs.isLoading = false; - state.logs.fetchError = true; - }, - - [types.REQUEST_LOGS_DATA_PREPEND](state) { - state.logs.isLoading = true; - }, - [types.RECEIVE_LOGS_DATA_PREPEND_SUCCESS](state, { logs = [], cursor }) { - const lines = logs.map(mapLine); - state.logs.lines = lines.concat(state.logs.lines); - state.logs.isLoading = false; - state.logs.cursor = cursor; - - if (!cursor) { - state.logs.isComplete = true; - } - }, - [types.RECEIVE_LOGS_DATA_PREPEND_ERROR](state) { - state.logs.isLoading = false; - state.logs.fetchError = true; - }, - [types.HIDE_REQUEST_LOGS_ERROR](state) { - state.logs.fetchError = false; - }, - - // Pods data - [types.SET_CURRENT_POD_NAME](state, podName) { - state.pods.current = podName; - }, - [types.RECEIVE_PODS_DATA_SUCCESS](state, podOptions) { - state.pods.options = podOptions; - }, - [types.RECEIVE_PODS_DATA_ERROR](state) { - state.pods.options = []; - }, -}; diff --git a/app/assets/javascripts/logs/stores/state.js b/app/assets/javascripts/logs/stores/state.js deleted file mode 100644 index ee17e8ecef2..00000000000 --- a/app/assets/javascripts/logs/stores/state.js +++ /dev/null @@ -1,56 +0,0 @@ -import { convertToFixedRange } from '~/lib/utils/datetime_range'; -import { timeRanges, defaultTimeRange } from '~/vue_shared/constants'; - -export default () => ({ - /** - * Full text search - */ - search: '', - - /** - * Time range (Show last) - */ - timeRange: { - options: timeRanges, - // Selected time range, can be fixed or relative - selected: defaultTimeRange, - // Current time range, must be fixed - current: convertToFixedRange(defaultTimeRange), - - invalidWarning: false, - }, - - /** - * Environments list information - */ - environments: { - options: [], - isLoading: false, - current: null, - fetchError: false, - }, - - /** - * Jobs with logs - */ - logs: { - lines: [], - isLoading: false, - /** - * Logs `cursor` represents the current pagination position, - * Should be sent in next batch (page) of logs to be fetched - */ - cursor: null, - isComplete: false, - - fetchError: false, - }, - - /** - * Pods list information - */ - pods: { - options: [], - current: null, - }, -}); diff --git a/app/assets/javascripts/packages_and_registries/settings/group/bundle.js b/app/assets/javascripts/packages_and_registries/settings/group/bundle.js index 482a3ef2ead..3689199751d 100644 --- a/app/assets/javascripts/packages_and_registries/settings/group/bundle.js +++ b/app/assets/javascripts/packages_and_registries/settings/group/bundle.js @@ -1,7 +1,6 @@ import { GlToast } from '@gitlab/ui'; import Vue from 'vue'; -import { parseBoolean } from '~/lib/utils/common_utils'; import Translate from '~/vue_shared/translate'; import SettingsApp from './components/group_settings_app.vue'; import { apolloProvider } from './graphql'; @@ -20,7 +19,6 @@ export default () => { provide: { groupPath: el.dataset.groupPath, groupDependencyProxyPath: el.dataset.groupDependencyProxyPath, - defaultExpanded: parseBoolean(el.dataset.defaultExpanded), }, render(createElement) { return createElement(SettingsApp); diff --git a/app/assets/javascripts/packages_and_registries/settings/group/components/dependency_proxy_settings.vue b/app/assets/javascripts/packages_and_registries/settings/group/components/dependency_proxy_settings.vue index 4c17b555d1b..59d4f5e24d0 100644 --- a/app/assets/javascripts/packages_and_registries/settings/group/components/dependency_proxy_settings.vue +++ b/app/assets/javascripts/packages_and_registries/settings/group/components/dependency_proxy_settings.vue @@ -1,7 +1,7 @@ - + {{ $options.i18n.DEPENDENCY_PROXY_HEADER }} {{ $options.i18n.DEPENDENCY_PROXY_DESCRIPTION }} diff --git a/app/assets/javascripts/packages_and_registries/settings/group/components/packages_settings.vue b/app/assets/javascripts/packages_and_registries/settings/group/components/packages_settings.vue index 14b51a92754..f8c35338262 100644 --- a/app/assets/javascripts/packages_and_registries/settings/group/components/packages_settings.vue +++ b/app/assets/javascripts/packages_and_registries/settings/group/components/packages_settings.vue @@ -9,7 +9,7 @@ import { import updateNamespacePackageSettings from '~/packages_and_registries/settings/group/graphql/mutations/update_group_packages_settings.mutation.graphql'; import { updateGroupPackageSettings } from '~/packages_and_registries/settings/group/graphql/utils/cache_update'; import { updateGroupPackagesSettingsOptimisticResponse } from '~/packages_and_registries/settings/group/graphql/utils/optimistic_responses'; -import SettingsBlock from '~/vue_shared/components/settings/settings_block.vue'; +import SettingsBlock from '~/packages_and_registries/shared/components/settings_block.vue'; export default { name: 'PackageSettings', @@ -23,7 +23,7 @@ export default { GenericSettings, DuplicatesSettings, }, - inject: ['defaultExpanded', 'groupPath'], + inject: ['groupPath'], props: { packageSettings: { type: Object, @@ -84,10 +84,7 @@ export default { - + {{ $options.i18n.PACKAGE_SETTINGS_HEADER }} diff --git a/app/assets/javascripts/packages_and_registries/shared/components/settings_block.vue b/app/assets/javascripts/packages_and_registries/shared/components/settings_block.vue new file mode 100644 index 00000000000..5caf95cd050 --- /dev/null +++ b/app/assets/javascripts/packages_and_registries/shared/components/settings_block.vue @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/app/assets/stylesheets/pages/settings.scss b/app/assets/stylesheets/pages/settings.scss index d0f058f6c68..ef6fac8863e 100644 --- a/app/assets/stylesheets/pages/settings.scss +++ b/app/assets/stylesheets/pages/settings.scss @@ -28,6 +28,7 @@ &:first-of-type { margin-top: 10px; + padding-top: 0; border: 0; } diff --git a/app/models/concerns/ci/artifactable.rb b/app/models/concerns/ci/artifactable.rb index 78340cf967b..fb4ea4206f4 100644 --- a/app/models/concerns/ci/artifactable.rb +++ b/app/models/concerns/ci/artifactable.rb @@ -30,6 +30,8 @@ module Ci raise NotSupportedAdapterError, 'This file format requires a dedicated adapter' end + ::Gitlab::ApplicationContext.push(artifact: file.model) + file.open do |stream| file_format_adapter_class.new(stream).each_blob(&blk) end diff --git a/app/views/clusters/clusters/cloud_providers/_cloud_provider_button.html.haml b/app/views/clusters/clusters/cloud_providers/_cloud_provider_button.html.haml index bed671832f3..3e0a8a4f88b 100644 --- a/app/views/clusters/clusters/cloud_providers/_cloud_provider_button.html.haml +++ b/app/views/clusters/clusters/cloud_providers/_cloud_provider_button.html.haml @@ -2,10 +2,11 @@ - help_path = local_assigns.fetch(:help_path) - label = local_assigns.fetch(:label) - last = local_assigns.fetch(:last, false) -- classes = ["btn btn-confirm gl-button btn-confirm-secondary gl-flex-direction-column gl-w-half"] +- classes = ["btn btn-confirm gl-button btn-confirm-secondary gl-flex-direction-column gl-flex-basis-0 gl-flex-grow-1 gl-min-w-0"] - conditional_classes = [("gl-mr-5" unless last)] = link_to help_path, class: classes + conditional_classes do - .svg-content.gl-p-3= image_tag logo_path, alt: label, class: "gl-w-64 gl-h-64" - %span + %span.gl-display-flex.gl-align-items-center.gl-m-3.gl-h-64 + = image_tag logo_path, alt: label, class: "gl-w-15 gl-max-h-full gl-max-w-full" + %span.gl-white-space-normal = label diff --git a/app/views/clusters/clusters/cloud_providers/_cloud_provider_selector.html.haml b/app/views/clusters/clusters/cloud_providers/_cloud_provider_selector.html.haml index e4128ee22a4..7039ce57bd9 100644 --- a/app/views/clusters/clusters/cloud_providers/_cloud_provider_selector.html.haml +++ b/app/views/clusters/clusters/cloud_providers/_cloud_provider_selector.html.haml @@ -1,14 +1,18 @@ - gke_label = s_('ClusterIntegration|Google GKE') - eks_label = s_('ClusterIntegration|Amazon EKS') +- civo_label = s_('ClusterIntegration|Civo Kubernetes') - create_cluster_label = s_('ClusterIntegration|Where do you want to create a cluster?') -- eks_help_path = help_page_path('user/infrastructure/clusters/connect/new_eks_cluster') -- gke_help_path = help_page_path('user/infrastructure/clusters/connect/new_gke_cluster') +- eks_help_path = help_page_path('user/infrastructure/clusters/connect/new_eks_cluster.md') +- gke_help_path = help_page_path('user/infrastructure/clusters/connect/new_gke_cluster.md') +- civo_help_path = help_page_path('user/infrastructure/clusters/connect/new_civo_cluster.md') -.gl-p-5 +.gl-py-5.gl-md-pl-5.gl-md-pr-5 %h4.gl-mb-5 = create_cluster_label .gl-display-flex = render partial: 'clusters/clusters/cloud_providers/cloud_provider_button', locals: { label: eks_label, logo_path: 'illustrations/logos/amazon_eks.svg', help_path: eks_help_path } + = render partial: 'clusters/clusters/cloud_providers/cloud_provider_button', + locals: { label: civo_label, logo_path: 'illustrations/third-party-logos/civo.svg', help_path: civo_help_path } = render partial: 'clusters/clusters/cloud_providers/cloud_provider_button', locals: { label: gke_label, logo_path: 'illustrations/logos/google_gke.svg', help_path: gke_help_path, last: true } diff --git a/app/views/groups/settings/packages_and_registries/show.html.haml b/app/views/groups/settings/packages_and_registries/show.html.haml index c4ce76c43ec..888419e463a 100644 --- a/app/views/groups/settings/packages_and_registries/show.html.haml +++ b/app/views/groups/settings/packages_and_registries/show.html.haml @@ -2,6 +2,5 @@ - page_title _('Packages & Registries') - @content_class = 'limit-container-width' unless fluid_layout -%section#js-packages-and-registries-settings{ data: { default_expanded: expanded_by_default?.to_s, - group_path: @group.full_path, +%section#js-packages-and-registries-settings{ data: { group_path: @group.full_path, group_dependency_proxy_path: group_dependency_proxy_path(@group) } } diff --git a/config/initializers/0_log_deprecations.rb b/config/initializers/0_log_deprecations.rb index 20fb5144937..6ba18ea1136 100644 --- a/config/initializers/0_log_deprecations.rb +++ b/config/initializers/0_log_deprecations.rb @@ -9,11 +9,15 @@ end if log_deprecations? # Log deprecation warnings emitted through Kernel#warn, such as from gems or # the Ruby VM. - Warning.process(/.+is deprecated$/) do |warning| - Gitlab::DeprecationJsonLogger.info(message: warning.strip, source: 'ruby') - # Returning :default means we continue emitting this to stderr as well. - :default - end + actions = { + /.+is deprecated$/ => lambda do |warning| + Gitlab::DeprecationJsonLogger.info(message: warning.strip, source: 'ruby') + # Returning :default means we continue emitting this to stderr as well. + :default + end + } + + Warning.process('', actions) # Log deprecation warnings emitted from Rails (see ActiveSupport::Deprecation). ActiveSupport::Notifications.subscribe('deprecation.rails') do |name, start, finish, id, payload| diff --git a/doc/administration/sidekiq.md b/doc/administration/sidekiq.md index 479e78ba0dc..d99e9a0a04b 100644 --- a/doc/administration/sidekiq.md +++ b/doc/administration/sidekiq.md @@ -6,19 +6,91 @@ info: To determine the technical writer assigned to the Stage/Group associated w # Configure an external Sidekiq instance **(FREE SELF)** -You can configure an external Sidekiq instance by using the Sidekiq that's -bundled in the GitLab package. Sidekiq requires connection to the Redis, +You can configure an external Sidekiq instance by using the Sidekiq that's bundled in the GitLab package. Sidekiq requires connection to the Redis, PostgreSQL, and Gitaly instances. -## Required configuration +## Configure TCP access for PostgreSQL, Gitaly, and Redis -To configure Sidekiq: +By default, GitLab uses UNIX sockets and is not set up to communicate via TCP. To change this: + +1. Edit the `/etc/gitlab/gitlab.rb` file on your GitLab instance and add the following: + + ```ruby + + ## PostgreSQL + + # Replace POSTGRESQL_PASSWORD_HASH with a generated md5 value + postgresql['sql_user_password'] = 'POSTGRESQL_PASSWORD_HASH' + postgresql['listen_address'] = '0.0.0.0' + postgresql['port'] = 5432 + + # Add the Sidekiq nodes to PostgreSQL's trusted addresses. + # In the following example, 10.10.1.30/32 is the private IP + # of the Sidekiq server. + postgresql['md5_auth_cidr_addresses'] = %w(127.0.0.1/32 10.10.1.30/32) + postgresql['trust_auth_cidr_addresses'] = %w(127.0.0.1/32 10.10.1.30/32) + + ## Gitaly + + # Make Gitaly accept connections on all network interfaces + gitaly['listen_addr'] = "0.0.0.0:8075" + ## Set up the Gitaly token as a form of authentication since you are accessing Gitaly over the network + ## https://docs.gitlab.com/ee/administration/gitaly/configure_gitaly.html#about-the-gitaly-token + gitaly['auth_token'] = 'abc123secret' + praefect['auth_token'] = 'abc123secret' + gitlab_rails['gitaly_token'] = 'abc123secret' + + ## Redis configuration + + redis['bind'] = '0.0.0.0' + redis['port'] = 6379 + # Password to Authenticate Redis + redis['password'] = 'redis-password-goes-here' + + gitlab_rails['auto_migrate'] = false + ``` + +1. Run `reconfigure`: + + ```shell + sudo gitlab-ctl reconfigure + ``` + +1. Restart the `PostgreSQL` server: + + ```shell + sudo gitlab-ctl restart postgresql + ``` + +1. After the restart, set `auto_migrate` to `true` or comment to use the default settings: + + ```ruby + gitlab_rails['auto_migrate'] = true + ``` + +1. Run `reconfigure` again: + + ```shell + sudo gitlab-ctl reconfigure + ``` + +## Set up Sidekiq instance 1. SSH into the Sidekiq server. + +1. Confirm that you can access the PostgreSQL, Gitaly, and Redis ports: + + ```shell + telnet 5432 # PostgreSQL + telnet 8075 # Gitaly + telnet 6379 # Redis + ``` + 1. [Download and install](https://about.gitlab.com/install/) the Omnibus GitLab package using steps 1 and 2. **Do not complete any other steps.** -1. Edit `/etc/gitlab/gitlab.rb` with the following information and make sure - to replace with your values: + +1. Copy the `/etc/gitlab/gitlab.rb` file from the GitLab instance and add the following settings. Make sure + to replace them with your values:
+ +