Skip to content

Commit

Permalink
* Add update script update-quarkus.sh storing details in diff-update …
Browse files Browse the repository at this point in the history
…folder

  * run quarkus update
  * save git diff
  * run maven test or maven package install if its an extension
  * generate csv of pom dependencies
  * output all diffs
* Fix labs
  * content changes
  * add missing solution projects quarkus-metrics-data-consumer, quarkus-appinfo-application
* Generate csv of solution-project-dependencies
* Include solution-project-dependencies in lab description (rendered as table from csv)
  • Loading branch information
christofluethi committed Jun 11, 2024
1 parent 74de97c commit 7ffd519
Show file tree
Hide file tree
Showing 88 changed files with 3,357 additions and 324 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ code/appinfo
META-INF
**.iml
.hugo_build.lock
target
target
/.quarkus
/diff-update
27 changes: 27 additions & 0 deletions assets/css/dep.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
table.dependencies {
font-size: 0.8em;
margin-bottom: 15px;
border-collapse: collapse;
padding: 0;
width: 100%;
}

table.dependencies caption {
font-size: 1.5em;
color: #1E5A96;
margin: 0.5em 0 0.75em;
}

table.dependencies tr {
padding: 0.35em;
}

table.dependencies td,
table.dependencies th {
padding: 5px 15px 5px 15px;
}

table.dependencies th {
font-weight: bold;
text-transform: uppercase;
}
12 changes: 6 additions & 6 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ lab_code_basedir = "/code/"
solution_code_basedir = "/solution/"

#versions
quarkusVersion = "3.10.0"
quarkusVersion = "3.11.1"
mutinyVersion = "2.5.1"
confluentKafkaAvroVersion = "7.5.1"
openJdkImage = "registry.access.redhat.com/ubi8/openjdk-17:1.16"
ubiQuarkusNativeImage = "quay.io/quarkus/ubi-quarkus-native-image:22.3-java17"
confluentKafkaAvroVersion = "7.6.1"
openJdkImage = "registry.access.redhat.com/ubi8/openjdk-21:1.19"
ubiQuarkusNativeImage = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21"
quarkusMicroImage = "quay.io/quarkus/quarkus-micro-image:2.0"
strimziVersion = "quay.io/strimzi/kafka:0.37.0-kafka-3.5.1"
jaegerTracingImage = " quay.io/jaegertracing/all-in-one:1.50.0"
strimziVersion = "quay.io/strimzi/kafka:0.41.0-kafka-3.7.0"
jaegerTracingImage = " quay.io/jaegertracing/all-in-one:1.57.0"
grafanaImage = "docker.io/grafana/grafana:latest"
prometheusImage = "quay.io/prometheus/prometheus:latest"

Expand Down
31 changes: 15 additions & 16 deletions content/en/docs/01.0/12_quarkus.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,18 @@ public class ApplicationImpl extends Application {
}

