Skip to content

Commit

Permalink
Merge branch 'main' into rest-api/artifact-version-state
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWittmann authored Mar 5, 2024
2 parents 02ca79f + f2c4f27 commit 3154558
Show file tree
Hide file tree
Showing 15 changed files with 526 additions and 480 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/image-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ name: Trivy Image Scan

on:
workflow_dispatch:
inputs:
image:
description: 'Image to be scanned'
default: quay.io/apicurio/apicurio-registry:latest-snapshot
required: true
schedule:
- cron: "0 6 * * *"

jobs:
call-image-scan-registry:
uses: Apicurio/apicurio-gh-workflows/.github/workflows/image-scan.yaml@main
with:
image: ${{ github.event.inputs.image }}
image: quay.io/apicurio/apicurio-registry:latest-snapshot
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.1</version>
<version>3.2.0</version>
<executions>
<execution>
<goals>
Expand Down
14 changes: 8 additions & 6 deletions distro/docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ This setup contains a fully configured Apicurio Registry package already integra

Here is the port mapping:
- 8080 for Keycloak
- 8081 for the Registry
- 8081 for the Registry API
- 8888 for the Registry UI


#### Starting the environment

Expand All @@ -57,15 +59,15 @@ docker system prune --volumes
The Keycloak instance is already configured, you don't have to create the realms manually.

At the first start there are no default users added to Keycloak. Please navigate to:
`http://YOUR_IP:8090`
`http://YOUR_IP:8080`

The default credentials for Keycloak are: `admin` and the password can be found in the previously generated `.env` file, under `KEYCLOAK_PASSWORD`.
The default credentials for Keycloak are: `admin` and the password is also `admin`.

Select Registry realm and add a user to it. You'll need to also assign the appropriated role.


#### Login to Apicurio and Keycloak

Apicurio URL: `http://YOUR_IP:8080`
Keycloak URL: `http://YOUR_IP:8090`
Apicurio Registry UI URL: `http://YOUR_IP:8888`
Apicurio Registry API URL: `http://YOUR_IP:8081`
Keycloak URL: `http://YOUR_IP:8080`

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ volumes:
services:
keycloak-server:
container_name: keycloak-apicurio
image: quay.io/keycloak/keycloak:19.0.2
image: quay.io/keycloak/keycloak:23.0.7
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_HOSTNAME_URL: http://localhost:8080
KC_HOSTNAME: "localhost"
KC_HOSTNAME_PORT: "8080"
KC_HOSTNAME_STRICT_BACKCHANNEL: "false"
command:
- start-dev
- --import-realm
Expand All @@ -27,22 +29,39 @@ services:
POSTGRES_USER: apicurio-registry
POSTGRES_PASSWORD: password

app:
image: apicurio/apicurio-registry-sql:latest-snapshot
backend:
image: quay.io/apicurio/apicurio-registry@sha256:3cf8b1a8b67ef1efff872556f642751f432eec8d1b704d45adececeff86a3222
environment:
REGISTRY_DATASOURCE_URL: 'jdbc:postgresql://database-apicurio:5432/apicurio-registry'
REGISTRY_DATASOURCE_USERNAME: apicurio-registry
REGISTRY_DATASOURCE_PASSWORD: password
REGISTRY_STORAGE_KIND: "sql"
REGISTRY_STORAGE_DB_KIND: "postgresql"
AUTH_ENABLED: "true"
KEYCLOAK_REALM: registry
QUARKUS_HTTP_PORT: 8081
LOG_LEVEL: "DEBUG"
KEYCLOAK_URL: "http://localhost:8080"
LOG_LEVEL: "DEBUG"
REGISTRY_UI_CONFIG_AUTH_KEYCLOAK_URL: "http://localhost:8080"
QUARKUS_OIDC_AUTH_SERVER_URL: "http://keycloak-server:8080/realms/registry"
TOKEN_ENDPOINT: "http://keycloak-server:8080/realms/registry/protocol/openid-connect/token"
KEYCLOAK_API_CLIENT_ID: registry-api
KEYCLOAK_UI_CLIENT_ID: apicurio-registry
REGISTRY_AUTH_URL_CONFIGURED: "http://host.docker.internal:8080/realms/registry"
REGISTRY_UI_AUTH_OIDC_CLIENTID: apicurio-registry
QUARKUS_OIDC_TLS_VERIFICATION: "none"
CORS_ALLOWED_ORIGINS: '*'
QUARKUS_PROFILE: "prod"
ports:
- 8081:8081
depends_on:
- postgres
- keycloak-server

