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

Commit 8fd6174

Browse files
committed
Update docs to use new platform/history/manifest commands
Fixes #1813
1 parent 253d9c6 commit 8fd6174

File tree

2 files changed

+192
-18
lines changed

2 files changed

+192
-18
lines changed

spring-cloud-dataflow-docs/src/main/asciidoc/streams-skipper.adoc

Lines changed: 99 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ The section <<spring-cloud-dataflow-stream-lifecycle-skipper>> covers the overal
55

66
This section is a continuation of the getting started section on <<getting-started-deploying-streams-spring-cloud-dataflow>> and shows how Streams can be updated and rolled back using the Local Data Flow server and Skipper.
77
The getting started section leaves off with the Stream `httptest` deployed.
8-
The Stream consists of two applications, the `http` and the `log` sink.
9-
If you execute the unix command `jps` you can see the two java processes running.
8+
The Stream consists of two applications, the `http` source and the `log` sink.
9+
If you execute the Unix command `jps` you can see the two java processes running.
1010

1111
[source,bash]
1212
----
@@ -17,16 +17,16 @@ $ jps | grep rabbit
1717

1818
== Upgrading
1919
We will now upgrade the log sink to version 1.2.0.RELEASE.
20-
Since we are deploying on the local deployer we will need to set the port to a different value (9001) than the currently running log sink's value of 9000.
21-
While we are at it, let's update log level to be `ERROR` and configure the Spring Boot actuator endpoints to be accessible without a password.
20+
Since we are using the local server we will need to set the port to a different value (9001) than the currently running log sink's value of 9000 to avoid a conflict.
21+
While we are at it, let's update log level to be `ERROR`.
2222
Create a YAML file named `local-log-update.yml` with the following contents
2323
[source,yml]
2424
----
2525
version:
2626
log: 1.2.0.RELEASE
2727
app:
2828
log:
29-
server.port: 9001
29+
server.port: 9002
3030
log.level: ERROR
3131
----
3232

@@ -37,7 +37,7 @@ dataflow:> stream skipper update --name httptest --propertiesFile /home/mpollack
3737
Update request has been sent for the stream 'httptest'
3838
----
3939

40-
Executing the unix command `jps` you can see the two java processes running, but now the log application is version 1.2.0.RELEASE
40+
Executing the Unix command `jps` you can see the two java processes running, but now the log application is version 1.2.0.RELEASE
4141

4242
[source,bash]
4343
----
@@ -78,17 +78,93 @@ If you query the `/info` endpoint of the app, you can also see that it is at ver
7878
$ curl http://localhost:9002/info
7979
{"app":{"description":"Spring Cloud Stream Log Sink Rabbit Binder Application","name":"log-sink-rabbit","version":"1.2.0.RELEASE"}}
8080
----
81+
82+
=== Stream History
83+
84+
The history of the Stream can be viewed by executing the `stream skipper history` command
85+
86+
[source,bash]
87+
----
88+
dataflow:>stream skipper history --name httptest
89+
╔═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤════════════════╗
90+
║Version│ Last updated │ Status │Package Name│Package Version│ Description ║
91+
╠═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪════════════════╣
92+
║2 │Mon Nov 27 22:41:16 EST 2017│DEPLOYED│httptest │1.0.0 │Upgrade complete║
93+
║1 │Mon Nov 27 22:40:41 EST 2017│DELETED │httptest │1.0.0 │Delete complete ║
94+
╚═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧════════════════╝
95+
----
96+
97+
=== Stream Manifest
98+
99+
The manifest is a YAML document that represents the final state of what was deployed to the platform.
100+
You can view the manifest for any Stream version using the command `stream skipper manifest --name <name-of-stream> --releaseVersion <optional-version>`
101+
If the `--releaseVersion` is not specified, the manifest for the last version is returned.
102+
103+
[source,bash]
104+
----
105+
dataflow:>stream skipper manifest --name httptest
106+
107+
---
108+
# Source: log.yml
109+
apiVersion: skipper.spring.io/v1
110+
kind: SpringCloudDeployerApplication
111+
metadata:
112+
name: log
113+
spec:
114+
resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit
115+
version: 1.2.0.RELEASE
116+
applicationProperties:
117+
spring.metrics.export.triggers.application.includes: integration**
118+
spring.cloud.dataflow.stream.app.label: log
119+
spring.cloud.stream.metrics.key: httptest.log.${spring.cloud.application.guid}
120+
spring.cloud.stream.bindings.input.group: httptest
121+
spring.cloud.stream.metrics.properties: spring.application.name,spring.application.index,spring.cloud.application.*,spring.cloud.dataflow.*
122+
spring.cloud.dataflow.stream.name: httptest
123+
spring.cloud.dataflow.stream.app.type: sink
124+
spring.cloud.stream.bindings.input.destination: httptest.http
125+
deploymentProperties:
126+
spring.cloud.deployer.indexed: true
127+
spring.cloud.deployer.group: httptest
128+
spring.cloud.deployer.count: 1
129+
130+
---
131+
# Source: http.yml
132+
apiVersion: skipper.spring.io/v1
133+
kind: SpringCloudDeployerApplication
134+
metadata:
135+
name: http
136+
spec:
137+
resource: maven://org.springframework.cloud.stream.app:http-source-rabbit
138+
version: 1.2.0.RELEASE
139+
applicationProperties:
140+
spring.metrics.export.triggers.application.includes: integration**
141+
spring.cloud.dataflow.stream.app.label: http
142+
spring.cloud.stream.metrics.key: httptest.http.${spring.cloud.application.guid}
143+
spring.cloud.stream.bindings.output.producer.requiredGroups: httptest
144+
spring.cloud.stream.metrics.properties: spring.application.name,spring.application.index,spring.cloud.application.*,spring.cloud.dataflow.*
145+
server.port: 9000
146+
spring.cloud.stream.bindings.output.destination: httptest.http
147+
spring.cloud.dataflow.stream.name: httptest
148+
spring.cloud.dataflow.stream.app.type: source
149+
deploymentProperties:
150+
spring.cloud.deployer.group: httptest
151+
----
152+
153+
The majority of the deployment and application properties were set by Data Flow in order to enable the applications to talk to each other and sending application metrics with identifying labels.
154+
155+
If you compare this YAML document to the one for `--releaseVersion=1` you will see the difference in the log application version.
156+
81157
== Rolling back
82158

83-
To go back to the previous version of the stream, you use the `stream skipper rollback` command
159+
To go back to the previous version of the stream, use the `stream skipper rollback` command.
84160

85161
[source,bash]
86162
----
87163
dataflow:>stream skipper rollback --name httptest
88164
Rollback request has been sent for the stream 'httptest'
89165
----
90166

91-
Executing the unix command `jps` you can see the two java processes running, but now the log application is back to 1.1.0.RELEASE. The http source process has remain unchanged.
167+
Executing the Unix command `jps` you can see the two java processes running, but now the log application is back to 1.1.0.RELEASE. The http source process has remain unchanged.
92168

93169
[source,bash]
94170
----
@@ -120,6 +196,20 @@ dataflow:> http post --target http://localhost:9000 --data "hello world upgraded
120196
And the log message in the log sink will now be back at the info error level.
121197
[source,bash]
122198
----
123-
INFO 23939 --- [http.httptest-1] log-sink : hello world rollback
199+
INFO 23939 --- [http.httptest-1] log-sink : hello world rollback
124200
----
125201

202+
The history command now shows the third version of the stream hsa been deployed.
203+
204+
[source,bash]
205+
----
206+
dataflow:>stream skipper history --name httptest
207+
╔═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤════════════════╗
208+
║Version│ Last updated │ Status │Package Name│Package Version│ Description ║
209+
╠═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪════════════════╣
210+
║3 │Mon Nov 27 23:01:13 EST 2017│DEPLOYED│httptest │1.0.0 │Upgrade complete║
211+
║2 │Mon Nov 27 22:41:16 EST 2017│DELETED │httptest │1.0.0 │Delete complete ║
212+
║1 │Mon Nov 27 22:40:41 EST 2017│DELETED │httptest │1.0.0 │Delete complete ║
213+
╚═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧════════════════╝
214+
----
215+
If you look at the manifest for version 3, it will show version 1.1.0.RELEASE for the log sink.

spring-cloud-dataflow-docs/src/main/asciidoc/streams.adoc

Lines changed: 93 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -861,13 +861,14 @@ dataflow:> stream deploy --name ticktock
861861

