typesafehub / conductr-lib

Other
8 stars 13 forks source link

Update BundleAttributes with optional tags property #132

Closed fsat closed 7 years ago

fsat commented 7 years ago

Marked as wip - I'd like to do manual test for this PR (in conjunction with CD + ConductR master branch)

fsat commented 7 years ago

CD Service should support tags as a list of query params in order to determine which bundles are to be updated

fsat commented 7 years ago

Quick manual test with CD built from https://github.com/typesafehub/conductr/pull/1736 has a successful result.

The CLI is based on the https://github.com/typesafehub/conductr-cli/pull/385 with some local changes which not yet pushed when the test is done.

CD is used to deploy reactive-maps-backend successfully:

192-168-1-5:conductr-cli felixsatyaputra$ sh test.sh
++ pwd
+ CURRENT_DIR=/Users/felixsatyaputra/workspace/typesafe-fsat/conductr-cli
+ cd /Users/felixsatyaputra/workspace/typesafe-fsat/conductr
+ sbt continuousDelivery/clean continuousDelivery/bundle:dist
[info] Loading global plugins from /Users/felixsatyaputra/.sbt/0.13/plugins
[info] Loading project definition from /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/project/project
[info] Loading project definition from /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/project
[info] Resolving key references (18643 settings) ...
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/felixsatyaputra/.ivy2/cache/org.slf4j/slf4j-nop/jars/slf4j-nop-1.7.14.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/felixsatyaputra/.ivy2/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
[info] Set current project to root (in build file:/Users/felixsatyaputra/workspace/typesafe-fsat/conductr/)
[success] Total time: 0 s, completed 13/04/2017 2:05:57 PM
[info] Packaging /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/continuous-delivery_2.11-0.1.0-sources.jar ...
[info] Done packaging.
[info] Wrote /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/continuous-delivery_2.11-0.1.0.pom
[info] Updating {file:/Users/felixsatyaputra/workspace/typesafe-fsat/conductr/}continuousDelivery...
[info] Resolving org.scala-lang#scala-library;2.11.8 ...
[info] Formatting 23 Scala sources {file:/Users/felixsatyaputra/workspace/typesafe-fsat/conductr/}continuousDelivery(compile) ...
[info] Resolving com.lightbend.lagom#api-tools_2.11;1.2.2 ...
[info] Done updating.
[info] Compiling 1 protobuf files to /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/src_managed/main/compiled_protobuf
[info] Compiling schema /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/src/main/protobuf/continuous-delivery.proto
[info] Compiling protobuf
[info] Protoc target directory: /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/src_managed/main/compiled_protobuf
[info] Compiling 23 Scala sources and 1 Java source to /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/classes...
[info] Main Scala API documentation to /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/api...
model contains 115 documentable templates
[warn] /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/src/main/scala/com/lightbend/conductr/cd/DeploymentScheduler.scala:75: Could not find any member to link for "akka.cluster.ddata.Replicator.UpdateSuccess".
[warn]   /**
[warn]   ^
[warn] /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/src/main/scala/com/lightbend/conductr/cd/DeployerStates.scala:82: Could not find any member to link for "akka.actor.FSM.goto".
[warn]   /**
[warn]   ^
[warn] two warnings found
[info] Main Scala API documentation successful.
[info] Packaging /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/continuous-delivery_2.11-0.1.0-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/scala-2.11/continuous-delivery_2.11-0.1.0.jar ...
[info] Done packaging.
[info] Wrote /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/test-lib/target/scala-2.11/test-lib_2.11-0.1.0.pom
[info] Main Scala API documentation to /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/test-lib/target/scala-2.11/api...
[info] Packaging /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/test-lib/target/scala-2.11/test-lib_2.11-0.1.0.jar ...
[info] Done packaging.
model contains 31 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/test-lib/target/scala-2.11/test-lib_2.11-0.1.0-javadoc.jar ...
[info] Done packaging.
[info] Bundle has been created: /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/bundle/continuous-delivery-0.1.0-b00005522a241480820bc2a7cf6777a035d2caa0595e028a6c50f520a40ae26a.zip
[success] Total time: 45 s, completed 13/04/2017 2:06:42 PM
+ cd /Users/felixsatyaputra/workspace/typesafe-fsat/conductr-cli
+ sandbox run 2.0.5 -n 3
|------------------------------------------------|
| Starting ConductR                              |
|------------------------------------------------|
Extracting ConductR core to /Users/felixsatyaputra/.conductr/images/core
Extracting ConductR agent to /Users/felixsatyaputra/.conductr/images/agent
Starting ConductR core instance on 192.168.10.1..
Waiting for ConductR to start..
Starting ConductR agent instance on 192.168.10.1..
Starting ConductR agent instance on 192.168.10.2..
Starting ConductR agent instance on 192.168.10.3..
|------------------------------------------------|
| Starting logging feature based on eslite       |
|------------------------------------------------|
Deploying bundle eslite..
Retrieving bundle..
Loading bundle from cache typesafe/bundle/eslite
Bintray credentials loaded from /Users/felixsatyaputra/.lightbend/commercial.credentials
Retrieving from cache /Users/felixsatyaputra/.conductr/cache/bundle/eslite-v1-3349b6bfbc09e8d88123fee5b33b2717e07fb2a91de719c99e0403c9e4b28ea5.zip
Loading bundle to ConductR..
[#################################################] 100%
Bundle 3349b6bfbc09e8d88123fee5b33b2717 is installed
Bundle loaded.
Bundle run request sent.
Bundle 3349b6bfbc09e8d88123fee5b33b2717 waiting to reach expected scale 1
Bundle 3349b6bfbc09e8d88123fee5b33b2717 has scale 0, expected 1..
Bundle 3349b6bfbc09e8d88123fee5b33b2717 expected scale 1 is met
|------------------------------------------------|
| Summary                                        |
|------------------------------------------------|
|- - - - - - - - - - - - - - - - - - - - - - - - |
| ConductR                                       |
|- - - - - - - - - - - - - - - - - - - - - - - - |
ConductR has been started:
  core instance on 192.168.10.1
  agent instances on 192.168.10.1, 192.168.10.2, 192.168.10.3
ConductR service locator has been started on:
  192.168.10.1:9008
|- - - - - - - - - - - - - - - - - - - - - - - - |
| Proxy                                          |
|- - - - - - - - - - - - - - - - - - - - - - - - |
HAProxy has not been started
To enable proxying ensure Docker is running and restart the sandbox
|- - - - - - - - - - - - - - - - - - - - - - - - |
| Bundles                                        |
|- - - - - - - - - - - - - - - - - - - - - - - - |
Check latest bundle status with:
  conduct info
Current bundle status:
ID       NAME    VER  #REP  #STR  #RUN  ROLES
3349b6b  eslite   v1     1     0     1  elasticsearch
++ find /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/bundle -iname '*.zip'
++ find /Users/felixsatyaputra/tmp -iname 'cd-test-*.zip'
++ head -1
+ conduct load /Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/bundle/continuous-delivery-0.1.0-b00005522a241480820bc2a7cf6777a035d2caa0595e028a6c50f520a40ae26a.zip /Users/felixsatyaputra/tmp/cd-test-config-8030a13232ae6328db2ecf1968ad019f2b9230f84436cb685559819194ba9a75.zip
Retrieving bundle..
Retrieving file:///Users/felixsatyaputra/workspace/typesafe-fsat/conductr/continuous-delivery/target/bundle/continuous-delivery-0.1.0-b00005522a241480820bc2a7cf6777a035d2caa0595e028a6c50f520a40ae26a.zip
Retrieving configuration..
Retrieving file:///Users/felixsatyaputra/tmp/cd-test-config-8030a13232ae6328db2ecf1968ad019f2b9230f84436cb685559819194ba9a75.zip
Loading bundle to ConductR..
[#################################################] 100%
Bundle b00005522a241480820bc2a7cf6777a0-8030a13232ae6328db2ecf1968ad019f is installed
Bundle loaded.
Start bundle with:        conduct run b000055-8030a13
Unload bundle with:       conduct unload b000055-8030a13
Print ConductR info with: conduct info
Print bundle info with:   conduct info b000055-8030a13
+ conduct run conti --scale 3
Bundle run request sent.
Bundle b00005522a241480820bc2a7cf6777a0-8030a13232ae6328db2ecf1968ad019f waiting to reach expected scale 3
Bundle b00005522a241480820bc2a7cf6777a0-8030a13232ae6328db2ecf1968ad019f has scale 0, expected 3.
Bundle b00005522a241480820bc2a7cf6777a0-8030a13232ae6328db2ecf1968ad019f has scale 1, expected 3.
Bundle b00005522a241480820bc2a7cf6777a0-8030a13232ae6328db2ecf1968ad019f has scale 2, expected 3.
Bundle b00005522a241480820bc2a7cf6777a0-8030a13232ae6328db2ecf1968ad019f expected scale 3 is met
Stop bundle with:         conduct stop b000055-8030a13
Print ConductR info with: conduct info
Print bundle info with:   conduct info b000055-8030a13
+ conduct load reactive-maps-backend-summary:v1-d073991ab918ee22c7426af8a62a48c5ebec737f53cfc4bccb0a4f712d76dd6a /Users/felixsatyaputra/tmp/test-config-a53237c1f4a067e13ef00090627fb3de8f31c1957ba2758a4fcd181a510c2e72.zip
Retrieving bundle..
Loading bundle from cache typesafe/bundle/reactive-maps-backend-summary:v1-d073991ab918ee22c7426af8a62a48c5ebec737f53cfc4bccb0a4f712d76dd6a
Bintray credentials loaded from /Users/felixsatyaputra/.lightbend/commercial.credentials
Retrieving from cache /Users/felixsatyaputra/.conductr/cache/bundle/reactive-maps-backend-summary-v1-d073991ab918ee22c7426af8a62a48c5ebec737f53cfc4bccb0a4f712d76dd6a.zip
Retrieving configuration..
Retrieving file:///Users/felixsatyaputra/tmp/test-config-a53237c1f4a067e13ef00090627fb3de8f31c1957ba2758a4fcd181a510c2e72.zip
Loading bundle to ConductR..
[#################################################] 100%
Bundle d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de is installed
Bundle loaded.
Start bundle with:        conduct run d073991-a53237c
Unload bundle with:       conduct unload d073991-a53237c
Print ConductR info with: conduct info
Print bundle info with:   conduct info d073991-a53237c
+ conduct run d073991-a53237c --scale 3
Bundle run request sent.
Bundle d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de waiting to reach expected scale 3
Bundle d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de has scale 0, expected 3.
Bundle d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de has scale 1, expected 3.
Bundle d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de has scale 2, expected 3.
Bundle d073991ab918ee22c7426af8a62a48c5-a53237c1f4a067e13ef00090627fb3de expected scale 3 is met
Stop bundle with:         conduct stop d073991-a53237c
Print ConductR info with: conduct info
Print bundle info with:   conduct info d073991-a53237c
+ conduct info
ID               NAME                           VER  #REP  #STR  #RUN  ROLES
3349b6b          eslite                          v1     1     0     1  elasticsearch
b000055-8030a13  continuous-delivery             v2     1     0     3  continuous-delivery
d073991-a53237c  reactive-maps-backend-summary   v1     1     0     3  intranet
+ conduct deploy -y reactive-maps-backend-summary
Bintray credentials loaded from /Users/felixsatyaputra/.lightbend/commercial.credentials
Resolving bundle version typesafe/bundle/reactive-maps-backend-summary
Deployment request sent.
Deployment ids:
  06137b86-e63d-4648-b9e5-83e3b9fbc279--e43a1965-48e0-44ff-b3e4-5ee0cf66463e
Deploying reactive-maps-backend-summary:v1-abf6045
[d073991-a53237c] Downloading bundle.
[d073991-a53237c] Downloading config
[d073991-a53237c] Loading bundle with config
[d073991-a53237c] Deploying - 3 old instance vs 0 new instance
[d073991-a53237c] Deploying - 2 old instance vs 1 new instance.
[d073991-a53237c] Deploying - 1 old instance vs 2 new instance.
[d073991-a53237c] Success
+ conduct info
ID               NAME                           VER  #REP  #STR  #RUN  ROLES
3349b6b          eslite                          v1     1     0     1  elasticsearch
b000055-8030a13  continuous-delivery             v2     1     0     3  continuous-delivery
d073991-a53237c  reactive-maps-backend-summary   v1     1     0     0  intranet
abf6045-a53237c  reactive-maps-backend-summary   v1     1     0     3  intranet