ui:
image: quay.io/apicurio/apicurio-registry-ui@sha256:ec60369e36cafd68e7af6f87df397c54975bbb71530744810822cf4aab2159d9
environment:
REGISTRY_API_URL: "http://localhost:8081/apis/registry/v3"
ports:
- 8888:8080
depends_on:
- backend
- keycloak-server
2 changes: 1 addition & 1 deletion go-sdk/generate-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ chown -R $UID /registry/go-sdk &&
chgrp -R $GID /registry/go-sdk
END

docker run --rm -v $SCRIPT_DIR/..:/registry golang:1.21.6 /bin/bash -c "$SCRIPT"
docker run --platform linux/amd64 --rm -v $SCRIPT_DIR/..:/registry golang:1.21.6 /bin/bash -c "$SCRIPT"
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.apicurio.deployment;

import io.fabric8.kubernetes.api.model.Namespace;
import io.fabric8.kubernetes.api.model.PodList;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import io.fabric8.kubernetes.client.LocalPortForward;
import io.fabric8.kubernetes.client.dsl.LogWatch;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.openshift.api.model.Route;
import io.fabric8.openshift.client.DefaultOpenShiftClient;
Expand All @@ -17,6 +19,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CompletableFuture;
Expand All @@ -38,6 +41,8 @@ public class RegistryDeploymentManager implements TestExecutionListener {
static KubernetesClient kubernetesClient;
static LocalPortForward registryPortForward;

static List<LogWatch> logWatch;

@Override
public void testPlanExecutionStarted(TestPlan testPlan) {
if (Boolean.parseBoolean(System.getProperty("cluster.tests"))) {
Expand Down Expand Up @@ -71,6 +76,10 @@ public void testPlanExecutionFinished(TestPlan testPlan) {
}
}

if (logWatch != null && !logWatch.isEmpty()) {
logWatch.forEach(LogWatch::close);
}

final Resource<Namespace> namespaceResource = kubernetesClient.namespaces()
.withName(TEST_NAMESPACE);
namespaceResource.delete();
Expand Down Expand Up @@ -99,12 +108,15 @@ private void handleInfraDeployment() throws Exception {
if (Boolean.parseBoolean(System.getProperty("deployInMemory"))) {
LOGGER.info("Deploying In Memory Registry Variant with image: {} ##################################################", System.getProperty("registry-in-memory-image"));
InMemoryDeploymentManager.deployInMemoryApp(System.getProperty("registry-in-memory-image"));
logWatch = streamPodLogs("apicurio-registry-memory");
} else if (Boolean.parseBoolean(System.getProperty("deploySql"))) {
LOGGER.info("Deploying SQL Registry Variant with image: {} ##################################################", System.getProperty("registry-sql-image"));
SqlDeploymentManager.deploySqlApp(System.getProperty("registry-sql-image"));
logWatch = streamPodLogs("apicurio-registry-sql");
} else if (Boolean.parseBoolean(System.getProperty("deployKafka"))) {
LOGGER.info("Deploying Kafka SQL Registry Variant with image: {} ##################################################", System.getProperty("registry-kafkasql-image"));
KafkaSqlDeploymentManager.deployKafkaApp(System.getProperty("registry-kafkasql-image"));
logWatch = streamPodLogs("apicurio-registry-kafka");
}
}

Expand Down Expand Up @@ -180,4 +192,19 @@ private static void deployResource(String resource) {
kubernetesClient.pods()
.inNamespace(TEST_NAMESPACE).waitUntilReady(60, TimeUnit.SECONDS);
}

private static List<LogWatch> streamPodLogs(String container) {
List<LogWatch> logWatchList = new ArrayList<>();

PodList podList = kubernetesClient.pods().inNamespace(TEST_NAMESPACE).withLabel("app", container).list();

podList.getItems().forEach(p -> logWatchList.add(kubernetesClient.pods()
.inNamespace(TEST_NAMESPACE)
.withName(p.getMetadata().getName())
.inContainer(container)
.tailingLines(10)
.watchLog(System.out)));

return logWatchList;
}
}
2 changes: 1 addition & 1 deletion operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<awaitility.version>4.2.0</awaitility.version>
<kubernetes-client-java-gen.version>6.10.0</kubernetes-client-java-gen.version>
<assertj.core.version>3.25.1</assertj.core.version>
<assertj.core.version>3.25.3</assertj.core.version>
<bouncycastle.version>1.70</bouncycastle.version>
<!-- ATTENTION! The Quarkus version needs to be aligned with the Quarkus Operator SDK -->
<!-- TODO: possibly stabilize on something shared with the rest of the repo -->
Expand Down
30 changes: 15 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,23 @@

<!-- Schema types -->
<avro.version>1.11.3</avro.version>
<wire-schema.version>4.9.3</wire-schema.version>
<wire-compiler.version>4.9.3</wire-compiler.version>
<okio-jvm.version>3.7.0</okio-jvm.version>
<okio.version>3.7.0</okio.version>
<okio-fake-file-system.version>3.7.0</okio-fake-file-system.version>
<wire-schema.version>4.9.7</wire-schema.version>
<wire-compiler.version>4.9.7</wire-compiler.version>
<okio-jvm.version>3.8.0</okio-jvm.version>
<okio.version>3.8.0</okio.version>
<okio-fake-file-system.version>3.8.0</okio-fake-file-system.version>
<icu4j.version>74.2</icu4j.version>
<protobuf.version>3.25.2</protobuf.version>
<xmlsec.version>4.0.1</xmlsec.version>
<protobuf.googleapi.types.version>2.31.0</protobuf.googleapi.types.version>
<protobuf.version>3.25.3</protobuf.version>
<xmlsec.version>4.0.2</xmlsec.version>
<protobuf.googleapi.types.version>2.34.0</protobuf.googleapi.types.version>
<wsdl4j.version>1.6.3</wsdl4j.version>
<google.truth.extension.version>1.3.0</google.truth.extension.version>
<google.truth.extension.version>1.4.1</google.truth.extension.version>

<!-- Picocli -->
<picocli.version>4.6.3</picocli.version>

<!-- Confluent API / client -->
<confluent.version>7.5.3</confluent.version>
<confluent.version>7.6.0</confluent.version>

<!-- Default Quarkus configuration profile -->
<quarkus.profile>dev</quarkus.profile>
Expand Down Expand Up @@ -182,7 +182,7 @@
<!-- Dependency versions -->
<lombok.version>1.18.30</lombok.version>
<h2.version>1.4.199</h2.version>
<commons-codec.version>1.16.0</commons-codec.version>
<commons-codec.version>1.16.1</commons-codec.version>
<jboss-slf4j.version>1.2.1.Final</jboss-slf4j.version>
<httpclient.version>4.5.14</httpclient.version>
<apicurio-common-rest-client.version>0.1.18.Final</apicurio-common-rest-client.version>
Expand All @@ -203,7 +203,7 @@

<!-- Scala -->
<version.scala-maven.plugin>4.4.0</version.scala-maven.plugin>
<scala.version>2.13.12</scala.version>
<scala.version>2.13.13</scala.version>

<!-- Plugin Versions -->
<version.compiler.plugin>3.12.1</version.compiler.plugin>
Expand All @@ -229,12 +229,12 @@
<os-maven-plugin.version>1.7.1</os-maven-plugin.version>

<!-- Test containers version, should be aligned with version used in Quarkus -->
<test-containers.version>1.19.3</test-containers.version>
<test-containers.version>1.19.6</test-containers.version>
<keycloak.testcontainers.version>1.9.0</keycloak.testcontainers.version>
<keycloak-admin-client.version>21.1.2</keycloak-admin-client.version>
<embedded-postgres.version>2.0.6</embedded-postgres.version>
<strimzi.version>0.105.0</strimzi.version>
<wiremock-jre8.version>2.35.1</wiremock-jre8.version>
<wiremock-jre8.version>2.35.2</wiremock-jre8.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -497,7 +497,7 @@
<dependency>
<artifactId>kotlinx-serialization-core</artifactId>
<groupId>org.jetbrains.kotlinx</groupId>
<version>1.6.2</version>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
Expand Down
Loading

0 comments on commit 3154558

Please sign in to comment.