habitat-sh / habitat Goto Github PK
View Code? Open in Web Editor NEWModern applications with built-in automation
Home Page: https://www.habitat.sh
License: Apache License 2.0
Modern applications with built-in automation
Home Page: https://www.habitat.sh
License: Apache License 2.0
How the hab command gets on your box is not covered by the tutorial.
The following section covers setting up keys to share packages
https://www.habitat.sh/docs/share-packages-overview/
It doesn't cover:
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.
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
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
We have a start here, but we also need the new origin API added and builder-api docs as well.
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.
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.
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
}
Add a 'format' command, ( a la go fmt
or terraform fmt
) to put plans into a consistent order.
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
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
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
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.
When attempting to sign in with GitHub, a [err=2] bad_verification_code
error happens if you do not have a public email address.
In order for sign in to work, you need to go to your GitHub profile and set the Public email to something other than "Don't show my email address" in your GitHub profile.
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.
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
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: ✗✗✗
✗✗✗
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?
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?
In components/core/Cargo.toml
you have a note that says that the components/.cargo/config
can be removed when https://github.com/dnaq/sodiumoxide/pull/103
is merged, and it is.
To get MariaDB/Percona to build I need to set the following in my install script:
export CXXFLAGS="$CFLAGS"
habitat should probably do this for me :)
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
}
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
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.
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.
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.
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
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
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.
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"
}
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:
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.
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))
}
}
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.
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)
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?
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
.
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
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.
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.
npm run lint
uses a form of the recommended configuration for codelyzerIs 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.
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 😄
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.
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).
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?
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
For discovering how to use habitat, it would be super-convenient to
hab p[TAB]
-> hab pkg
etc.,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.
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
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?
I tried hab
at work through a corporate proxy and it can't download any of the packages, while at home it worked.
rustup
had this issue before too, it uses curl now, like cargo
.
The README says to install the signing key in /hab/cache/keys before running the next step.
Where does one obtain the key from?
reported here
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)
✗✗✗
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
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
An a Habitat engineer, I would like to use the new Angular 2 router, so I can stay current with its features.
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.
@angular/router
is used instead of @angular/router-deprecated
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.
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
...
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
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
}
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.