diff --git a/.baseimage-release b/.baseimage-release new file mode 100644 index 00000000000..6e8bf73aa55 --- /dev/null +++ b/.baseimage-release @@ -0,0 +1 @@ +0.1.0 diff --git a/Makefile b/Makefile index 905371a502d..5b4b8808d9e 100644 --- a/Makefile +++ b/Makefile @@ -47,13 +47,16 @@ else PROJECT_VERSION=$(BASE_VERSION) endif -DOCKER_TAG=$(shell uname -m)-$(PROJECT_VERSION) - PKGNAME = github.com/$(PROJECT_NAME) GO_LDFLAGS = -X github.com/hyperledger/fabric/metadata.Version=$(PROJECT_VERSION) CGO_FLAGS = CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" UID = $(shell id -u) +ARCH=$(shell uname -m) CHAINTOOL_RELEASE=v0.9.0 +BASEIMAGE_RELEASE=$(shell cat ./.baseimage-release) + +DOCKER_TAG=$(ARCH)-$(PROJECT_VERSION) +BASE_DOCKER_TAG=$(ARCH)-$(BASEIMAGE_RELEASE) EXECUTABLES = go docker git curl K := $(foreach exec,$(EXECUTABLES),\ @@ -63,13 +66,9 @@ K := $(foreach exec,$(EXECUTABLES),\ SUBDIRS = gotools sdk/node SUBDIRS:=$(strip $(SUBDIRS)) -# Make our baseimage depend on any changes to images/base or scripts/provision -BASEIMAGE_RELEASE = $(shell cat ./images/base/release) -BASEIMAGE_DEPS = $(shell git ls-files images/base scripts/provision) - JAVASHIM_DEPS = $(shell git ls-files core/chaincode/shim/java) PROJECT_FILES = $(shell git ls-files) -IMAGES = base src ccenv peer membersrvc javaenv +IMAGES = src ccenv peer membersrvc javaenv all: peer membersrvc checks @@ -122,14 +121,14 @@ linter: gotools # we may later inject the binary into a different docker environment # This is necessary since we cannot guarantee that binaries built # on the host natively will be compatible with the docker env. -%/bin/protoc-gen-go: build/image/base/.dummy Makefile +%/bin/protoc-gen-go: Makefile @echo "Building $@" @mkdir -p $(@D) @docker run -i \ --user=$(UID) \ -v $(abspath vendor/github.com/golang/protobuf):/opt/gopath/src/github.com/golang/protobuf \ -v $(abspath $(@D)):/opt/gopath/bin \ - hyperledger/fabric-baseimage go install github.com/golang/protobuf/protoc-gen-go + hyperledger/fabric-baseimage:$(BASE_DOCKER_TAG) go install github.com/golang/protobuf/protoc-gen-go build/bin/chaintool: Makefile @echo "Installing chaintool" @@ -172,25 +171,19 @@ build/bin/block-listener: @echo "Binary available as $@" @touch $@ -build/bin/%: build/image/base/.dummy $(PROJECT_FILES) +build/bin/%: $(PROJECT_FILES) @mkdir -p $(@D) @echo "$@" $(CGO_FLAGS) GOBIN=$(abspath $(@D)) go install -ldflags "$(GO_LDFLAGS)" $(PKGNAME)/$(@F) @echo "Binary available as $@" @touch $@ -# Special override for base-image. -build/image/base/.dummy: $(BASEIMAGE_DEPS) - @echo "Building docker base-image" - @mkdir -p $(@D) - @./scripts/provision/docker.sh $(BASEIMAGE_RELEASE) - @touch $@ - # Special override for src-image -build/image/src/.dummy: build/image/base/.dummy $(PROJECT_FILES) +build/image/src/.dummy: $(PROJECT_FILES) @echo "Building docker src-image" @mkdir -p $(@D) @cat images/src/Dockerfile.in \ + | sed -e 's/_BASE_TAG_/$(BASE_DOCKER_TAG)/g' \ | sed -e 's/_TAG_/$(DOCKER_TAG)/g' \ > $(@D)/Dockerfile @git ls-files | tar -jcT - > $(@D)/gopath.tar.bz2 @@ -202,6 +195,7 @@ build/image/src/.dummy: build/image/base/.dummy $(PROJECT_FILES) build/image/ccenv/.dummy: build/image/src/.dummy build/image/ccenv/bin/protoc-gen-go build/image/ccenv/bin/chaintool Makefile @echo "Building docker ccenv-image" @cat images/ccenv/Dockerfile.in \ + | sed -e 's/_BASE_TAG_/$(BASE_DOCKER_TAG)/g' \ | sed -e 's/_TAG_/$(DOCKER_TAG)/g' \ > $(@D)/Dockerfile docker build -t $(PROJECT_NAME)-ccenv $(@D) @@ -216,7 +210,10 @@ build/image/ccenv/.dummy: build/image/src/.dummy build/image/ccenv/bin/protoc-ge build/image/javaenv/.dummy: Makefile $(JAVASHIM_DEPS) @echo "Building docker javaenv-image" @mkdir -p $(@D) - @cat images/javaenv/Dockerfile.in > $(@D)/Dockerfile + @cat images/javaenv/Dockerfile.in \ + | sed -e 's/_BASE_TAG_/$(BASE_DOCKER_TAG)/g' \ + | sed -e 's/_TAG_/$(DOCKER_TAG)/g' \ + > $(@D)/Dockerfile @git ls-files core/chaincode/shim/java | tar -jcT - > $(@D)/javashimsrc.tar.bz2 @git ls-files protos core/chaincode/shim/table.proto settings.gradle | tar -jcT - > $(@D)/protos.tar.bz2 docker build -t $(PROJECT_NAME)-javaenv $(@D) @@ -229,6 +226,7 @@ build/image/%/.dummy: build/image/src/.dummy build/docker/bin/% @echo "Building docker $(TARGET)-image" @mkdir -p $(@D)/bin @cat images/app/Dockerfile.in \ + | sed -e 's/_BASE_TAG_/$(BASE_DOCKER_TAG)/g' \ | sed -e 's/_TAG_/$(DOCKER_TAG)/g' \ > $(@D)/Dockerfile cp build/docker/bin/$(TARGET) $(@D)/bin @@ -240,10 +238,6 @@ build/image/%/.dummy: build/image/src/.dummy build/docker/bin/% protos: gotools ./devenv/compile_protos.sh -base-image-clean: - -docker rmi -f $(PROJECT_NAME)-baseimage - -@rm -rf build/image/base ||: - src-image-clean: ccenv-image-clean peer-image-clean membersrvc-image-clean %-image-clean: diff --git a/devenv/Vagrantfile b/devenv/Vagrantfile index 8d9d6999daf..54af341894a 100644 --- a/devenv/Vagrantfile +++ b/devenv/Vagrantfile @@ -27,7 +27,7 @@ cd #{SRCMOUNT}/devenv SCRIPT -baseimage_release = File.read '../images/base/release' +baseimage_release = File.read '../.baseimage-release' Vagrant.require_version ">= 1.7.4" Vagrant.configure('2') do |config| diff --git a/devenv/setup.sh b/devenv/setup.sh index 08dac37e90c..42e7b3b5330 100755 --- a/devenv/setup.sh +++ b/devenv/setup.sh @@ -40,19 +40,6 @@ DEVENV_REVISION=`(cd /hyperledger/devenv; git rev-parse --short HEAD)` SCRIPT_DIR="$(readlink -f "$(dirname "$0")")" cat "$SCRIPT_DIR/failure-motd.in" >> /etc/motd -# Update system -apt-get update -qq - -# Prep apt-get for docker install -apt-get install -y apt-transport-https ca-certificates -apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D - -# Add docker repository -echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list - -# Update system -apt-get update -qq - # Storage backend logic case "${DOCKER_STORAGE_BACKEND}" in aufs|AUFS|"") @@ -72,9 +59,6 @@ case "${DOCKER_STORAGE_BACKEND}" in exit 1;; esac -# Install docker -apt-get install -y linux-image-extra-$(uname -r) apparmor docker-engine - # Configure docker DOCKER_OPTS="-s=${DOCKER_STORAGE_BACKEND_STRING} -r=true --api-cors-header='*' -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock ${DOCKER_OPTS}" sed -i.bak '/^DOCKER_OPTS=/{h;s|=.*|=\"'"${DOCKER_OPTS}"'\"|};${x;/^$/{s||DOCKER_OPTS=\"'"${DOCKER_OPTS}"'\"|;H};x}' /etc/default/docker @@ -85,9 +69,6 @@ usermod -a -G docker vagrant # Add vagrant user to the docker group # Test docker docker run --rm busybox echo All good -# Run our common setup -/hyperledger/scripts/provision/host.sh - # Set Go environment variables needed by other scripts export GOPATH="/opt/gopath" export GOROOT="/opt/go/" diff --git a/images/base/.gitignore b/images/base/.gitignore deleted file mode 100644 index 94143827ed0..00000000000 --- a/images/base/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Dockerfile diff --git a/images/base/Dockerfile.in b/images/base/Dockerfile.in deleted file mode 100644 index 3babb952831..00000000000 --- a/images/base/Dockerfile.in +++ /dev/null @@ -1,5 +0,0 @@ -FROM _DOCKER_BASE_ -COPY scripts /hyperledger/baseimage/scripts -RUN /hyperledger/baseimage/scripts/common/init.sh -RUN /hyperledger/baseimage/scripts/docker/init.sh -RUN /hyperledger/baseimage/scripts/common/setup.sh diff --git a/images/base/Makefile b/images/base/Makefile deleted file mode 100644 index be148e69668..00000000000 --- a/images/base/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -NAME=hyperledger/fabric-baseimage -VERSION=$(shell cat ./release) -ARCH=$(shell uname -m) -DOCKER_TAG ?= $(ARCH)-$(VERSION) -VAGRANTIMAGE=packer_virtualbox-iso_virtualbox.box - -DOCKER_BASE_x86_64=ubuntu:trusty -DOCKER_BASE_s390x=s390x/ubuntu:xenial -DOCKER_BASE_ppc64le=ppc64le/ubuntu:xenial - -DOCKER_BASE=$(DOCKER_BASE_$(ARCH)) - -ifeq ($(DOCKER_BASE), ) -$(error "Architecture \"$(ARCH)\" is unsupported") -endif - - -# strips off the post-processors that try to upload artifacts to the cloud -packer-local.json: packer.json - jq 'del(."post-processors"[0][1]) | del(."post-processors"[1][1])' packer.json > $@ - -all: vagrant docker - -$(VAGRANTIMAGE): packer-local.json - BASEIMAGE_RELEASE=$(VERSION) \ - packer build -only virtualbox-iso packer-local.json - -Dockerfile: Dockerfile.in Makefile - @echo "# Generated from Dockerfile.in. DO NOT EDIT!" > $@ - @cat Dockerfile.in | \ - sed -e "s|_DOCKER_BASE_|$(DOCKER_BASE)|" >> $@ - -docker: Dockerfile release - @echo "Generating docker" - @docker build -t $(NAME):$(DOCKER_TAG) . - -vagrant: $(VAGRANTIMAGE) remove release - vagrant box add -name $(NAME) $(VAGRANTIMAGE) - -push: - @echo "You will need your ATLAS_TOKEN set for this to succeed" - packer push -name $(NAME) packer.json - -remove: - -vagrant box remove --box-version 0 $(NAME) - -clean: remove - -rm $(VAGRANTIMAGE) - -rm Dockerfile - -rm packer-local.json diff --git a/images/base/README.md b/images/base/README.md deleted file mode 100644 index 6073455aca5..00000000000 --- a/images/base/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Baseimage Introduction -This directory contains the infrastructure for creating a new baseimage used as the basis for various functions within the Hyperledger workflow such as our Vagrant based development environment, chaincode compilation/execution, unit-testing, and even cluster simulation. It is based on ubuntu-14.04 with various opensource projects added such as golang, rocksdb, grpc, and node.js. The actual Hyperledger code is injected just-in-time before deployment. The resulting images are published to public repositories such as [atlas.hashicorp.com](https://atlas.hashicorp.com/hyperledger/boxes/fabric-baseimage) for consumption by Vagrant/developers and [hub.docker.com](https://hub.docker.com/r/hyperledger/fabric-baseimage/) for consumption by docker-based workflows. - -![Baseimage Architectural Overview](./images/packer-overview.png) - -The purpose of this baseimage is to act as a bridge between a raw ubuntu/trusty64 configuration and the customizations required for supporting a hyperledger environment. Some of the FOSS components that need to be added to Ubuntu do not have convenient native packages. Therefore, they are built from source. However, the build process is generally expensive (often taking in excess of 30 minutes) so it is fairly inefficient to JIT assemble these components on demand. - -Therefore, the expensive FOSS components are built into this baseimage once and subsequently cached on the public repositories so that workflows may simply consume the objects without requiring a local build cycle. - -# Intended Audience -This is only intended for release managers curating the base images on atlas and docker-hub. Typical developers may safely ignore this directory completely. - -Anyone wishing to customize their image is encouraged to do so via downstream means, such as the vagrant infrastructure in the root directory of this project or the Dockerfile. - -## Exceptions - -If a component is found to be both broadly applicable and expensive to build JIT, it may be a candidate for inclusion in a future baseimage. - -# Usage - -## Usage Pattern 1 - Local baseimage builds for testing a proposed change - -* "make vagrant" will build just the vagrant image and install it into the local environment as "hyperledger/fabric-baseimage:v0", making it suitable to local testing. - * To utilize the new base image in your local tests, run `vagrant destroy` then `USE_LOCAL_BASEIMAGE=true vagrant up`, also preface `vagrant ssh` as `USE_LOCAL_BASEIMAGE=true vagrant ssh` or simply export that variable, or Vagrant will fail to find the ssh key. -* "make docker" will build just the docker image and commit it to your local environment as "hyperledger/fabric-baseimage" - -## Usage Pattern 2 - Release manager promoting a new base image to the public repositories - -- Step 1: Decide on the version number to be used and update the packer.json template variables:release -- Step 2: Initiate a build - -Note: You will need credentials to the public repositories, as discussed in Uploading Permissions below. If you do not have these credentials, you are probably not an image release manager. Otherwise, discuss it on the Hyperledger slack to see if you should be added. - -### Hosted Build Method - -"make push" will push the build configuration to atlas for cloud-hosted building of the images. You only need to have the ATLAS_TOKEN defined for this to succeed, as the atlas build server will push the artifacts out to the respective hosts once the build completes. Therefore, the repository credentials are already cached on the build server and you only need credentials for the build-server itself. You can check the status of the build [here](https://atlas.hashicorp.com/hyperledger/build-configurations/baseimage/) - -### Local Build Method - -"make [all]" will generate both a vagrant and docker image and push them out to the cloud. This method requires both ATLAS and DOCKERHUB credentials since the artifacts are pushed directly to the hosting providers from your build machine. - -## Uploading Permissions - -The system relies on several environment variables to establish credentials with the hosting repositories: - -* ATLAS_TOKEN - used to push both vagrant images and packer templates to atlas.hashicorp.com -* DOCKERHUB_[EMAIL|USERNAME|PASSWORD] - used to push docker images to hub.docker.com - -Note that if you only plan on pushing the build to the atlas packer build service, you only need the ATLAS_TOKEN set as the dockerhub interaction will occur from the atlas side of the process where the docker credentials are presumably already configured. - -## Versioning - -Vagrant boxes are only versioned when they are submitted to a repository. Vagrant does not support applying a version to a vagrant box via the `vagrant box add` command. Adding the box gives it an implicit version of 0. Setting `USE_LOCAL_BASEIMAGE=true` in the `vagrant up` command causes the Vagrant file in the the parent directory to pick version 0, instead of the default. diff --git a/images/base/http/preseed.cfg b/images/base/http/preseed.cfg deleted file mode 100644 index d3619ce76f7..00000000000 --- a/images/base/http/preseed.cfg +++ /dev/null @@ -1,34 +0,0 @@ -debconf debconf/frontend select Noninteractive -choose-mirror-bin mirror/http/proxy string -d-i clock-setup/utc boolean true -d-i clock-setup/utc-auto boolean true -d-i finish-install/reboot_in_progress note -d-i grub-installer/only_debian boolean true -d-i grub-installer/with_other_os boolean true -d-i partman-auto/choose_recipe select atomic -d-i partman-auto/method string regular -d-i partman/choose_partition select finish -d-i partman/confirm boolean true -d-i partman/confirm_nooverwrite boolean true -d-i partman/confirm_write_new_label boolean true - -# Set the kernel -d-i base-installer/kernel/override-image string linux-virtual - -# Default user -d-i passwd/user-fullname string vagrant -d-i passwd/username string vagrant -d-i passwd/user-password password vagrant -d-i passwd/user-password-again password vagrant -d-i passwd/username string vagrant - -# Minimum packages (see postinstall.sh) -d-i pkgsel/include string openssh-server -d-i pkgsel/install-language-support boolean false -d-i pkgsel/update-policy select none -d-i pkgsel/upgrade select none - -d-i time/zone string UTC -d-i user-setup/allow-password-weak boolean true -d-i user-setup/encrypt-home boolean false -tasksel tasksel/first multiselect standard, server diff --git a/images/base/images/packer-overview.graffle/data.plist b/images/base/images/packer-overview.graffle/data.plist deleted file mode 100644 index c6fc4f1b778..00000000000 --- a/images/base/images/packer-overview.graffle/data.plist +++ /dev/null @@ -1,1383 +0,0 @@ - - - - - ActiveLayerIndex - 0 - ApplicationVersion - - com.omnigroup.OmniGraffle - 139.18.0.187838 - - AutoAdjust - - BackgroundGraphic - - Bounds - {{0, 0}, {575.99998474121094, 1466}} - Class - SolidGraphic - ID - 2 - Style - - shadow - - Draws - NO - - stroke - - Draws - NO - - - - BaseZoom - 0 - CanvasOrigin - {0, 0} - ColumnAlign - 1 - ColumnSpacing - 36 - CreationDate - 2016-02-22 22:11:37 +0000 - Creator - Greg Haskins - DisplayScale - 1 0/72 in = 1.0000 in - GraphDocumentVersion - 8 - GraphicsList - - - Class - LineGraphic - Head - - ID - 22 - - ID - 60 - Points - - {310.14783447722266, 96.412900484504561} - {373.3780487804878, 189} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 4 - - - - Class - LineGraphic - Head - - ID - 57 - - ID - 59 - OrthogonalBarAutomatic - - OrthogonalBarPoint - {0, 0} - OrthogonalBarPosition - 76.855720520019531 - Points - - {245.3613785038917, 96.388558716933716} - {108, 266} - {181, 753} - {314.5000004554858, 752.81861412981596} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - LineType - 2 - TailArrow - 0 - Width - 2 - - - Tail - - ID - 4 - - - - Class - LineGraphic - Head - - ID - 57 - - ID - 58 - Points - - {364.99937473792534, 505.12549205971999} - {364.99580448417515, 724.24999998950307} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 54 - - - - Bounds - {{315, 724.75}, {100, 56}} - Class - ShapedGraphic - ID - 57 - Shape - FlattenedRectangle - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 custom environment} - VerticalPad - 0 - - TextRelativeArea - {{0.10000000000000001, 0}, {0.80000000000000004, 1}} - - - Class - LineGraphic - Head - - ID - 30 - - ID - 56 - Points - - {388.73435760680411, 486.3256814805485} - {439.2620074228966, 528} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 54 - - - - Class - LineGraphic - Head - - ID - 40 - - ID - 55 - Points - - {342.97352711499752, 487.69524871963358} - {300.58818602417603, 528} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 54 - - - - Bounds - {{317.5, 428.875}, {95, 75.75}} - Class - ShapedGraphic - ID - 54 - Shape - Diamond - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 hyperledger fabric} - VerticalPad - 0 - - - - Class - LineGraphic - Head - - ID - 49 - - ID - 53 - Points - - {464.62462462462463, 569.5} - {464.82882888295114, 603.50000901136877} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 30 - - - - Bounds - {{433, 622}, {100, 56}} - Class - ShapedGraphic - ID - 51 - Shape - FlattenedRectangle - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 docker environment} - VerticalPad - 0 - - TextRelativeArea - {{0.10000000000000001, 0}, {0.80000000000000004, 1}} - - - Bounds - {{424, 613}, {100, 56}} - Class - ShapedGraphic - ID - 50 - Shape - FlattenedRectangle - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 docker environment} - VerticalPad - 0 - - TextRelativeArea - {{0.10000000000000001, 0}, {0.80000000000000004, 1}} - - - Bounds - {{415, 604}, {100, 56}} - Class - ShapedGraphic - ID - 49 - Shape - FlattenedRectangle - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 docker environment} - VerticalPad - 0 - - TextRelativeArea - {{0.10000000000000001, 0}, {0.80000000000000004, 1}} - - - Class - LineGraphic - Head - - ID - 30 - - ID - 48 - Points - - {508.88537781669504, 503.46248035776267} - {484.83665338645471, 528} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 46 - - - - Class - LineGraphic - Head - - ID - 30 - - ID - 47 - Points - - {466.75138277659562, 426.49991523085737} - {464.88213627992633, 528} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 35 - - - - Bounds - {{495, 467.375}, {62, 37.25}} - Class - ShapedGraphic - ID - 46 - Shape - Hexagon - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 Dockerfile} - VerticalPad - 0 - - TextRelativeArea - {{0, 0.10000000000000001}, {1, 0.80000000000000004}} - - - Bounds - {{486, 458.375}, {62, 37.25}} - Class - ShapedGraphic - ID - 45 - Shape - Hexagon - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 Dockerfile} - VerticalPad - 0 - - TextRelativeArea - {{0, 0.10000000000000001}, {1, 0.80000000000000004}} - - - Bounds - {{477, 449.375}, {62, 37.25}} - Class - ShapedGraphic - ID - 44 - Shape - Hexagon - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 Dockerfile} - VerticalPad - 0 - - TextRelativeArea - {{0, 0.10000000000000001}, {1, 0.80000000000000004}} - - - Class - LineGraphic - Head - - ID - 24 - - ID - 43 - Points - - {277.52222222222446, 574} - {279.23335524784636, 612.50049307640984} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 40 - - - - Bounds - {{230.5, 613}, {100, 56}} - Class - ShapedGraphic - ID - 24 - Shape - FlattenedRectangle - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 development environment} - VerticalPad - 0 - - TextRelativeArea - {{0.10000000000000001, 0}, {0.80000000000000004, 1}} - - - Class - LineGraphic - Head - - ID - 40 - - ID - 41 - Points - - {276.50000301611595, 426.5} - {276.50000301611595, 528} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 33 - - - - Bounds - {{202, 528}, {149, 46}} - Class - ShapedGraphic - ID - 40 - ImageID - 6 - Shape - Rectangle - Style - - fill - - Draws - NO - - shadow - - Draws - NO - - stroke - - Draws - NO - - - - - Bounds - {{436, 326.75}, {62, 46}} - Class - ShapedGraphic - ID - 38 - ImageID - 5 - Shape - Rectangle - Style - - fill - - Draws - NO - - shadow - - Draws - NO - - stroke - - Draws - NO - - - - - Class - LineGraphic - Head - - ID - 35 - - ID - 37 - Points - - {467.00000967504548, 372.75} - {467.00000967504548, 399.5} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 38 - - - - Class - LineGraphic - Head - - ID - 33 - - ID - 36 - Points - - {276.49991756300551, 370.5} - {276.49980234985657, 399.5} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 28 - - - - Bounds - {{411, 400}, {112, 26}} - Class - ShapedGraphic - ID - 35 - Shape - Rectangle - Style - - stroke - - CornerRadius - 9 - - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 docker:hyperledger/fabric-baseimage} - - - - Bounds - {{220.5, 400}, {112, 26}} - Class - ShapedGraphic - ID - 33 - Shape - Rectangle - Style - - stroke - - CornerRadius - 9 - - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 vagrant:hyperledger/fabric-baseimage} - - - - Class - LineGraphic - Head - - ID - 38 - - ID - 32 - Points - - {408.21374764707127, 245} - {454.09227872378818, 326.75} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 22 - - - - Class - LineGraphic - Head - - ID - 28 - - ID - 31 - Points - - {368.03295668549907, 245} - {294.63182674199624, 329} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 22 - - - - Bounds - {{390, 528}, {149, 41.5}} - Class - ShapedGraphic - ID - 30 - ImageID - 4 - Shape - Rectangle - Style - - fill - - Draws - NO - - shadow - - Draws - NO - - stroke - - Draws - NO - - - - - Bounds - {{199, 329}, {155, 41.5}} - Class - ShapedGraphic - ID - 28 - ImageID - 3 - Shape - Rectangle - Style - - fill - - Draws - NO - - shadow - - Draws - NO - - stroke - - Draws - NO - - - - - Class - LineGraphic - Head - - ID - 22 - - ID - 26 - Points - - {435.32867419331808, 159.90087452433639} - {413.63683982367951, 189} - - Style - - stroke - - HeadArrow - FilledArrow - Legacy - - TailArrow - 0 - Width - 2 - - - Tail - - ID - 20 - - - - Bounds - {{390, 103.5}, {133, 56}} - Class - ShapedGraphic - ID - 20 - Shape - Hexagon - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 hyperledger/\ -fabric-baseimage} - VerticalPad - 0 - - TextRelativeArea - {{0, 0.10000000000000001}, {1, 0.80000000000000004}} - - - Bounds - {{331, 189}, {123, 56}} - Class - ShapedGraphic - ID - 22 - ImageID - 2 - Shape - Rectangle - Style - - fill - - Draws - NO - - shadow - - Draws - NO - - stroke - - Draws - NO - - - - - Bounds - {{342, 18}, {73, 59}} - Class - ShapedGraphic - ID - 10 - Shape - Diamond - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 ubuntu} - VerticalPad - 0 - - - - Bounds - {{264, 18}, {73, 59}} - Class - ShapedGraphic - ID - 9 - Shape - Diamond - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 nodejs} - VerticalPad - 0 - - - - Bounds - {{186, 18}, {73, 59}} - Class - ShapedGraphic - ID - 8 - Shape - Diamond - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 grpc} - VerticalPad - 0 - - - - Bounds - {{108, 18}, {73, 59}} - Class - ShapedGraphic - ID - 7 - Shape - Diamond - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 golang} - VerticalPad - 0 - - - - Bounds - {{30, 18}, {73, 59}} - Class - ShapedGraphic - ID - 6 - Shape - Diamond - Style - - Text - - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc - -\f0\fs22 \cf0 rocksdb} - VerticalPad - 0 - - - - Bounds - {{12, 10}, {537, 86}} - Class - ShapedGraphic - ID - 4 - Shape - Rectangle - Style - - fill - - Draws - NO - - stroke - - CornerRadius - 9 - Pattern - 1 - - - Text - - Align - 2 - Text - {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf460 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qr - -\f0\fs22 \cf0 Upstream FOSS} - - - - GridInfo - - GuidesLocked - NO - GuidesVisible - YES - HPages - 1 - ImageCounter - 7 - ImageLinkBack - - - - - - - - ImageList - - image6.png - image5.png - image4.png - image3.png - image2.png - - KeepToScale - - Layers - - - Lock - NO - Name - Layer 1 - Print - YES - View - YES - - - LayoutInfo - - Animate - NO - circoMinDist - 18 - circoSeparation - 0.0 - layoutEngine - dot - neatoSeparation - 0.0 - twopiSeparation - 0.0 - - LinksVisible - NO - MagnetsVisible - NO - MasterSheets - - ModificationDate - 2016-04-08 16:20:56 +0000 - Modifier - Greg Haskins - NotesVisible - NO - Orientation - 2 - OriginVisible - NO - PageBreaks - YES - PrintInfo - - NSBottomMargin - - float - 41 - - NSHorizonalPagination - - coded - BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG - - NSLeftMargin - - float - 18 - - NSPaperSize - - size - {611.99998474121094, 792} - - NSPrintReverseOrientation - - int - 0 - - NSRightMargin - - float - 18 - - NSTopMargin - - float - 18 - - - PrintOnePage - - ReadOnly - NO - RowAlign - 1 - RowSpacing - 36 - SheetTitle - Canvas 1 - SmartAlignmentGuidesActive - YES - SmartDistanceGuidesActive - YES - UniqueID - 1 - UseEntirePage - - VPages - 2 - WindowInfo - - CurrentSheet - 0 - ExpandedCanvases - - - name - Canvas 1 - - - Frame - {{69, 50}, {1406, 1115}} - ListView - - OutlineWidth - 142 - RightSidebar - - ShowRuler - - Sidebar - - SidebarWidth - 120 - VisibleRegion - {{-340, 0}, {1257, 960}} - Zoom - 1 - ZoomValues - - - Canvas 1 - 1 - 1 - - - - - diff --git a/images/base/images/packer-overview.graffle/image2.png b/images/base/images/packer-overview.graffle/image2.png deleted file mode 100644 index 7e5bdd51c01..00000000000 Binary files a/images/base/images/packer-overview.graffle/image2.png and /dev/null differ diff --git a/images/base/images/packer-overview.graffle/image3.png b/images/base/images/packer-overview.graffle/image3.png deleted file mode 100644 index 437a535b657..00000000000 Binary files a/images/base/images/packer-overview.graffle/image3.png and /dev/null differ diff --git a/images/base/images/packer-overview.graffle/image4.png b/images/base/images/packer-overview.graffle/image4.png deleted file mode 100644 index 045093e2b58..00000000000 Binary files a/images/base/images/packer-overview.graffle/image4.png and /dev/null differ diff --git a/images/base/images/packer-overview.graffle/image5.png b/images/base/images/packer-overview.graffle/image5.png deleted file mode 100644 index 0a367e5d9dc..00000000000 Binary files a/images/base/images/packer-overview.graffle/image5.png and /dev/null differ diff --git a/images/base/images/packer-overview.graffle/image6.png b/images/base/images/packer-overview.graffle/image6.png deleted file mode 100644 index efbf05abd22..00000000000 Binary files a/images/base/images/packer-overview.graffle/image6.png and /dev/null differ diff --git a/images/base/images/packer-overview.png b/images/base/images/packer-overview.png deleted file mode 100644 index 66c9087c63b..00000000000 Binary files a/images/base/images/packer-overview.png and /dev/null differ diff --git a/images/base/packer.json b/images/base/packer.json deleted file mode 100644 index 03f9f3a8dce..00000000000 --- a/images/base/packer.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "push": { - "name": "", - "vcs": true - }, - "variables": { - "artifact": "baseimage", - "release": "{{env `BASEIMAGE_RELEASE`}}", - "dockerhub_email": "{{env `DOCKERHUB_EMAIL`}}", - "dockerhub_username": "{{env `DOCKERHUB_USERNAME`}}", - "dockerhub_password": "{{env `DOCKERHUB_PASSWORD`}}" - }, - "provisioners": [ - { - "type": "shell", - "environment_vars": ["BASEIMAGE_RELEASE={{user `release`}}"], - "override": { - "virtualbox-iso": { - "scripts": [ - "scripts/common/init.sh", - "scripts/vagrant/init.sh", - "scripts/vagrant/virtualbox.sh", - "scripts/vagrant/vagrant.sh", - "scripts/common/setup.sh", - "scripts/vagrant/cleanup.sh", - "scripts/vagrant/zerodisk.sh" - ], - "execute_command": "echo 'vagrant'|sudo -S {{.Vars}} bash '{{.Path}}'" - } - } - } - ], - "builders": [ - { - "type": "virtualbox-iso", - "boot_command": [ - "", - "", - "", - "/install/vmlinuz", - " auto", - " console-setup/ask_detect=false", - " console-setup/layoutcode=us", - " console-setup/modelcode=pc105", - " debian-installer=en_US", - " fb=false", - " initrd=/install/initrd.gz", - " kbd-chooser/method=us", - " keyboard-configuration/layout=USA", - " keyboard-configuration/variant=USA", - " locale=en_US", - " netcfg/get_hostname=ubuntu-1404", - " netcfg/get_domain=vagrantup.com", - " noapic", - " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg", - " -- ", - "" - ], - "headless": true, - "boot_wait": "10s", - "disk_size": 40960, - "guest_os_type": "Ubuntu_64", - "http_directory": "http", - "iso_checksum": "ca2531b8cd79ea5b778ede3a524779b9", - "iso_checksum_type": "md5", - "iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso", - "ssh_username": "vagrant", - "ssh_password": "vagrant", - "ssh_port": 22, - "ssh_wait_timeout": "10000s", - "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S bash 'shutdown.sh'", - "virtualbox_version_file": ".vbox_version", - "guest_additions_mode": "disable", - "hard_drive_interface": "sata", - "vboxmanage": [ - ["modifyvm", "{{.Name}}", "--vrde", "off"], - ["modifyvm", "{{.Name}}", "--pae", "off"], - ["modifyvm", "{{.Name}}", "--paravirtprovider", "legacy"] - ] - } - ], - "post-processors": [ - [ - { - "type": "vagrant", - "only": [ - "virtualbox-iso" - ], - "keep_input_artifact": false - }, - { - "type": "atlas", - "only": [ - "virtualbox-iso" - ], - "artifact": "hyperledger/{{user `artifact`}}", - "artifact_type": "vagrant.box", - "metadata": { - "provider": "virtualbox", - "version": "{{user `release`}}" - } - } - ] - ] -} diff --git a/images/base/release b/images/base/release deleted file mode 100644 index 2cfabea2f1e..00000000000 --- a/images/base/release +++ /dev/null @@ -1 +0,0 @@ -0.0.11 diff --git a/images/base/scripts/common/golang_crossCompileSetup.sh b/images/base/scripts/common/golang_crossCompileSetup.sh deleted file mode 100755 index 0d7468203d7..00000000000 --- a/images/base/scripts/common/golang_crossCompileSetup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -helpme() -{ - cat </etc/profile.d/goroot.sh -export GOROOT=$GOROOT -export GOPATH=$GOPATH -export PATH=\$PATH:$GOROOT/bin:$GOPATH/bin -EOF - - -# Install NodeJS - -if [ x$MACHINE = xs390x ] -then - apt-get install --yes nodejs -elif [ x$MACHINE = xppc64le ] -then - apt-get install --yes nodejs -else - NODE_VER=0.12.7 - NODE_PACKAGE=node-v$NODE_VER-linux-x64.tar.gz - TEMP_DIR=/tmp - SRC_PATH=$TEMP_DIR/$NODE_PACKAGE - - # First remove any prior packages downloaded in case of failure - cd $TEMP_DIR - rm -f node*.tar.gz - wget --quiet https://nodejs.org/dist/v$NODE_VER/$NODE_PACKAGE - cd /usr/local && sudo tar --strip-components 1 -xzf $SRC_PATH -fi - -# Install GRPC - -# ---------------------------------------------------------------- -# NOTE: For instructions, see https://github.com/google/protobuf -# -# ---------------------------------------------------------------- - -# First install protoc -cd /tmp -wget --quiet https://github.com/google/protobuf/archive/v3.0.2.tar.gz -tar xpzf v3.0.2.tar.gz -cd protobuf-3.0.2 -apt-get install -y autoconf automake libtool curl make g++ unzip -apt-get install -y build-essential -./autogen.sh -# NOTE: By default, the package will be installed to /usr/local. However, on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH. -# You can add it, but it may be easier to just install to /usr instead. -# -# To do this, invoke configure as follows: -# -# ./configure --prefix=/usr -# -#./configure -./configure --prefix=/usr - -if [ x$MACHINE = xs390x ] -then - echo FIXME: protobufs wont compile on 390, missing atomic call -else - make - make check - make install -fi -export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH -cd ~/ - -# Install rocksdb -apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev -cd /tmp -git clone https://github.com/facebook/rocksdb.git -cd rocksdb -git checkout tags/v4.1 -if [ x$MACHINE = xs390x ] -then - echo There were some bugs in 4.1 for z/p, dev stream has the fix, living dangereously, fixing in place - sed -i -e "s/-march=native/-march=z196/" build_tools/build_detect_platform - sed -i -e "s/-momit-leaf-frame-pointer/-DDUMBDUMMY/" Makefile -elif [ x$MACHINE = xppc64le ] -then - echo There were some bugs in 4.1 for z/p, dev stream has the fix, living dangereously, fixing in place. - echo Below changes are not required for newer releases of rocksdb. - sed -ibak 's/ifneq ($(MACHINE),ppc64)/ifeq (,$(findstring ppc64,$(MACHINE)))/g' Makefile -fi - -PORTABLE=1 make shared_lib -INSTALL_PATH=/usr/local make install-shared -ldconfig -cd ~/ - -# Make our versioning persistent -echo $BASEIMAGE_RELEASE > /etc/hyperledger-baseimage-release - -# clean up our environment -apt-get -y autoremove -apt-get clean -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/images/base/scripts/docker/init.sh b/images/base/scripts/docker/init.sh deleted file mode 100755 index 4e1e5c95c50..00000000000 --- a/images/base/scripts/docker/init.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -apt-get update -apt-get install -y wget diff --git a/images/base/scripts/vagrant/cleanup.sh b/images/base/scripts/vagrant/cleanup.sh deleted file mode 100644 index ddbc4b0b493..00000000000 --- a/images/base/scripts/vagrant/cleanup.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Removing leftover leases and persistent rules -echo "cleaning up dhcp leases" -rm /var/lib/dhcp/* - -# Make sure Udev doesn't block our network -echo "cleaning up udev rules" -rm /etc/udev/rules.d/70-persistent-net.rules -mkdir /etc/udev/rules.d/70-persistent-net.rules -rm -rf /dev/.udev/ -rm /lib/udev/rules.d/75-persistent-net-generator.rules - -echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" -echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/images/base/scripts/vagrant/init.sh b/images/base/scripts/vagrant/init.sh deleted file mode 100755 index 3c10c5a5b39..00000000000 --- a/images/base/scripts/vagrant/init.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -e -set -x - -# Install headers so that we may build the vbox drivers layer -apt-get install -y build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev unzip - -sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers -sed -i -e 's/%sudo ALL=(ALL:ALL) ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers - -# Tweak sshd to prevent DNS resolution (speed up logins) -echo 'UseDNS no' >> /etc/ssh/sshd_config - -# Remove 5s grub timeout to speed up booting -cat < /etc/default/grub -# If you change this file, run 'update-grub' afterwards to update -# /boot/grub/grub.cfg. - -GRUB_DEFAULT=0 -GRUB_TIMEOUT=0 -GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet" -GRUB_CMDLINE_LINUX="debian-installer=en_US" -EOF - -update-grub diff --git a/images/base/scripts/vagrant/vagrant.sh b/images/base/scripts/vagrant/vagrant.sh deleted file mode 100755 index d43ab6351c1..00000000000 --- a/images/base/scripts/vagrant/vagrant.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e -set -x - -# Vagrant specific -date > /etc/vagrant_box_build_time - -# Installing vagrant keys -mkdir -pm 700 /home/vagrant/.ssh -wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys -chmod 0600 /home/vagrant/.ssh/authorized_keys -chown -R vagrant /home/vagrant/.ssh diff --git a/images/base/scripts/vagrant/virtualbox.sh b/images/base/scripts/vagrant/virtualbox.sh deleted file mode 100755 index a8b2aeb1531..00000000000 --- a/images/base/scripts/vagrant/virtualbox.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -x - -apt-get install --yes virtualbox-guest-utils diff --git a/images/base/scripts/vagrant/zerodisk.sh b/images/base/scripts/vagrant/zerodisk.sh deleted file mode 100644 index 35370d64a3d..00000000000 --- a/images/base/scripts/vagrant/zerodisk.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Zero out the free space to save space in the final image: -dd if=/dev/zero of=/EMPTY bs=1M -rm -f /EMPTY - -# Sync to ensure that the delete completes before this moves on. -sync -sync -sync diff --git a/images/src/Dockerfile.in b/images/src/Dockerfile.in index 5b94527b6e4..507220741e5 100644 --- a/images/src/Dockerfile.in +++ b/images/src/Dockerfile.in @@ -1,2 +1,2 @@ -FROM hyperledger/fabric-baseimage:latest +FROM hyperledger/fabric-baseimage:_BASE_TAG_ ADD gopath.tar.bz2 $GOPATH/src/github.com/hyperledger/fabric diff --git a/scripts/provision/common.sh b/scripts/provision/common.sh deleted file mode 100755 index 0efe7e63570..00000000000 --- a/scripts/provision/common.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# Add any logic that is common to both the peer and docker environments here - -apt-get update -qq - -# Used by CHAINTOOL -apt-get install -y default-jre diff --git a/scripts/provision/docker.sh b/scripts/provision/docker.sh deleted file mode 100755 index 8ed21a7ca14..00000000000 --- a/scripts/provision/docker.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash - -# --------------------------------------------------------------------------- -# Install the hyperledger/fabric-baseimage docker environment -# --------------------------------------------------------------------------- -# -# There are some interesting things to note here: -# -# 1) Note that we take the slightly unorthodox route of _not_ publishing -# a "latest" tag to dockerhub. Rather, we only publish specifically -# versioned images and we build the notion of "latest" here locally -# during provisioning. This is because the notion of always -# pulling the latest/greatest from the net doesn't really apply to us; -# we always want a coupling between the fabric and the docker environment. -# At the same time, requiring each and every Dockerfile to pull a specific -# version adds overhead to the Dockerfile generation logic. Therefore, -# we employ a hybrid solution that capitalizes on how docker treats the -# "latest" tag. That is, untagged references implicitly assume the tag -# "latest" (good for simple Dockerfiles), but will satisfy the tag from -# the local cache before going to the net (good for helping us control -# what "latest" means locally) -# -# A good blog entry covering the mechanism being exploited may be found here: -# -# http://container-solutions.com/docker-latest-confusion -# -# 2) A benefit of (1) is that we now have a convenient vehicle for performing -# JIT customizations of our docker image during provisioning just like we -# do for vagrant. For example, we can install new packages in docker within -# this script. We will capitalize on this in future patches. -# -# 3) Note that we do some funky processing of the environment (see "printenv" -# and "ENV" components below). Whats happening is we are providing a vehicle -# for allowing the baseimage to include environmental definitions using -# standard linux mechanisms (e.g. /etc/profile.d). The problem is that -# docker-run by default runs a non-login/non-interactive /bin/dash shell -# which omits any normal /etc/profile or ~/.bashrc type processing, including -# environment variable definitions. So what we do is we force the execution -# of an interactive shell and extract the defined environment variables -# (via "printenv") and then re-inject them (using Dockerfile::ENV) in a -# manner that will make them visible to a non-interactive DASH shell. -# -# This helps for things like defining things such as the GOPATH. -# -# An alternative would be to bake any Dockerfile::ENV items in during -# baseimage creation, but packer lacks the capability to do so, so this -# is a compromise. -# --------------------------------------------------------------------------- - -NAME=hyperledger/fabric-baseimage -RELEASE=`uname -m`-$1 -DOCKERHUB_NAME=$NAME:$RELEASE - -CURDIR=`dirname $0` - -docker inspect $DOCKERHUB_NAME 2>&1 > /dev/null -if [ "$?" == "0" ]; then - echo "BUILD-CACHE: exists!" - BASENAME=$DOCKERHUB_NAME -else - echo "BUILD-CACHE: Pulling \"$DOCKERHUB_NAME\" from dockerhub.." - docker pull $DOCKERHUB_NAME - docker inspect $DOCKERHUB_NAME 2>&1 > /dev/null - if [ "$?" == "0" ]; then - echo "BUILD-CACHE: Success!" - BASENAME=$DOCKERHUB_NAME - else - echo "BUILD-CACHE: WARNING - Build-cache unavailable, attempting local build" - (cd $CURDIR/../../images/base && make docker DOCKER_TAG=localbuild) - if [ "$?" != "0" ]; then - echo "ERROR: Build-cache could not be compiled locally" - exit -1 - fi - BASENAME=$NAME:localbuild - fi -fi - -# Ensure that we have the baseimage we are expecting -docker inspect $BASENAME 2>&1 > /dev/null -if [ "$?" != "0" ]; then - echo "ERROR: Unable to obtain a baseimage" - exit -1 -fi - -# any further errors should be fatal -set -e - -TMP=`mktemp -d` -DOCKERFILE=$TMP/Dockerfile - -LOCALSCRIPTS=$TMP/scripts -REMOTESCRIPTS=/hyperledger/scripts/provision - -mkdir -p $LOCALSCRIPTS -cp -R $CURDIR/* $LOCALSCRIPTS - -# extract the FQN environment and run our common.sh to create the :latest tag -cat < $DOCKERFILE -FROM $BASENAME -`for i in \`docker run -i $BASENAME /bin/bash -l -c printenv\`; -do - echo ENV $i -done` -COPY scripts $REMOTESCRIPTS -RUN $REMOTESCRIPTS/common.sh -RUN chmod a+rw -R /opt/gopath - -EOF - -[ ! -z "$http_proxy" ] && DOCKER_ARGS_PROXY="$DOCKER_ARGS_PROXY --build-arg http_proxy=$http_proxy" -[ ! -z "$https_proxy" ] && DOCKER_ARGS_PROXY="$DOCKER_ARGS_PROXY --build-arg https_proxy=$https_proxy" -[ ! -z "$HTTP_PROXY" ] && DOCKER_ARGS_PROXY="$DOCKER_ARGS_PROXY --build-arg HTTP_PROXY=$HTTP_PROXY" -[ ! -z "$HTTPS_PROXY" ] && DOCKER_ARGS_PROXY="$DOCKER_ARGS_PROXY --build-arg HTTPS_PROXY=$HTTPS_PROXY" -[ ! -z "$no_proxy" ] && DOCKER_ARGS_PROXY="$DOCKER_ARGS_PROXY --build-arg no_proxy=$no_proxy" -[ ! -z "$NO_PROXY" ] && DOCKER_ARGS_PROXY="$DOCKER_ARGS_PROXY --build-arg NO_PROXY=$NO_PROXY" -docker build $DOCKER_ARGS_PROXY -t $NAME:latest $TMP - -rm -rf $TMP diff --git a/scripts/provision/host.sh b/scripts/provision/host.sh deleted file mode 100755 index e5a8aa22f48..00000000000 --- a/scripts/provision/host.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -CURDIR=`dirname $0` - -$CURDIR/common.sh - -# Install docker-compose -curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose -chmod +x /usr/local/bin/docker-compose - -# Install Python, pip, behave, nose -# -# install python-dev and libyaml-dev to get compiled speedups -apt-get install --yes python-dev -apt-get install --yes libyaml-dev - -apt-get install --yes python-setuptools -apt-get install --yes python-pip -pip install --upgrade pip -pip install behave -pip install nose - -# updater-server, update-engine, and update-service-common dependencies (for running locally) -pip install -I flask==0.10.1 python-dateutil==2.2 pytz==2014.3 pyyaml==3.10 couchdb==1.0 flask-cors==2.0.1 requests==2.4.3 - -# Python grpc package for behave tests -# Required to update six for grpcio -pip install --ignore-installed six -pip install --upgrade 'grpcio==0.13.1' - -# install ruby and apiaryio -#apt-get install --yes ruby ruby-dev gcc -#gem install apiaryio - -# Install Tcl prerequisites for busywork -apt-get install --yes tcl tclx tcllib - -# Install NPM for the SDK -apt-get install --yes npm - -# Install JDK 1.8 for Java chaincode development -add-apt-repository ppa:openjdk-r/ppa -y -apt-get update && apt-get install openjdk-8-jdk -y - -# Download Gradle and create sym link -wget https://services.gradle.org/distributions/gradle-2.12-bin.zip -P /tmp --quiet -unzip -q /tmp/gradle-2.12-bin.zip -d /opt && rm /tmp/gradle-2.12-bin.zip -ln -s /opt/gradle-2.12/bin/gradle /usr/bin - -# Download maven for supporting maven build in java chaincode -MAVEN_VERSION=3.3.9 -mkdir -p /usr/share/maven /usr/share/maven/ref -curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \ - | tar -xzC /usr/share/maven --strip-components=1 \ - && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn - -# Set the default JDK to 1.8 -update-java-alternatives -s java-1.8.0-openjdk-amd64