View APB_doc.md

FeedHenry Ansible Playbook Bundles

The document is documenting best practises for the FeedHenry APB development!

Installation

The apb CLI can be installed locally, but it is highly recommended using it wrapped in a Linux container. Below is an example on how to create an alias for the wrappedapb CLI:

alias apb='docker run --rm --privileged -v $PWD:/mnt -v $HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u $UID docker.io/feedhenry/apb'
View test.md

One terminal:

➜  kafkacat git:(master) ./kafkacat -P -b 172.30.246.240:9092 -t input_demo
FUCK
yeah
this 
works
View template.yaml
apiVersion: v1
kind: Template
metadata:
name: barnabas
parameters:
- description: Number of Zookeper cluster nodes which will be deployed (odd number of nodes is recomended)
displayName: Number of Zookeper cluster nodes (odd number of nodes is recomended)
name: ZOOKEEPER_NODE_COUNT
required: true
value: "3"
View gist:3d1679a50bd8431af3321f47d9646cb0
definitely should change the names to fh-sync-redis/fh-sync-mongo, reduces the chance of a collision.
You could do:
- name: Delete fh-sync required services
command: oc delete service fh-sync-{{ item }}
with_items:
- redis
- mongo
View gist:fcceee25e8341f8cbe27d1f3d6b34f0d
[2017-10-12T14:17:53.005Z] [DEBUG] Successfully converted Image feedhenry/ios-app-apb:latest into Spec
[2017-10-12T14:17:53.124Z] [DEBUG] Registry::imageToSpec
[2017-10-12T14:17:53.458Z] [ERROR] Something went wrong loading decoded spec yaml, YAML error: line 17: did not find expected key
[2017-10-12T14:17:53.458Z] [ERROR] unable to retrieve spec data for image - YAML error: line 17: did not find expected key
[2017-10-12T14:17:53.458Z] [ERROR] unable to fetch specs for registry dh - YAML error: line 17: did not find expected key
[2017-10-12T14:17:53.458Z] [WARNING] registry: 0x14ca600 was unable to complete bootstrap - YAML error: line 17: did not find expected key
[2017-10-12T14:17:53.458Z] [ERROR] Failed to bootstrap
[2017-10-12T14:17:53.458Z] [ERROR] all registries failed on bootstrap
[2017-10-12T14:17:53.458Z] [NOTICE] Broker successfully bootstrapped
View gist:57adb8b8ab7e1306c8cd29d619af9e4b
[2017-10-11T14:41:10.896Z] [INFO] Initiating Recovery Process
[2017-10-11T14:41:10.896Z] [DEBUG] Dao::FindByState
[2017-10-11T14:41:10.896Z] [INFO] No jobs to recover
[2017-10-11T14:41:10.896Z] [NOTICE]
[2017-10-11T14:41:10.897Z] [INFO] Broker configured to bootstrap on startup
[2017-10-11T14:41:10.897Z] [INFO] Attempting bootstrap...
[2017-10-11T14:41:10.897Z] [INFO] AnsibleBroker::Bootstrap
[2017-10-11T14:41:10.897Z] [DEBUG] Dao::BatchGetRaw
[2017-10-11T14:41:10.897Z] [DEBUG] DockerHubAdapter::GetImages
[2017-10-11T14:41:10.897Z] [DEBUG] BundleSpecLabel: com.redhat.apb.spec
View gist:5aa159e9fc87aae3271029af08d248a0
2017/10/11 09:58:49 [warn] 29#29: *2 [lua] remote_v2.lua:161: call(): failed to get list of services: invalid status: 0 url: https://23456789/admin/api/services.json, context: ngx.timer
2017/10/11 09:58:52 [warn] 29#29: *2 [lua] remote_v1.lua:108: call(): configuration download error: 23456789 could not be resolved (2: Server failure), context: ngx.timer
ERROR: ./src/configuration_loader.lua:47: missing configuration
stack traceback:
./src/configuration_loader.lua:47: in function 'boot'
libexec/boot.lua:6: in function 'file_gen'
init_worker_by_lua:45: in function <init_worker_by_lua:43>
[C]: in function 'xpcall'
init_worker_by_lua:52: in function <init_worker_by_lua:50>
View gist:ff1af64d221fd833e64676e7b900545d
Status: Downloaded newer image for docker.io/feedhenry/apb:latest
Finished writing dockerfile.
docker build -t docker.io/feedhenry/3scale-apb .
Sending build context to Docker daemon 119.8 kB
Step 1/7 : FROM ansibleplaybookbundle/apb-base
---> a0a080bfb5d2
View gist:ee340869c503bcfd1b63ed786afeb262
docker push matzew/3scale-apb
The push refers to a repository [registry.fedoraproject.org/matzew/3scale-apb]
bf9182497ca4: Preparing
007332fccbff: Preparing
dfc65498f34b: Preparing
37b45dc491dc: Preparing
b7a492bd3b78: Preparing
78edefe2b6a1: Waiting
b362758f4793: Waiting
unauthorized: authentication required
View gist:aba13c6b4800d7cdf0866ce6f732e24d
make
docker run --rm -u 1000 -v /home/Matthias/Work/Mobile.NEXT/3scale-apb:/mnt:z feedhenry/apb prepare
Unable to find image 'feedhenry/apb:latest' locally
Trying to pull repository registry.fedoraproject.org/feedhenry/apb ...
Trying to pull repository registry.access.redhat.com/feedhenry/apb ...
Trying to pull repository docker.io/feedhenry/apb ...
/usr/bin/docker-current: unable to retrieve auth token: 401 unauthorized.
See '/usr/bin/docker-current run --help'.
make: *** [Makefile:8: apb_build] Error 125