-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #444 from UffizziCloud/feature/443_set_resource_ca…
…p_of_8_gb_per_deployment [443] added total limit of 8 gb for a deployment
- Loading branch information
Showing
18 changed files
with
113 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
core/app/forms/uffizzi_core/api/cli/v1/template/create_form.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class UffizziCore::Api::Cli::V1::Template::CreateForm < UffizziCore::Template | ||
validate :check_max_memory_limit | ||
validate :check_max_memory_request | ||
|
||
private | ||
|
||
def check_max_memory_limit | ||
return if valid_containers_memory_limit? | ||
|
||
errors.add(:payload, :max_memory_limit_error, max: project.account.container_memory_limit) | ||
end | ||
|
||
def check_max_memory_request | ||
return if valid_containers_memory_request? | ||
|
||
errors.add(:payload, :max_memory_request_error, max: project.account.container_memory_limit) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
core/app/services/uffizzi_core/deployment/memory_service.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class UffizziCore::Deployment::MemoryService | ||
class << self | ||
def valid_memory_limit?(_deployment) | ||
true | ||
end | ||
|
||
def memory_limit_error_message(_deployment); end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class UffizziCore::Template::MemoryService | ||
class << self | ||
def valid_memory_limit?(_template) | ||
true | ||
end | ||
|
||
def memory_limit_error_message(_template); end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
core/test/fixtures/files/uffizzi-compose-vote-app-docker-with-memory-request.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
services: | ||
redis: | ||
image: redis:latest | ||
|
||
postgres: | ||
image: postgres:9.6 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
|
||
nginx: | ||
image: nginx:latest | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 4000M | ||
configs: | ||
- source: vote_conf | ||
target: /etc/nginx/conf.d | ||
entrypoint: /usr/sbin/nginx-debug | ||
command: | ||
- "-g" | ||
- "daemon off;" | ||
|
||
worker: | ||
image: uffizzicloud/example-worker:latest | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 4000M | ||
|
||
vote: | ||
image: uffizzicloud/example-vote:latest | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 4000M | ||
|
||
result: | ||
image: uffizzicloud/example-result:latest | ||
|
||
x-uffizzi-ingress: | ||
service: nginx | ||
port: 8080 | ||
|
||
configs: | ||
vote_conf: | ||
file: configs/vote.conf | ||
defaulf_conf: | ||
file: config_files/config_file.conf |