Giter VIP home page Giter VIP logo

habitat-sh / habitat Goto Github PK

View Code? Open in Web Editor NEW
2.6K 83.0 315.0 184.67 MB

Modern applications with built-in automation

Home Page: https://www.habitat.sh

License: Apache License 2.0

Makefile 0.25% Shell 10.38% Rust 78.92% Ruby 0.14% HTML 0.01% JavaScript 0.25% RAML 0.21% PowerShell 8.85% Batchfile 0.01% Dockerfile 0.24% C# 0.49% C 0.15% Handlebars 0.09% Go 0.01% Mustache 0.01%
automation configuration-management distributed-systems containers rust package-manager package-management choreographer

habitat's Introduction

Build Status Discourse status Open Source Helpers

Habitat is open source software that creates platform-independent build artifacts and provides built-in deployment and management capabilities.

The goal of Habitat is to allow you to automate your application behavior when you create your application, and then bundle your application with the automation it needs to behave with the correct run time behavior, update strategies, failure handling strategies, and scaling behavior, wherever you choose to deploy it.

See a quick demo of how to build, deploy and manage an application with Habitat:

Project State: Active

Issues Response Time Max: 5 business days

Pull Request Response Time Max: 5 business days

Build, Deploy and Manage with Habitat (5:33)

Table of Contents

Diagrams

Graphics that will help you and your team better understand the concepts and how they fit together into the larger Habitat ecosystem.

Where Habitat Fits

Habitat Flow Infographic

Try the interactive infographics on the website!

How Habitat Works

Habitat and Docker

View all diagrams in Docs

Training

View all demos and tutorials in Learn

Install

You can download Habitat from the Habitat downloads page.

Once you have downloaded it, follow the instructions on the page for your specific operating system.

If you are running macOS and use Homebrew, you can use our official Homebrew tap.

$ brew tap habitat-sh/habitat
$ brew install hab

If you are running Windows and use Chocolatey, you can install our chocolatey package

C:\> choco install habitat

If you do not run Homebrew or Chocolatey, or if you use Linux, you can use the Habitat install.sh or install.ps1 script.

Bash:

$ curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash

Powershell:

C:\> Set-ExecutionPolicy Bypass -Scope Process -Force
C:\> iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.ps1'))

Contribute

We are always looking for more opportunities for community involvement. Interested in contributing? Check out our CONTRIBUTING.md to get started!

Documentation

Get started with the Habitat tutorials or plunge into the complete documentation.

Code Organization

Core Plans

The Habitat plans that are built and maintained by Habitat's Core Team are in their own repo.

Habitat Supervisor and other core components

The code for the Habitat Supervisor and other core components are in the components directory.

Docs

Habitat's website and documentation source is located in the www directory of the Habitat source code. See its README for more information.

Roadmap

The Habitat project's roadmap is public and is on our community page.

The Habitat core team's project tracker is also public and on Github.

Community and support

Building

See BUILDING.md for platform specific info on building Habitat from source.

Native Packages

See README.md for info on Native Packages.

Further reference material

Code of Conduct

Participation in the Habitat community is governed by the code of conduct.

License

Copyright (c) 2016 Chef Software Inc. and/or applicable contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

habitat's People

Contributors

adamhjk avatar atrniv avatar baumanj avatar chef-ci avatar chef-delivery avatar chefsalim avatar christophermaier avatar cnunciato avatar davidmcneil avatar dependabot[bot] avatar elliott-davis avatar fnichol avatar georgemarshall avatar ianmadd avatar jasonheath avatar jeremymv2 avatar krnowak avatar magwalk avatar mgamini avatar mwrock avatar nellshamrell avatar qubitrenegade avatar raskchanky avatar reset avatar sajjaphani avatar scotthain avatar smacfarlane avatar smurawski avatar tashimi avatar thesentinels avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

habitat's Issues

[plans] Curl plan should support/find CA certificates out of the box

When I run a curl command, and it requires CA certificates for an SSL/TLS connection, the command should not fail. Current behavior is:

> hab install core/curl
» Installing core/curl
→ Using core/cacerts/2016.04.20/20160427211220
→ Using core/glibc/2.22/20160427193532
→ Using core/linux-headers/4.3/20160427193435
→ Using core/openssl/1.0.2g/20160427211222
→ Using core/zlib/1.2.8/20160427194411
↓ Downloading core/curl/7.47.1/20160428171340
    485.03 KB / 485.03 KB \ [====] 100.00 % 1.79 MB/s
✓ Installed core/curl/7.47.1/20160428171340
★ Install of core/curl complete with 6 packages installed.

> hab pkg exec core/curl curl -v https://google.com
* Rebuilt URL to: https://google.com/
*   Trying 172.217.2.142...
* Connected to google.com (172.217.2.142) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, Client hello (1):
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

I suspect this is either a tweak to the ./configure in the Plan, or if curl cannot support this for some reason we could move bin/curl to bin/curl.real and use a wrapping script at bin/curl to look something like this:

#!$(pkg_path_for busybox-static)/bin/sh
exec $pkg_prefix/bin/curl.real --cacert $(pkg_path_for cacerts)/ssl/cacert.pem) $@

Could be a nice entry point for someone looking to dig into Plan authorship 😄

Studio doesn't work properly with "vi"

I'm running a Virtualbox on Windows with CentOS 7.
When I SSH in from Cygwin and use "vi" from within studio, keystrokes display letters instead (see screenshot).

habitat_editor_issue

I suspected maybe it was Cygwin since Windows isn't supported, but I get similar odd behaviour when running inside of Virtualbox. The difference is keystrokes don't display characters, but "i" doesn't quite enable "Insert Mode" properly (e.g. backspace doesn't backspace).

Possibly no "vi" support?

Running build outside studio leads to odd log filenames

On OSX:

~/plans/mytutorialapp $ hab pkg build .
...snip...
Script done, file is /src/results/logs/..2016-06-16-145637.log
~/plans/mytutorialapp $ ls -la results/logs/
total 232
drwxr-xr-x  2 miketheman  staff     102 Jun 16 10:57 .
drwxr-xr-x  3 miketheman  staff     272 Jun 16 10:56 ..
-rw-r--r--  1 miketheman  staff  117898 Jun 16 10:56 ..2016-06-16-145637.log

hab start core/hab-depot with set permissions failed

  1. hab pkg install core/hab-depot
  2. hab start core/hab-depot
