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

feat(warmup)!: Add warmup wait command #379

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Conversation

tinou98
Copy link
Contributor

@tinou98 tinou98 commented Dec 4, 2024

This allows to programmatically (with script) wait for elements to be ready, instead of hardcoding a duration.

Scripts examples

Warm-up:

KEY="data/${1:0:2}/$1";
if [ "$(aws s3api head-object --bucket cold --key "$KEY" --query StorageClass)" == '"GLACIER"' ]
then
    aws s3api restore-object --restore-request Days=7 --bucket cold --key "$KEY"
fi

Warm-up wait:

KEY="data/${1:0:2}/$1";
until [ "$(aws s3api head-object --bucket cold --key "$KEY" --query StorageClass)" != '"GLACIER"' ]
do
    sleep 60s
done

This is a simple version that will wait for each object sequentially (but that shouldn't be a problem as all warm up request are done in a first pass, and thus runs in parallel).

I'm up for discussion if another model looks good, like

  • moving the loop in the lib, and the wait script just check if the file is ready
  • having only one script, that warm-up and then return the status

This allow to programatically (with script) wait for elements to be
ready
Signed-off-by: MATILLAT Quentin <qmatillat@gmail.com>
Signed-off-by: MATILLAT Quentin <qmatillat@gmail.com>
@aawsome aawsome changed the title feat(warmup): Add warmup wait command feat(warmup)!: Add warmup wait command Dec 10, 2024
@aawsome aawsome added this pull request to the merge queue Dec 10, 2024
Merged via the queue into rustic-rs:main with commit fe2a9bd Dec 11, 2024
21 checks passed
@rustic-release-plz rustic-release-plz bot mentioned this pull request Dec 11, 2024
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