Skip to content

Commit f6c889d

Browse files
committed
Improve docs, add AWS ECR into entrypoint.sh
1 parent bf03a8b commit f6c889d

3 files changed

Lines changed: 24 additions & 16 deletions

File tree

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ are used by image builder.
1414

1515
* `quay.io/fedora/fedora-bootc` versions N and N-1 (`x86_64`, `aarch64`)
1616
* `quay.io/centos-bootc/centos-bootc` versions Stream 9 and 10 (`x86_64`, `aarch64`)
17+
* `registry.redhat.io/rhelXX/rhel-bootc` (9 and 10) (`x86_64`)
1718

1819
## Building Containerfiles
1920

@@ -57,20 +58,29 @@ Images are available as multi-arch image manifests with the following URIs:
5758
* `quay.io/osbuild/centos-bootc:stream10-gce`
5859
* `quay.io/osbuild/centos-bootc:stream10-qcow2`
5960

61+
Image Mode for RHEL 9/10 images are only built on CICD to ensure everything
62+
works, but not pushed anywhere.
63+
6064
Derived images are automatically rebuilt after every push. Daily rebuild is
6165
scheduled for every morning (CET).
6266

6367
## CICD
6468

6569
Building, manifest creation, and pushing are handled by a GitHub Action. Because
66-
the configuration matrix is large, it is generated using the `gen-cicd.py`
67-
script from [`config.yaml`](config.yaml).
70+
the configuration matrix is large, it is generated using the `make matrix`
71+
command and it uses [`config.yaml`](config.yaml) as the input.
6872

6973
No cross-arch build is currently done since only x86_64 and aarch64 are
7074
supported and these are all available on GitHub.
7175

72-
GitHub Actions use `ghcr.io` as a cache registry to speed up builds do base
73-
images does not need to be pulled from `quay.io` everytime.
76+
GitHub Actions use `ghcr.io` as a cache registry to speed up pulls and builds
77+
because both `quay.io` and `registry.redhat.io` are hosted elsewhere. The cache
78+
registry is private.
79+
80+
The generation script also creates `matrix-*.sh` shell scripts which are called
81+
from `entrypoint.sh` which is used on RHOS cron job for builds on our AWS EC2
82+
infra. This is used in `Container.foundry` which is containerized version of
83+
this repository with all the scripts and Containerfiles.
7484

7585
## Using derived images
7686

@@ -84,9 +94,3 @@ image-builder-cli manifest --bootc-ref quay.io/osbuild/fedora-bootc:43-qcow2 --b
8494
## LICENSE
8595

8696
Apache License 2.0
87-
88-
## TODO
89-
90-
* Document RHEL builds
91-
* Add AWS credentials and client to login.sh
92-
* Looks like /root/resources directory is missing (so symlinks are incorrect)

entrypoint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@ else
2929
echo "Using registry.redhat.io credentials from the host system"
3030
fi
3131

32+
IMAGE="rhel-bootc"
33+
if [ -n "${AWS_REGION:-}" ] && [ -n "${AWS_ACCESS_KEY_ID:-}" ] && [ -n "${AWS_SECRET_ACCESS_KEY:-}" ] && [ -n "${ECR_URL:-}" ]; then
34+
ECR_HOSTNAME=$(echo "$ECR_URL" | sed -e 's|^https://||' -e 's|^http://||')
35+
echo "Logging in to $ECR_HOSTNAME"
36+
aws ecr get-login-password --region "$AWS_REGION" | buildah login --username AWS --password-stdin "$ECR_HOSTNAME"
37+
IMAGE="$ECR_HOSTNAME/$IMAGE"
38+
fi
39+
3240
if [ -n "${1:-}" ]; then
3341
echo "Running custom script $1 with arguments: ${*:2}"
3442
./"$1" "${@:2}"
3543
else
3644
echo "Running default build matrix"
37-
./matrix-rhel9.sh rhel-bootc:9
38-
./matrix-rhel10.sh rhel-bootc:10
45+
./matrix-rhel9.sh "$IMAGE:9"
46+
./matrix-rhel10.sh "$IMAGE:10"
3947
fi

login.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ set -xeuo pipefail
44
if [ -n "${REPO_USERNAME:-}" ] && [ -n "${REPO_PASSWORD:-}" ]; then
55
echo "Logging in to $TO_REGISTRY"
66
echo "$REPO_PASSWORD" | buildah login -u "$REPO_USERNAME" --password-stdin "$TO_REGISTRY"
7-
elif [ -n "${AWS_REGION:-}" ] && [ -n "${AWS_ACCESS_KEY_ID:-}" ] && [ -n "${AWS_SECRET_ACCESS_KEY:-}" ] && [ -n "${ECR_URL:-}" ]; then
8-
# Let's assume the ECR_URL from app-interface Vault is in fact not URL but hostname
9-
echo "Logging in to $ECR_URL"
10-
aws ecr get-login-password --region "$AWS_REGION" | buildah login --username AWS --password-stdin "$ECR_URL"
117
fi
128

139
USE_CACHE=

0 commit comments

Comments
 (0)