Valentin Lab
b26153644e
new: charm can now declare relations
A relation can be 'recommended', 'required', 'optional'. It can also auto-pair.
6 years ago
Valentin Lab
da2ffeb456
fix: relation data was forgotten/mixed due to a big cache bug
6 years ago
Valentin Lab
208aa1ad7f
new: dev: small refactor of ``file_get_hash`` !minor
6 years ago
Valentin Lab
4e8ed59228
chg: dev: refactor out ``get_service_relation_tech_dep``
6 years ago
Valentin Lab
79c3e5b48b
new: better help message with charm actions listed as commands
6 years ago
Valentin Lab
5c0317d240
new: dev: provide ``get_container_network_ips`` to charms
6 years ago
Valentin Lab
e37864afc3
new: dev: provide ``get_host_path`` to find host path of a local directory.
This is useful when preparing to launch a docker container from
a ``compose`` in docker command.
6 years ago
Valentin Lab
96362fabb2
fix: dev: don't hide unexpected errors when launching docker in ``wait_for_tcp_port``.
6 years ago
Valentin Lab
bfc068876c
fix: remove bogus bash warning when using actions.
6 years ago
Valentin Lab
b92c1e5d42
fix: do not silently pass errors when populating environment variable for running hooks.
6 years ago
Valentin Lab
9b822d0b3e
fix: docker base image was wrong in image building charms having more than one layer.
6 years ago
Valentin Lab
8cbaa5356b
fix: support of empty ``docker-compose`` struct in compose YAML
6 years ago
Valentin Lab
65a2714dc0
new: dev: minor tweaks to existing displayed feedbacks in networking code. !minor
6 years ago
Valentin Lab
5d3a3fde83
chg: database password file can now be stored in a different directory than host !api
``DB_PASSFILE`` is split into ``HOST_DB_PASSFILE`` and ``CLIENT_DB_PASSFILE`` to allow
to use a ``HOST_DB_PASSFILE`` in a directory that is accessible to ``compose`` even when
run in docker mode.
Using this, we can store HOST_DB_PASSFILE along with the database files,
which makes a lot more sense as it resolv issues of synchronising the
database with the content of this file (namely, the authorization
scheme). So when restoring the datastore of the database, the charm
scripts will be able to use the db password file and will not have to
worry about if it is in sync with the files or not.
Note that ``db_docker_opts`` and ``db_cmd_opts`` are now bash arrays. As
previous implementation was brittle, especially for handling spaces in
arguments.
6 years ago
Valentin Lab
66b9c9e57c
fix: dev: moved state's temporary files for database communication in ``$state_tmpdir``
They were in ``/tmp`` and this was far from ideal (conflict between
concurrent version, or other process much more likely).
6 years ago
Valentin Lab
7b16c07c7f
fix: avoid leaking stopped containers
6 years ago
Valentin Lab
5c64645648
fix: ``wait_for_tcp_port`` would not work as expected and always succeed.
``$DEFAULT_BASH_IMAGE`` would not be set (because not exported) and as consequence
the ``docker run`` would fail with an errorlevel different from 1. The failure
condition was bogus here, and we should not rely on ``$DEFAULT_BASH_IMAGE`` to be
exported. Both have been corrected.
6 years ago
Valentin Lab
e521d5fee9
new: store and keep compiled docker-compose and a mean to use-it for services.
The ``docker-compose.yml`` is saved along with an executable ``dc`` and
``.env`` in a directory to be shared as a volume in case we'd like to
launch a subservice in the same setup from a launched service. For instance,
a ``cron`` charm could want to launch ``run-once`` services.
The charm only need to access the ``dc`` binary, this can be done by
sharing the binary as a volume. This is the recommended way to do this:
``\${DOCKER_COMPOSE_PATH}/bin/dc:/bin/dc:ro``. Notice how we use a
docker-compose level variable here as the DOCKER_COMPOSE_PATH will only
be computed after all ``init`` hooks are done. This is the purpose of
the ``.env`` file that is also generated.
These directories are garbage collected if no containers have volumes
connected to it.
6 years ago
Valentin Lab
37d5c0a43d
new: ``compose`` is now to be used in a docker.
6 years ago
Valentin Lab
9f4cb01a36
chg: dev: minor comment addition, removal, and simplification. !minor
6 years ago
Valentin Lab
08f21ff10a
chg: dev: delete obsolete code !minor
6 years ago
Valentin Lab
9624f3b00f
fix: dev: should not need any direct connection from container to host
These variables should not be used.
6 years ago
Valentin Lab
654d6733ac
fix: dev: function should use ``return``, not ``exit``.
6 years ago
Valentin Lab
a03ae8ba51
new: bail out when failing to read compose file and be more explicit
6 years ago
Valentin Lab
0085403e54
fix: was not compatible with ``busybox`` version of ``readlink``.
This will be required in a docker container based on alpine for
instance.
6 years ago
Valentin Lab
4b4aa5215f
fix: remove warning about "static" network.
The declaration of this network is completely useless.
6 years ago
Valentin Lab
7a779015b0
fix: use a docker container to check for open tcp port
This will allow to dockerize compose in the future and makes
it more portable. Indeed, the containers are not always reachable
from the host.
6 years ago
Valentin Lab
0a1d885d2f
fix: improper failure if using an empty service definition in ``compose.yml``
An empty definition is useful if you need the service to be selected as a
default service when using ``compose up`` with no argument, and you don't
have anything to configure in the given service.
6 years ago
Valentin Lab
5a60c03ff9
chg: better error message and error catching upon YAML merging
6 years ago
Valentin Lab
ad2a6232fd
new: ``run-once`` service should not be linked as dependencies to proper ``service``.
This will prevent ``run-once`` service to be ran by ``compose up`` if linked as a
dependency to another service.
6 years ago
Valentin Lab
72930065d6
chg: dev: factorize and cache ``get_service_type``
6 years ago
Valentin Lab
c4e8a45183
chg: dev: change the comment place !minor
6 years ago
Valentin Lab
e9770aacea
new: export command line information so that hooks can use it
6 years ago
Valentin Lab
189dc1daf4
new: support for type of service ``run-once`` through hook ``dc-pre-run`` and removal of auto-populated ``up``.
6 years ago
Valentin Lab
cebda50840
chg: dev: always 2 newlines between 2 functions def !minor
6 years ago
Valentin Lab
47635f1b80
chg: dev: small improvement on catching errors and debugging info !minor
6 years ago
Valentin Lab
5e8c1246ba
chg: dev: trap should not be set up if only sourcing the file.
6 years ago
Valentin Lab
40b173b935
new: added ``--add-compose-content, -Y YAML`` for one-time ``compose.yml`` addition.
6 years ago
Valentin Lab
a024649a5f
new: ``compose config`` on validation success outputs the final docker-compose file on standard output instead of standard error.
6 years ago
Valentin Lab
376c915b10
new: added ``cached_wget`` utility function to compose intended for charms to use.
6 years ago
Valentin Lab
68b1c33987
chg: dev: added idea in TODO comment !minor
6 years ago
Valentin Lab
8cc7c16062
chg: dev: cosmetic !minor
6 years ago
Valentin Lab
b460f95bf8
new: allow compose to work without any ``compose.yml`` found.
As services will have by default charms of the same name, this allows to
launch "charms" (spawn a service of this charm) without defining any yaml.
6 years ago
Valentin Lab
317f033efd
chg: dev: explicitely include ``common``
6 years ago
Valentin Lab
de1087a025
fix: rogue doubling of arguments.
6 years ago
Valentin Lab
c79e55e38f
new: added a new ``pre_deploy`` hook for anything to do before launching docker-compose and after relations
6 years ago
Valentin Lab
364218dcdc
new: ``logs`` command has a ``--tail 10`` default parameter.
6 years ago
Valentin Lab
5289fba5d4
fix: dev: remove commented out code that is very obsolete !minor
6 years ago
Valentin Lab
26347c7383
new: added ``--rebuild-relations-to-service, -R SERVICE`` to force the rebuild of relations with target service.
6 years ago
Valentin Lab
5734efecf8
more big fat changes
6 years ago