Skip to content
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

AZP: Retry git clone #10158

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Conversation

Alexey-Rivkin
Copy link
Collaborator

@Alexey-Rivkin Alexey-Rivkin commented Sep 18, 2024

What

Retry 'git clone' command in case of a failure.

Why ?

Sometimes we get a git clone error:

git clone --depth 1 -b v1.16.x https://github.com/openucx/ucx.git /__w/2/s/ucx_v1.16.x_88170_gpu
Cloning into '/__w/2/s/ucx_v1.16.x_88170_gpu'...
error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly 

Switching to the built-in Azure function will prevent such failures using the retry logic.

@Alexey-Rivkin Alexey-Rivkin added the WIP-DNM Work in progress / Do not review label Sep 18, 2024
@Alexey-Rivkin Alexey-Rivkin force-pushed the topic/rm_manual_git_clone branch 5 times, most recently from c7f4e0d to 06bcc58 Compare September 22, 2024 08:34
@Alexey-Rivkin Alexey-Rivkin changed the title AZP: rm the manual git clone from wire-compat tests AZP: Retryl git clone Sep 22, 2024
@Alexey-Rivkin Alexey-Rivkin changed the title AZP: Retryl git clone AZP: Retry git clone Sep 22, 2024
@@ -247,3 +247,23 @@ get_arch() {
echo "$arch"
fi
}

git_clone_with_retry() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation (see other functions in this file)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed indentation to match the existing code style.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existing indentation uses 4 spaces you use tabs, its not the same

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

@Alexey-Rivkin Alexey-Rivkin marked this pull request as ready for review September 23, 2024 09:46
@Alexey-Rivkin Alexey-Rivkin removed the WIP-DNM Work in progress / Do not review label Sep 23, 2024
local branch="$1"
local target_dir="$2"
local max_attempts=5
local repo_url="https://github.com/openucx/ucx.git"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we take it from some azure env var?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thank you for the great idea!


for attempt in $(seq 1 $max_attempts); do
echo "Attempt $attempt of $max_attempts: Cloning UCX (branch: $branch)"
if git clone --depth 1 -b "$branch" "$repo_url" "$target_dir"; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe pass depth as a parameter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, 10x!

@yosefe
Copy link
Contributor

yosefe commented Sep 28, 2024

@Alexey-Rivkin pls squash

@yosefe yosefe merged commit 0ae8bcd into openucx:master Sep 29, 2024
141 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants