-
Notifications
You must be signed in to change notification settings - Fork 33
feat(obs): change parallelized file system to obs Bucket #154
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
Open
Zippo-Wang
wants to merge
1
commit into
huaweicloud:master
Choose a base branch
from
Zippo-Wang:feat_obs
base: master
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.
Open
Changes from all commits
Commits
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 hidden or 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 hidden or 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 hidden or 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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,111 @@ | ||
| #!/bin/bash | ||
|
|
||
| packageCmd=("yum" "dnf" "apt") | ||
|
|
||
| checkS3fsInstalled() { | ||
| echo "[INFO] Check version and check if it works" | ||
| isInstalled=1 | ||
| command -v s3fs >/dev/null 2>&1 || { isInstalled=0; } | ||
| if [ ${isInstalled} = 0 ]; then | ||
| echo "[WARN] has no command named s3fs" | ||
| return ${isInstalled} | ||
| fi | ||
| echo "[INFO] s3fs has been installed" | ||
| return ${isInstalled} | ||
| } | ||
|
|
||
| checkLinuxOS() { | ||
| if grep -i -q "EulerOS" /etc/os-release; then | ||
| # EulerOS | ||
| return 5 | ||
| elif [ -f "/etc/redhat-release" ]; then | ||
| # CentOS or RHEL or EulerOS | ||
| if grep -i -q "CentOS" /etc/redhat-release; then | ||
| return 1 | ||
| elif grep -i -q "Fedora" /etc/redhat-release; then | ||
| return 4 | ||
| elif grep -i -q "EulerOS" /etc/redhat-release; then | ||
| return 5 | ||
| fi | ||
| elif [ -f "/etc/issue" ]; then | ||
| # Ubuntu or Debian or Euler | ||
| if grep -i -q "ubuntu" /etc/issue; then | ||
| return 2 | ||
| elif grep -i -q "debian" /etc/issue; then | ||
| return 3 | ||
| elif grep -i -q "Euler" /etc/os-release; then | ||
| return 5 | ||
| fi | ||
| elif [ -f "/etc/fedora-release" ]; then | ||
| # Fedora | ||
| if grep -i -q "Fedora" /etc/fedora-release; then | ||
| return 4 | ||
| fi | ||
| else | ||
| # unknown OS | ||
| return 0 | ||
| fi | ||
| } | ||
|
|
||
| installS3fs() { | ||
| echo "[INFO] Install dependencies and s3fs" | ||
| pgkManageCmd=${1} | ||
|
|
||
| if which yum >/dev/null 2>&1 && [ ${pgkManageCmd} = "yum" ]; then | ||
| echo "[INFO] command 'yum' is available, trying to install s3fs with yum" | ||
| sudo yum -y install epel-release | ||
| sudo yum -y install s3fs-fuse | ||
| return | ||
| elif which apt >/dev/null 2>&1 && [ ${pgkManageCmd} = "apt" ]; then | ||
| echo "[INFO] command 'apt' is available, trying to install s3fs with apt" | ||
| sudo apt -y install s3fs | ||
| return | ||
| elif which dnf >/dev/null 2>&1 && [ ${pgkManageCmd} = "dnf" ]; then | ||
| echo "[INFO] command 'dnf' is available, trying to install s3fs with dnf" | ||
| sudo dnf -y install s3fs-fuse | ||
| return | ||
| else | ||
| echo "[ERROR] unsupported systems, please install s3fs manually" | ||
| fi | ||
| } | ||
|
|
||
| # pre install | ||
| checkS3fsInstalled | ||
| isInstalled=$? | ||
| if [ ${isInstalled} = 1 ]; then | ||
| exit 1 | ||
| fi | ||
|
|
||
| # install | ||
| checkLinuxOS | ||
| osCode=$? | ||
| echo "[INFO] OS Code is ${osCode}" | ||
|
|
||
| if [ ${osCode} = 1 ] || [ ${osCode} = 5 ]; then | ||
| echo "[INFO] OS is CentOS or EulerOS, use yum to install s3fs" | ||
| installS3fs "yum" | ||
| elif [ ${osCode} = 2 ] || [ ${osCode} = 3 ]; then | ||
| echo "[INFO] OS is Ubuntu or Debian, use apt to install s3fs" | ||
| installS3fs "apt" | ||
| elif [ ${osCode} = 4 ]; then | ||
| echo "[INFO] OS is Fedora, use dnf to install s3fs" | ||
| installS3fs "dnf" | ||
| else | ||
| echo "[WARN] Unknown OS, try to force installation of s3fs" | ||
| for cmd in ${packageCmd[@]}; do | ||
| installS3fs ${cmd} | ||
| checkS3fsInstalled | ||
| isInstalled=$? | ||
| if [ ${isInstalled} = 1 ]; then | ||
| exit 1 | ||
| fi | ||
| done | ||
| fi | ||
|
|
||
| # post install | ||
| checkS3fsInstalled | ||
| isInstalled=$? | ||
| if [ ${isInstalled} = 1 ]; then | ||
| exit 1 | ||
| fi | ||
| echo "[ERROR] failed to install s3fs, please install s3fs manually" |
Binary file not shown.
Binary file not shown.
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.