Skip to content

Commit 7beffb7

Browse files
authored
Merge pull request #1977 from rnc/PIPELINE
Containerbuild / konflux
2 parents 1e3a8ed + 739d5ee commit 7beffb7

File tree

335 files changed

+411
-64711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+411
-64711
lines changed

deploy/base-development.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ fi
2626
if [ -z "$JBS_S3_SYNC_ENABLED" ]; then
2727
export JBS_S3_SYNC_ENABLED=true
2828
fi
29+
if [ -z "$JBS_CONTAINER_BUILDS" ]; then
30+
export JBS_CONTAINER_BUILDS=false
31+
fi
2932
if [ -z "$JBS_MAX_MEMORY" ]; then
3033
export JBS_MAX_MEMORY=4096
3134
fi
@@ -65,6 +68,7 @@ ${GIT_DEPLOY_TOKEN}
6568
${GIT_DEPLOY_URL}
6669
${GIT_DISABLE_SSL_VERIFICATION}
6770
${JBS_BUILD_IMAGE_SECRET}
71+
${JBS_CONTAINER_BUILDS}
6872
${JBS_GIT_CREDENTIALS}
6973
${JBS_QUAY_IMAGE}
7074
${JBS_MAX_MEMORY}

deploy/base/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ metadata:
55
name: jvm-build-config
66
spec:
77
enableRebuilds: true
8+
containerBuilds: ${JBS_CONTAINER_BUILDS}
89
mavenBaseLocations:
910
maven-repository-300-jboss: "https://repository.jboss.org/nexus/content/groups/public/"
1011
maven-repository-301-confluent: "https://packages.confluent.io/maven"
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

4-
commonLabels:
5-
app: hacbs-jvm-console
64
resources:
7-
- deployment.yaml
8-
- sa.yaml
9-
- rbac.yaml
10-
- service.yaml
11-
- route.yaml
5+
- deployment.yaml
6+
- sa.yaml
7+
- rbac.yaml
8+
- service.yaml
9+
- route.yaml
10+
labels:
11+
- includeSelectors: true
12+
pairs:
13+
app: hacbs-jvm-console

deploy/crds/base/jvmbuildservice.io_jbsconfigs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ spec:
9292
workerThreads:
9393
type: string
9494
type: object
95+
containerBuilds:
96+
description: Whether to use a standard build pipeline or build in
97+
a Docker container via buildah.
98+
type: boolean
9599
enableRebuilds:
96100
type: boolean
97101
gitSourceArchive:

deploy/minikube-ci.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export JVM_BUILD_SERVICE_IMAGE=quay.io/$QUAY_USERNAME/hacbs-jvm-controller
3838
# Represents an empty dockerconfig.json
3939
export JBS_BUILD_IMAGE_SECRET="ewogICAgImF1dGhzIjogewogICAgfQp9Cg==" # notsecret
4040
export JBS_S3_SYNC_ENABLED="\"false\""
41+
export JBS_CONTAINER_BUILDS=false
4142
export JBS_MAX_MEMORY=4096
4243

4344
cat $DIR/base/namespace/namespace.yaml | envsubst '${JBS_WORKER_NAMESPACE}' | kubectl apply -f -
@@ -55,6 +56,7 @@ ${GIT_DEPLOY_TOKEN}
5556
${GIT_DEPLOY_URL}
5657
${GIT_DISABLE_SSL_VERIFICATION}
5758
${JBS_BUILD_IMAGE_SECRET}
59+
${JBS_CONTAINER_BUILDS}
5860
${JBS_GIT_CREDENTIALS}
5961
${JBS_QUAY_IMAGE}
6062
${JBS_MAX_MEMORY}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

4-
commonLabels:
5-
app: hacbs-jvm-operator
64
resources:
7-
- deployment.yaml
8-
- namespace.yaml
9-
- sa.yaml
10-
- rbac.yaml
11-
- metricservice.yaml
5+
- deployment.yaml
6+
- namespace.yaml
7+
- sa.yaml
8+
- rbac.yaml
9+
- metricservice.yaml
10+
labels:
11+
- includeSelectors: true
12+
pairs:
13+
app: hacbs-jvm-operator

go.mod

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ go 1.22.0
55
toolchain go1.22.6
66

77
require (
8-
github.com/CycloneDX/cyclonedx-go v0.9.0
98
github.com/aws/aws-sdk-go v1.54.19
109
github.com/go-logr/logr v1.4.2
11-
github.com/google/go-containerregistry v0.20.1
10+
github.com/google/go-containerregistry v0.20.1 // indirect
1211
github.com/google/uuid v1.6.0
1312
github.com/konflux-ci/image-controller v0.0.0-20240809150447-338fc0d1a859
1413
github.com/onsi/gomega v1.34.1
@@ -42,12 +41,8 @@ require (
4241
github.com/blendle/zapdriver v1.3.1 // indirect
4342
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
4443
github.com/cespare/xxhash/v2 v2.2.0 // indirect
45-
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
4644
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
47-
github.com/docker/cli v26.1.2+incompatible // indirect
48-
github.com/docker/distribution v2.8.3+incompatible // indirect
4945
github.com/docker/docker v26.1.5+incompatible // indirect
50-
github.com/docker/docker-credential-helpers v0.8.0 // indirect
5146
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
5247
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
5348
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
@@ -83,7 +78,6 @@ require (
8378
github.com/josharian/intern v1.0.0 // indirect
8479
github.com/json-iterator/go v1.1.12 // indirect
8580
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
86-
github.com/klauspost/compress v1.17.4 // indirect
8781
github.com/ktr0731/go-ansisgr v0.1.0 // indirect
8882
github.com/ktr0731/go-fuzzyfinder v0.8.0 // indirect
8983
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
@@ -93,28 +87,24 @@ require (
9387
github.com/mattn/go-isatty v0.0.20 // indirect
9488
github.com/mattn/go-runewidth v0.0.15 // indirect
9589
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
96-
github.com/mitchellh/go-homedir v1.1.0 // indirect
9790
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
9891
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
9992
github.com/modern-go/reflect2 v1.0.2 // indirect
10093
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
10194
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
10295
github.com/nsf/termbox-go v1.1.1 // indirect
10396
github.com/opencontainers/go-digest v1.0.0 // indirect
104-
github.com/opencontainers/image-spec v1.1.0 // indirect
10597
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
10698
github.com/pkg/errors v0.9.1 // indirect
10799
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
108100
github.com/prometheus/common v0.51.1 // indirect
109101
github.com/prometheus/procfs v0.12.0 // indirect
110102
github.com/prometheus/statsd_exporter v0.22.7 // indirect
111103
github.com/rivo/uniseg v0.4.4 // indirect
112-
github.com/sirupsen/logrus v1.9.3 // indirect
113104
github.com/spf13/cobra v1.8.0 // indirect
114105
github.com/spf13/pflag v1.0.5 // indirect
115106
github.com/stoewer/go-strcase v1.2.0 // indirect
116107
github.com/tektoncd/triggers v0.27.0 // indirect
117-
github.com/vbatts/tar-split v0.11.5 // indirect
118108
github.com/xlab/treeprint v1.2.0 // indirect
119109
go.opencensus.io v0.24.0 // indirect
120110
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect

go.sum

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ
4848
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
4949
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
5050
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
51-
github.com/CycloneDX/cyclonedx-go v0.9.0 h1:inaif7qD8bivyxp7XLgxUYtOXWtDez7+j72qKTMQTb8=
52-
github.com/CycloneDX/cyclonedx-go v0.9.0/go.mod h1:NE/EWvzELOFlG6+ljX/QeMlVt9VKcTwu8u0ccsACEsw=
5351
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
5452
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
5553
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
@@ -74,8 +72,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
7472
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
7573
github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE=
7674
github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc=
77-
github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M=
78-
github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0=
7975
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
8076
github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g=
8177
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
@@ -522,8 +518,6 @@ github.com/tektoncd/pipeline v0.59.2 h1:hspD31XWToUIFnUFkUitjqGBnW0hd9Q9cVHYbhjp
522518
github.com/tektoncd/pipeline v0.59.2/go.mod h1:VjXZUGLrOy45B35ufbJZ2DLMt+TSJ3R4ZjKJvi7RWg4=
523519
github.com/tektoncd/triggers v0.27.0 h1:c55e/YJF6Vs5BEarqDYksFYuR4sFbmAVEqrLNPZvXUk=
524520
github.com/tektoncd/triggers v0.27.0/go.mod h1:DkkAkdSd9aAW9RklUVyFRKQ8kONmZQw4Ur2G1r3wFQo=
525-
github.com/terminalstatic/go-xsd-validate v0.1.5 h1:RqpJnf6HGE2CB/lZB1A8BYguk8uRtcvYAPLCF15qguo=
526-
github.com/terminalstatic/go-xsd-validate v0.1.5/go.mod h1:18lsvYFofBflqCrvo1umpABZ99+GneNTw2kEEc8UPJw=
527521
github.com/tidwall/gjson v1.12.1 h1:ikuZsLdhr8Ws0IdROXUS1Gi4v9Z4pGqpX/CvJkxvfpo=
528522
github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
529523
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
@@ -536,12 +530,6 @@ github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C
536530
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs=
537531
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
538532
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
539-
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
540-
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
541-
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
542-
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
543-
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
544-
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
545533
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
546534
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
547535
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/BuildVerifyCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
214214
}
215215
for (var i : contaminatedGavs.entrySet()) {
216216
if (!i.getValue().getAllowed()) {
217-
gavs.removeAll(i.getValue().getContaminatedArtifacts());
218-
// i.getValue().getContaminatedArtifacts().forEach(gavs::remove);
217+
i.getValue().getContaminatedArtifacts().forEach(gavs::remove);
219218
}
220219
}
221220
generateBuildSbom();
@@ -241,6 +240,7 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
241240
}
242241
}
243242

243+
// TODO: ### For container-builds, should sbom generation be delegated to the task within that? If it supports it?
244244
private void generateBuildSbom() {
245245
if (buildInfoPath == null) {
246246
Log.infof("Not generating build sbom, path not set");

java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/TagDeployCommand.java

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
1717
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
18-
import com.amazonaws.regions.Regions;
18+
import com.amazonaws.regions.Region;
19+
import com.amazonaws.regions.RegionUtils;
1920
import com.amazonaws.services.codeartifact.AWSCodeArtifactClientBuilder;
2021
import com.amazonaws.services.codeartifact.model.GetAuthorizationTokenRequest;
2122
import com.amazonaws.util.AwsHostNameUtils;
22-
import com.redhat.hacbs.container.deploy.git.Git;
2323
import com.redhat.hacbs.container.deploy.mavenrepository.CodeArtifactRepository;
2424
import com.redhat.hacbs.container.deploy.mavenrepository.MavenRepositoryDeployer;
2525

@@ -48,36 +48,6 @@ public class TagDeployCommand implements Runnable {
4848
@CommandLine.Option(names = "--mvn-repo")
4949
String mvnRepo;
5050

51-
@ConfigProperty(name = "git.deploy.token")
52-
Optional<String> gitToken;
53-
54-
// If endpoint is null then default GitHub API endpoint is used. Otherwise:
55-
// for GitHub, endpoint like https://api.github.com
56-
// for GitLib, endpoint like https://gitlab.com
57-
@CommandLine.Option(names = "--git-url")
58-
String gitURL;
59-
60-
@CommandLine.Option(names = "--git-identity")
61-
String gitIdentity;
62-
63-
@CommandLine.Option(names = "--git-disable-ssl-verification")
64-
boolean gitDisableSSLVerification;
65-
66-
@CommandLine.Option(names = "--git-reuse-repository")
67-
boolean reuseRepository;
68-
69-
@CommandLine.Option(names = "--image-id")
70-
String imageId;
71-
72-
@CommandLine.Option(required = true, names = "--scm-uri")
73-
String scmUri;
74-
75-
@CommandLine.Option(required = true, names = "--scm-commit")
76-
String commit;
77-
78-
@CommandLine.Option(required = true, names = "--source-path")
79-
Path sourcePath;
80-
8151
@Inject
8252
BootstrapMavenContext mvnCtx;
8353

@@ -86,21 +56,6 @@ public void run() {
8656

8757
var deploymentPath = Path.of(artifactDirectory);
8858

89-
// TODO: Should we write out to a 'DependencyPipelineResults' a GitArchive?
90-
Git.GitStatus archivedSourceTags = new Git.GitStatus();
91-
// Save the source first regardless of deployment checks
92-
if (isNotEmpty(gitIdentity) && gitToken.isPresent()) {
93-
var git = Git.builder(gitURL, gitIdentity, gitToken.get(), gitDisableSSLVerification);
94-
if (reuseRepository) {
95-
git.initialise(scmUri);
96-
} else {
97-
Log.warnf("Not reusing repository; creating under %s", scmUri);
98-
git.create(scmUri);
99-
}
100-
Log.infof("Pushing changes back to URL %s", git.getName());
101-
archivedSourceTags = git.add(sourcePath, commit, imageId);
102-
}
103-
10459
if (!deploymentPath.toFile().exists()) {
10560
Log.warnf("No deployed artifacts found. Has the build been correctly configured to deploy?");
10661
throw new RuntimeException("Deploy failed");
@@ -127,11 +82,11 @@ public void run() {
12782
String domainOwner = repo.substring(firstDash + 1, repo.indexOf("."));
12883
Log.infof("Generating AWS token for domain %s, owner %s, region %s", domain, domainOwner, parsedRegion);
12984

130-
Regions region = Regions.fromName(parsedRegion);
85+
Region region = RegionUtils.getRegion(parsedRegion);
13186
var awsClient = AWSCodeArtifactClientBuilder.standard()
13287
.withCredentials(awsProfile.isEmpty() ? DefaultAWSCredentialsProviderChain.getInstance()
13388
: new ProfileCredentialsProvider(awsProfile.get()))
134-
.withRegion(region).build();
89+
.withRegion(region.getName()).build();
13590
mvnPassword = Optional.of(awsClient.getAuthorizationToken(
13691
new GetAuthorizationTokenRequest().withDomain(domain).withDomainOwner(domainOwner))
13792
.getAuthorizationToken());

0 commit comments

Comments
 (0)