Skip to content

Commit

Permalink
HMS-5416: run nightly job ever 15 mins
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsherrill committed Jan 29, 2025
1 parent 13ef705 commit 08f5bb0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions cmd/external-repos/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func main() {
}

if len(args) < 2 {
log.Fatal().Msg("Requires arguments: download, import, introspect, snapshot, nightly-jobs [INTERVAL], pulp-orphan-cleanup [BATCH_SIZE]")
log.Fatal().Msg("Requires arguments: download, import, introspect, snapshot, process-repos [INTERVAL], pulp-orphan-cleanup [BATCH_SIZE]")
}
if args[1] == "download" {
if len(args) < 3 {
Expand Down Expand Up @@ -91,7 +91,7 @@ func main() {
} else {
log.Warn().Msg("Snapshotting disabled")
}
} else if args[1] == "nightly-jobs" {
} else if args[1] == "process-repos" {
err = enqueueIntrospectAllRepos(ctx)
if err != nil {
log.Error().Err(err).Msg("error queueing introspection tasks")
Expand Down Expand Up @@ -132,6 +132,10 @@ func main() {
if err != nil {
log.Error().Err(err).Msg("error starting pulp orphan cleanup tasks")
}
} else if args[1] == "nightly-jobs" {
log.Fatal().Msg("Did you mean 'process-repos'?")
} else {
log.Fatal().Msgf("Unknown command: %s", args[1])
}
}

Expand Down
6 changes: 3 additions & 3 deletions deployments/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ objects:
name: content-sources-candlepin
key: key
optional: true
- name: nightly-jobs
- name: process-repos
# https://crontab.guru/
schedule: ${NIGHTLY_CRON_JOB}
suspend: ${{SUSPEND_CRON_JOB}}
Expand All @@ -517,8 +517,8 @@ objects:
inheritEnv: true
command:
- /external-repos
- nightly-jobs
- "24"
- process-repos
- "96"
env:
- name: CLOWDER_ENABLED
value: ${CLOWDER_ENABLED}
Expand Down
2 changes: 1 addition & 1 deletion docs/register_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ make repos-import-rhel9
```
2.
```
go run cmd/external-repos/main.go nightly-jobs
go run cmd/external-repos/main.go process-repos
```
3. Let those repositories snapshot

Expand Down
2 changes: 1 addition & 1 deletion docs/workflows/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This information is stored within the database and can be fetched or searched us
### How often does introspection occur?
Repositories are attempted to be introspected once per day. A job is run hourly that attempts to introspect any repos that have not been introspected successfully in the last 24 hours.

* this job can be run manually with `go run cmd/external-repos/main.go nightly-jobs`
* this job can be run manually with `go run cmd/external-repos/main.go process-repos`

Introspection can also be triggered directly using the API & UI, or using the command line:
* `go run cmd/external-repos/main.go introspect-all`
Expand Down
4 changes: 2 additions & 2 deletions docs/workflows/snapshotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ The snapshots are served at a path `/pulp/content/<domain>/<distribution_path>`.

### How often does snapshotting occur?

A cron job is run every hour that introspects at least 1 out every 24 repositories with the goal of snapshotting every repository at least once a day.
A cron job is run every 15 minutes that introspects at least 1 out every 96 repositories with the goal of snapshotting every repository at least once a day.

* this job can be run manually with `go run cmd/external-repos/main.go nightly-jobs 24`
* this job can be run manually with `go run cmd/external-repos/main.go process-repos 96`
* or to snapshot only those repositories with a URL: `go run cmd/external-repos/main.go snapshot https://myrepo.example.com/path/`

### How are snapshots used?
Expand Down

0 comments on commit 08f5bb0

Please sign in to comment.