hab-sup(MN): Starting core/hab-depot
hab-sup(GS): Supervisor 192.168.1.110: 874a76f8-42e6-486c-9eea-40157e847fa3
hab-sup(GS): Census hab-depot.default: 79902ce8-7189-43e5-ba6f-613cff84e4d8
hab-sup(GS): Starting inbound gossip listener
hab-sup(GS): Starting outbound gossip distributor
hab-sup(GS): Starting gossip failure detector
hab-sup(CN): Starting census health adjuster
hab-sup(ER)[src/error.rs:328:8]: Failed to set permissions

how could it be possible to run depot locally?

Document key upload process in 'Uploading keys' section

The following section covers setting up keys to share packages

https://www.habitat.sh/docs/share-packages-overview/

It doesn't cover:

  • How to generate a key
  • Where the public & private key is located

Uploading the keys for the origin

If you created a new origin and the depot does not already have the keys for that origin, you may upload them. If you do not upload at least the public key for the origin, the depot will reject the upload of your packages under that origin.

Providing the public key for the origin allows supervisors to verify the integrity of the Habitat packages (.hart files).

You can upload keys for the origin through the web interface for the depot, or by using the hab origin key upload command. You must be authenticated using the access token described in the previous step before you can upload keys.

https://www.habitat.sh/docs/concepts-keys/

The habitat dashboard contains 2 links 'managing and using keys' and 'generating keys'
They both link to this ^ page. However that page doesn't document the key creation process.

screenshot 2016-06-17 11 58 55

Update

User dparfitt in slack clarified that you don't need to use the gui to upload a key

hab origin key generate foo
hab origin key upload foo

If you look closely when doing hab origin key generate foo you will see that the key is stored locally at

/Users/<yourUser>/.hab/cache/keys/foo-20160618202715.pub

hab version outside studio doesn't match version inside studio

On OSX:

~/plans/mytutorialapp $ hab --version
hab 0.7.0/20160614231131
~/plans/mytutorialapp $ hab studio enter
   hab-studio: Creating Studio at /hab/studios/src (default)
   hab-studio: Importing miketheman secret origin key
» Importing origin key from standard input
★ Imported secret origin key miketheman-20160616143833.
   hab-studio: Entering Studio at /hab/studios/src (default)
   hab-studio: Exported: HAB_ORIGIN=miketheman
[1][default:/src:0]# hab --version
hab 0.6.0/20160613074414

bash completion for `hab`

For discovering how to use habitat, it would be super-convenient to

  1. have basic completion: hab p[TAB] -> hab pkg etc.,
  2. have more advanced completion:
    • hab pkg exec [TAB] -> hab pkg core/hab-pkg-`
    • hab pkg exec core/hab-pkg-do[TAB] -> hab pkg exec core/hab-pkg-docker,
    • hab pkg exec core/hab-pkg-docker [TAB] -> ``hab pkg exec core/hab-pkg-docker hab-pkg-dockerize`

clap-rs/clap#376 is probably relevant for (1.); (2.) is probably harder.

support core/pip for python

in do_build() I want to install pip deps, but I get these errors:

Traceback (most recent call last):
  File "get-pip.py", line 19177, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available

the problem is core/python didn't compiled with zlib.

so could you please support pip for python?

[builder-web] Lint Angular code with codelyzer

The Story

As a Habitat engineer, I would like to have my code linted according to the Angular 2 style guide, so I can have easier to understand code.

Description

