Recently I started experimenting with running ab inside OpenShift 158 | origin — imagine that you’d be able to 159 | build images in your cluster, using Ansible playbooks as definitions.
160 |Openshift by default runs its pods in a 161 | restrictive 162 | environment. In the proof of concept I was forced to run ab in a privileged 163 | pod. In the end, the whole test suite is passing in that privileged pod.
164 |Ansible-bender has these commands:
159 |Command |
166 | Description |
167 |
|---|---|
|
171 | build a new container image using selected playbook |
172 |
|
174 | list all builds |
175 |
|
177 | display build logs |
178 |
|
180 | provide detailed metadata about the selected build |
181 |
|
183 | Push images you built to remote locations. |
184 |
|
186 | Clean images from database which are no longer present on the disk. |
187 |
|
189 | Adds a template playbook with all the vars. |
190 |
Ansible bender has a caching mechanism. It is enabled by default. ab caches 165 | task results (=images). If a task content did not change and the base image is 166 | the same, the layer is loaded from cache instead of being processed again. This 167 | doesn’t work correctly with tasks which process file: ab doesn’t handle files 168 | yet.
169 |You are able to control caching in two ways:
170 |disable it completely by running ab build --no-cache
or adding a tag to your task named no-cache — ab detects such tag and
173 | will not try to load from cache
When building your image by default, every task (except for setup) is being 179 | cached as an image layer. This may have bad consequences on storage and 180 | security: there may be things which you didn’t want to have cached nor stored 181 | in a layer (certificates, package manager metadata, build artifacts).
182 |ab allows you to easily disable layering mechanism. All you need to do is to
183 | add a tag stop-layering to a task which will disable layering (and caching)
184 | for that task and all the following ones.