-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC-0030 - Add support to Diego for file based service bindings #942
Open
dimitardimitrov13
wants to merge
19
commits into
cloudfoundry:develop
Choose a base branch
from
dimitardimitrov13:CFAR-929_VCAP_SERVICES
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+60
−1
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
07ac037
Replace bbs with the PoC version
dimitardimitrov13 9b4c77a
Merge branch 'develop' into CFAR-929_VCAP_SERVICES
dimitardimitrov13 6cb0e5b
Create service binding root as tmpfs poll
dimitardimitrov13 5e45a22
Revise the service_binding_root strategy.
dimitardimitrov13 99dd7b2
Restore bbs packaging
dimitardimitrov13 c96537a
Add service_binding_root tmpfs.
dimitardimitrov13 e107132
Testing of rep service_binding_root
dimitardimitrov13 46162b6
Add service_binding_root to spec.
dimitardimitrov13 c530058
Adding of logging for max containers. Debug.
dimitardimitrov13 2b925af
Remove shebang for a bash.
dimitardimitrov13 56f187b
Remove debug.
dimitardimitrov13 beb5a62
Adding of BDD tests for setup_service_binding_root.erb.
dimitardimitrov13 f0b8a59
Refactoring.
dimitardimitrov13 b365cbc
Merge branch 'cloudfoundry:develop' into CFAR-929_VCAP_SERVICES
dimitardimitrov13 1709145
Merge branch 'cloudfoundry:develop' into CFAR-929_VCAP_SERVICES
dimitardimitrov13 0696ffe
Merge branch 'cloudfoundry:develop' into CFAR-929_VCAP_SERVICES
dimitardimitrov13 f97689b
Changes according Updates #1008
dimitardimitrov13 95aa7c4
Revert bbs submodule.
dimitardimitrov13 1af6dda
Fix volume_mounted_files path
dimitardimitrov13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
<% | ||
_max_containers = 250 | ||
if_p("diego.rep.max_containers") do |value| | ||
_max_containers = value | ||
end | ||
if _max_containers <= 0 | ||
raise "The max_containers prop should be a positive integer" | ||
end | ||
%> | ||
max_containers=<%= _max_containers %> | ||
|
||
# Define the service binding root directory | ||
volume_mounted_files="/var/vcap/data/rep/shared/garden/volume_mounted_files" | ||
|
||
# Calculate the size for the tmpfs (1MB per container) | ||
root_tmpfs_size=$((max_containers * 1))M | ||
|
||
# Ensure the root directory is safely removed and recreated | ||
if [ -d "$volume_mounted_files" ]; then | ||
# Ensure the root directory is unmounted before removing it | ||
if mountpoint -q "$volume_mounted_files"; then | ||
fuser -k "$volume_mounted_files" | ||
umount -l "$volume_mounted_files" | ||
fi | ||
|
||
sleep 10 | ||
|
||
rm -rf "$volume_mounted_files" | ||
fi | ||
|
||
mkdir -p "$volume_mounted_files" | ||
|
||
# Mount the root tmpfs | ||
mount -t tmpfs -o size="$root_tmpfs_size" tmpfs "$volume_mounted_files" || exit 1 | ||
|
||
# Set permissions and ownership for the root directory and all subdirectories | ||
chmod 0700 "$volume_mounted_files" | ||
chown vcap:vcap "$volume_mounted_files" |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to increase the size of the diego footprint on the cell, which will reduce space for the containers themselves.
❓ Is additional space taken into account when the rep reports the resources on the cell to the BBS? It should be taken into account when this property is set to "auto".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, that's new for me. Would you elaborate further on this? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding, this https://github.com/cloudfoundry/executor/blob/main/initializer/configuration/configuration.go#L115 should be extended to add number_of_containers * 1MB to account for the 'overhead' that 'volume_mounted_files' will bring. Am I correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! That looks correct to me.