Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-container build support #2108

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ The following environment variables are configurable and may be set by the user
| GIT_DEPLOY_TOKEN | Authentication token
| GIT_DEPLOY_URL | The URL for the Git service (GitHub/GitLab are supported) to archive the sources
| GIT_DISABLE_SSL_VERIFICATION | Whether to disable SSL verification for Git archival service communication
| JBS_CONTAINER_BUILD | Use Konflux tasks to build using containers (default: `true`)
| JBS_QUAY_IMAGE_CONTROLLER | The name for the operator image repository. Defaults to `hacbs-jvm-controller`.
| JBS_QUAY_IMAGE_TAG | The tag for the images (defaults to `dev`)
| JBS_QUAY_ORG | JBS images are pulled by default from the `QUAY_USERNAME` organization. This may be overridden by changing this
Expand Down
4 changes: 0 additions & 4 deletions deploy/base-development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ fi
if [ -z "$JBS_S3_SYNC_ENABLED" ]; then
export JBS_S3_SYNC_ENABLED=false
fi
if [ -z "$JBS_CONTAINER_BUILDS" ]; then
export JBS_CONTAINER_BUILDS=true
fi
if [ -z "$JBS_MAX_MEMORY" ]; then
export JBS_MAX_MEMORY=4096
fi
Expand Down Expand Up @@ -81,7 +78,6 @@ ${GIT_DEPLOY_TOKEN}
${GIT_DEPLOY_URL}
${GIT_DISABLE_SSL_VERIFICATION}
${JBS_BUILD_IMAGE_SECRET}
${JBS_CONTAINER_BUILDS}
${JBS_GIT_CREDENTIALS}
${JBS_QUAY_IMAGE_CONTROLLER}
${JBS_QUAY_IMAGE_TAG}
Expand Down
1 change: 0 additions & 1 deletion deploy/base/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: jvm-build-config
spec:
enableRebuilds: true
containerBuilds: ${JBS_CONTAINER_BUILDS}
mavenBaseLocations:
maven-repository-300-jboss: "https://repository.jboss.org/nexus/content/groups/public/"
maven-repository-301-confluent: "https://packages.confluent.io/maven"
Expand Down
4 changes: 0 additions & 4 deletions deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ spec:
workerThreads:
type: string
type: object
containerBuilds:
description: Whether to use a standard build pipeline or build in
a Docker container via buildah.
type: boolean
enableRebuilds:
type: boolean
gitSourceArchive:
Expand Down
92 changes: 92 additions & 0 deletions deploy/tasks/maven-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: maven-deployment
annotations:
tekton.dev/pipelines.minVersion: 0.12.1
tekton.dev/tags: image-build, konflux
labels:
app.kubernetes.io/version: "0.1"
build.appstudio.redhat.com/build_type: docker
spec:
description: |-
Takes a OCI archive and deploys the result
params:
- name: IMAGE_URL
description: Reference to the OCI archive
type: string
- name: IMAGE_DIGEST
description: Digest to use
type: string
- name: MVN_REPO
description: Maven repository to deploy to
type: string
- name: MVN_USERNAME
description: Maven repository username
type: string
- name: MVN_PASSWORD
description: Name of the secret holding the Maven repository password
type: string
- name: ORAS_OPTIONS
type: string
description: Optional environment variable string for build-trusted-artifacts
default: ""
- name: JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE
description: Name of the processor image. Useful to override for development.
type: string
default: "quay.io/redhat-appstudio/hacbs-jvm-build-request-processor:dev"
volumes:
- name: shared
emptyDir: {}
- name: workdir
emptyDir: {}
stepTemplate:
volumeMounts:
- mountPath: /shared
name: shared
- mountPath: /var/workdir
name: workdir
steps:
- name: restore-trusted-artifact
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:d6f57d97d19008437680190908fe5444cda380f9c77d0e9efde7153720412e05
script: |
echo "Restoring artifacts to workspace"
URL=$IMAGE_URL
DIGEST=$IMAGE_DIGEST
AARCHIVE=$(oras manifest fetch $ORAS_OPTIONS $URL@$DIGEST | jq --raw-output '.layers[0].digest')
echo "URL $URL DIGEST $DIGEST AARCHIVE $AARCHIVE"
use-archive oci:$URL@$AARCHIVE=/var/workdir/artifacts
env:
- name: ORAS_OPTIONS
value: $(params.ORAS_OPTIONS)
- name: IMAGE_DIGEST
value: $(params.IMAGE_DIGEST)
- name: IMAGE_URL
value: $(params.IMAGE_URL)
- name: deploy
image: $(params.JVM_BUILD_SERVICE_REQPROCESSOR_IMAGE)
securityContext:
runAsUser: 0
computeResources:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: 50m
memory: 512Mi
env:
- name: MVN_REPO
value: $(params.MVN_REPO)
- name: MVN_USERNAME
value: $(params.MVN_USERNAME)
- name: MAVEN_PASSWORD
valueFrom:
secretKeyRef:
name: $(params.MVN_PASSWORD)
key: mavenpassword
args:
- deploy
- --directory=/var/workdir/artifacts
- --mvn-repo=$(params.MVN_REPO)
- --mvn-username=$(params.MVN_USERNAME)
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ spec:
workerThreads:
type: string
type: object
containerBuilds:
description: Whether to use a standard build pipeline or build in
a Docker container via buildah.
type: boolean
enableRebuilds:
type: boolean
gitSourceArchive:
Expand Down
4 changes: 1 addition & 3 deletions openshift-with-appstudio-test/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ func setupConfig(t *testing.T, namespace string) *testArgs {
Name: v1alpha1.JBSConfigName,
},
Spec: v1alpha1.JBSConfigSpec{
EnableRebuilds: true,
ContainerBuilds: true,
EnableRebuilds: true,
MavenBaseLocations: map[string]string{
"maven-repository-300-jboss": "https://repository.jboss.org/nexus/content/groups/public/",
"maven-repository-301-confluent": "https://packages.confluent.io/maven",
Expand Down Expand Up @@ -1070,7 +1069,6 @@ func setupMinikube(t *testing.T, namespace string) *testArgs {
},
Spec: v1alpha1.JBSConfigSpec{
EnableRebuilds: true,
ContainerBuilds: true,
AdditionalRecipes: []string{"https://github.com/jvm-build-service-test-data/recipe-repo"},
BuildSettings: v1alpha1.BuildSettings{
BuildRequestMemory: "512Mi",
Expand Down
6 changes: 2 additions & 4 deletions pkg/apis/jvmbuildservice/v1alpha1/jbsconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const (
ConfigArtifactCacheWorkerThreadsDefault = "50"
ConfigArtifactCacheStorageDefault = "10Gi"

KonfluxBuildDefinitions = "https://github.com/redhat-appstudio/jvm-build-service/main/deploy/tasks/buildah-oci-ta.yaml"
KonfluxBuildDefinitions = "https://github.com/redhat-appstudio/jvm-build-service/main/deploy/tasks/buildah-oci-ta.yaml"
KonfluxMavenDeployDefinitions = "https://github.com/rnc/jvm-build-service/KJB11/deploy/tasks/maven-deployment.yaml"
)

type JBSConfigSpec struct {
Expand All @@ -53,9 +54,6 @@ type JBSConfigSpec struct {
GitSourceArchive GitSourceArchive `json:"gitSourceArchive,omitempty"`
CacheSettings CacheSettings `json:"cacheSettings,omitempty"`
BuildSettings BuildSettings `json:"buildSettings,omitempty"`

// Whether to use a standard build pipeline or build in a Docker container via buildah.
ContainerBuilds bool `json:"containerBuilds,omitempty"`
}

type ImageRegistrySpec struct {
Expand Down
Loading
Loading