Configuration
Harpoon is configured via a YAML file that contains Harpoon configuration and configuration for each docker image.
The Harpoon
options below can be configured inside your configuration under
a harpoon
section, but most options will be overridden with what is provided
by the command line.
However, these can be overridden on a per task basis with the overrides
option for the task.
The Image
options below are what is available per image:
---
images:
<image_name>:
<image_options>
Harpoon
tag = (optional) string
Tag used for pulling/pushing a single image
flat = (default=False) boolean
Don’t show images as layers when doing harpoon show
extra = (default=””) string
Sets the $@
variable. Alternatively specify these after a --
on the commandline
debug = (default=False) boolean
Whether debug has been specified
config = (optional) file
The location of the configuration to use. If not set the HARPOON_CONFIG
env variable is used
addons = { string : [ string, … ] }
A dictionary of namespace to list of names for addons to register
stdout = (default=<_io.TextIOWrapper name=’<stdout>’ mode=’w’ encoding=’utf-8’>) any
The stdout to use for printing
do_push = (default=False) boolean
Push images after making them (automatically set by the push
tasks
artifact = (optional) string
Extra information for actions
tty_stdin = (default=None) any
The stdin to use for a tty
no_cleanup = (default=False) boolean
Don’t cleanup the images/containers automatically after finish
tty_stdout = (default=<function HarpoonSpec.harpoon_spec.<locals>.<lambda> at 0x7f940c70e830>) any
The stdout to use for a tty
tty_stderr = (default=<function HarpoonSpec.harpoon_spec.<locals>.<lambda> at 0x7f940c70e9e0>) any
The stderr to use for a tty
extra_files = [ string, … ]
Extra files to load in as configuration
chosen_task = (default=”list_tasks”) string
The task to run
interactive = (default=True) boolean
Run the container with a tty
chosen_image = (default=””) string
The image that we want to run
silent_build = (default=False) boolean
Don’t print out log information
keep_replaced = (default=False) boolean
Don’t auto remove replaced images
only_pushable = (default=False) boolean
Ignore images that don’t have an image_index
option
ignore_missing = (default=False) boolean
Don’t raise errors if we try to pull an image that doesn’t exist
docker_context = any
The docker context object (set internally)
no_intervention = (default=False) boolean
Don’t create intervention images when an image breaks
intervene_afterwards = (default=False) boolean
Create an intervention image even if the image succeeds
docker_context_maker = any
Function that makes a new docker context object (set internally)
Image
tag = (optional) string
defaults to ‘latest’
env = [ [string, (string_or_int_as_string )] , … ]
Environment options
cpu = <options>
CPU options
cap_add = (default=None) [ string, … ]
List of kernel capabilties to add to the container
cap_drop = (default=None) [ string, … ]
List of kernel capabilties to drop from the container
mem_limit = (default=0) integer
Memory limit in bytes
cpu_shares = (default=None) integer
The CPU Shares for container (ie. the relative weight vs othercontainers)
cpuset_cpus = (default=None) string
CPUs in which to allow execution (0-3, 0,1).
cpuset_mems = (default=None) string
Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems.
memswap_limit = (default=0) integer
Total memory usage (memory + swap); set -1 to disable swap
name = (default=”{_key_name_1}”) string
The name of the image
user = (default=None) string
The user to use inside the container
vars = dictionary
Arbritrary dictionary of values
bash = delayed
A command to run, will transform into {self.shell} -c '<bash>'
shell = (default=”/bin/bash”) string
The shell to use for the bash option
links = [ [match, (string )] , … ]
The containers to link into this container
ports = [ [string_or_int_as_string, (string_or_int_as_stringstring_or_int_as_string )] , … ]
The ports to expose
harpoon = any
The harpoon object
command = delayed
The default command for the image
context = dict_from_bool
The context options for building the container
volumes = <options>
Extra volumes to mount in the container
mount = [ [string, string, (string, )] , … ]
Volumes to mount into this container
share_with = [ string, … ]
Containers to share volumes with
ulimits = (default=None) [ dictionary, … ]
A list of ulimits to set in the container
network = <options>
Network options
dns = (default=None) [ string, … ]
A list of dns servers for the container to use
mode = (default=None) string
Sets the networking mode for the container
hostname = (default=None) string
The desired hostname to use for the container
disabled = (default=False) boolean
Whether the network is disabled
domainname = (default=None) string
The desired domain name to use for the containe
dns_search = (default=None) [ string, … ]
A list of DNS search domains
extra_hosts = [ string, … ]
A list of hostnames/IP mappings to be added to the container’s /etc/hosts file
network_mode = (default=None) string
The network mode
publish_all_ports = (default=False) boolean
Allocates a random host port for all of a container’s exposed ports
devices = (default=None) [ dictionary, … ]
Devices to add to the container
key_name = “{_key_name_1}”
The name of the key this image was defined with in the configuration
commands = (required) [ match, … ]
The commands that make up the Dockerfile for this image
lxc_conf = (default=None) filename
The location to an lxc_conf file
image_name = (optional) string
The name of the image that is to be built
cache_from = delayed
The images to use cache from
log_config = (default=None) [ dictionary, … ]
Log configuration for the container
privileged = (default=False) boolean
Gives the container full access to the host
image_index = (default=””) string
The index and prefix to push to. i.e. my_registry.com/myapp/
assume_role = (optional) string
An aws iam role to assume for running the container
security_opt = (default=None) [ string, … ]
A list of string values to customize labels for MLS systems, such as SELinux.
no_tty_option = (default=False) boolean
Say False for tty when making the image but still use dockerpty
configuration = any
The root configuration
other_options = <options>
Other options to use in docker commands
start = dictionary
Extra options to pass into docker.start
build = dictionary
Extra options to pass into docker.build
create = dictionary
Extra options to pass into docker.create
host_config = dictionary
extra options to pass into docker.utils.host_config
container_name = (optional) string
The name to give to the running container
authentication = { string : set_options }
Authentication options for specific registries
wait_condition = (optional) <options>
Wait for this condition to resolve before starting other containers
greps = (optional) { string : string }
A dictionary of filename to a regex of what to expect in the file
harpoon = “{harpoon}”
Access to the harpoon object
timeout = (default=300) integer
How many seconds till we stop waiting altogether
command = (optional) [ string, … ]
A list of commands to run
port_open = (optional) [ integer, … ]
A list of ports to look for
file_value = (optional) { string : string }
A dictionary of filename to expected content
curl_result = (optional) { string : string }
A dictionary of urls and expected content from the url
file_exists = (optional) [ string, … ]
A list of files to look for
wait_between_attempts = (default=5) float
How many seconds to wait between attempts
restart_policy = (default=None) string
The behaviour to apply when the container exists
deleteable_image = (default=False) boolean
Whether this image can be deleted after use
read_only_rootfs = (default=False) boolean
Mount the container’s root filesystem as read only. Specified as a boolean value.
image_name_prefix = (default=””) string
The prefix given to the name of the image
dependency_options = { image_name : <options> }
Any options to apply to our dependency containers
attached = (default=False) boolean
Whether harpoon attaches to this container or not
wait_condition = (optional) <options>
Dictionary of image name to wait_conditions. These override wait conditions on the dependency itself
greps = (optional) { string : string }
A dictionary of filename to a regex of what to expect in the file
harpoon = “{harpoon}”
Access to the harpoon object
timeout = (default=300) integer
How many seconds till we stop waiting altogether
command = (optional) [ string, … ]
A list of commands to run
port_open = (optional) [ integer, … ]
A list of ports to look for
file_value = (optional) { string : string }
A dictionary of filename to expected content
curl_result = (optional) { string : string }
A dictionary of urls and expected content from the url
file_exists = (optional) [ string, … ]
A list of files to look for
wait_between_attempts = (default=5) float
How many seconds to wait between attempts
cleanup_intermediate_images = (default=True) boolean
Whether to remove intermediate images from multi stage builds