Skip to content

Commit fe738af

Browse files
committed
Port mirror registry to use Quay
1 parent 09334e3 commit fe738af

File tree

4 files changed

+380
-59
lines changed

4 files changed

+380
-59
lines changed

docs/contributor/howto_quay_build.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Building Quay From Sources for MicroShift CI
2+
3+
## Introduction
4+
5+
MicroShift CI requires a local mirror registry for storing container images and
6+
container build artifacts. This is necessary for improving the stability of tests
7+
(less dependency on network flakes) and overall performance (faster image access).
8+
9+
The simplest local mirror registry tool that can be used in MicroShift CI is
10+
[Docker Distribution Registry](https://docs.docker.com/registry), but it lacks
11+
support of `sigstore`, which forces its users not to use signature validation.
12+
13+
[Project Quay](https://github.com/quay/quay) provides for a more feature reach
14+
alternative, but it comes with a few challenges:
15+
* Quay registry is more complex to set up and more resource consuming
16+
* Quay registry is not supported on the `aarch64` platform
17+
18+
Quay can be deployed in a [Quick Local Development](https://github.com/quay/quay/blob/master/docs/quick-local-deployment.md)
19+
mode that runs the registry inside local containers. To mitigate the lack of the
20+
`aarch64` platform support, it is necessary to pre-build the required container
21+
images from [Project Quay](https://github.com/quay/quay) sources and store them
22+
at [quay.io/microshift] registry to be consumed by MicroShift CI.
23+
24+
The remainder of this document describes how to build Quay container images from
25+
sources and store them in a cloud registry.
26+
27+
## Prerequisites
28+
29+
Run the following command to initialize the Quay Git repository.
30+
31+
```
32+
git clone https://github.com/quay/quay.git
33+
cd quay
34+
```
35+
36+
Review the list of [Quay Releases](https://github.com/quay/quay/releases) to
37+
select the branch. It is recommended to use a release with the `latest` tag
38+
(`v3.11.7` at the time of writing this document).
39+
40+
Check out the appropriate code branch.
41+
42+
```
43+
QUAY_VER=v3.11.7
44+
git checkout "${QUAY_VER}"
45+
```
46+
47+
Install the RPM dependencies required to build Quay images from sources.
48+
49+
```
50+
sudo dnf install -y podman podman-compose
51+
sudo ln -s $(which podman-compose) /usr/bin/docker-compose
52+
```
53+
54+
## Image Build
55+
56+
Run the following command to build Quay container images.
57+
58+
```
59+
make local-dev-build-images
60+
```
61+
62+
Make sure that required `quay-local` image was built successfully.
63+
64+
```
65+
$ podman images quay-local
66+
REPOSITORY TAG IMAGE ID CREATED SIZE
67+
localhost/quay-local latest 7f4def76a288 2 minutes ago 786 MB
68+
```
69+
70+
## Image Push
71+
72+
Log into your `quay.io` account at the `microshift` organization.
73+
74+
```
75+
podman login quay.io/microshift
76+
```
77+
78+
Tag the local image with the version and current architecture, and push it to
79+
the cloud registry.
80+
81+
```
82+
podman tag localhost/quay-local:latest quay.io/microshift/quay:${QUAY_VER}-$(uname -m)
83+
podman push quay.io/microshift/quay:${QUAY_VER}-$(uname -m)
84+
```
85+
86+
Finally, browse to [Quay Repository Settings](https://quay.io/repository/microshift/quay?tab=settings)
87+
and make sure the repository has public access.

test/assets/quay/config.yaml.template

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
ALLOWED_OCI_ARTIFACT_TYPES:
2+
application/vnd.oci.image.config.v1+json:
3+
- application/vnd.oci.image.layer.v1.tar+zstd
4+
application/vnd.sylabs.sif.config.v1+json:
5+
- application/vnd.sylabs.sif.layer.v1+tar
6+
AUTHENTICATION_TYPE: Database
7+
AVATAR_KIND: local
8+
BUILDLOGS_REDIS:
9+
host: ${REDIS_IP}
10+
password: strongpassword
11+
port: 6379
12+
DATABASE_SECRET_KEY: 5861fd40-0eab-42fb-8837-574ae401fa89
13+
DB_CONNECTION_ARGS: {}
14+
DB_URI: postgresql://user:pass@${POSTGRES_IP}/quay
15+
DEFAULT_TAG_EXPIRATION: 2w
16+
DISTRIBUTED_STORAGE_CONFIG:
17+
default:
18+
- LocalStorage
19+
- storage_path: /datastorage/registry
20+
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
21+
DISTRIBUTED_STORAGE_PREFERENCE:
22+
- default
23+
FEATURE_ACI_CONVERSION: false
24+
FEATURE_ACTION_LOG_ROTATION: false
25+
FEATURE_ANONYMOUS_ACCESS: true
26+
FEATURE_APP_REGISTRY: false
27+
FEATURE_APP_SPECIFIC_TOKENS: true
28+
FEATURE_BITBUCKET_BUILD: false
29+
FEATURE_BLACKLISTED_EMAILS: false
30+
FEATURE_BUILD_SUPPORT: false
31+
FEATURE_CHANGE_TAG_EXPIRATION: true
32+
FEATURE_DIRECT_LOGIN: true
33+
FEATURE_EXTENDED_REPOSITORY_NAMES: true
34+
FEATURE_FIPS: false
35+
FEATURE_GITHUB_BUILD: false
36+
FEATURE_GITHUB_LOGIN: false
37+
FEATURE_GITLAB_BUILD: false
38+
FEATURE_GOOGLE_LOGIN: false
39+
FEATURE_INVITE_ONLY_USER_CREATION: false
40+
FEATURE_MAILING: false
41+
FEATURE_NONSUPERUSER_TEAM_SYNCING_SETUP: false
42+
FEATURE_PARTIAL_USER_AUTOCOMPLETE: true
43+
FEATURE_PROXY_STORAGE: false
44+
FEATURE_REPO_MIRROR: false
45+
FEATURE_REQUIRE_TEAM_INVITE: true
46+
FEATURE_RESTRICTED_V1_PUSH: true
47+
FEATURE_SECURITY_NOTIFICATIONS: false
48+
FEATURE_SECURITY_SCANNER: false
49+
FEATURE_STORAGE_REPLICATION: false
50+
FEATURE_TEAM_SYNCING: false
51+
FEATURE_USER_CREATION: true
52+
FEATURE_USER_LAST_ACCESSED: true
53+
FEATURE_USER_LOG_ACCESS: false
54+
FEATURE_USER_METADATA: false
55+
FEATURE_USER_RENAME: false
56+
FEATURE_USERNAME_CONFIRMATION: true
57+
FRESH_LOGIN_TIMEOUT: 10m
58+
GITHUB_LOGIN_CONFIG: {}
59+
GITHUB_TRIGGER_CONFIG: {}
60+
GITLAB_TRIGGER_KIND: {}
61+
LDAP_ALLOW_INSECURE_FALLBACK: false
62+
LDAP_EMAIL_ATTR: mail
63+
LDAP_UID_ATTR: uid
64+
LDAP_URI: ldap://localhost
65+
LOG_ARCHIVE_LOCATION: default
66+
LOGS_MODEL: database
67+
LOGS_MODEL_CONFIG: {}
68+
MAIL_DEFAULT_SENDER: [email protected]
69+
MAIL_PORT: 587
70+
MAIL_USE_AUTH: false
71+
MAIL_USE_TLS: false
72+
PREFERRED_URL_SCHEME: http
73+
REGISTRY_TITLE: Project Quay
74+
REGISTRY_TITLE_SHORT: Project Quay
75+
REPO_MIRROR_INTERVAL: 30
76+
REPO_MIRROR_TLS_VERIFY: true
77+
SEARCH_MAX_RESULT_PAGE_COUNT: 10
78+
SEARCH_RESULTS_PER_PAGE: 10
79+
SECRET_KEY: f8d15d8b-5b24-4210-a762-1db6175cba2a
80+
SECURITY_SCANNER_INDEXING_INTERVAL: 30
81+
SERVER_HOSTNAME: ${QUAY_URL}
82+
SETUP_COMPLETE: true
83+
SUPER_USERS:
84+
- microshift
85+
TAG_EXPIRATION_OPTIONS:
86+
- 2w
87+
TEAM_RESYNC_STALE_TIME: 30m
88+
TESTING: false
89+
USE_CDN: false
90+
USER_EVENTS_REDIS:
91+
host: ${REDIS_IP}
92+
password: strongpassword
93+
port: 6379
94+
USER_RECOVERY_TOKEN_LIFETIME: 30m
95+
USERFILES_LOCATION: default

test/assets/quay/user_dump.sql

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
--
2+
-- PostgreSQL database dump
3+
--
4+
5+
-- Dumped from database version 10.12 (Debian 10.12-2.pgdg90+1)
6+
-- Dumped by pg_dump version 10.12 (Debian 10.12-2.pgdg90+1)
7+
8+
SET statement_timeout = 0;
9+
SET lock_timeout = 0;
10+
SET idle_in_transaction_session_timeout = 0;
11+
SET client_encoding = 'UTF8';
12+
SET standard_conforming_strings = on;
13+
SELECT pg_catalog.set_config('search_path', '', false);
14+
SET check_function_bodies = false;
15+
SET xmloption = content;
16+
SET client_min_messages = warning;
17+
SET row_security = off;
18+
19+
--
20+
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: user
21+
--
22+
23+
COPY public."user" (id, uuid, username, password_hash, email, verified, stripe_id, organization, robot, invoice_email, invalid_login_attempts, last_invalid_login, removed_tag_expiration_s, enabled, invoice_email_address, company, family_name, given_name, location, maximum_queued_builds_count, creation_date, last_accessed) FROM stdin;
24+
1 781bf4e3-2458-4b6a-9137-e80ea516be1d microshift $2b$12$aBToatOQeemO4IVB5/lhXOUk3J3iRZaLOpTB9RAho.JLOjnPWdquO microshift@redhat.com t \N f f f 0 2024-12-30 11:40:06.096595 1209600 t \N \N \N \N \N \N 2024-12-30 11:40:06.096597 \N
25+
\.
26+
27+
28+
--
29+
-- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: user
30+
--
31+
32+
SELECT pg_catalog.setval('public.user_id_seq', 1, true);
33+
34+
35+
--
36+
-- PostgreSQL database dump complete
37+
--
38+

0 commit comments

Comments
 (0)