spring-cloud / spring-cloud-skipper

A package manager that installs, upgrades, and rolls back Spring Boot applications on multiple Cloud Platforms.
http://cloud.spring.io/spring-cloud-skipper/
Apache License 2.0
111 stars 78 forks source link

Fix status after failed update #972

Closed jvalkeal closed 4 years ago

jvalkeal commented 4 years ago

To test, start skipper with 100s timeout as it defaults to 300s

--spring.cloud.skipper.server.strategies.healthcheck.timeout-in-millis=100000

Do deploy and fail time with update by using wrong probe path:

dataflow:>app import --uri https://dataflow.spring.io/rabbitmq-maven-latest
dataflow:>stream create --name s1 --definition "time|log"

dataflow:>stream deploy --name s1 --properties "app.log.server.port=8082,app.time.server.port=8081,deployer.log.local.startup-probe.path=/actuator/health,deployer.time.local.startup-probe.path=/actuator/health"

dataflow:>stream update --name s1 --properties "app.time.server.port=8083,deployer.time.local.startup-probe.path=/actuator/fake"

After deploy:

skipper:>release history --release-name s1
╔═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤════════════════╗
║Version│        Last updated        │ Status │Package Name│Package Version│  Description   ║
╠═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪════════════════╣
║1      │Mon Aug 24 13:05:42 BST 2020│DEPLOYED│s1          │1.0.0          │Install complete║
╚═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧════════════════╝

skipper:>release status --release-name s1
╔═══════════════╤═════════════════════════════════════════════════╗
║Last Deployed  │Mon Aug 24 13:05:42 BST 2020                     ║
║Status         │DEPLOYED                                         ║
║Platform Status│All applications have been successfully deployed.║
║               │[s1.log-v1], State = [s1.log-v1-0=deployed]      ║
║               │[s1.time-v1], State = [s1.time-v1-0=deployed]    ║
╚═══════════════╧═════════════════════════════════════════════════╝

skipper:>release list
╔════╤═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤═════════════╤═════════════════════════════════════════════╗
║Name│Version│        Last updated        │ Status │Package Name│Package Version│Platform Name│               Platform Status               ║
╠════╪═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪═════════════╪═════════════════════════════════════════════╣
║s1  │1      │Mon Aug 24 13:05:42 BST 2020│DEPLOYED│s1          │1.0.0          │default      │[s1.log-v1], State = [s1.log-v1-0=deployed]  ║
║    │       │                            │        │            │               │             │[s1.time-v1], State = [s1.time-v1-0=deployed]║
╚════╧═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧═════════════╧═════════════════════════════════════════════╝

$ ps -ef|grep java|grep rabbit
jvalkea+  5966  5459 36 13:05 ?        00:00:36 /usr/lib/jvm/java-8-oracle/jre/bin/java -jar /home/jvalkealahti/.m2/repository/org/springframework/cloud/stream/app/time-source-rabbit/2.1.3.RELEASE/time-source-rabbit-2.1.3.RELEASE.jar
jvalkea+  5979  5459 38 13:05 ?        00:00:37 /usr/lib/jvm/java-8-oracle/jre/bin/java -jar /home/jvalkealahti/.m2/repository/org/springframework/cloud/stream/app/log-sink-rabbit/2.1.4.RELEASE/log-sink-rabbit-2.1.4.RELEASE.jar

During update you see:

$ ps -ef|grep java|grep rabbit
jvalkea+  5966  5459 36 13:05 ?        00:00:36 /usr/lib/jvm/java-8-oracle/jre/bin/java -jar /home/jvalkealahti/.m2/repository/org/springframework/cloud/stream/app/time-source-rabbit/2.1.3.RELEASE/time-source-rabbit-2.1.3.RELEASE.jar
jvalkea+  5979  5459 38 13:05 ?        00:00:37 /usr/lib/jvm/java-8-oracle/jre/bin/java -jar /home/jvalkealahti/.m2/repository/org/springframework/cloud/stream/app/log-sink-rabbit/2.1.4.RELEASE/log-sink-rabbit-2.1.4.RELEASE.jar
jvalkea+  6312  5459 99 13:07 ?        00:00:23 /usr/lib/jvm/java-8-oracle/jre/bin/java -jar /home/jvalkealahti/.m2/repository/org/springframework/cloud/stream/app/time-source-rabbit/2.1.3.RELEASE/time-source-rabbit-2.1.3.RELEASE.jar

After failed update:

skipper:>release history --release-name s1
╔═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤════════════════════════════════════════════════════════════════════╗
║Version│        Last updated        │ Status │Package Name│Package Version│                            Description                             ║
╠═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪════════════════════════════════════════════════════════════════════╣
║2      │Mon Aug 24 13:07:14 BST 2020│FAILED  │s1          │1.0.0          │Did not detect apps in replacing release as healthy after 100000 ms.║
║1      │Mon Aug 24 13:05:42 BST 2020│DEPLOYED│s1          │1.0.0          │Install complete                                                    ║
╚═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧════════════════════════════════════════════════════════════════════╝

skipper:>release status --release-name s1
╔═══════════════╤═══════════════════════════════════════════╗
║Last Deployed  │Mon Aug 24 13:07:14 BST 2020               ║
║Status         │FAILED                                     ║
║Platform Status│The applications are being deployed.       ║
║               │[s1.log-v1], State = [s1.log-v1-0=deployed]║
║               │[s1.time-v2], State = [unknown]            ║
╚═══════════════╧═══════════════════════════════════════════╝

skipper:>release list
╔════╤═══════╤════════════════════════════╤════════╤════════════╤═══════════════╤═════════════╤═════════════════════════════════════════════╗
║Name│Version│        Last updated        │ Status │Package Name│Package Version│Platform Name│               Platform Status               ║
╠════╪═══════╪════════════════════════════╪════════╪════════════╪═══════════════╪═════════════╪═════════════════════════════════════════════╣
║s1  │1      │Mon Aug 24 13:05:42 BST 2020│DEPLOYED│s1          │1.0.0          │default      │[s1.log-v1], State = [s1.log-v1-0=deployed]  ║
║    │       │                            │        │            │               │             │[s1.time-v1], State = [s1.time-v1-0=deployed]║
║s1  │2      │Mon Aug 24 13:07:14 BST 2020│FAILED  │s1          │1.0.0          │default      │[s1.log-v1], State = [s1.log-v1-0=deployed]  ║
║    │       │                            │        │            │               │             │[s1.time-v2], State = [unknown]              ║
╚════╧═══════╧════════════════════════════╧════════╧════════════╧═══════════════╧═════════════╧═════════════════════════════════════════════╝

$ ps -ef|grep java|grep rabbit
jvalkea+  5966  5459 36 13:05 ?        00:00:36 /usr/lib/jvm/java-8-oracle/jre/bin/java -jar /home/jvalkealahti/.m2/repository/org/springframework/cloud/stream/app/time-source-rabbit/2.1.3.RELEASE/time-source-rabbit-2.1.3.RELEASE.jar
jvalkea+  5979  5459 38 13:05 ?        00:00:37 /usr/lib/jvm/java-8-oracle/jre/bin/java -jar /home/jvalkealahti/.m2/repository/org/springframework/cloud/stream/app/log-sink-rabbit/2.1.4.RELEASE/log-sink-rabbit-2.1.4.RELEASE.jar
ilayaperumalg commented 4 years ago

LGTM, verified the changes as well.

ilayaperumalg commented 4 years ago

Merging.