debian-image-builder-frontend/devel
jkozol 5a34506eb6 devel: update local containerized development
Update multiple aspects of our docker development stack. The frontend now
has a devel specific webpack that allows development against a local server/api.
The docker-composer.yaml also includes both versioning and networking updates.
Overall, the major change is to migrate our proxy access into the crc webpack proxy.
2023-10-11 09:34:52 +02:00
..
config devel: remove frontend spandx proxy 2022-07-14 17:59:54 +02:00
.env Fix docker stack (#713) 2022-04-26 14:00:53 +01:00
.gitignore devel: re-use existing dashboards 2021-10-29 11:02:22 +01:00
docker-compose.yml devel: update local containerized development 2023-10-11 09:34:52 +02:00
gen-certs.sh devel: add full-stack development environment 2021-05-21 19:23:14 +02:00
gen-dashboards devel/gen-dashboard: use python3 explicitly in the shebang 2022-08-04 12:18:07 +02:00
README.md devel: update local containerized development 2023-10-11 09:34:52 +02:00
setup.sh devel: re-use existing dashboards 2021-10-29 11:02:22 +01:00

devtools

Development Tools for Image Builder

Setup

To start local development, first clone the image builder stack:

git clone git@github.com:osbuild/osbuild.git
git clone git@github.com:osbuild/osbuild-composer.git
git clone git@github.com:osbuild/image-builder.git
git clone git@github.com:osbuild/image-builder-frontend.git

The folder structure should look like:

.
├── image-builder
├── image-builder-frontend
├── osbuild
└── osbuild-composer

Secondly redirect a few domains to localhost. One for each environment of cloud.redhat.com that exists. You only need the ones you will be developing against. If you are outside the Red Hat VPN, only prod is available:

echo "127.0.0.1 prod.foo.redhat.com" >> /etc/hosts
echo "127.0.0.1 qa.foo.redhat.com" >> /etc/hosts
echo "127.0.0.1 ci.foo.redhat.com" >> /etc/hosts
echo "127.0.0.1 stage.foo.redhat.com" >> /etc/hosts

Lastly run the setup tool from image-builder-frontend to generate TLS certs and extract the Grafana dashboards from the image-builder and osbuild-composer repos.

cd image-builder-frontend/devel
./setup.sh

Environment Variables

For the Image Builder backend to upload successfully, you need to set some environment variables. For AWS, for example, set the following environment variables in the .env file:

OSBUILD_AWS_REGION
OSBUILD_AWS_ACCESS_KEY_ID
OSBUILD_AWS_SECRET_ACCESS_KEY
OSBUILD_AWS_S3_BUCKET

And then add to the list of environment variables for the backend container in the docker-compose.yml file.

The config variables for the Image Builder backend can be found here.

Run

To build the containers run the following command:

docker compose build # (or docker-compose build)

To run the containers:

docker compose up # (or docker-compose up)

Note: As per the docker compose cli docs, the new syntax for running docker compose changed from docker-compose to docker compose

Access the service through the GUI: https://stage.foo.redhat.com:1337/beta/insights/image-builder, or directly through the API: https://stage.foo.redhat.com:1337/docs/api/image-builder.

The metrics containers are only launched when explicitly required. The command for this is below:

docker compose --profile metrics up

Access the Grafana dashboard on https://localhost:3000. The default username is admin and the password is set to foobar. The prometheus instance can be accessed on https://localhost:9000