static {
DisabledInitialContextManager.register();
System.setProperty("java.util.concurrent.ForkJoinPool.common.threadFactory",
"io.quarkus.bootstrap.forkjoin.QuarkusForkJoinWorkerThreadFactory");
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
System.setProperty("io.netty.allocator.maxOrder", "1");
System.setProperty("io.netty.machineId", "e2:dd:dc:62:56:a3:ba:f8");
ProfileManager.setLaunchMode(LaunchMode.NORMAL);
System.setProperty("io.netty.machineId", "d5:17:d2:22:b3:dd:20:8a");
System.setProperty("io.netty.allocator.maxOrder", "3");
System.setProperty("logging.initial-configurator.min-level", "500");
System.setProperty("io.quarkus.security.http.test-if-basic-auth-implicitly-required", "true");
LaunchMode.set(LaunchMode.NORMAL);
StepTiming.configureEnabled();
Timing.staticInitStarted();
ExecutionModeManager.staticInit();
Timing.staticInitStarted(false);
Config.ensureInitialized();
LOG = Logger.getLogger("io.quarkus.application");
StartupContext var0 = new StartupContext();
Expand All @@ -163,21 +169,14 @@ public class ApplicationImpl extends Application {
StepTiming.configureStart();
((StartupTask)(new setupLoggingStaticInit-1235809433())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new ioThreadDetector-1463825589())).deploy(var0);
/* ... */
((StartupTask)(new ResteasyReactiveProcessor.serverSerializers1997124575())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new blockingOP558072755())).deploy(var0);
((StartupTask)(new ResteasyReactiveProcessor.setupEndpoints615463616())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new build163995889())).deploy(var0);
((StartupTask)(new ResteasyReactiveProcessor.setupDeployment713137389())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new staticInit-1777814589())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new initStatic1190120725())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new generateResources-1025303321())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new setupResteasyInjection2143006352())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask)(new staticInit-210558872())).deploy(var0);
((StartupTask)(new ResteasyReactiveProcessor.addDefaultAuthFailureHandler1048820038())).deploy(var0);
StepTiming.printStepTime(var0);
} catch (Throwable var2) {
ApplicationStateNotification.notifyStartupFailed(var2);
Expand Down
28 changes: 8 additions & 20 deletions content/en/docs/01.0/13_development.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ description: >
Quarkus from the development perspective
---


## Development Mode

Quarkus comes with a built-in development mode. Run your application with:
Expand Down Expand Up @@ -66,7 +65,11 @@ jar, do not attempt to run normal devmode.
Now you need to connect your local agent to the remote host, using the `remote-dev` command:

```s
./mvnw quarkus:remote-dev -Ddebug=false -Dquarkus.package.type=mutable-jar -Dquarkus.live-reload.url=http://my-remote-host:8080 -Dquarkus.live-reload.password=changeit
./mvnw quarkus:remote-dev \
-Ddebug=false \
-Dquarkus.package.type=mutable-jar \
-Dquarkus.live-reload.url=http://my-remote-host:8080 \
-Dquarkus.live-reload.password=changeit
```

Now every time you refresh the browser you should see any changes you have made locally immediately visible in the
Expand Down Expand Up @@ -144,24 +147,9 @@ the code in the `{{% param solution_code_basedir %}}dev-services` folder. The ex
provision some data and uses the `hibernate-orm-panache` implementation which we will not cover any further. However,
this does not change how the devservices work.

Our pom.xml looks like this:
```xml
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
</dependency>
<!-- ... -->
</dependencies>
```
The dev-services `pom.xml` contains the following dependencies:

{{< csvtable csv="/solution/dev-services/dependencies.csv" class="dependencies" >}}

In our application properties we have configured the datasource type:
```properties
Expand Down
3 changes: 2 additions & 1 deletion content/en/docs/01.0/14_extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ cannot annotate them.
For this to achieve we could create a simple extension:

```s
mvn io.quarkus:quarkus-maven-plugin:{{% param "quarkusVersion" %}}:create-extension -N -DgroupId=ch.puzzle.quarkustechlab -DextensionId=message-converter-as-beans -DwithoutTests
mvn io.quarkus:quarkus-maven-plugin:{{% param "quarkusVersion" %}}:create-extension -N \
-DgroupId=ch.puzzle.quarkustechlab -DextensionId=message-converter-as-beans -DwithoutTests
```

In this simple extensions we only need the deployment module.
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/01.0/15_vertx.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ uni.subscribe()
.with(it -> System.out.println("File content is: " + it));
```

To dive further into the Mutiny framework consider checking their [documentation](https://smallrye.io/smallrye-mutiny/guides).
To dive further into the Mutiny framework consider checking their [documentation](https://smallrye.io/smallrye-mutiny/latest/guides/imperative-to-reactive/).
2 changes: 1 addition & 1 deletion content/en/docs/01.0/18_solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Chapter | Chapter Name | Solution Project
8.2 | Reactive messaging with Kafka | `quarkus-reactive-messaging-producer`, `quarkus-reactive-messaging-consumer` and `kafka-stack`
8.3 | Cloud Events | `quarkus-cloudevents-producer`, `quarkus-cloudevents-consumer` and `kafka-stack`
9.2 | Tracing with Jaeger | `quarkus-opentelemetry-jaeger` and `opentelemetry-stack`
9.3 | Metrics with micrometer | `quarkus-metrics-data-producer` and `opentelemetry-stack`
9.3 | Metrics with micrometer | `quarkus-metrics-data-producer`, `quarkus-metrics-data-consumer` and `opentelemetry-stack`
10 | Quarkus Extensions | `techlab-extension-appinfo` and `quarkus-appinfo-application`
57 changes: 25 additions & 32 deletions content/en/docs/02.0/21_first-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ To create your first Quarkus application you have several possibilities:
* Create your application with the Quickstart UI [code.quarkus.io](https://code.quarkus.io/)
* Use IntelliJ or eclipse plugins which will assist creating projects (these are usually also based on code.quarkus.io)

### Maven dependencies reference

The solution for this lab uses the following dependencies in the `pom.xml`:

{{< csvtable csv="/solution/quarkus-getting-started/dependencies.csv" class="dependencies" >}}

Be aware that `quarkus.platform.version` and `quarkus-plugin.version` should be set to `{{% param "quarkusVersion" %}}` in your `pom.xml`.

### Task {{% param sectionnumber %}}.1: Create your application with maven

Expand Down Expand Up @@ -46,7 +53,7 @@ live reloading on each API call. Try hitting the API and test the
curl http://localhost:8080/hello
```

You should get the `Hello from RESTEasy Reactive` response in your console. Other RESTeasy functionalities work like they always do.
You should get the `Hello from Quarkus REST` response in your console. Other RESTeasy functionalities work like they always do.
For further information on basic REST interaction with Quarkus see [Documentation](https://quarkus.io/guides/rest-json).


Expand Down Expand Up @@ -128,13 +135,15 @@ public class ApplicationImpl extends Application {

static {
DisabledInitialContextManager.register();
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
System.setProperty("java.util.concurrent.ForkJoinPool.common.threadFactory", "io.quarkus.bootstrap.forkjoin.QuarkusForkJoinWorkerThreadFactory");
System.setProperty("logging.initial-configurator.min-level", "500");
System.setProperty("io.netty.allocator.maxOrder", "3");
System.setProperty("io.netty.machineId", "a2:a0:88:71:ba:49:9f:1a");
ProfileManager.setLaunchMode(LaunchMode.NORMAL);
System.setProperty("logging.initial-configurator.min-level", "500");
System.setProperty("io.netty.machineId", "80:90:28:d0:a0:e1:64:c8");
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
System.setProperty("io.quarkus.security.http.test-if-basic-auth-implicitly-required", "true");
LaunchMode.set(LaunchMode.NORMAL);
StepTiming.configureEnabled();
ExecutionModeManager.staticInit();
Timing.staticInitStarted(false);
Config.ensureInitialized();
LOG = Logger.getLogger("io.quarkus.application");
Expand All @@ -143,50 +152,34 @@ public class ApplicationImpl extends Application {

try {
StepTiming.configureStart();
((StartupTask) (new MutinyProcessor.buildTimeInit521613965())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new VertxCoreProcessor.ioThreadDetector1463825589())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new BlockingOperationControlBuildStep.blockingOP558072755())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new LoggingResourceProcessor.setupLoggingStaticInit2062061316())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new VirtualThreadsProcessor.setup657958880())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new ResteasyReactiveProcessor.addDefaultAuthFailureHandler1457820534())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new SmallRyeContextPropagationProcessor.buildStatic677493008())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new NativeImageConfigBuildStep.build282698227())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new VertxProcessor.currentContextFactory166049300())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new JacksonProcessor.jacksonSupport1959914842())).deploy(var0);
((StartupTask)(new NativeImageConfigBuildStep.build282698227())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new SyntheticBeansProcessor.initStatic1190120725())).deploy(var0);
((StartupTask)(new VertxCoreProcessor.ioThreadDetector1463825589())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new ArcProcessor.generateResources844392269())).deploy(var0);
/* ... */
((StartupTask)(new ResteasyReactiveProcessor.serverSerializers1997124575())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new ResteasyReactiveProcessor.setupEndpoints1082683577())).deploy(var0);
((StartupTask)(new ResteasyReactiveProcessor.setupEndpoints615463616())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new ResteasyReactiveProcessor.serverSerializers168685733())).deploy(var0);
((StartupTask)(new ResteasyReactiveProcessor.setupDeployment713137389())).deploy(var0);
StepTiming.printStepTime(var0);
((StartupTask) (new ResteasyReactiveProcessor.setupDeployment713137389())).deploy(var0);
((StartupTask)(new ResteasyReactiveProcessor.addDefaultAuthFailureHandler1048820038())).deploy(var0);
StepTiming.printStepTime(var0);
} catch (Throwable var2) {
ApplicationStateNotification.notifyStartupFailed(var2);
var0.close();
throw (Throwable) (new RuntimeException("Failed to start quarkus", var2));
throw (Throwable)(new RuntimeException("Failed to start quarkus", var2));
}
}
/* ... */
}
```

Our application contains RESTEasy Reactive endpoints and uses different Serializers. You may find a line containing `((StartupTask) (new ResteasyReactiveProcessor.serverSerializers168685733())).deploy(var0);` in the static block.
Our application contains REST endpoints and uses different Serializers. You may find a line containing `((StartupTask)(new ResteasyReactiveProcessor.serverSerializers1997124575())).deploy(var0);` in the static block.
Where does this come from? Open the file `ResteasyReactiveProcessor$serverSerializers...` from the `io/quarkus/deployment/steps` folder. You may find the deploy code for the resteasy de-/serializers.
```java
// $FF: synthetic class
public class ResteasyCommonProcessor$setupResteasyInjection2143006352 implements StartupTask {
public class ResteasyReactiveProcessor$serverSerializers1997124575 implements StartupTask {

/* removed for simplicity */

Expand Down
Loading

0 comments on commit 7ffd519

Please sign in to comment.