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

Add experimental support for a statically built Supervisor, feature toggled in hab #625

Merged
merged 2 commits into from
Jun 3, 2016

Conversation

fnichol
Copy link
Collaborator

@fnichol fnichol commented Jun 2, 2016

This change set adds a statically build hab-sup Plan which produces a core/hab-sup-static package. The defaults of using a glibc-based dynamically linked binary remain unchanged. This will allow us to begin a vetting of a static Supervisor approach without committing all users to the experiment.

[hab] Add a simple feature toggle to use a static Supervisor.

This change introduces a simple feature toggle which allows the hab binary to use a statically build version of the Supervisor rather than the current glibc dynamically linked version.

As this is the first feature toggle that I know of in the codebase, we'll start really simple with an environment variable implementation and think carefully about scaling up to more :)

To back the hab start and hab sup subcommands with the core/hab-sup-static pacakge rather than the default core/hab-sup package, set the HAB_FEAT_SUP_STATIC environment variable to a non-empty value. Otherwise our default behavior continues as normal, using the core/hab-sup package.

For example:

> env RUST_LOG=info,hab::command::sup=debug,hab::exec=debug HAB_FEAT_SUP_STATIC=true hab start core/redis
DEBUG:hab::command::sup: Enabling statically compiled Supervisor from core/hab-sup-static
DEBUG:hab::exec: Calling execv: ("/hab/pkgs/core/hab-sup-static/0.6.0/20160602141707/bin/hab-sup") ["start", "core/redis"]
hab-sup(MN): Starting core/redis
hab-sup(GS): Supervisor 172.17.0.2: 13d12e83-de28-4ff9-8674-a64af032952b
hab-sup(GS): Census redis.default: abf0c60c-1cae-40bc-b1a3-fc64d96a5193
hab-sup(GS): Starting inbound gossip listener
-- snip --

gif-keyboard-17951758283600807726

@thesentinels
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @adamhjk to be a potential reviewer

@fnichol fnichol changed the title Add experiment support for a statically build Supervisor, feature toggled in hab Add experimental support for a statically build Supervisor, feature toggled in hab Jun 2, 2016
@fnichol fnichol changed the title Add experimental support for a statically build Supervisor, feature toggled in hab Add experimental support for a statically built Supervisor, feature toggled in hab Jun 2, 2016
@fnichol
Copy link
Collaborator Author

fnichol commented Jun 2, 2016

Note that if/when we merge this, then I'll push a core/hab-sup-static release to the Depot for easier end-user experimentation. It is possible to build the static Supervisor yourself with hab pkg build components/sup/static and then install it into your devshell with hab install ./results/core-hab-sup-static-*.hart

@thesentinels
Copy link
Contributor

☔ The latest upstream changes (presumably d0cdaa8) made this pull request unmergeable. Please resolve the merge conflicts.

@reset
Copy link
Collaborator

reset commented Jun 2, 2016

@fnichol this needs a rebase ;)

@fnichol
Copy link
Collaborator Author

fnichol commented Jun 2, 2016

Cool I merge-conflicted my own self!

gif-keyboard-5225112616654563954

This change introduces a simple feature toggle which allows the `hab`
binary to use a statically build version of the Supervisor rather than
the current glibc dynamically linked version.

As this is the first feature toggle that I know of in the codebase,
we'll start really simple with an environment variable implementation
and think carefully about scaling up to more :)

To back the `hab start` and `hab sup` subcommands with the
`core/hab-sup-static` pacakge rather than the default `core/hab-sup`
package, set the `HAB_FEAT_SUP_STATIC` environment variable to a
non-empty value. Otherwise our default behavior continues as normal,
using the `core/hab-sup` package.

For example:

```
> env RUST_LOG=info,hab::command::sup=debug,hab::exec=debug HAB_FEAT_SUP_STATIC=true hab start core/redis
DEBUG:hab::command::sup: Enabling statically compiled Supervisor from core/hab-sup-static
DEBUG:hab::exec: Calling execv: ("/hab/pkgs/core/hab-sup-static/0.6.0/20160602141707/bin/hab-sup") ["start", "core/redis"]
hab-sup(MN): Starting core/redis
hab-sup(GS): Supervisor 172.17.0.2: 13d12e83-de28-4ff9-8674-a64af032952b
hab-sup(GS): Census redis.default: abf0c60c-1cae-40bc-b1a3-fc64d96a5193
hab-sup(GS): Starting inbound gossip listener
-- snip --
```

