Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ If you want less Red Hat repos:
OPTIONS_REPOSITORY_IMPORT_FILTER=small make repos-import
```

This will import and snapshot repos needed for the minimal viable environment. Useful for running Playwright tests.
This will import and snapshot repos needed for the initial viable environment required before running Playwright tests.

```sh
make repos-minimal
Expand Down
6 changes: 5 additions & 1 deletion mk/repos.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ repos-import-rhel10: ## Import only rhel 10 repos
OPTIONS_REPOSITORY_IMPORT_FILTER=rhel10 go run ./cmd/external-repos/main.go import

.PHONY: repos-minimal
repos-minimal: ## Import and snapshot repos needed for a minimal setup, usefull for Playwright testing, currently: SMALL + EPEL10
repos-minimal: ## Import and snapshot or introspect repos needed before running Playwright tests, the repos used: HARDCODED (2) + SMALL + EPEL10
OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/appstream/os/ --force
OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason for the second import? 🤔 it should be enough to only import it once 😅

go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/baseos/os/ --force
OPTIONS_REPOSITORY_IMPORT_FILTER=small go run ./cmd/external-repos/main.go import
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel9/9/aarch64/codeready-builder/os/ --force
OPTIONS_REPOSITORY_IMPORT_FILTER=epel10 go run ./cmd/external-repos/main.go import
Expand Down
6 changes: 3 additions & 3 deletions pkg/external_repos/snapshotted_repos/rhel10-aarch64.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/baseos/os",
"distribution_arch": "aarch64",
"distribution_version": "10",
"selector": "rhel10",
"selector": "rhel10,hardcoded",
"feature_name": "RHEL-OS-x86_64",
"origin": "red_hat"
},
Expand All @@ -15,7 +15,7 @@
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/appstream/os",
"distribution_arch": "aarch64",
"distribution_version": "10",
"selector": "rhel10",
"selector": "rhel10,hardcoded",
"feature_name": "RHEL-OS-x86_64",
"origin": "red_hat"
},
Expand All @@ -31,7 +31,7 @@
},
{
"name": "Red Hat Enterprise Linux 10 for ARM 64 - Extensions (RPMs)",
"content_label" :"rhel-10-for-aarch64-extensions-rpms",
"content_label": "rhel-10-for-aarch64-extensions-rpms",
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/extensions/os",
"distribution_arch": "aarch64",
"distribution_version": "10",
Expand Down
47 changes: 47 additions & 0 deletions scripts/time_valid_repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Measure how long it takes to import, and snapshot or introspect particular repositories and wait until they become valid
# Run the backend locally

echo "------------------------------------------"
echo "Importing repos and forcing a snapshot..."
echo "------------------------------------------"

# # original - epel10 and small
# OPTIONS_REPOSITORY_IMPORT_FILTER=small go run ./cmd/external-repos/main.go import
# go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel9/9/aarch64/codeready-builder/os/ --force

# OPTIONS_REPOSITORY_IMPORT_FILTER=epel10 go run ./cmd/external-repos/main.go import
# go run cmd/external-repos/main.go snapshot --url https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/ --force
# # --

SECONDS=0

# update - hardcoded rhel 10, aarch: baseos and appstream
OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/appstream/os/ --force

OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/baseos/os/ --force

OPTIONS_REPOSITORY_IMPORT_FILTER=epel10 go run ./cmd/external-repos/main.go import
go run cmd/external-repos/main.go introspect --url https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/ --force

echo "------------------------------------------"
echo "Repos imported."
echo "------------------------------------------"
echo "Checking snapshot status of all repos..."
echo "------------------------------------------"

while [[ "$(curl -s http://localhost:8000/api/content-sources/v1.0/repositories/ -H "$( ./scripts/header.sh 12675780 1111)" | jq '.data | all(.status == "Valid")')" == "false" ]]; do
echo "[$(date +%H:%M:%S)] Waiting... (${SECONDS}s elapsed)"
sleep 5
done

duration=$SECONDS

echo "------------------------------------------"
echo "Success! All snapshots are Valid."
printf "%d min %d s\n" $((duration/60)) $((duration%60))
echo "${duration}s"
echo "------------------------------------------"