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

[hab] Creation of hab binary. #342

Merged
merged 12 commits into from
Apr 5, 2016
Merged

[hab] Creation of hab binary. #342

merged 12 commits into from
Apr 5, 2016

Conversation

fnichol
Copy link
Collaborator

@fnichol fnichol commented Apr 1, 2016

This change introduces a new binary into the Habitat ecosystem: the
hab command, which is intended to be a user-facing command set,
seperate from the Habitat Supervisor (called via the hab-sup binary).

The current implementation is a first step: part prototype and part
implementation. It shows a possible command set layout (i.e. a hab <NOUN> <VERB> structure) and short command aliases. Here is the current output from
the help usage:

hab 0.4.0

Authors: The Habitat Maintainers <[email protected]>

"A Habitat is the natural environment for your services" - Alan Turing

USAGE:
    hab [FLAGS] [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    archive    Runs Habitat package archive commands
    help       Prints this message or the help message of the given subcommand(s)
    pkg        Runs Habitat package commands
    rumor      Runs Habitat rumor commands
    sup        Runs Habitat supervisor commands

ALIASES:
    inject      Alias for: 'rumor inject'
    install     Alias for: 'pkg install'
    start       Alias for: 'sup start'

Additionally, subcommand and alias delegation has a first-pass implementation.
This is used for the hap sup subcommand, which actually executes the
hap-sup binary via an execv(3) system call. In other words the hap
program becomes the hap-sup program, passing along all behavior including
help dialogs. The hab start alias also delegates directly to the hab-sup start subcommand.

@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

@fnichol fnichol force-pushed the fnichol/hab-cli-mvp branch from 8768b06 to bf6893f Compare April 3, 2016 15:27
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

1 similar comment
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

fnichol added 9 commits April 5, 2016 10:24
This change introduces a new binary into the Habitat ecosystem: the
`hab` command, which is intended to be a user-facing command set,
seperate from the Habitat Supervisor (called via the `hab-sup` binary).

The current implementation is a first step: part prototype and part
implementation. It shows a possible command set layout (i.e. a `hab <NOUN>
<VERB>` structure) and short command aliases. Here is the current output from
the help usage:

```
hab 0.4.0

Authors: The Habitat Maintainers <[email protected]>

"A Habitat is the natural environment for your services" - Alan Turing

USAGE:
    hab [FLAGS] [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    arch    Runs Habitat package archive commands
    help    Prints this message or the help message of the given subcommand(s)
    pkg     Runs Habitat package commands
    sup     Runs Habitat supervisor commands

ALIASES:
    install     Alias for: 'pkg install'
    start       Alias for: 'sup start'

```

Additionally, subcommand and alias delegation has a first-pass implementation.
This is used for the `hap sup` subcommand, which actually executes the
`hap-sup` binary via an `execv(3)` system call. In other words the `hap`
program becomes the `hap-sup` program, passing along all behavior including
help dialogs. The `hab start` alias also delegates directly to the `hab-sup
start` subcommand.
@fnichol fnichol force-pushed the fnichol/hab-cli-mvp branch from 124cd6b to 85aa340 Compare April 5, 2016 16:27
@fnichol
Copy link
Collaborator Author

fnichol commented Apr 5, 2016

Current status of hab:

root@a122aba2a80f:/src# hab
hab 0.4.0

Authors: The Habitat Maintainers <[email protected]>

"A Habitat is the natural environment for your services" - Alan Turing

USAGE:
    hab [FLAGS] [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    archive    Runs Habitat package archive commands
    help       Prints this message or the help message of the given subcommand(s)
    pkg        Runs Habitat package commands
    rumor      Runs Habitat rumor commands
    sup        Runs Habitat supervisor commands

ALIASES:
    inject      Alias for: 'rumor inject'
    install     Alias for: 'pkg install'
    start       Alias for: 'sup start'

Current status of hab-sup:

root@a122aba2a80f:/src# hab-sup
bldr 0.4.0

USAGE:
        hab-sup [FLAGS] [SUBCOMMAND]

FLAGS:
    -h, --help        Prints help information
        --no-color    Turn ANSI color off :(
    -V, --version     Prints version information
    -v                Verbose output; shows line numbers

SUBCOMMANDS:
    config                  Print the default.toml for a given package
    decrypt                 Decrypt and verify a message
    encrypt                 Encrypt and sign a message with a service as the recipient
    export-key              Export a public bldr key
    generate-service-key    Generate a bldr service key
    generate-user-key       Generate a bldr user key
    help                    Prints this message
    import-key              Import a public bldr key
    list-keys               List user and service keys
    sh                      Start an interactive shell
    start                   Start a bldr package

fnichol added 3 commits April 5, 2016 13:04
Note that the origin has not yet changed, but allows us to build and run
packages with the new artifact names from a Depot.
@fnichol fnichol changed the title WIP - [hab] Creation of hab binary. [hab] Creation of hab binary. Apr 5, 2016
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

pub mod ident;
pub mod install;

pub use self::archive::PackageArchive;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Exactly.

@reset
Copy link
Collaborator

reset commented Apr 5, 2016

@fnichol what is the common crate for versus the core crate?

@fnichol
Copy link
Collaborator Author

fnichol commented Apr 5, 2016

@reset I'm hoping this could be a temporary crate that is hosting some common code to both the hab CLI and the hap-sup Supervisor. If the code went into core then all other projects (hab-depot, builder-*, etc.) would gain that extra code and any deps. required. I needed to make depot-client API calls which left me at a circular dependency loop (depot-client requires core, which depot-core) and so put the code in "another spot". Not a fan of the name ATM, but it got the feature work completed.

@bookshelfdave
Copy link
Contributor

LGTM

@reset
Copy link
Collaborator

reset commented Apr 5, 2016

@fnichol looks good to me as long as the common crate is a temporary solution. Let's do it:

gif-keyboard-17695186407360658884

@reset
Copy link
Collaborator

reset commented Apr 5, 2016

@delivery approve

@chef-delivery chef-delivery merged commit c63d995 into master Apr 5, 2016
@chef-delivery
Copy link
Contributor

Failed to approve change: 620a3fe4-b22d-4451-ac4f-da849828a3a3 @reset

@reset
Copy link
Collaborator

reset commented Apr 5, 2016

@delivery approve

@chef-delivery
Copy link
Contributor

Failed to approve change: 620a3fe4-b22d-4451-ac4f-da849828a3a3 @reset

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