Signed-off-by: Fletcher Nichol <[email protected]>
@fnichol fnichol force-pushed the fnichol/hab-sup-static branch from d7c421b to 2b95ce8 Compare June 2, 2016 19:05
@juliandunn
Copy link
Contributor

Let's take this - it's feature flagged off so we can roll it out whenever.

@thesentinels r+

@thesentinels
Copy link
Contributor

📌 Commit 2b95ce8 has been approved by juliandunn

@thesentinels
Copy link
Contributor

⌛ Testing commit 2b95ce8 with merge dc007e2...

thesentinels pushed a commit that referenced this pull request Jun 3, 2016
Signed-off-by: Fletcher Nichol <[email protected]>

Pull request: #625
Approved by: juliandunn
thesentinels pushed a commit that referenced this pull request Jun 3, 2016
This change introduces a simple feature toggle which allows the `hab`
binary to use a statically build version of the Supervisor rather than
the current glibc dynamically linked version.

As this is the first feature toggle that I know of in the codebase,
we'll start really simple with an environment variable implementation
and think carefully about scaling up to more :)

To back the `hab start` and `hab sup` subcommands with the
`core/hab-sup-static` pacakge rather than the default `core/hab-sup`
package, set the `HAB_FEAT_SUP_STATIC` environment variable to a
non-empty value. Otherwise our default behavior continues as normal,
using the `core/hab-sup` package.

For example:

```
> env RUST_LOG=info,hab::command::sup=debug,hab::exec=debug HAB_FEAT_SUP_STATIC=true hab start core/redis
DEBUG:hab::command::sup: Enabling statically compiled Supervisor from core/hab-sup-static
DEBUG:hab::exec: Calling execv: ("/hab/pkgs/core/hab-sup-static/0.6.0/20160602141707/bin/hab-sup") ["start", "core/redis"]
hab-sup(MN): Starting core/redis
hab-sup(GS): Supervisor 172.17.0.2: 13d12e83-de28-4ff9-8674-a64af032952b
hab-sup(GS): Census redis.default: abf0c60c-1cae-40bc-b1a3-fc64d96a5193
hab-sup(GS): Starting inbound gossip listener
-- snip --
```

Signed-off-by: Fletcher Nichol <[email protected]>

Pull request: #625
Approved by: juliandunn
@thesentinels
Copy link
Contributor

☀️ Test successful - travis

@thesentinels thesentinels merged commit 2b95ce8 into master Jun 3, 2016
@fnichol fnichol deleted the fnichol/hab-sup-static branch June 10, 2016 04:19
jtimberman pushed a commit that referenced this pull request Jun 12, 2016
Signed-off-by: Fletcher Nichol <[email protected]>

Pull request: #625
Approved by: juliandunn
jtimberman pushed a commit that referenced this pull request Jun 12, 2016
This change introduces a simple feature toggle which allows the `hab`
binary to use a statically build version of the Supervisor rather than
the current glibc dynamically linked version.

As this is the first feature toggle that I know of in the codebase,
we'll start really simple with an environment variable implementation
and think carefully about scaling up to more :)

To back the `hab start` and `hab sup` subcommands with the
`core/hab-sup-static` pacakge rather than the default `core/hab-sup`
package, set the `HAB_FEAT_SUP_STATIC` environment variable to a
non-empty value. Otherwise our default behavior continues as normal,
using the `core/hab-sup` package.

For example:

```
> env RUST_LOG=info,hab::command::sup=debug,hab::exec=debug HAB_FEAT_SUP_STATIC=true hab start core/redis
DEBUG:hab::command::sup: Enabling statically compiled Supervisor from core/hab-sup-static
DEBUG:hab::exec: Calling execv: ("/hab/pkgs/core/hab-sup-static/0.6.0/20160602141707/bin/hab-sup") ["start", "core/redis"]
hab-sup(MN): Starting core/redis
hab-sup(GS): Supervisor 172.17.0.2: 13d12e83-de28-4ff9-8674-a64af032952b
hab-sup(GS): Census redis.default: abf0c60c-1cae-40bc-b1a3-fc64d96a5193
hab-sup(GS): Starting inbound gossip listener
-- snip --
```

Signed-off-by: Fletcher Nichol <[email protected]>

Pull request: #625
Approved by: juliandunn
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.

4 participants