Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit d9bb024

Browse files
committed
Update SCDF so that multipleComposedTaskWithArguments succeeds
Step 1. Make sure to remove the version from the docker compose. It is no longer needed and causes older versions of docker to fail Step 2. Update compose files to use the latest version of SCDF 3.x instead of 2.11.x Step 3. Update build image script so that uses java 17 when creating containers Update the DataFlowIT and the Abstract classes it is built on so that multipleComposedTaskWithArguments test passes. Notice that JobParameterJacksonDeserializer and JobParametersJacksonMixIn have been updated. These changes mirror those in #5850. These were required for the test to pass. At the time this PR is merged we can merge accepting those from #5850. Provide docs on how SCDF images are created and pushed Also update the DEFAULT_JDK to Java 17 Update PR based on code review comments * Added log message in case a JobParameter Type is invalid * cleaned up workflow.adoc
1 parent 538d1fe commit d9bb024

File tree

10 files changed

+90
-20
lines changed

10 files changed

+90
-20
lines changed

.github/workflows/build-image.sh

+5-8
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if [ "$TAG" == "" ]; then
1313
exit 1
1414
fi
1515
if [ "$DEFAULT_JDK" = "" ]; then
16-
echo "DEFAULT_JDK not found using 11"
17-
DEFAULT_JDK=11
16+
echo "DEFAULT_JDK not found using 17"
17+
DEFAULT_JDK=17
1818
else
1919
echo "DEFAULT_JDK=$DEFAULT_JDK"
2020
fi
@@ -55,7 +55,8 @@ if [ ! -f "$JAR" ]; then
5555
exit $RC
5656
fi
5757
fi
58-
for v in 8 11 17; do
58+
# TODO add Java 21 when packeto supports it
59+
for v in 17; do
5960
echo "Creating: $REPO:$TAG-jdk$v"
6061
pack build --builder gcr.io/paketo-buildpacks/builder:base \
6162
--path "$JAR" \
@@ -93,9 +94,5 @@ for v in 8 11 17; do
9394
fi
9495
fi
9596
done
96-
#if [ "$PUSH" == "true" ]; then
97-
# echo "Pruning Docker"
98-
# docker system prune -f
99-
# docker system prune --volumes -f
100-
#fi
97+
10198

.github/workflows/build-images.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
shell: bash
8282
env:
8383
TAG: ${{ needs.prepare.outputs.version }}
84-
DEFAULT_JDK: '11'
84+
DEFAULT_JDK: '17'
8585
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
8686
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
8787
DELETE_TAGS: ${{ inputs.delete-tags }}

.github/workflows/workflow.adoc

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
= Workflow Reference
2+
3+
This README serves as a guide to the GitHub Action workflows included in this repository.
4+
It outlines the purpose and functionality of each workflow, detailing their role in the CI and release processes.
5+
Additionally, this document provides an overview of the scripts and actions utilized in these workflows, offering insights into how they work together in SCDF's CI/CD pipeline.
6+
7+
This document is a work in progress, and as various workflows are updated, the documentation will be revised to reflect both existing and new behaviors.
8+
9+
10+
== Building Docker Images and pushing the containers to DockerHub
11+
.This diagram shows the flow of execution of how workflows create Docker imges.
12+
```
13+
┌─────────────────────────┐
14+
│ │
15+
│ │
16+
│build-snapshot-worker.yml┼────┐
17+
│ │ │
18+
│ │ │
19+
└─────────────────────────┘ │
20+
┌─────────────────────────┐ │
21+
│ │ │
22+
│ │ │
23+
│ ci-images.yml ┼────┤ ┌─────────────────────────┐ ┌─────────────────────────┐
24+
│ │ │ │ │ │ │
25+
│ │ │ │ │ │ │
26+
└─────────────────────────┘ ├────►│ build-images.yml ┼────────►│ build-image.sh │
27+
┌─────────────────────────┐ │ │ │ │ │
28+
│ │ │ │ │ │ │
29+
│ │ │ └───────────┬─────────────┘ └─────────────────────────┘
30+
│ ci.yml ┼────┤ │
31+
│ │ │ │
32+
│ │ │ ┌───────────┴─────────────┐
33+
└─────────────────────────┘ │ │ │
34+
┌─────────────────────────┐ │ │ │
35+
│ │ │ │ images.json │
36+
│ │ │ │ │
37+
│ release-worker.yml ┼────┘ │ │
38+
│ │ └─────────────────────────┘
39+
│ │
40+
└─────────────────────────┘
41+
```
42+
43+
Part of the release and CI process involves creating and pushing images to a registry (such as DockerHub) for the Dataflow server, Skipper server, CTR app, and other components.
44+
This process is managed by the `build-images` (build-images.yml) workflow. While the `build-images` workflow is typically not run independently, it is invoked by other workflows that handle CI builds and releases.
45+
The `build-images` workflow determines which images to create based on the `images.json` file.
46+
This file contains metadata on the primary SCDF components that need to have an associated image.
47+
Each entry specifies the location (directory) where the jar can be found, jar name, and image name for each artifact that will be used to construct the image.
48+
For each entry in the `images.json` file, the workflow calls the `build-image.sh` script, which retrieves the jar, builds the image, and then pushes it to the registry.
49+
50+
SCDF also provides images for external applications that support some of the optional features that are offered by dataflow.
51+
These include Grafana and Prometheus local.
52+
These images are created and pushed using the docker/build-push-action@v2 action.
53+
54+
=== Scripts used to build images
55+
As mentioned above, the `build-image.sh` script is responsible for building the specified image based on the parameters provided and then pushing the image to Dockerhub.
56+
This script uses Paketo to build an image for each of the supported Java versions using the corresponding jar file.
57+
The resulting image name will look something like `spring-cloud-dataflow-server:3.0.0-SNAPSHOT-jdk17`.
58+
Additionally, the script creates a default image using the default Java version as specified by the `DEFAULT_JDK` environment variable.
59+
60+
The format for running the `build-image.sh` is as follows:
61+
[source, bash]
62+
```
63+
bash
64+
./build-image.sh <directory containing the jar> <The name of the image to create> <name of the jar>
65+
```
66+
67+
There is an optional `DEFAULT_JDK` environment variable that allows you to set the JDK version for the default image created.
68+
If not the script will set it to its current setting (which as of the writing of this document is `17`).
69+
70+
NOTE: When new releases of Java are available and are compliant with the SCDF release, they need to be added to the `build-image.sh` script.
71+

spring-cloud-dataflow-rest-resource/src/main/java/org/springframework/cloud/dataflow/rest/support/jackson/JobParameterJacksonDeserializer.java

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public JobParameter deserialize(JsonParser jsonParser, DeserializationContext de
5454
try {
5555
jobParameter = new JobParameter(value, Class.forName(type), identifying);
5656
} catch (ClassNotFoundException e) {
57+
logger.warn("JobParameter type %s is not supported by DataFlow. Verify type is valid or in classpath.".formatted(type) );
5758
throw new IllegalArgumentException("JobParameter type %s is not supported by DataFlow".formatted(type), e);
5859
}
5960
}

spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/integration/test/DataFlowIT.java

-2
Original file line numberDiff line numberDiff line change
@@ -1314,8 +1314,6 @@ public void composedTask() {
13141314
assertThat(taskBuilder.allTasks().size()).isEqualTo(0);
13151315
}
13161316

1317-
//TODO: Boot3x followup
1318-
@Disabled("TODO: Boot3x followup Wait for composed Task runner to be ported to 3.x")
13191317
@Test
13201318
public void multipleComposedTaskWithArguments() {
13211319
logger.info("task-multiple-composed-task-with-arguments-test");

spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/integration/test/db/AbstractDataflowTests.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ protected static class EmptyConfig {
6464
ClusterContainer.from(TagNames.DATAFLOW_2_8, DATAFLOW_IMAGE_PREFIX + "2.8.4"),
6565
ClusterContainer.from(TagNames.DATAFLOW_2_9, DATAFLOW_IMAGE_PREFIX + "2.9.6"),
6666
ClusterContainer.from(TagNames.DATAFLOW_2_10, DATAFLOW_IMAGE_PREFIX + "2.10.3"),
67-
ClusterContainer.from(TagNames.DATAFLOW_2_11, DATAFLOW_IMAGE_PREFIX + "2.11.3")
67+
ClusterContainer.from(TagNames.DATAFLOW_2_11, DATAFLOW_IMAGE_PREFIX + "2.11.4"),
68+
ClusterContainer.from(TagNames.DATAFLOW_3_0, DATAFLOW_IMAGE_PREFIX + "3.0.0")
6869
);
6970

7071
public final static List<ClusterContainer> SKIPPER_CONTAINERS = Arrays.asList(
7172
ClusterContainer.from(TagNames.SKIPPER_2_6, SKIPPER_IMAGE_PREFIX + "2.6.2"),
7273
ClusterContainer.from(TagNames.SKIPPER_2_7, SKIPPER_IMAGE_PREFIX + "2.7.4"),
7374
ClusterContainer.from(TagNames.SKIPPER_2_8, SKIPPER_IMAGE_PREFIX + "2.8.6"),
7475
ClusterContainer.from(TagNames.SKIPPER_2_9, SKIPPER_IMAGE_PREFIX + "2.9.3"),
75-
ClusterContainer.from(TagNames.SKIPPER_2_11, SKIPPER_IMAGE_PREFIX + "2.11.3")
76+
ClusterContainer.from(TagNames.SKIPPER_2_11, SKIPPER_IMAGE_PREFIX + "2.11.4"),
77+
ClusterContainer.from(TagNames.SKIPPER_3_0, SKIPPER_IMAGE_PREFIX + "3.0.0")
7678
);
7779

7880
public final static List<ClusterContainer> DATABASE_CONTAINERS = Arrays.asList(

spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/integration/test/tags/TagNames.java

+6
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ public abstract class TagNames {
7373
public static final String SKIPPER_2_8 = "skipper_2_8";
7474

7575
public static final String SKIPPER_2_9 = "skipper_2_9";
76+
7677
public static final String SKIPPER_2_11 = "skipper_2_11";
7778

79+
public static final String SKIPPER_3_0 = "skipper_3_0";
80+
7881
public static final String SKIPPER_main = "skipper_main";
7982

8083
public static final String DATAFLOW = "dataflow";
@@ -86,7 +89,10 @@ public abstract class TagNames {
8689
public static final String DATAFLOW_2_9 = "dataflow_2_9";
8790

8891
public static final String DATAFLOW_2_10 = "dataflow_2_10";
92+
8993
public static final String DATAFLOW_2_11 = "dataflow_2_11";
9094

95+
public static final String DATAFLOW_3_0 = "dataflow_3_0";
96+
9197
public static final String DATAFLOW_main = "dataflow_main";
9298
}

spring-cloud-dataflow-server/src/test/resources/docker-compose-maven-it-task-import.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
# CI specific test Task (scenario) registered from maven resource
42
services:
53

src/docker-compose/docker-compose-prometheus.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
# Extends the default docker-compose.yml with Prometheus/Grafana monitoring configuration
42
# Usage: docker-compose -f ./docker-compose.yml -f ./docker-compose-prometheus.yml up
53
services:

src/docker-compose/docker-compose.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
# Configuration environment variables:
32
# - DATAFLOW_VERSION and SKIPPER_VERSION specify what DataFlow and Skipper image versions to use.
43
# - STREAM_APPS_URI and TASK_APPS_URI are used to specify what Stream and Task applications to pre-register.
@@ -21,7 +20,7 @@ version: '3'
2120
services:
2221
dataflow-server:
2322
user: root
24-
image: springcloud/spring-cloud-dataflow-server:${DATAFLOW_VERSION:-2.11.2-SNAPSHOT}${BP_JVM_VERSION:-}
23+
image: springcloud/spring-cloud-dataflow-server:${DATAFLOW_VERSION:-3.0.0-SNAPSHOT}${BP_JVM_VERSION:-}
2524
container_name: dataflow-server
2625
ports:
2726
- "9393:9393"
@@ -64,7 +63,7 @@ services:
6463
6564
skipper-server:
6665
user: root
67-
image: springcloud/spring-cloud-skipper-server:${SKIPPER_VERSION:-2.11.2-SNAPSHOT}${BP_JVM_VERSION:-}
66+
image: springcloud/spring-cloud-skipper-server:${SKIPPER_VERSION:-3.0.0-SNAPSHOT}${BP_JVM_VERSION:-}
6867
container_name: skipper-server
6968
ports:
7069
- "7577:7577"

0 commit comments

Comments
 (0)