-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: provisioning script #335
Conversation
925bb8e
to
9d3cb0a
Compare
Codecov Report
@@ Coverage Diff @@
## main #335 +/- ##
==========================================
- Coverage 58.29% 58.13% -0.16%
==========================================
Files 51 51
Lines 2503 2503
==========================================
- Hits 1459 1455 -4
- Misses 929 932 +3
- Partials 115 116 +1
Continue to review full report at Codecov.
|
3eede98
to
e4e203c
Compare
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.
I'm about half-way (at ## CONTAINERD
) and have a few comments already, so i'll just submit them now and continue with the rest.
local repo_name="$1" | ||
local tag="$2" | ||
local bin="$3" | ||
echo "https://github.com/$repo_name/releases/download/$tag/$bin" |
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.
I really love all this variables names to document what are those arguments and
not just https://github.com/${1}/.....
local url=$(curl -sL "$latest_url" | awk -F'"' '/tag_name/ {printf $4}') | ||
echo "$url" |
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.
Why not:
local url=$(curl -sL "$latest_url" | awk -F'"' '/tag_name/ {printf $4}') | |
echo "$url" | |
curl -sL "$latest_url" | awk -F'"' '/tag_name/ {printf $4}' |
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.
i wanted to make the return more explicit, but yes it is unnecessary
tag=$(git ls-remote --tags --sort="v:refname" "https://github.com/$repo_name" | | ||
tail -n 1 | sed 's/.*\///; s/\^{}//') | ||
echo "$tag" |
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.
same as latest_release_tag
.
lvcreate -q --wipesignatures y -n thinpool "$volume_group" -l 95%VG || die "Failed to create logical volume for thinpool data" | ||
say "Created logical volume for $volume_group thinpool data" | ||
|
||
lvcreate -q --wipesignatures y -n thinpoolmeta "$thinpool" -l 1%VG || die "Failed to create logical volume for thinpool metadata" |
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.
Hmm.. That 95%
and 1%
combo seems strange.
- where is the remaining
4%
- the
METADATA_SPARSE_SIZE="10G"
DATA_SPARSE_SIZE="100G"
pair has a 1:10 ratio.
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.
It's even more fishy, we have fix size for spare files, but we use dynamic volume size with lvm.
If the disk full size is less than $((DATA_SPARSE_SIZE + METADATA_SPARSE_SIZE))
we should fail before we even try to erase it.
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.
nvm, i see DATA_SPARSE_SIZE
and METADATA_SPARSE_SIZE
are used for dev only without lvm.
(leave this thread here to record my confusion 😆 )
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.
i copied all the devpool stuff from our existing script, did not actually read any of it 😁
f45c3ff
to
141814d
Compare
😬 sorry @yitsushi I had a mistake in the docs |
provision.sh tool
Drawn a lot from firecracker's one of these, but not as much as i expected as their bits made my shellcheck yell at me a lot
There are docs included in this PR, but here is the help:
And an action shot: