|
| 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 | + |
0 commit comments