Repository navigation
Description
External services (MySQL, redis, memcached) and the need for an "uber container" to run our test suites are a pain point for the Pivotal Tracker team. For example, our Dockerfile installs the same version of MySQL 5.6.x that we run on pivotaltracker.com to run tests. But, we also have a PCF tile that runs against p-mysql. There seem to be two options for testing both DBs:
-
Have a second docker image that duplicates the uber image, substituting MariaDB 10.0.x for MySQL 5.6.x.
-
Jump through hoops of installing both MySQL and MariaDB in the same docker image (using something like http://mysqlsandbox.net/)
We've gone with option 1 for the time being. While an external service such as RDS is an option, I'd rather not be in the business of managing pools of instances and incur the extra network latency.
In an ideal, future-Concourse world, I could mix and match my external services with Docker Compose. As an example, see how Logplex runs their suite on TravisCI:
If they want to run against redis 3.x, it's as simple as changing a line: https://github.com/heroku/logplex/blob/master/docker-compose.yml#L5
An added benefit of Docker Compose is how quickly you get an environment running locally on your workstation. I don't have any of the Logplex dependencies on my MacBook (erlang, redis, etc.). But, my onboarding experience was:
git clone [email protected]:heroku/logplex.gitcd logplexdocker-compose build && docker-compose run test
In the span of 5 minutes I had an erlang test suite running against redis 2.8.
Activity
arnisoph commentedon Mar 30, 2016
To run integration tests I need to bootstrap some containers using compose or similar. Is this somehow possible yet?
ahelal commentedon Mar 30, 2016
Or some thinking like Travis matrix or test kitchen suites. So you can run tests with different combination of things i.e. version, os's, ...
rajatvig commentedon Apr 20, 2016
Is this support likely to land anytime soon?
oppegard commentedon Apr 20, 2016
It'd be nice to hear from @vito if something like this fits into the conceptual model of Concourse. I haven't thought through what supporting Docker Compose means, only that I want it. For example, I'm not sure if this makes sense as a Resource. To be more clear about what I'd like:
fly executestill works.It seems like a
docker-compose.ymlwould be a good way to describe the desired containers and their networking. It lets teams use Concourse for CI and Docker Compose for local development.vito commentedon Apr 20, 2016
When I have more time I want to play with allowing resources to expose network addresses to builds. That way you could model throwaway databases and services as resources that go away when the build is done. This could be done either with a single Docker Compose resource or with individual postgres/mysql/etc. resources.
Tankanow commentedon May 14, 2016
+1
I vote for as-native-as-possible
docker-composesupport. One simple sounding, if not implementable, solution is to give tasks access to the worker OS.royseto commentedon May 28, 2016
Hi, I learned about Concourse this morning and like almost everything I've read about it. Currently we use Jenkins and have a build pipeline that first builds a Docker image, then runs a bunch of test suites against that image in downstream jobs.
However, I think not being able to link dependent containers into a single Concourse build job will block us from migrating to Concourse. Our app is a Python/Flask app with dependencies on postgres and redis. My build script needs to look something like this:
where my docker-compose.yml looks something like this:
I want to containerize postgres and redis so that we can parallelize our tests and avoid having them step on each other.
Please let me know if there's a way to accomplish what I am trying to do in Concourse today. Unless I'm missing something, I think I need to make a shell script that does the above and keep calling it from Jenkins for now. Thanks!
vito commentedon May 29, 2016
With 1.3 it'll be pretty trivial to run Docker within your task:
docker daemon & docker-compose up docker-compose runtests /tests.shThis can already be done today, with some workarounds that won't be necessary come 1.3 (e.g. mounting a tmpfs for the Docker graph). You'd also need to run the task with
privileged: true, which may also be fixable now that cgroup namespacing is supported in Linux 4.6, though that will have to wait for Garden-runC to support it (/cc @julz).royseto commentedon May 29, 2016
Thanks @vito. I'll try it out after 1.3 comes out. Do you have a sense for what the performance overhead would be of running Docker containers inside Garden instead of running just Docker or Garden inside the host machine?
julz commentedon May 29, 2016
There shouldn't really be much of an impact: containers are just processes (there's no virtualisation going on), the overhead is very very small. The only real impact I can think of is you don't get the shared image cache from the host.
royseto commentedon May 29, 2016
OK, thanks for clarifying that @julz.
seanknox commentedon Jun 2, 2016
@julz @vito, short of docker-compose or concourse v1.3 availability, how does one run tasks that need to run multiple, linked Docker containers? E.g. a Rails app container that also needs additional service containers running like Redis and Postgres.
drnic commentedon Jun 5, 2016
Tankanow commentedon Jun 8, 2016
@drnic, can you explain this a bit more? How do I integrate this pool of VMs into concourse?
102 remaining items
AnianZ commentedon Apr 17, 2019
This workflow seems to have stopped working with the release of concourse 5.0.0. I can't get the docker-compose in a container setup working any more. It fails with
mount: can't find /sys/fs/cgroup in /proc/mountsRelated post in the forum by another person affected: https://discuss.concourse-ci.org/t/docker-compose-inside-concourse-5-no-longer-working/1232
meAmidos commentedon Apr 17, 2019
@AnianZ This might help with the issue: meAmidos/dcind#12
AnianZ commentedon Apr 17, 2019
@meAmidos Thank you! That was exactly what I was looking for. Apparently I was watching the wrong version of dcind.
willejs commentedon Jan 9, 2020
@vito is there any future plan or ideas as to how to tackle this?
vito commentedon Jan 9, 2020
@willejs The situation hasn't really changed from last time. We have too much on our plate and no one from the community has really tried to tackle this and come up with RFCs/proposals, so until that happens this likely won't go anywhere beyond the current solutions. 🙁
Sispheor commentedon Feb 28, 2020
What about something like proposed on Github action?
The only thing missing in Action is the ability to use a private registry for the image. But otherwise the implementation seems correct.
lucasmdrs commentedon Mar 20, 2020
Most CIs use a similar definition to the on above as shown by @Sispheor , TravisCI, CircleCI, Github Actions, GitlabCI... it doesn't seem like a big feature request.
This makes it harder to run integration tests, that currently only available through some sort of workaround with docker-compose or scripts.
jchesterpivotal commentedon Mar 20, 2020
It doesn't appear to be a big request, no.
But I think the history of this issue shows that it's a non-trivial change in the current architecture of Concourse.
It might become easier in future as various architectural refactoring work takes place in order to support Kubernetes as a runtime.
lucasmdrs commentedon Mar 21, 2020
By no means I meant to say it's a trivial change, I apologize if I misspelled and seemed that way.
But the history of this issue, the date of opening and the large adoption of this feature in other CI tools, shows that it shouldn't be diminished to a Core side-road ("Small features or bug fixes that aren't part of any epic on the roadmap") even less to a Backburner priority lane.
I'm here to support the request and keep this running, because it's something I would love to see being payed more attention to, as it's something that prevents me to fully adopt the tool.
vito commentedon Mar 22, 2020
I fully agree with this, and it would be great if someone from the community could help out. As I said before, we have too much on our plate right now to take this on ourselves. :/
While this is clearly a highly-sought-after feature, there are other highly-sought-after features which are more important right now because the pain felt without them is much worse: namely, support for branches/pull-requests (see the v10 roadmap) and support for runtimes like Kubernetes. Compared to those feature gaps, this issue is a quality-of-life improvement which has existing workarounds and patterns (though they may not be perfect), which means it has lower priority.
Concourse is a small team and we have to choose our battles. Unfortunately with as many users as we have it's not a matter of simply saying things are high priority, it's a matter of choosing who to disappoint, and hoping the community can pick things up where we can't. 🙁
Once we get past those big features we can start to take a deeper look at this. But y'all don't have to wait. Progress in the form of technical proposals and proof-of-concepts would really help get the ball rolling. If you want to support this request, that's really the way.
rucciva commentedon Jul 17, 2020
Hi all, i'm new to concourse, and i have a question, does concourse has some kind of detachable/background task or maybe a persistent resource? Regarding this issue, i'm thinking of running something like
docker-compose run --no-deps --use-aliases <service-name>as concourse (detachable) task or maybe (persistent) resources for each of the dependency services before running the final test service. As for the docker daemon, i'm thinking of mapping /var/run/docker.sock to tcp port using something like mutagen so that concourse worker can have access to it.danihodovic commentedon Oct 14, 2020
A Concourse CI resource that executes docker-compose against a remote host:
https://github.com/troykinsella/concourse-docker-compose-resource
aoldershaw commentedon Nov 18, 2020
I put together an RFC with a proposal for a new
services:field fortasksthat looks like:Would love to hear anyone's thoughts! concourse/rfcs#84
scottillogical commentedon Jun 12, 2024
For anyone else who needs this functionality right now, I published the following docker image and example pipeline that is working well for my use case https://github.com/scottillogical/concourse-docker-compose