This repository contains components used to deploy the HACBS JVM build service.
See each component’s directory for specific documentation.
Working out of your clone of this repository, you have two paths for initializing everything to try and run a test build againast a KCP enabled environment.
Specifically for our make dev
based developer flow:
-
continue to set
QUAY_USERNAME
,QUAY_E2E_ORGANIZATION
andQUAY_TOKEN
like we currently do in our developer flow. -
admittedly,
QUAY_USERNAME
andQUAY_E2E_ORGANIZAION
may be the same in the developer flow i.e. your personal quay repository -
also set
QUAY_TAG
todev
-
image references will become
quay.io/$QUAY_USERNAME/hacbs-jvm-<controller|cache|build-request-processor>:dev
Specifically testing against levels of the quay.io/redhat-appstudio/hacbs-jvm-*
images from merged PRs:
-
either unset
QUAY_USERNAME
or set it toredhat-appstudio
-
set
QUAY_TAG
to the specific image/commit sha you want to test against -
leave
QUAY_E2E_ORGANIZATION
andQUAY_TOKEN
the same, pointing to your personal quay repo, so that the artifact cache can still push its updates -
image references will become
quay.io/redhat-appstudio/hacbs-jvm-<controller|cache|build-request-processor>:$QUAY_TAG
Common steps regardless of using developer images you build yourself or official quay.io/redhat-appstudio
images:
-
artifact cache images will be pushed to
quay.io/$QUAY_E2E_ORGANIZATION/….
usingQUAY_TOKEN
to authenticate on the push -
download
helm
viacurl -L https://mirror.openshift.com/pub/openshift-v4/clients/helm/latest/helm-linux-amd64 -o /usr/local/bin/helm
-
mimic the setting of
CLUSTER_KUBECONFIG
andKCP_KUBECONFIG
as you have them set in your infra-deploymentspreview.env
file -
from KCP, enter the
hacbs
workspace in the infra-deployments bootstrapped env, i.e.oc ws hacbs
-
from KCP, create a test namespace i.e.
oc create ns jvm-bld-test
-
from KCP, enter that new test namespace i.e.
oc project jvm-bld-test
orkubectl config set-context --current --namespace=jvm-bld-test
-
run
./deploy/init-hacbs-user-workspace-sa-rbac.sh
out of your clone of this repo against your compute/workload cluster where you have setHACBS_WORKSPACE_NAMESPACE
to your KCP test namesapce i.e.jvm-build-test
-
run
./deploy/init-hacbs-user-workspace.sh
out of your clone of this repo to initialize you KCP test namespace with the artifact cache andTasks
needed to run our testPipelines
andPipelineRuns
-
then go to
./hack/examples
and pick whichPipeline
andPipelineRun
test to run.
The OpenShift E2E test is programmed to run a test with following steps:
-
Create a new project in targeted OpenShift cluster and run the build pipeline which contains a Maven task from this repo to build the simple java test project
-
Make sure the pipeline succeeds and all related artifactbuilds and dependecybuilds (triggered after pipeline completion) finish successfully
-
Check that all "contaminated" builds are resolved
-
Verify that triggering a second build accesses dependencies that are cached from a previous build
-
Verify that the correct JDK version is identified in dependencybuilds
-
Check that maven/gradle logs/sources are found in rebuilt artifacts
Before running the test, you need to export couple of env vars that reference container images for the operator, cache and reqprocessor. Some existing images can be found at redhat-appstudio quay.io org (search for keyword "jvm")
Also you need to specify your quay.io username that will be used for pushing rebuilt dependencies in a format: quay.io/$QUAY_USERNAME/test-images
. Make sure the repo "test-images" exists in your account and is publicly available.
export QUAY_USERNAME=<your-quay-io-account-username>
export JVM_BUILD_SERVICE_IMAGE=
export JVM_BUILD_SERVICE_CACHE_IMAGE=
export JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE=
./deploy/openshift-ci.sh
make openshift-e2e