-
Notifications
You must be signed in to change notification settings - Fork 0
ETT-316 issues with glacier expiration job #186
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ba68758
ETT-316 issues with glacier expiration job
moseshll 34a2be2
- Add `libtest-exception-perl` to the Dockerfile although it seems to…
moseshll 9c3a0b7
- Add `--job-size` flag to `expire_backups.pl`
moseshll 0cbe8b6
Add optional `--limit` parameter to `bin/expire_backups.pl`.
moseshll 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/usr/bin/perl | ||
|
|
||
| use warnings; | ||
| use strict; | ||
|
|
||
| use FindBin; | ||
| use Getopt::Long qw(:config no_ignore_case); | ||
| use Pod::Usage; | ||
| use YAML::XS; | ||
|
|
||
| use lib "$FindBin::Bin/../lib"; | ||
| use HTFeed::BackupExpirationBatch; | ||
| use HTFeed::Log { root_logger => 'INFO, screen' }; | ||
|
|
||
| my $dry_run = 0; # -d | ||
| my $storage_config_file = undef; # -c | ||
| my $storage_name = undef; # -s | ||
| my $help = 0; | ||
|
|
||
| GetOptions( | ||
| 'config|c=s' => \$storage_config_file, | ||
| 'dry-run|d' => \$dry_run, | ||
| 'storage|s=s' => \$storage_name, | ||
| 'help|?' => \$help | ||
| ) or pod2usage(2); | ||
| pod2usage(1) if $help; | ||
|
|
||
| if (scalar @ARGV != 1) { | ||
| die "path to job file is required"; | ||
| } | ||
|
|
||
| my $storage_config = undef; | ||
| if ($storage_config_file) { | ||
| $storage_config = YAML::XS::LoadFile($storage_config_file); | ||
| } | ||
|
|
||
| my $exp = HTFeed::BackupExpirationBatch->new( | ||
| dry_run => $dry_run, | ||
| job_file => $ARGV[0], | ||
| storage_config => $storage_config, | ||
| storage_name => $storage_name | ||
| ); | ||
| $exp->run(); | ||
|
|
||
| __END__ | ||
|
|
||
| =head1 NAME | ||
|
|
||
| expire_versions.pl - remove a batch of superseded material from backup storage. | ||
|
|
||
| =head1 SYNOPSIS | ||
|
|
||
| expire_versions.pl [--config STORAGE_CONFIG_FILE] [--dry-run] -s STORAGE_NAME PATH_TO_JOB_FILE | ||
|
|
||
| STORAGE_CONFIG_FILE - path to a YAML file with config hash for STORAGE_NAME | ||
| STORAGE_NAME - storage class name matched against feed_backups.storage_name | ||
| PATH_TO_JOB_FILE - path to a TSV file with format namespace<TAB>id<TAB>version | ||
| =cut |
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.
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 think I see why this is needed in terms of injecting config to the child process if we are doing
fork()andexec()rather than justfork()and retaining the parents' config. It may be possible to set an env var to use a custom config (HTFEED_CONFIG) and write that out in the test? But if we need to do this I think it's OK.