Angular 2 has published a style guide (https://angular.io/styleguide), and a tool for linting according to that style guide (https://www.npmjs.com/package/codelyzer.) We should start following these guidelines where appropriate and using codelyzer in the lint process.

Acceptance Criteria

  • npm run lint uses a form of the recommended configuration for codelyzer
  • The app works

[builder-web] Origins failing to load

Via Chrome https://app.habitat.sh/#/origins

I created a self-named origin on one computer yesterday.

Today, on another computer, I get:

Failed to load origins: Cannot read property 'map' of undefined

Source of message is here:

<div *ngIf="!ui.loading" class="page-body">
<p *ngIf="ui.errorMessage">
Failed to load origins: {{ui.errorMessage}}
</p>

From the second computer, I can see these in the inspector console:

GET https://willem.habitat.sh/v1/user/origins 401 (Unauthorized)
GET https://willem.habitat.sh/v1/user/invitations 401 (Unauthorized)

Signing out fully and signing in again works.

Where do you get the core key?

The README says to install the signing key in /hab/cache/keys before running the next step.

Where does one obtain the key from?

Problem with Gossip exchange when nodes have multiple NICs

I have a problem getting Gossip exchange to work in an environment where Docker containers are connected to multiple networks.
Containers have two NICs:
eth0 (docker0 bridge network)
eth1 (multi-host overlay network)

The supervisor seems to report the first routable IP as it's gossip address to other peers. This makes the Gossip exchange fail since the eth0 IP is not routed to the other containers.
And given that IP addresses of Docker containers are ephemeral, the supervisor's --listen-peer option can't be used to solve this.

In Docker container networks you really want to always refer to other containers/services by their name and not an IP address. Since peers already do report their hostname, please make it an option for the supervisor to use the hostname of the peer when establishing Gossip connections.

Uploading a package allowed when no key in Origin

The Scene

An environment so secure, it requires cryptographic magic to ensure that the person that built and uploaded a package is allowed to download and run it.

The Players

A young(-ish) man, trying really hard to create a package that he can share with the world.
A young website, trying to allow anyone to submit and download signed packages.


Act I

He types in hab pkg build and is finally met with the pleasure of an exit code that is equal to 0.

Following directions, he then uploads the package to the website with a "swift" hab pkg upload results/miketheman-mytutorialapp-0.1.0-20160616184336-x86_64-linux.hart
(director's note - the results place gets a bit messy and these names are pretty long and hard to tab-complete).

The package is then shuttled off to some nether regions of US-WEST-2, where some goblins will snack on it.

fade

Act II

Zoom in on our youngish man, trying to do the Right Thing, opens up a new session somewhere, and tries to run the packaged application.

$ hab sup start miketheman/mytutorialapp
∵ Package for core/hab-sup not found, installing
» Installing core/hab-sup
↓ Downloading core/busybox-static/1.24.2/20160612081725
...
↓ Downloading miketheman-20160616143833 public origin key
hab-sup(ER)[src/error.rs:310:8]: 404 Not Found

He bursts into tears, and throws his laptop off the top of the Empire State Building, swearing off computing and moves to a farm to raise goats.

fade

Act III

Some time later, a not-so-young man discusses his experience with others, and finds out that he wasn't alone, and that indeed, this had been identified close to launch but had not circled back to resolve.

The man's hard exterior softens, and his pent-up misery of the previous era washes out, as he finds himself surrounded by people that love him, and accept him for who he is, just a guy trying to do a thing.

All along, all that was needed was a small guard against uploading to a website when a signing key wasn't available for download.
With that addition, the wrongs are righted, and our cast of merry troubadours continues on to the next web-town to spread joy and happiness.

FIN

Why Rust?

Just curious to know why Habitat was written in mostly Rust? What other languages were considered? What was the final deciding factor for using Rust?

docker issue during hab export

I am following the tutorial steps and currently i am on this step:

[default:/src:0]# hab pkg export docker myorigin/mytutorialapp

and i am getting the following error

★ Install of core/hab-sup complete with 12 packages installed.
» Symlinking hab from core/hab into /tmp/hab-pkg-dockerize-dylO/rootfs/hab/bin
★ Binary hab from core/hab/0.7.0/20160614230104 symlinked to /tmp/hab-pkg-dockerize-dylO/rootfs/hab/bin/hab
» Symlinking bash from core/busybox-static into /tmp/hab-pkg-dockerize-dylO/rootfs/bin
★ Binary bash from core/busybox-static/1.24.2/20160612081725 symlinked to /tmp/hab-pkg-dockerize-dylO/rootfs/bin/bash
» Symlinking sh from core/busybox-static into /tmp/hab-pkg-dockerize-dylO/rootfs/bin
★ Binary sh from core/busybox-static/1.24.2/20160612081725 symlinked to /tmp/hab-pkg-dockerize-dylO/rootfs/bin/sh
Error response from daemon: client is newer than server (client API version: 1.23, server API version: 1.22)

  • how should i solve it ?

[builder-web] Upgrade to Angular 2 RC

The Story

As a Habitat engineer, I want be running the latest release candidate of Angular 2, so I can keep up to date with the current features of the software.

Description

Angular 2 is now release candidate: https://github.com/angular/angular/blob/master/CHANGELOG.md#200-rc2-2016-06-15

Some things have changed, like the names of the packages and where different things are stored, so there's a little work upgrading.

We should not switch to the new router, that's a separate ticket. Use the router-deprecated module instead.

Acceptance Criteria

  • The latest release candidate is in package.json and npm-shrinkwrap.json
  • Everything in the app works as expected

plan.sh file not seen when on a mounted disk image path

Hi all
I am on OS X El Capitan 10.11.5 and I use a mounted disk image (.dmg) for projects, etc. While I was learning Habitat by the documentation, I noticed when entering the studio with hab studio enter from /my/mounted/folder/plans/myproject then running build it would say

ERROR: Plan file not found at /src/plan.sh or /src/habitat/plan.sh

If I follow the docs/tutorial strictly, and I do the same from ~/plans/myproject it runs.

Is this expected?

"No such file or directory" trying to enter the studio

Attempts to enter studio complained about not finding an unspecified file or directory.

$ sudo hab studio -k myorigin enter
✗✗✗
✗✗✗ No such file or directory (os error 2)
✗✗✗

The fix was to create /hab/pkgs manually (sudo mkdir -p /hab/pkgs). @adamhjk noted this should have happened automatically and that's not happening for some reason with the bare Linux binary. Once the directory existed, the above command did all of the package downloading it needed and dropped me at the studio prompt.

In case it's relevant, it wasn't obvious in the tutorial that I should run the above command with sudo, so my first attempts omitted it. I don't know if hab stashed a "we already ran, so don't worry about bootstrapping anything" value somewhere. Probably not, but just in case.

Hab has issues installing package dependencies on Mac

Example:

➜  hab install core/hab-depot
» Installing core/hab-depot
↓ Downloading core/bzip2/1.0.6/20160612075040
    141.05 KB / 141.05 KB / [========================================================================================] 100.00 % 899.75 KB/s  ✗✗✗
✗✗✗ Can't create '/hab/pkgs/core/bzip2/1.0.6/20160612075040' (libarchive err_code=2)
✗✗✗

Non-existent hab user/group results in `Failed to set permissions` error

I was missing the hab user/group and trying to run hab start core/postgresql. It would be nice to detect this state specifically from other generic failed to set permissions errors.

hab-sup(ER)[src/error.rs:321:8]: Failed to set permissions

impl From<hcore::Error> for SupError {
    fn from(err: hcore::Error) -> SupError {
        sup_error!(Error::HabitatCore(err))
    }
}

be able to modify and rebuild from plan.sh without rerunning a full build.

Doing a build of mariadb takes 30+ minutes, it would be great if I could update stuff in the plan.sh that does not affect the build and thus skip the do_build() step.

It would be cool if habitat could autodetect that I didn't change anything critical to the build, but I'd be okay with passing a flag like --skip-build or something.

habitat shouldn't require sudo

Is there any particular (and well motivated) reason why habitat should be running using sudo? It requires access to /hab/pkgs/, can user change path for pkgs? or keep it somewhere in home while uid!=0?

Applications shouldn't require root to start (for example hab start core/redis). While I can interact with docker without beeing root, hab tries to force this on me.

[feature request] plan.sh generator

Something like hab create {planname} or such that would generate a plan.sh with some boilerplate variables.
Maybe similar to Homebrew's create - where passing in a github release tag url activates a lot of the default variables

This would lower the "getting started" bar for a new plan.

hab studio: unzip: command not found

build command fails when the pkg_source is a .zip file.

I expect a .zip file to work the same way a .tar.gz file would work.

Here is a sample plan.sh to demonstrate the error:

pkg_origin=nathenharvey
pkg_name=etherpad-lite
pkg_version=1.6.0
pkg_maintainer="Nathen Harvey <[email protected]>"
pkg_license=('Apache-2.0')
pkg_source=https://github.com/ether/${pkg_name}/archive/${pkg_version}.zip
pkg_shasum="d0635f2904f0c06295bde9d37ec950329cea319ae2dc7d2fdedcb1a281dbbad8"
pkg_deps=(core/node)
pkg_build_deps=()
pkg_expose=(9001)

do_build() {
  echo "This is a no-op"
}

do_install() {
  echo "this is a no-op"
}

build fails if pkg_source is blank

If your plan.sh file doesn't have a pkg_source, then it throws the following error basename: missing operand

[3][default:/src:1]# build /src/
   : Loading /src/plan.sh
   redis: Plan loaded
basename: missing operand
Try 'basename --help' for more information.
   redis: Build time: 0m0s
   redis: Exiting on error

with debug

[1][default:/src:0]# ls
00-RELEASENOTES  CONTRIBUTING  INSTALL    Makefile   deps     redis.conf  runtest-cluster   sentinel.conf  tests
BUGS             COPYING       MANIFESTO  README.md  plan.sh  runtest     runtest-sentinel  src            utils
[2][default:/src:0]# DEBUG=1 build /src/
++ basename /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build
+ _program=hab-plan-build
+ HAB_PLAN_BUILD=0.7.0/20160614232259
+ : /hab
+ HAB_CACHE_SRC_PATH=/hab/cache/src
+ HAB_CACHE_ARTIFACT_PATH=/hab/cache/artifacts
+ : /hab/cache/keys
+ export HAB_CACHE_KEY_PATH
+ HAB_PKG_PATH=/hab/pkgs
+ PLAN_CONTEXT=/src/
+ : https://willem.habitat.sh/v1/depot
+ export HAB_DEPOT_URL
+ INITIAL_PATH=/hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin:/hab/pkgs/core/bash/4.3.42/20160612075613/bin:/hab/pkgs/core/binutils/2.25.1/20160612064534/bin:/hab/pkgs/core/bzip2/1.0.6/20160612075040/bin:/hab/pkgs/core/coreutils/8.24/20160612075329/bin:/hab/pkgs/core/file/5.24/20160612064523/bin:/hab/pkgs/core/findutils/4.4.2/20160612080341/bin:/hab/pkgs/core/gawk/4.1.3/20160612075739/bin:/hab/pkgs/core/grep/2.22/20160612075540/bin:/hab/pkgs/core/gzip/1.6/20160612080637/bin:/hab/pkgs/core/hab/0.7.0/20160614230104/bin:/hab/pkgs/core/sed/4.2.2/20160612075228/bin:/hab/pkgs/core/tar/1.28/20160612075701/bin:/hab/pkgs/core/unzip/6.0/20160612081414/bin:/hab/pkgs/core/wget/1.16.3/20160612081342/bin:/hab/pkgs/core/xz/5.2.2/20160612080402/bin:/hab/pkgs/core/acl/2.2.52/20160612075215/bin:/hab/pkgs/core/attr/2.4.47/20160612075207/bin:/hab/pkgs/core/glibc/2.22/20160612063629/bin:/hab/pkgs/core/less/481/20160612080021/bin:/hab/pkgs/core/libcap/2.24/20160612075226/bin:/hab/pkgs/core/libidn/1.32/20160612081104/bin:/hab/pkgs/core/ncurses/6.0/20160612075116/bin:/hab/pkgs/core/openssl/1.0.2h/20160612081127/bin:/hab/pkgs/core/pcre/8.38/20160612075520/bin
++ pwd
+ INITIAL_PWD=/src
++ tr '[[:upper:]]' '[[:lower:]]'
++ uname -m
+ pkg_arch=x86_64
++ tr '[[:upper:]]' '[[:lower:]]'
++ uname -s
+ pkg_sys=linux
+ pkg_target=x86_64-linux
+ pkg_origin=
++ date -u +%Y%m%d%H%M%S
+ pkg_release=20160615220544
+ pkg_build_deps=()
+ pkg_deps=()
+ pkg_lib_dirs=()
+ pkg_bin_dirs=()
+ pkg_include_dirs=()
+ pkg_svc_run=
+ pkg_expose=()
+ pkg_svc_user=hab
+ pkg_svc_group=hab
+ pkg_svc_path=/hab/svc/@__pkg_name__@
+ pkg_svc_data_path=/hab/svc/@__pkg_name__@/data
+ pkg_svc_files_path=/hab/svc/@__pkg_name__@/files
+ pkg_svc_var_path=/hab/svc/@__pkg_name__@/var
+ pkg_svc_config_path=/hab/svc/@__pkg_name__@/config
+ pkg_svc_static_path=/hab/svc/@__pkg_name__@/static
+ graceful_exit=true
+ umask 0022
+ trap _on_exit 1 2 3 15 ERR
+ OPTIND=2
+ getopts u: opt
++ abspath /src/
++ [[ -d /src/ ]]
++ pushd /src/
++ pwd
++ popd
+ PLAN_CONTEXT=/src
++ abspath /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build
++ [[ -d /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build ]]
++ [[ -e /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build ]]
+++ dirname /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build
++ pushd /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin
+++ pwd
+++ basename /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build
++ echo /hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build
++ popd
+ THIS_PROGRAM=/hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build
+ [[ -f /src/plan.sh ]]
+ [[ -f /src/habitat/plan.sh ]]
+ [[ ! -f /src/plan.sh ]]
+ cd /src
+ build_line 'Loading /src/plan.sh'
+ case "${TERM:-}" in
+ echo -e '   \033[1;36m: \033[1;37mLoading /src/plan.sh\033[0m'
   : Loading /src/plan.sh
+ return 0
+ source /src/plan.sh
++ pkg_origin=spuder
++ pkg_name=redis
++ pkg_version=0.0.1
++ pkg_maintainer='Your Name <your email address>'
++ pkg_license=()
++ pkg_deps=()
++ pkg_build_deps=(core/make)
++ pkg_bin_dirs=(bin)
++ pkg_lib_dirs=(lib)
++ pkg_expose=(6379)
++ pkg_svc_user=root
+ build_line 'Plan loaded'
+ case "${TERM:-}" in
+ echo -e '   \033[1;36mredis: \033[1;37mPlan loaded\033[0m'
   redis: Plan loaded
+ return 0
+ [[ -n root ]]
+ pkg_origin=root
+ [[ -z root ]]
+ [[ -z 0.0.1 ]]
+ [[ -n xxx ]]
++ sed 's|@__pkg_name__@|redis|g'
++ echo
+ pkg_svc_run=
+ [[ -z '' ]]
++ basename
basename: missing operand
Try 'basename --help' for more information.
+ pkg_filename=
++ _on_exit
++ local exit_status=1
++ [[ 0 -gt 0 ]]
++ : redis
++ elapsed=0
+++ awk '{printf "%dm%ds", $1/60, $1%60}'
+++ echo 0
++ elapsed=0m0s
++ case "${TERM:-}" in
++ echo -e '   \033[1;36mredis: \033[1;37mBuild time: 0m0s\033[0m'
   redis: Build time: 0m0s
++ [[ 1 -ne 0 ]]
++ case "${TERM:-}" in
++ echo -e '   \033[1;36mredis: \033[1;31mExiting on error\033[0m'
   redis: Exiting on error
++ exit 1

Steps to reproduce

  • Clone redis
  • cd redis-stable
  • make plan file
  • enter studio
  • build /src/
pkg_origin=spuder
pkg_name=redis
pkg_version=0.0.1
pkg_maintainer="Your Name <your email address>"
pkg_license=()
#pkg_source=http://apache.claz.org/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz
#pkg_shasum=f10a0b51f45c4f64c1fe69ef713abf9eb9571bc7385a82da892e83bb6c965e90
pkg_deps=()
pkg_build_deps=(core/make)
pkg_bin_dirs=(bin)
#pkg_include_dirs=(include)
pkg_lib_dirs=(lib)
pkg_expose=(6379)
pkg_svc_user="root"

do_build() {
    make
}

Format plans so most frequently changed variables are at the top

Proposal

Add a 'format' command, ( a la go fmt or terraform fmt) to put plans into a consistent order.

Why

90% of a plan will never change. Whereas a few lines will change with every release. Those should be at the top and in a predictable order.

Additionally some variables are required (pkg_name, pkg_origin, pkg_source, pkg_shasum).

For example, look at the elasticsearch plan

pkg_name=elasticsearch
pkg_origin=core
pkg_version=2.3.2
pkg_maintainer="The Habitat Maintainers <[email protected]>"
pkg_license=('Revised BSD')
pkg_source=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${pkg_version}/${pkg_name}-${pkg_version}.tar.gz
pkg_filename=${pkg_name}-${pkg_version}.tar.gz
pkg_shasum=04c4d3913d496d217e038da88df939108369ae2e78eea29cb1adf1c4ab3a000a
pkg_deps=(core/glibc core/server-jre)
pkg_bin_dirs=(bin)
pkg_lib_dirs=(lib)
pkg_svc_run="es/bin/elasticsearch --default.path.conf=$pkg_svc_config_path"
pkg_expose=(9200 9300)

Elasticsearch releases frequently, why not put the version & shasum near the top.

# Frequently changed values
pkg_name=elasticsearch
pkg_origin=core
pkg_version=2.3.2
pkg_shasum=04c4d3913d496d217e038da88df939108369ae2e78eea29cb1adf1c4ab3a000a

Generator

An alternative solution to having a tool that modifies the order, would be to have a 'generator' that creates a generic plan with a sane order

Specify dependency versions

Please don't use * for dependency versions. This basically skips all the nice properties of using SemVer for crates (which cargo assumes).

It probably doesn't matter that much to you right now since you have Cargo.lock files anyway, but in general it's just… not good. It should be easy to replace all * versions in Cargo.toml files with the specific version used in the corresponding Cargo.lock.

./configure: No such file or directory

Using the following plan file

pkg_origin=spuder
pkg_name=ant
pkg_version=1.9.7
pkg_maintainer="Your Name <your email address>"
pkg_license=('Apache 2')
pkg_source=http://apache.osuosl.org//ant/binaries/apache-ant-1.9.7-bin.tar.gz
pkg_shasum=1d0b808fe82cce9bcc167f8dbb7c7e89c1d7f7534c0d9c64bf615ec7c3e6bfe5
pkg_deps=()
pkg_build_deps=(
  core/make
  core/gcc
)
pkg_bin_dirs=(bin)

Gives the following error

/hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build: line 1700: ./configure: No such file or directory
   ant: Downloading 'http://apache.osuosl.org//ant/binaries/apache-ant-1.9.7-bin.tar.gz' to 'apache-ant-1.9.7-bin.tar.gz'
--2016-06-16 04:19:15--  http://apache.osuosl.org//ant/binaries/apache-ant-1.9.7-bin.tar.gz
Resolving apache.osuosl.org (apache.osuosl.org)... 64.50.236.52, 64.50.233.100
Connecting to apache.osuosl.org (apache.osuosl.org)|64.50.236.52|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5601575 (5.3M) [application/x-gzip]
Saving to: 'apache-ant-1.9.7-bin.tar.gz'

apache-ant-1.9.7-bi 100%[=====================>]   5.34M   509KB/s   in 9.7s

2016-06-16 04:19:25 (566 KB/s) - 'apache-ant-1.9.7-bin.tar.gz' saved [5601575/5601575]

   ant: Downloaded 'apache-ant-1.9.7-bin.tar.gz'
   ant: Verifying apache-ant-1.9.7-bin.tar.gz
   ant: Checksum verified for apache-ant-1.9.7-bin.tar.gz
   ant: Clean the cache
   ant: Unpacking apache-ant-1.9.7-bin.tar.gz
   ant: Setting build environment
mkdir: created directory '/hab/cache/src/ant-1.9.7'
   ant: Setting PREFIX=/hab/pkgs/root/ant/1.9.7/20160616041841
   ant: Setting LD_RUN_PATH=
   ant: Setting CFLAGS=-I/hab/pkgs/core/make/4.1/20160612080650/include -I/hab/pkgs/core/gcc/5.2.0/20160612064854/include
   ant: Setting LDFLAGS=-L/hab/pkgs/core/gcc/5.2.0/20160612064854/lib
   ant: Preparing to build
   ant: Building
/hab/pkgs/core/hab-plan-build/0.7.0/20160614232259/bin/hab-plan-build: line 1700: ./configure: No such file or directory
   ant: Build time: 0m44s
   ant: Exiting on error
Script done, file is /src/results/logs/..2016-06-16-041841.log

Same error happens when trying to use the exact redis plan.
https://github.com/habitat-sh/habitat/blob/master/plans/redis/plan.sh

However the cpio plan works (which is nearly identical)
https://github.com/habitat-sh/habitat/blob/master/plans/cpio/plan.sh

[builder-web] Upgrade to new Angular 2 Router

The Story

An a Habitat engineer, I would like to use the new Angular 2 router, so I can stay current with its features.

Description

Starting in Angular 2 RC 0 (see #884), there's a new Router (see https://github.com/habitat-sh/core-plans-dev/blob/main/MigratedGoogleDocs/Router%20Refactorings.docx

Upgrade from using the deprecated router to using the new router.

Acceptance Criteria

  • @angular/router is used instead of @angular/router-deprecated
  • The app works as expected

Nodes can become duplicated in the Gossip Ring

After creating a ring of supervisors, if the first node (the one that didn't peer to another) goes down and starts back up, it will become duplicated in the ring.

In the example below the ring was established, then the first node (.191) was shutdown and started again by peering with another member of the ring. I then stopped it and restarted it again. This resulted in 3 member entries, each with a different ID.

$ curl -s 172.31.11.191:9631/gossip | jq -c '.member_list.members[] | [(.ip,.id,.health)]'
["172.31.11.191","fde15cb1-81d5-470e-8ec2-50f422051b75","Alive"]
["172.31.7.147","9cc27829-0749-4be5-a7d8-11b4469e9cf0","Alive"]
["172.31.11.191","5d32161f-8b4a-4e26-97e3-fa22e424f69b","Confirmed"]
["172.31.2.28","6a17b272-9d3e-4770-a9c8-74ce2c9e932c","Alive"]
["172.31.18.192","967c6fc7-ed42-4a50-ac63-0f8184c9f3f8","Alive"]
["172.31.11.191","c94ff543-e022-4134-b528-b87ce4c972bb","Confirmed"]

Furthermore, once a node has become duplicated like this, it doesn't accept being peered against again.

# hab start chefops/elasticsearch --org chefops --peer=172.31.11.191
hab-sup(MN): Starting chefops/elasticsearch
hab-sup(GS): Supervisor 172.31.7.147: a2c333fc-2f11-4c8a-87d3-ba0a14f82867
hab-sup(GS): Census elasticsearch.default: 66866a39-5b07-4416-865a-30f5b72f03bd
hab-sup(GS): Starting inbound gossip listener
hab-sup(GS): Joining gossip peer at 172.31.11.191:9634
hab-sup(GS): Failed to create a gossip client for 172.31.11.191:9634
hab-sup(GS): Could not connect to any initial peers; attempt 1 of 10.
hab-sup(GS): Joining gossip peer at 172.31.11.191:9634
hab-sup(GS): Failed to create a gossip client for 172.31.11.191:9634
hab-sup(GS): Could not connect to any initial peers; attempt 2 of 10.
hab-sup(GS): Joining gossip peer at 172.31.11.191:9634
...

Not Easy Finding the "First Peer" without DNS

It would be dope if I could say this by name and let it figure out the IP address. Should I be adding DNS for it? Something like skydns2/Consul-based DNS to "find" leaders?

Please close if invalid, I may not have figured out the correct way to do this.

Observed: all/current

hab start -t leader core/redis --peer 172.17.0.4

Expected:

hab start -t leader core/redis --friends

studio and docker-machine cloud drivers don't really play well together

When using hab-studio with docker-machine, the local filesystem path for ~/.hab/cache and the current source dir are set up to be mounted as volumes in your docker container. This works with VirtualBox and VMWare as docker-machine sets up shared folders accordingly for the location of where your home directory is and so the directory can be mounted from the VM into the container. When using a cloud driver, there isn't the concept of shared folders and so this doesn't work. When it fails, you just get something like

[jeremy@yavin foo]$ RUST_LOG=debug hab   studio -vv -n new
DEBUG:hab::config: Loading CLI config from /Users/jeremy/.hab/etc/cli.toml
DEBUG:hab::command::studio: Setting default origin katzj via CLI config
DEBUG:hab::command::studio::inner: Propagating environment variable into container: HAB_ORIGIN=katzj
DEBUG:hab::exec: Calling execv: ("/usr/local/bin/docker") ["run", "--rm", "--tty", "--interactive", "--privileged", "--env", "HAB_ORIGIN=katzj", "--volume", "/var/run/docker.sock:/var/run/docker.sock", "--volume", "/Users/jeremy/.hab/cache/keys:/hab/cache/keys", "--volume", "/Users/jeremy/src/hab/plans/foo:/src", "habitat-docker-registry.bintray.io/studio", "-vv", "-n", "new"]
   hab-studio: Creating Studio at /hab/studios/src (default)
'/hab/studios/src/lib64/lib' -> 'lib'
'/hab/studios/src/usr/lib64/lib' -> 'lib'
'/hab/studios/src/var/lock' -> '/run/lock'
'/hab/studios/src/etc/mtab' -> '/proc/self/mounts'
changed ownership of '/hab/studios/src/var/log/lastlog' to 0:13
mode of '/hab/studios/src/var/log/lastlog' changed to 0664 (rw-rw-r--)
mode of '/hab/studios/src/var/log/btmp' changed to 0600 (rw-------)
'/etc/hosts' -> '/hab/studios/src/etc/hosts'
'/etc/resolv.conf' -> '/hab/studios/src/etc/resolv.conf'
   hab-studio: Importing katzj secret origin key
» Importing origin key from standard input
✗✗✗
✗✗✗ Crypto error: Unsupported key version: ✗✗✗
✗✗✗

-R option is either mis documented, or not implemented

According to the docs:

By default, the studio is destroyed after you exit it; however you can override this by specifying the -R option when calling the hab studio enter subcommand.

Yet I've tried every permutation of this -R with no luck. Not sure if I'm just a little slow, of if that option doesn't exist.

hab studio -R -k spuder enter
hab studio -k spuder -R enter
hab studio -k spuder enter -R
ERROR: Invalid option: -R

Automatic Environment Variable Dependency Propagation

I had to set the Git config environment variable GIT_SSL_CAINFO to use go get in a plan that depends on core/go (cacerts), would it be possible to automatically inject this?

e.g.:

do_prepare() {
    export GIT_SSL_CAINFO=$(pkg_path_for cacerts)/ssl/certs/cacert.pem
    build_line "Setting GIT_SSL_CAINFO=$GIT_SSL_CAINFO"

    # XXX(fujin): Figure out GOPATH convention for Habitat
    export GOPATH=${pkg_prefix}
    go get -u github.com/FiloSottile/gvt
}

CMake doesn't install - hab-sup failed to set permissions error

Note that I am newbie, I might not use this correctly...
I just downloaded Hab for Linux from https://www.habitat.sh/docs/get-habitat/, extracted the archive and put the binary in /usr/local/bin(In case there is a setup phase not mentioned on Get Habitat).
Hab version: 0.7.0/20160614230104

In any case, I'll put all the steps I've taken:

$ hab pkg install core/cmake
» Installing core/cmake
↓ Downloading core/gcc-libs/5.2.0/20160612075020
    2.06 MB / 2.06 MB | [=================================] 100.00 % 3.52 MB/s  ↓ Downloading core-20160612031944 public origin key
    75 B / 75 B | [=======================================] 100.00 % 1.36 MB/s  ☑ Cached core-20160612031944 public origin key
✗✗✗
✗✗✗ Can't create '/hab/pkgs/core/gcc-libs/5.2.0/20160612075020' (libarchive err_code=2)
✗✗✗

Tried with sudo:

$ sudo hab pkg install core/cmake
» Installing core/cmake
↓ Downloading core/gcc-libs/5.2.0/20160612075020
    2.06 MB / 2.06 MB | [=================================] 100.00 % 2.40 MB/s  ↓ Downloading core-20160612031944 public origin key
    75 B / 75 B | [=======================================] 100.00 % 1.31 MB/s  ☑ Cached core-20160612031944 public origin key
✓ Installed core/gcc-libs/5.2.0/20160612075020
↓ Downloading core/glibc/2.22/20160612063629
    16.21 MB / 16.21 MB \ [===============================] 100.00 % 9.13 MB/s  ✓ Installed core/glibc/2.22/20160612063629
↓ Downloading core/linux-headers/4.3/20160612063537
    798.92 KB / 798.92 KB \ [=============================] 100.00 % 3.13 MB/s  ✓ Installed core/linux-headers/4.3/20160612063537
↓ Downloading core/cmake/3.5.2/20160612153830
    10.93 MB / 10.93 MB - [===============================] 100.00 % 8.52 MB/s  ✓ Installed core/cmake/3.5.2/20160612153830
★ Install of core/cmake complete with 4 packages installed.

Then I tried to run it(note also that "xxx" are on the same line with the progress bar in this case, just as a side note :)):

$ hab start core/cmake
∵ Package for core/hab-sup not found, installing
» Installing core/hab-sup
↓ Downloading core/busybox-static/1.24.2/20160612081725
    510.89 KB / 510.89 KB \ [=============================] 100.00 % 2.15 MB/s  ✗✗✗
✗✗✗ Can't create '/hab/pkgs/core/busybox-static/1.24.2/20160612081725' (libarchive err_code=2)
✗✗✗

Tried with sudo:

$ sudo hab start core/cmake
∵ Package for core/hab-sup not found, installing
» Installing core/hab-sup
↓ Downloading core/busybox-static/1.24.2/20160612081725
    510.89 KB / 510.89 KB \ [=============================] 100.00 % 2.07 MB/s  ✓ Installed core/busybox-static/1.24.2/20160612081725
↓ Downloading core/bzip2/1.0.6/20160612075040
    141.05 KB / 141.05 KB / [===========================] 100.00 % 336.92 KB/s  ✓ Installed core/bzip2/1.0.6/20160612075040
↓ Downloading core/cacerts/2016.04.20/20160612081125
    132.32 KB / 132.32 KB | [===========================] 100.00 % 915.80 KB/s  ✓ Installed core/cacerts/2016.04.20/20160612081125
→ Using core/gcc-libs/5.2.0/20160612075020
→ Using core/glibc/2.22/20160612063629
↓ Downloading core/libarchive/3.2.0/20160612140528
    584.98 KB / 584.98 KB / [=============================] 100.00 % 1.33 MB/s  ✓ Installed core/libarchive/3.2.0/20160612140528
↓ Downloading core/libsodium/1.0.8/20160612140317
    187.96 KB / 187.96 KB \ [=============================] 100.00 % 1.16 MB/s  ✓ Installed core/libsodium/1.0.8/20160612140317
→ Using core/linux-headers/4.3/20160612063537
↓ Downloading core/openssl/1.0.2h/20160612081127
    2.10 MB / 2.10 MB | [=================================] 100.00 % 4.43 MB/s  ✓ Installed core/openssl/1.0.2h/20160612081127
↓ Downloading core/xz/5.2.2/20160612080402
    247.38 KB / 247.38 KB \ [=============================] 100.00 % 1.33 MB/s  ✓ Installed core/xz/5.2.2/20160612080402
↓ Downloading core/zlib/1.2.8/20160612064520
    73.06 KB / 73.06 KB / [=============================] 100.00 % 648.19 KB/s  ✓ Installed core/zlib/1.2.8/20160612064520
↓ Downloading core/hab-sup/0.7.0/20160614232939
    1.54 MB / 1.54 MB | [=================================] 100.00 % 4.51 MB/s  ✓ Installed core/hab-sup/0.7.0/20160614232939
★ Install of core/hab-sup complete with 12 packages installed.
hab-sup(MN): Starting core/cmake
hab-sup(GS): Supervisor 192.168.100.3: d7b79a0a-242b-4d2e-b75f-dfccb9891f07
hab-sup(GS): Census cmake.default: 8d053b41-9084-4738-9a8d-17ec6f43e491
hab-sup(GS): Starting inbound gossip listener
hab-sup(GS): Starting outbound gossip distributor
hab-sup(GS): Starting gossip failure detector
hab-sup(CN): Starting census health adjuster
hab-sup(ER)[src/error.rs:328:8]: Failed to set permissions

"build" is not using pkg_origin, defaulting to "root"

I'm using a Vagrant box, OS CentOS Linux release 7.2.1511 (Core).

I followed tutorial from here: https://www.habitat.sh/tutorials/getting-started-create-plan/

My plan.sh is exactly the same as the guide:

pkg_name=mytutorialapp
pkg_origin=myorigin

And I get the below output. The artifacts have "root" appended instead of "myorigin". Any ideas? When I run "hab pkg export docker root/mytutorialapp", it works.

» Signing /hab/cache/artifacts/.root-mytutorialapp-0.1.0-20160621150149-x86_64-linux.tar.xz
 Signing /hab/cache/artifacts/.root-mytutorialapp-0.1.0-20160621150149-x86_64-linux.tar.xz with root-20160620135320 to create /hab/cache/artifacts/root-mytutorialapp-0.1.0-20160621150149-x86_64-linux.hart
 Signed artifact /hab/cache/artifacts/root-mytutorialapp-0.1.0-20160621150149-x86_64-linux.hart.
'/hab/cache/artifacts/root-mytutorialapp-0.1.0-20160621150149-x86_64-linux.hart' -> '/src/results/root-mytutorialapp-0.1.0-20160621150149-x86_64-linux.hart'
   mytutorialapp: hab-plan-build cleanup
   mytutorialapp:
   mytutorialapp: Source Cache: /hab/cache/src/mytutorialapp-0.1.0
   mytutorialapp: Installed Path: /hab/pkgs/root/mytutorialapp/0.1.0/20160621150149
   mytutorialapp: Artifact: /src/results/root-mytutorialapp-0.1.0-20160621150149-x86_64-linux.hart
   mytutorialapp: Build Report: /src/results/last_build.env
   mytutorialapp: SHA256 Checksum: 00ce3062d0470ee3958857d14b0ce6d09b88afaa7d8ec7de2ce93ff73b25bc2e
   mytutorialapp: Blake2b Checksum: 0df5e629d77a922e701d23094e0ea9d500d5e8cc2343a87a4f492b4d43bb26ec
   mytutorialapp:
   mytutorialapp: I love it when a plan.sh comes together.
   mytutorialapp:
   mytutorialapp: Build time: 0m8s

sh: 1: cd: can't cd to components/director

When running make on OS X 10.11.5 with Docker beta for Mac installed, I get the following at the end of the run:

Creating habitat_cargo_1
Creating habitat_cache_keys_1
Creating habitat_etc_1
Creating habitat_cache_artifacts_1
sh: 1: cd: can't cd to components/director
make: *** [build-director] Error 2

some pip-installed Python modules give a CERTIFICATE_VERIFY_FAILED error during build

For example:

    Download error on https://pypi.python.org/simple/numpy/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.
c:590) -- Some packages may not be found!
    Couldn't find index page for 'numpy' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
 -- Some packages may not be found!
    No local packages or download links found for numpy>=1.6
    Traceback (most recent call last):
      File "<string>", line 1, in <module>

      File "/tmp/pip-build-j0adA9/numexpr/setup.py", line 219, in <module>
        setup_package()
      File "/tmp/pip-build-j0adA9/numexpr/setup.py", line 215, in setup_package
        setup(**metadata)
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/site-packages/setuptools/dist.py", line 268, in __init_
_
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/site-packages/setuptools/dist.py", line 313, in fetch_b
uild_eggs
        replace_conflicting=True,
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/site-packages/pkg_resources/__init__.py", line 836, in
resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1081, in
 best_match
        return self.obtain(req, installer)
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1093, in
 obtain
        return installer(requirement)
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/site-packages/setuptools/dist.py", line 380, in fetch_b
uild_egg
        return cmd.easy_install(req)
      File "/hab/pkgs/core/python2/2.7.11/20160620182552/lib/python2.7/site-packages/setuptools/command/easy_install.py", line
 623, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('numpy>=1.6')

Relevant plan.sh lines (this is a build plan embedded at private_repo/habitat/plan.sh):

pkg_deps=(core/glibc core/gcc core/python2)
pkg_build_deps=(core/gcc core/make core/python2 core/git)
pkg_bin_dirs=(bin)
pkg_lib_dirs=(lib)
pkg_include_dirs=(include)

do_download(){
  return 0
}

do_verify(){
  return 0
}

do_unpack(){
  return 0
}

do_build(){
  pushd /src > /dev/null
  pwd
  pip install --upgrade pip
  pip install --install-option="--prefix=${pkg_prefix}" $(grep numpy requirements.txt)
  pip install --install-option="--prefix=${pkg_prefix}" $(grep numexpr requirements.txt)
  pip install --install-option="--prefix=${pkg_prefix}" $(grep Cython requirements.txt)
  pip install --install-option="--prefix=${pkg_prefix}" -r requirements.txt
  popd > /dev/null
}

do_install(){
  pushd $PLAN_CONTEXT > /dev/null
  pip install -e .
  popd > /dev/null
}

Stream did not contain valid utf-8

While running through the getting started tutorial, it appears that I was able to get all the way through building the docker image just fine. However, upon running the container, I get the following output:

% docker run -it -p 8080:8080 vaio/mytutorialapp
hab-sup(MN): Starting vaio/mytutorialapp
hab-sup(GS): Supervisor 172.17.0.2: 82f77535-a89e-4f7f-9d34-c8fcec78dbd4
hab-sup(GS): Census mytutorialapp.default: 58ac6d01-fd56-4ac5-b488-b3b9e3705556
hab-sup(GS): Starting inbound gossip listener
hab-sup(GS): Starting outbound gossip distributor
hab-sup(GS): Starting gossip failure detector
hab-sup(CN): Starting census health adjuster
hab-sup(ER)[src/error.rs:322:8]: IOError(Error { repr: Custom(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }) })

I'm using hab 0.7.0/20160614230104 on Arch Linux.

No gossip exchange if Organization is defined in Director service profile

Given the two configurations on two different nodes, when a configuration is applied to the gossip ring with hab config apply, a gossip.toml is not generated on either node.

# Node 1
[cfg.services.core.redis.live.habitat]
start = "--permanent-peer --peer ${peer_ip}:9000"

[cfg.services.core.hab-builder-api.live.habitat]
start = "--permanent-peer --bind database:redis.live,router:hab-builder-router.live --peer ${peer_ip}:9000"
# Node 2
[cfg.services.core.hab-builder-router.live.habitat]
start = "--permanent-peer"

It appears to be the last segment of the service identifier, the organization. In both of these cases the organization is set to habitat. Removing the organization is a workaround for now!

habitat.sh/try web pages capture all commands

habitat_try

When on https://www.habitat.sh/try or any of its child pages, commands do not work. IE: Opening a new tab (ctrl + t) or copy (ctrl + c) or paste (ctrl + v).

It appears what's happening is that there is no way to unfocus the command shell in the window and that the command shell prevents any kind of regular browser behavior. So while this might be a side effect of the cool in-browser command shell, it also doesn't feel great to the user, who might want to copy and paste commands out from the tutorial, open new tabs in their browser, etc.

Proxy support does not work

Back in #652 we had to remove proxy support in order to get SSL working correctly. The reason we can't do both at the moment has to do with Hyper, the HTTP client we're using.

Fix this so both SSL and proxy support work correctly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.