worker/caasoperator: download & unpack charm #8151

Merged
merged 2 commits into from Nov 29, 2017

Conversation

Projects
None yet
3 participants
Member

axw commented Nov 29, 2017

Description of change

When the operator starts up, it checks if it
has a charm directory. If it does not, it will
ask for the application's charm URL and SHA256
hash, download and verify, and then unpack it
into the charm directory. The agent also sets
its status to maintenance during that process,
and active later.

Also:

  • move Dockerfile and requirements.txt under the caas directory
  • change CAAS operator agent to never use lumberjack, always log to stderr (so we can use kubectl logs)

QA steps

  1. minikube start
  2. juju bootstrap localhost
  3. juju add-caas kubernetes k8s
  4. juju add-model k8s k8s
  5. juju deploy ubuntu
  6. eval $(minikube docker-env)
  7. make operator-image
  8. kubectl set image po/juju-operator-ubuntu juju-operator=juju/caas-jujud-operator:latest
    (wait for pod to be recreated)
  9. kubectl logs po/juju-operator-ubuntu
    (should see via logs that the charm is downloaded and "ready at /var/lib/juju/charm")
  10. docker exec -i ls /var/lib/juju/charm
    (should see contents of ubuntu charm)

Documentation changes

None.

Bug reference

None.

caas: send logs to stderr
Don't use lumberjack in the CAAS operator;
output logs to stderr, so CAAS native log
facilities can be used (e.g. kubectl logs).

Also, move Dockerfile under the caas directory.
+ // ForceUpgrade indicates whether or not application
+ // units should upgrade to the charm even if they
+ // are in an error state.
+ ForceUpgrade bool `json:"force-upgrade,omitempty"`
@wallyworld

wallyworld Nov 29, 2017

Owner

Do we need this? We don't upgrade running units.

@axw

axw Nov 29, 2017

Member

I'm thinking we might want to use this type for the uniter, to avoid making two calls like we do now (one to get the charm URL/force flag, another to get the SHA256 sum).

worker/caasoperator: download & unpack charm
When the operator starts up, it checks if it
has a charm directory. If it does not, it will
ask for the application's charm URL and SHA256
hash, download and verify, and then unpack it
into the charm directory. The agent also sets
its status to maintenance during that process,
and active later.
Member

axw commented Nov 29, 2017

$$merge$$

Contributor

jujubot commented Nov 29, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit ed762fa into juju:develop Nov 29, 2017

1 check failed

continuous-integration/jenkins/pr-merge This commit cannot be built
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment