- {{ $options.modal.editButtonLabel }}
-
-
-
-
-
-
-
-
-
-
- {{ errorMessage }}
-
-
+
{{ $options.i18n.title }}
+
+
+
+
+
+
+
+
+ {{ errorMessage }}
+
+ {{ $options.i18n.actionSecondaryText }}
+
+ {{ $options.i18n.actionPrimaryText }}
+
diff --git a/app/assets/javascripts/ml/model_registry/constants.js b/app/assets/javascripts/ml/model_registry/constants.js
index 2c0ff9165c8..a3131afbcf4 100644
--- a/app/assets/javascripts/ml/model_registry/constants.js
+++ b/app/assets/javascripts/ml/model_registry/constants.js
@@ -24,7 +24,6 @@ export const MODEL_ENTITIES = {
};
export const MLFLOW_USAGE_MODAL_ID = 'model-registry-mlflow-usage-modal';
-export const MODEL_EDIT_MODAL_ID = 'edit-model-modal';
export const MODEL_VERSION_EDIT_MODAL_ID = 'edit-model-version-modal';
export const emptyArtifactFile = {
diff --git a/app/assets/javascripts/pages/projects/ml/models/edit/index.js b/app/assets/javascripts/pages/projects/ml/models/edit/index.js
new file mode 100644
index 00000000000..da160b85e9b
--- /dev/null
+++ b/app/assets/javascripts/pages/projects/ml/models/edit/index.js
@@ -0,0 +1,8 @@
+import Vue from 'vue';
+import VueRouter from 'vue-router';
+import { initSimpleApp } from '~/helpers/init_simple_app_helper';
+import { EditMlModel } from '~/ml/model_registry/apps';
+
+Vue.use(VueRouter);
+
+initSimpleApp('#js-mount-edit-ml-model', EditMlModel, { withApolloProvider: true });
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
index 37acde760cc..39d89e4718c 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_auto_merge_enabled.vue
@@ -4,6 +4,7 @@ import autoMergeMixin from 'ee_else_ce/vue_merge_request_widget/mixins/auto_merg
import autoMergeEnabledQuery from 'ee_else_ce/vue_merge_request_widget/queries/states/auto_merge_enabled.query.graphql';
import { createAlert } from '~/alert';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
+import { fetchPolicies } from '~/lib/graphql';
import { __ } from '~/locale';
import { AUTO_MERGE_STRATEGIES } from '../../constants';
import eventHub from '../../event_hub';
@@ -16,6 +17,7 @@ export default {
apollo: {
state: {
query: autoMergeEnabledQuery,
+ fetchPolicy: fetchPolicies.NETWORK_ONLY,
variables() {
return this.mergeRequestQueryVariables;
},
@@ -41,14 +43,14 @@ export default {
},
data() {
return {
- state: {},
+ state: null,
isCancellingAutoMerge: false,
isRemovingSourceBranch: false,
};
},
computed: {
loading() {
- return this.$apollo.queries.state.loading && Object.keys(this.state).length === 0;
+ return this.$apollo.queries.state.loading || !this.state;
},
stateRemoveSourceBranch() {
if (!this.state.mergeRequest.shouldRemoveSourceBranch) return false;
diff --git a/app/assets/stylesheets/components/code_flow.scss b/app/assets/stylesheets/components/code_flow.scss
index a3640a5c0e2..11c229681b1 100644
--- a/app/assets/stylesheets/components/code_flow.scss
+++ b/app/assets/stylesheets/components/code_flow.scss
@@ -8,3 +8,7 @@ $code-flow-tabs-height: 51px;
.code-flow-content {
height: calc(100vh - #{$performance-bar-height} - #{$top-bar-height} - var(--broadcast-message-height, 0px) - #{$detail-page-header-height} - #{$vulnerability-page-title-height} - #{$content-wrapper-padding} - #{$code-flow-tabs-height});
}
+
+.code-flow-content-modal {
+ height: var(--modal-content-height);
+}
diff --git a/app/controllers/projects/build_artifacts_controller.rb b/app/controllers/projects/build_artifacts_controller.rb
index 703486f237a..f70e490341d 100644
--- a/app/controllers/projects/build_artifacts_controller.rb
+++ b/app/controllers/projects/build_artifacts_controller.rb
@@ -2,7 +2,6 @@
class Projects::BuildArtifactsController < Projects::ApplicationController
include ExtractsPath
- include RendersBlob
before_action :authorize_read_build!
before_action :extract_ref_name_and_path
diff --git a/app/controllers/projects/ml/models_controller.rb b/app/controllers/projects/ml/models_controller.rb
index 1c5d773bc7d..bffe96dd495 100644
--- a/app/controllers/projects/ml/models_controller.rb
+++ b/app/controllers/projects/ml/models_controller.rb
@@ -4,8 +4,8 @@ module Projects
module Ml
class ModelsController < ::Projects::ApplicationController
before_action :authorize_read_model_registry!
- before_action :authorize_write_model_registry!, only: [:destroy, :new]
- before_action :set_model, only: [:show, :destroy]
+ before_action :authorize_write_model_registry!, only: [:destroy, :new, :edit]
+ before_action :set_model, only: [:show, :destroy, :edit]
feature_category :mlops
MAX_MODELS_PER_PAGE = 20
@@ -16,6 +16,8 @@ module Projects
def show; end
+ def edit; end
+
def destroy
@model.destroy!
diff --git a/app/helpers/projects/ml/model_registry_helper.rb b/app/helpers/projects/ml/model_registry_helper.rb
index 8f2a3032275..b1e39515c8d 100644
--- a/app/helpers/projects/ml/model_registry_helper.rb
+++ b/app/helpers/projects/ml/model_registry_helper.rb
@@ -35,6 +35,7 @@ module Projects
data = {
projectPath: project.full_path,
index_models_path: project_ml_models_path(project),
+ edit_model_path: edit_project_ml_model_path(project, model.id),
create_model_version_path: new_project_ml_model_version_path(project, model_model_id: model.id),
can_write_model_registry: can_write_model_registry?(user, project),
mlflow_tracking_url: mlflow_tracking_url(project),
@@ -48,6 +49,22 @@ module Projects
to_json(data)
end
+ def edit_ml_model_data(model, user)
+ project = model.project
+
+ data = {
+ projectPath: project.full_path,
+ can_write_model_registry: can_write_model_registry?(user, project),
+ markdown_preview_path: preview_markdown_path(project),
+ model_path: project_ml_model_path(project, model),
+ model_id: model.id,
+ model_name: model.name,
+ model_description: model.description.to_s
+ }
+
+ to_json(data)
+ end
+
def new_ml_model_version_data(model, user)
project = model.project
diff --git a/app/models/ci/processable.rb b/app/models/ci/processable.rb
index 7a14388938d..3249fae7691 100644
--- a/app/models/ci/processable.rb
+++ b/app/models/ci/processable.rb
@@ -99,12 +99,7 @@ module Ci
end
def assign_resource_from_resource_group(processable)
- if Feature.enabled?(:assign_resource_worker_deduplicate_until_executing, processable.project) &&
- Feature.disabled?(:assign_resource_worker_deduplicate_until_executing_override, processable.project)
- Ci::ResourceGroups::AssignResourceFromResourceGroupWorkerV2.perform_async(processable.resource_group_id)
- else
- Ci::ResourceGroups::AssignResourceFromResourceGroupWorker.perform_async(processable.resource_group_id)
- end
+ Ci::ResourceGroups::AssignResourceFromResourceGroupWorker.perform_async(processable.resource_group_id)
end
def self.select_with_aggregated_needs(project)
diff --git a/app/views/projects/ml/models/edit.html.haml b/app/views/projects/ml/models/edit.html.haml
new file mode 100644
index 00000000000..3b25c2d8787
--- /dev/null
+++ b/app/views/projects/ml/models/edit.html.haml
@@ -0,0 +1,5 @@
+- add_to_breadcrumbs s_('ModelRegistry|Model registry'), project_ml_models_path(@model.project)
+- breadcrumb_title @model.name
+- page_title @model.name
+
+#js-mount-edit-ml-model{ data: { view_model: edit_ml_model_data(@model, @current_user) } }
diff --git a/app/workers/ci/resource_groups/assign_resource_from_resource_group_worker_v2.rb b/app/workers/ci/resource_groups/assign_resource_from_resource_group_worker_v2.rb
index e25480502b6..13655b84275 100644
--- a/app/workers/ci/resource_groups/assign_resource_from_resource_group_worker_v2.rb
+++ b/app/workers/ci/resource_groups/assign_resource_from_resource_group_worker_v2.rb
@@ -8,6 +8,14 @@ module Ci
# whereas this AssignResourceFromResourceGroupWorkerV2 has a strategy of `until_executing`.
# We are also using the same data_consistency (always) as the old AssignResourceFromResourceGroupWorker
# since this needs to process the latest/real-time data.
+ #
+ # 2024-10-17 Update:
+ # This worker is no longer needed and is not being called anywhere in the code base.
+ # This will no-op when `perform` is called.
+ # See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/168483
+ #
+ # TODO: this worker should be completely removed in the future.
+ # Removal issue: https://gitlab.com/gitlab-org/gitlab/-/issues/499658
class AssignResourceFromResourceGroupWorkerV2
include ApplicationWorker
@@ -19,20 +27,10 @@ module Ci
queue_namespace :pipeline_processing
feature_category :continuous_delivery
- # This worker is idempotent that it produces the same result
- # as long as the same resource group id is passed as an argument.
- # We often run into a race condition with an `until_executed` strategy,
- # so we are using an `until_executing` strategy here.
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/436988 for details.
idempotent!
deduplicate :until_executing, if_deduplicated: :reschedule_once, including_scheduled: true
- def perform(resource_group_id)
- ::Ci::ResourceGroup.find_by_id(resource_group_id).try do |resource_group|
- Ci::ResourceGroups::AssignResourceFromResourceGroupService.new(resource_group.project, nil)
- .execute(resource_group)
- end
- end
+ def perform(resource_group_id); end
end
end
end
diff --git a/config/feature_flags/beta/assign_resource_worker_deduplicate_until_executing.yml b/config/feature_flags/beta/assign_resource_worker_deduplicate_until_executing.yml
deleted file mode 100644
index a264ba76d8e..00000000000
--- a/config/feature_flags/beta/assign_resource_worker_deduplicate_until_executing.yml
+++ /dev/null
@@ -1,9 +0,0 @@
----
-name: assign_resource_worker_deduplicate_until_executing
-feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/436988
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152303
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/460793
-milestone: '17.1'
-group: group::environments
-type: beta
-default_enabled: true
diff --git a/config/feature_flags/beta/assign_resource_worker_deduplicate_until_executing_override.yml b/config/feature_flags/beta/assign_resource_worker_deduplicate_until_executing_override.yml
deleted file mode 100644
index 7a0e25a441e..00000000000
--- a/config/feature_flags/beta/assign_resource_worker_deduplicate_until_executing_override.yml
+++ /dev/null
@@ -1,9 +0,0 @@
----
-name: assign_resource_worker_deduplicate_until_executing_override
-feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/436988
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/160564/
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/460793
-milestone: '17.3'
-group: group::environments
-type: beta
-default_enabled: false
diff --git a/config/routes/project.rb b/config/routes/project.rb
index c823079da71..3925ca206b5 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -479,7 +479,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
namespace :ml do
resources :experiments, only: [:index, :show, :destroy], controller: 'experiments', param: :iid
resources :candidates, only: [:show, :destroy], controller: 'candidates', param: :iid
- resources :models, only: [:index, :show, :destroy, :new], controller: 'models', param: :model_id do
+ resources :models, only: [:index, :show, :edit, :destroy, :new], controller: 'models', param: :model_id do
resources :versions, only: [:new], controller: 'model_versions'
resources :versions, only: [:show], controller: 'model_versions', param: :model_version_id
end
diff --git a/db/docs/keys.yml b/db/docs/keys.yml
index c1566ab7b64..0a0131a9ddf 100644
--- a/db/docs/keys.yml
+++ b/db/docs/keys.yml
@@ -11,4 +11,3 @@ description: SSH keys used by users or for deployments.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685
milestone: "<6.0"
gitlab_schema: gitlab_main_clusterwide
-sharding_key_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/463929
diff --git a/doc/administration/packages/container_registry.md b/doc/administration/packages/container_registry.md
index 3b6eae3a870..26246c9d42f 100644
--- a/doc/administration/packages/container_registry.md
+++ b/doc/administration/packages/container_registry.md
@@ -1296,6 +1296,60 @@ blobs start being deleted is anything permanent done.
You can run garbage collection in the background without the need to schedule it or require read-only mode,
if you migrate to the [metadata database](container_registry_metadata_database.md).
+## Scaling by component
+
+This section outlines the potential performance bottlenecks as registry traffic increases by component.
+Each subsection is roughly ordered by recommendations that benefit from smaller to larger registry workloads.
+The registry is not included in the [reference architectures](../reference_architectures/index.md),
+and there are no scaling guides which target number of seats or requests per second.
+
+### Database
+
+1. **Move to a separate database**: As database load increases, scale vertically by moving the registry metadata database
+ to a separate physical database. A separate database can increase the amount of resources available
+ to the registry database while isolating the traffic produced by the registry.
+1. **Move to a HA PostgreSQL third-party solution**: Similar to [Praefect](../reference_architectures/5k_users.md#praefect-ha-postgresql-third-party-solution),
+ moving to a reputable provider or solution enables HA and is suitable for multi-node registry deployments.
+ You must pick a provider that supports native Postgres partitioning, triggers, and functions,
+ as the registry makes heavy use of these.
+
+### Registry server
+
+1. **Move to a separate node**: A [separate node](#configure-gitlab-and-registry-to-run-on-separate-nodes-linux-package-installations)
+ is one way to scale vertically to increase the resources available to the container registry server process.
+1. **Run multiple registry nodes behind a load balancer**: While the registry can handle
+ a high amount of traffic with a single large node, the registry is generally intended to
+ scale horizontally with multiple deployments. Configuring multiple smaller nodes
+ also enables techniques such as autoscaling.
+
+### Redis Cache
+
+Enabling the [Redis](https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/configuration.md?ref_type=heads#redis)
+cache improves performance, but also enables features such as renaming repositories.
+
+1. **Redis Server**: A single Redis instance is supported and is the simplest way
+ to access the benefits of the Redis caching.
+1. **Redis Sentinel**: Redis Sentinel is also supported and enables the cache to be HA.
+1. **Redis Cluster**: Redis Cluster can also be used for further scaling as deployments grow.
+
+### Storage
+
+1. **Local file system**: A local file system is the default and is relatively performant,
+ but not suitable for multi-node deployments or a large amount of registry data.
+1. **Object storage**: [Use object storage](#use-object-storage) to enable the practical storage
+ of a larger amount of registry data. Object storage is also suitable for multi-node registry deployments.
+
+### Online garbage collection
+
+1. **Adjust defaults**: If online garbage collection is not reliably clearing the [review queues](container_registry_metadata_database.md#queue-monitoring),
+ you can adjust the `interval` settings in the `manifests` and `blobs` sections under the
+ [`gc`](https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/configuration.md?ref_type=heads#gc)
+ configuration section. The default is `5s`, and these can be configured with milliseconds as well,
+ for example `500ms`.
+1. **Scale horizontally with the registry server**: If you are scaling the registry application horizontally
+ with multi-node deployments, online garbage collection automatically scales without
+ the need for configuration changes.
+
## Configure GitLab and Registry to run on separate nodes (Linux package installations)
By default, package assumes that both services are running on the same node.
diff --git a/doc/ci/environments/deployment_safety.md b/doc/ci/environments/deployment_safety.md
index 7cdeceb526a..f5c0d0713f9 100644
--- a/doc/ci/environments/deployment_safety.md
+++ b/doc/ci/environments/deployment_safety.md
@@ -102,7 +102,7 @@ can be prevented in some circumstances.
> - Job retries for rollback deployments checkbox [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/410427) in GitLab 16.3.
You might need to quickly roll back to a stable, outdated deployment.
-By default, pipeline job retries for [deployment rollback](index.md#environment-rollback) are enabled.
+By default, pipeline job retries for [deployment rollback](index.md#deployment-rollback) are enabled.
To disable pipeline retries, clear the **Allow job retries for rollback deployments** checkbox. You should disable pipeline retries in sensitive projects.
diff --git a/doc/ci/environments/external_deployment_tools.md b/doc/ci/environments/external_deployment_tools.md
index 4e07978c7cf..f129e6e1f80 100644
--- a/doc/ci/environments/external_deployment_tools.md
+++ b/doc/ci/environments/external_deployment_tools.md
@@ -22,7 +22,7 @@ For example, the following features are available by setting up tracking:
NOTE:
Some of the features are not available because GitLab can't authorize and leverage those external deployments, including
-[Protected Environments](protected_environments.md), [Deployment Approvals](deployment_approvals.md), [Deployment safety](deployment_safety.md), and [Environment rollback](index.md#environment-rollback).
+[Protected Environments](protected_environments.md), [Deployment Approvals](deployment_approvals.md), [Deployment safety](deployment_safety.md), and [Deployment rollback](index.md#deployment-rollback).
## How to set up deployment tracking
diff --git a/doc/ci/environments/index.md b/doc/ci/environments/index.md
index 2569b5bdf82..ad31776ba5c 100644
--- a/doc/ci/environments/index.md
+++ b/doc/ci/environments/index.md
@@ -10,7 +10,13 @@ DETAILS:
**Tier:** Free, Premium, Ultimate
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
-Environments describe where code is deployed.
+Environments connect GitLab to your infrastructure. An environment:
+
+- Can monitor and deploy to its target infrastructure.
+- Has its own variables.
+- Can be long-lived or ephemeral, depending on its use case.
+
+In addition, access to an environment can be controlled.
Each time [GitLab CI/CD](../index.md) deploys a version of code to an environment,
a deployment is created.
@@ -47,52 +53,182 @@ There are a few ways to view a list of environments for a given project:
Deployments show up in this list only after a deployment job has created them.
-## Search environments
+### Environment URL
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10754) in GitLab 15.5.
-> - [Searching environments within a folder](https://gitlab.com/gitlab-org/gitlab/-/issues/373850) was introduced in GitLab 15.7 with [Feature flag `enable_environments_search_within_folder`](https://gitlab.com/gitlab-org/gitlab/-/issues/382108). Enabled by default.
-> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/382108) in GitLab 17.4. Feature flag `enable_environments_search_within_folder` removed.
+> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/337417) to persist arbitrary URLs in GitLab 15.2 [with a flag](../../administration/feature_flags.md) named `soft_validation_on_external_url`. Disabled by default.
+> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/337417) in GitLab 15.3. [Feature flag `soft_validation_on_external_url`](https://gitlab.com/gitlab-org/gitlab/-/issues/367206) removed.
-To search environments by name:
+The [environment URL](../yaml/index.md#environmenturl) is displayed in a few
+places in GitLab:
+
+- In a merge request as a link:
+ 
+- In the Environments view as a button:
+ 
+- In the Deployments view as a button:
+ 
+
+You can see this information in a merge request if:
+
+- The merge request is eventually merged to the default branch (usually `main`).
+- That branch also deploys to an environment (for example, `staging` or `production`).
+
+For example:
+
+
+
+#### Go from source files to public pages
+
+With GitLab [Route Maps](../review_apps/index.md#route-maps), you can go directly
+from source files to public pages in the environment set for review apps.
+
+## Working with deployments
+
+When you deploy a version of your code to an environment, you create a deployment.
+There is usually only one active deployment per environment.
+
+After a deployment is created, you can roll it out to users.
+
+### Configure manual deployments
+
+You can create a job that requires someone to manually start the deployment.
+For example:
+
+```yaml
+deploy_prod:
+ stage: deploy
+ script:
+ - echo "Deploy to production server"
+ environment:
+ name: production
+ url: https://example.com
+ rules:
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+ when: manual
+```
+
+The `when: manual` action:
+
+- Exposes the **Run** (**{play}**) button for the job in the GitLab UI, with the text **Can be manually deployed to <environment>**.
+- Means the `deploy_prod` job must be triggered manually.
+
+You can find **Run** (**{play}**) in the pipelines, environments, deployments, and jobs views.
+
+### Track newly included merge requests per deployment
+
+GitLab can track newly included merge requests per deployment.
+When a deployment succeeds, the system calculates commit-diffs between the latest deployment and the previous deployment.
+You can fetch tracking information with the [Deployment API](../../api/deployments.md#list-of-merge-requests-associated-with-a-deployment)
+or view it at a post-merge pipeline in [merge request pages](../../user/project/merge_requests/index.md).
+
+To enable tracking configure your environment so either:
+
+- The [environment name](../yaml/index.md#environmentname) doesn't use folders with `/` (long-lived or top-level environments).
+- The [environment tier](#deployment-tier-of-environments) is either `production` or `staging`.
+
+ Here are some example configurations using the [`environment` keyword](../yaml/index.md#environment) in `.gitlab-ci.yml`:
+
+ ```yaml
+ # Trackable
+ environment: production
+ environment: production/aws
+ environment: development
+
+ # Non Trackable
+ environment: review/$CI_COMMIT_REF_SLUG
+ environment: testing/aws
+ ```
+
+Configuration changes apply only to new deployments. Existing deployment records do not have merge requests linked or unlinked from them.
+
+### Check out deployments locally
+
+A reference in the Git repository is saved for each deployment, so
+knowing the state of your current environments is only a `git fetch` away.
+
+In your Git configuration, append the `[remote "