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

mirror clone: Improve handling of latest versions #1313

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Apr 15, 2021

What problem does this PR solve?

When running tiup mirror clone ... v5.0.0 it may download a different version of a component if there
is no v5.0.0 for that component.

If you specify "v9999" it will cause tiup mirror clone to download the latest version of all components.

What is changed and how it works?

  1. Print a message when falling back on the latest version for a component
  2. Allow the user to specify "latest" as version to get the latest version.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Try tiup mirror clone /path/to/tiup-mirror --os linux --arch amd64 latest and tiup mirror clone /path/to/tiup-mirror --os linux --arch amd4 v5.0.0.

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release notes:

Allow specifying "latest" as version for `tiup mirror clone`

@ti-chi-bot ti-chi-bot requested a review from lucklove April 15, 2021 08:03
@ti-chi-bot ti-chi-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 15, 2021
1. If a version is specified and we fall back on the latest version
   then print a message about this.
2. Allow specifying "latest" as version to download the latest version
   of all components.
@dveeden dveeden force-pushed the mirror_clone_latest branch from b347b15 to 2c09edd Compare April 15, 2021 08:14
@ti-chi-bot ti-chi-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 15, 2021
@AstroProfundis
Copy link
Contributor

I think it should be "latest" available version by default, so I'm not sure if it's necessary to add an alias to specify "latest". PTAL @lucklove

@dveeden
Copy link
Contributor Author

dveeden commented Apr 15, 2021

I think it should be "latest" available version by default, so I'm not sure if it's necessary to add an alias to specify "latest". PTAL @lucklove

Making "latest" the default would be ok with me as that is probably what people want if they don't specify --full. However that's not how it works now as you need to specify a version.

[dvaneeden@dve-carbon ~]$ tiup mirror clone ~/tiup-mirror/ --arch=amd64 --os=linux
Start to clone mirror, targetDir is /home/dvaneeden/tiup-mirror/, selectedVersions are []
If this does not meet expectations, please abort this process, read `tiup mirror clone --help` and run again
Arch [amd64]
OS [linux]
download https://tiup-mirrors.pingcap.com/tiup-linux-amd64.tar.gz 6.71 MiB / 6.71 MiB 100.00% 7.66 MiB p/s                                                                                    
[dvaneeden@dve-carbon ~]$ tiup mirror clone ~/tiup-mirror/ --arch=amd64 --os=linux v99
Start to clone mirror, targetDir is /home/dvaneeden/tiup-mirror/, selectedVersions are [v99]
If this does not meet expectations, please abort this process, read `tiup mirror clone --help` and run again
Arch [amd64]
OS [linux]
download https://tiup-mirrors.pingcap.com/alertmanager-v0.17.0-linux-amd64.tar.gz 22.54 MiB / 22.54 MiB 100.00% 15.71 MiB p/s                                                                 
download https://tiup-mirrors.pingcap.com/bench-v1.4.1-linux-amd64.tar.gz 7.84 MiB / 7.84 MiB 100.00% 8.94 MiB p/s                                                                            
download https://tiup-mirrors.pingcap.com/blackbox_exporter-v0.12.0-linux-amd64.tar.gz 4.72 MiB / 4.72 MiB 100.00% 6.12 MiB p/s                                                               
download https://tiup-mirrors.pingcap.com/br-v5.0.0-linux-amd64.tar.gz 41.08 MiB / 41.08 MiB 100.00% 23.98 MiB p/s                                                                            
download https://tiup-mirrors.pingcap.com/client-v1.4.1-linux-amd64.tar.gz 4.50 MiB / 4.50 MiB 100.00% 5.11 MiB p/s                                                                           
download https://tiup-mirrors.pingcap.com/cluster-v1.4.1-linux-amd64.tar.gz 8.05 MiB / 8.05 MiB 100.00% 187.73 MiB p/s                                                                        
download https://tiup-mirrors.pingcap.com/dm-v1.4.1-linux-amd64.tar.gz 7.73 MiB / 7.73 MiB 100.00% 69.69 MiB p/s                                                                              
download https://tiup-mirrors.pingcap.com/dm-master-v2.0.2-linux-amd64.tar.gz 1.19 MiB / 31.44 MiB 3.77% 1.92 MiB p/s                                                                         ^C
[dvaneeden@dve-carbon ~]$ tiup mirror clone ~/tiup-mirror/ --arch=amd64 --os=linux --tidb-lightning
Error: flag needs an argument: --tidb-lightning
[dvaneeden@dve-carbon ~]$ tiup mirror clone ~/tiup-mirror/ --arch=amd64 --os=linux --tidb-lightning=v999
Start to clone mirror, targetDir is /home/dvaneeden/tiup-mirror/, selectedVersions are []
If this does not meet expectations, please abort this process, read `tiup mirror clone --help` and run again
Arch [amd64]
OS [linux]
download https://tiup-mirrors.pingcap.com/tiup-linux-amd64.tar.gz 6.71 MiB / 6.71 MiB 100.00% 489.30 MiB p/s   

@AstroProfundis
Copy link
Contributor

Oh I see, that's an issue of how clone parses the argument list.

@lucklove
Copy link
Member

Clever implementation!!!

@lucklove
Copy link
Member

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lucklove

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 15, 2021
@lucklove
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 2c09edd

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 15, 2021
@ti-chi-bot
Copy link
Member

@dveeden: Your PR was out of date, I have automatically updated it for you.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@dveeden
Copy link
Contributor Author

dveeden commented Apr 15, 2021

/merge

@ti-chi-bot
Copy link
Member

@dveeden: /merge is only allowed for the committers in list.

In response to this:

/merge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@AstroProfundis
Copy link
Contributor

/merge

@ti-chi-bot ti-chi-bot merged commit 1d16f0d into pingcap:master Apr 16, 2021
@AstroProfundis AstroProfundis added this to the v1.5.0 milestone May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants