cloudfoundry-community / autosleep

Auto sleep service for CloudFoundry
Apache License 2.0
39 stars 21 forks source link

Sample manifest uses env vs JAVA_OPTS in demo video #272

Open drnic opened 7 years ago

drnic commented 7 years ago

In the demo video, the manifest.tmpl.yml specifies all the properties via JAVA_OPTS:

screen shot 2017-01-08 at 3 05 18 pm

But in the https://github.com/cloudfoundry-community/autosleep/blob/develop/manifest.tmpl.yml the configuration is via env variables.

Is this either/or? Or is JAVA_OPTS preferred?

If we change configuration, do we cf restart or cf restage?

pradyutsarma commented 7 years ago

I guess the manifest was updated to not use the JAVA_OPTS after the cf summit demo. It would be better to stick to the env variables rather than the JAVA_OPTS variable. However, both work for me.

gberche-orange commented 7 years ago

@drnic

See related background on why we originally tried to avoid the . syntax in https://github.com/cloudfoundry-community/autosleep/pull/270#issuecomment-272848089

The JAVA_OPTS option allowed to still use the dot syntax (which allow for convenient copy/paste between the spring java source code and documentation), and not convert it to the snake case format (with underscores as separators).

Is this either/or? Or is JAVA_OPTS preferred?

I'd suggest to pick one of the syntax and stick to it.

There is a spring precedence order documented at https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-external-config (JAVA_OPTS is converted by java buildpack into JVM arguments which with the -D prefix translate into java system properties)

If we change configuration, do we cf restart or cf restage?

As any environment variables changes in CF, you have to restage. This may be optimized with restart only so speed up, I'm not sure (not specific to autosleep though).