862862
https://cloud.spring.io/spring-cloud-skipper/[Skipper] is a server that allows you to discover Spring Boot applications and manage their lifecycle on multiple Cloud Platforms.
863863

864-
Applications in Skipper are bundled as packages which contain templated configuration files. They also contain an option `values` file that contains default values using to fill in template placeholders.
864+
Applications in Skipper are bundled as packages which contain templated configuration files. They also contain an optional `values` file that contains default values using to fill in template placeholders. You can find out more about the format of the package .zip file in Skipper's documentation on https://docs.spring.io/spring-cloud-skipper/docs/1.0.0.M2/reference/htmlsingle/#packages[Packages].
865865
Skipper's templated configuration files contain placeholders for application properties, application version, and deployment properties.
866-
Packages are uploaded to Skipper and stored in a package repository.
866+
Package .zip files are uploaded to Skipper and stored in a package repository.
867867
Skipper's package repository is analogous to those found in tools such as `apt-get` or `brew`.
868868

869869
You can override template values when installing or upgrading a package.
870870
Skipper orchestrates the upgrade/rollback procedure of applications between different versions, taking the minimal set of actions to bring the system to the desired state.
871+
For example, if only one application in a stream has been updated, only that single application is deployed with a new version and the old version undeployed.
871872
An application is considered different when upgrading if any of it's application properties, deployment properties (excluding count), or application version (e.g. 1.0.0.RELEASE) is different from the currently installed application.
872873

873874
Spring Cloud Data Flow is integrated with Skipper by generating a Skipper package when deploying a Stream.
@@ -890,13 +891,11 @@ There is an important optional command argument to the `stream skipper deploy` c
890891
Skipper can be configured to deploy to multiple platforms.
891892
Skipper is pre-configured with a platform named `default` which will deploys applications to the local machine where Skipper is running.
892893
The default value of the command line argument `--platformName` is `default`.
893-
If you are commonly deploying to one platform, when installing Skipper you can override the configuration of the `default` platform. Otherwise, specify the platformName if you want to deploy to platforms such as PCF and Kubernetes.
894-
894+
If you are commonly deploying to one platform, when installing Skipper you can override the configuration of the `default` platform.
895+
Otherwise, specify the platformName to one of the values returned by the command `stream skipper platform-list`
895896

896897
NOTE: In future releases, only the local Data Flow server will be configured with the `default` platform.
897898

898-
NOTE: In the current release of Data Flow, there is not yet a command/REST endpoint to list the platforms that Skipper is configured to use.
899-
As such, you will have to find out the platform name to use by either running the Skipper Shell or knowing how you configured the platforms for Skipper when installing Skipper.
900899

901900
[[spring-cloud-dataflow-stream-lifecycle-skipper-update]]
902901
=== Updating a Stream
@@ -909,7 +908,79 @@ If the Stream `http | log` was deployed, and the version of `log` which register
909908
dataflow:>stream skipper update --name httptest --properties version.log=1.2.0.RELEASE
910909
----
911910

912-
NOTE: The `--propertiesFile` can be in a YAML format, which is preferred since the underlying model that Skipper uses is YAML based and the translation from java.util.Properties format to YAML does not cover all possible YAML documents.
911+
=== Stream versions
912+
Skipper keeps a history of the Streams that were deployed.
913+
After updating a Stream, there will be a second version of the stream.
914+
You can query for the history of the versions using the command `stream skipper history --name <name-of-stream>`.
915+
916+
[source,bash]
917+
----
918+
dataflow:>stream skipper history --name httptest
919+
╔═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤════════════════╗
920+
║Version│ Last updated │ Status │Package Name│Package Version│ Description ║
921+
╠═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪════════════════╣
922+
║2 │Mon Nov 27 22:41:16 EST 2017│DEPLOYED│httptest │1.0.0 │Upgrade complete║
923+
║1 │Mon Nov 27 22:40:41 EST 2017│DELETED │httptest │1.0.0 │Delete complete ║
924+
╚═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧════════════════╝
925+
----
926+
927+
=== Stream Manifests
928+
Skipper keeps an "manifest" of the all the applications, their application properties and deployment properties after all values have been substituted.
929+
This represents the final state of what was deployed to the platform.
930+
You can view the manifest for any of the versions of a Stream using the command `stream skipper manifest --name <name-of-stream> --releaseVersion <optional-version>`
931+
If the `--releaseVersion` is not specified, the manifest for the last version is returned.
932+
933+
[source,bash]
934+
----
935+
dataflow:>stream skipper manifest --name httptest
936+
937+
---
938+
# Source: log.yml
939+
apiVersion: skipper.spring.io/v1
940+
kind: SpringCloudDeployerApplication
941+
metadata:
942+
name: log
943+
spec:
944+
resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit
945+
version: 1.2.0.RELEASE
946+
applicationProperties:
947+
spring.metrics.export.triggers.application.includes: integration**
948+
spring.cloud.dataflow.stream.app.label: log
949+
spring.cloud.stream.metrics.key: httptest.log.${spring.cloud.application.guid}
950+
spring.cloud.stream.bindings.input.group: httptest
951+
spring.cloud.stream.metrics.properties: spring.application.name,spring.application.index,spring.cloud.application.*,spring.cloud.dataflow.*
952+
spring.cloud.dataflow.stream.name: httptest
953+
spring.cloud.dataflow.stream.app.type: sink
954+
spring.cloud.stream.bindings.input.destination: httptest.http
955+
deploymentProperties:
956+
spring.cloud.deployer.indexed: true
957+
spring.cloud.deployer.group: httptest
958+
spring.cloud.deployer.count: 1
959+
960+
---
961+
# Source: http.yml
962+
apiVersion: skipper.spring.io/v1
963+
kind: SpringCloudDeployerApplication
964+
metadata:
965+
name: http
966+
spec:
967+
resource: maven://org.springframework.cloud.stream.app:http-source-rabbit
968+
version: 1.2.0.RELEASE
969+
applicationProperties:
970+
spring.metrics.export.triggers.application.includes: integration**
971+
spring.cloud.dataflow.stream.app.label: http
972+
spring.cloud.stream.metrics.key: httptest.http.${spring.cloud.application.guid}
973+
spring.cloud.stream.bindings.output.producer.requiredGroups: httptest
974+
spring.cloud.stream.metrics.properties: spring.application.name,spring.application.index,spring.cloud.application.*,spring.cloud.dataflow.*
975+
server.port: 9000
976+
spring.cloud.stream.bindings.output.destination: httptest.http
977+
spring.cloud.dataflow.stream.name: httptest
978+
spring.cloud.dataflow.stream.app.type: source
979+
deploymentProperties:
980+
spring.cloud.deployer.group: httptest
981+
----
982+
983+
The majority of the deployment and application properties were set by Data Flow in order to enable the applications to talk to each other and sending application metrics with identifying labels.
913984

914985
[[spring-cloud-dataflow-stream-lifecycle-skipper-rollback]]
915986
=== Rollback a Stream
@@ -919,9 +990,22 @@ You can rollback to a previous version of the Stream using the command `stream s
919990
dataflow:>stream skipper rollback --name httptest
920991
----
921992

993+
There is an optional `--releaseVersion` command argument which is the version of the Stream.
994+
If not specified, the rollback goes to the previous stream version.
995+
996+
=== Application Count
997+
998+
The application count is a dynamic property of the system.
999+
If due to scaling at runtime, the application to be upgraded has 5 instances running, then 5 instances of the upgraded application will be deployed.
1000+
1001+
=== Skipper's Upgrade Strategy
1002+
1003+
Skipper has a simple 'red/black' upgrade strategy. It deploys the new version of the applications, as many instances as the currently running version, and checks the `/health` endpoint of the application.
1004+
If the health of the new application is good, then the previous application is undeployed.
1005+
If the health of the new application is bad, then all new applications are undeployed and the upgrade is considered not successful.
9221006

923-
NOTE: There is an optional `--releaseVersion` command argument which is the version of the Stream. In the current release of Data Flow, there is not yet a command/REST endpoint to list all the versions of the Stream that have been deployed.
924-
As such, if you want to rollback to something other than the previous release, you will need to run the Skipper Shell.
1007+
The upgrade strategy is not a rolling upgrade, so if 5 applications of the application to upgrade are runningn, then in a sunny day scenario, 5 of the new applications will also be running before the older version is undeployed.
1008+
Future versions of Skipper will support rolling upgrades and other types of checks, e.g. manual, to continue to upgrade process.
9251009

9261010
== Stream DSL
9271011

0 commit comments

Comments
 (0)