Skip to content

Refactor bndl so that component configurations are modified more consistently between different input types#494

Merged
huntc merged 1 commit intotypesafehub:masterfrom
longshorej:bndl-description-bug
Jun 15, 2017
Merged

Refactor bndl so that component configurations are modified more consistently between different input types#494
huntc merged 1 commit intotypesafehub:masterfrom
longshorej:bndl-description-bug

Conversation

@longshorej
Copy link
Copy Markdown
Contributor

@longshorej longshorej commented Jun 14, 2017

This PR modifies bndl so that it behaves more consistently between component types. Notably, there's two changes here:

--component-description removed in favor of --description that now works with all component types, not just OCI, consistent with other flags like --endpoint and --volume.

The arguments are processed centrally in bndl_create.py whereas prior to this, for OCI/Docker inputs, they were processed in two places. This makes OCI inputs less special and more consistent with the other formats.

Fixes #491

@longshorej
Copy link
Copy Markdown
Contributor Author

Manual Tests

Omitting description should result in description = ""

$ docker save dockercloud/hello-world | bndl --no-shazar | tar x
-> 0

$ cat hello-world/bundle.conf 
annotations {
  com {
    lightbend {
      conductr {
        oci-image-tags {
          hello-world = "latest"
        }
      }
    }
  }
}
components {
  hello-world {
    file-system-type = "oci-image"
    start-command = []
    endpoints {
      hello-world-tcp-80 {
        bind-protocol = "tcp"
        bind-port = 80
        service-name = "hello-world-tcp-80"
      }
    }
    description = ""
  }
  bundle-status {
    description = "Status check for the bundle component"
    file-system-type = "universal"
    start-command = [
      "check"
      "--any-address"
      "$HELLO_WORLD_TCP_80_HOST?retry-delay=10&retry-count=6"
    ]
    endpoints {}
  }
}
compatibilityVersion = "0"
diskSpace = 1073741824
memory = 402653184
name = "hello-world"
nrOfCpus = 0.1
roles = [
  "web"
]
system = "hello-world"
systemVersion = "0"
tags = [
  "0.0.1"
]
version = "1"-> 0

Specifying description should result in a populated description

$ docker save dockercloud/hello-world | bndl --description 'testing!' --no-shazar | tar x
-> 0
$ cat hello-world/bundle.conf 
annotations {
  com {
    lightbend {
      conductr {
        oci-image-tags {
          hello-world = "latest"
        }
      }
    }
  }
}
components {
  hello-world {
    file-system-type = "oci-image"
    start-command = []
    endpoints {
      hello-world-tcp-80 {
        bind-protocol = "tcp"
        bind-port = 80
        service-name = "hello-world-tcp-80"
      }
    }
    description = "testing!"
  }
  bundle-status {
    description = "Status check for the bundle component"
    file-system-type = "universal"
    start-command = [
      "check"
      "--any-address"
      "$HELLO_WORLD_TCP_80_HOST?retry-delay=10&retry-count=6"
    ]
    endpoints {}
  }
}
compatibilityVersion = "0"
diskSpace = 1073741824
memory = 402653184
name = "hello-world"
nrOfCpus = 0.1
roles = [
  "web"
]
system = "hello-world"
systemVersion = "0"
tags = [
  "0.0.1"
]
version = "1"-> 0

Chirper still works

$ conduct info
Licensed To: cc64df31-ec6b-4e08-bb6b-3216721a56b@lightbend
Max ConductR agents: 3
ConductR Version(s): 0.1.0, 2.1.*
Grants: akka-sbr, cinnamon, conductr

ID       NAME                           TAG  #REP  #STR  #RUN  ROLES
cc3f7b2  friend-impl           1.0-SNAPSHOT     1     0     1  web
a09e7e0  load-test-impl        1.0-SNAPSHOT     1     0     1  web
ec3a715  activity-stream-impl  1.0-SNAPSHOT     1     0     1  web
2b43b4d  chirp-impl            1.0-SNAPSHOT     1     0     1  web
a32763e  cassandra                              1     0     1  cassandra
09aef82  front-end             1.0-SNAPSHOT     1     0     1  web
-> 0

@longshorej longshorej changed the title WIP - DO NOT MERGE - Refactor bndl so that component configurations are modified more consistently between different input types Refactor bndl so that component configurations are modified more consistently between different input types Jun 15, 2017
@longshorej
Copy link
Copy Markdown
Contributor Author

@huntc huntc merged commit 2d594dc into typesafehub:master Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants