Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

worker/caasoperator: download & unpack charm #8151

Merged
merged 2 commits into from Nov 29, 2017

Conversation

axw
Copy link
Contributor

@axw 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.

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.
@axw
Copy link
Contributor Author

axw commented Nov 29, 2017

// 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"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

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.
@axw
Copy link
Contributor Author

axw commented Nov 29, 2017

$$merge$$

@jujubot
Copy link
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants