-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conan-docker-runner added #267
base: master
Are you sure you want to change the base?
Conversation
--- | ||
layout: post | ||
comments: false | ||
title: "Introducing the Conan Docker runners: Running Conan remotelly" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that Running Conan remotelly
it's a bit confusing name...
What about something similar to: Running Conan Seamlessly in Docker Containers ?
meta_title: "How to run Conan inside a Docker container" | ||
description: "Runing Conan inside a Docker container" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add something like seamless or transparent here
--- | ||
layout: post | ||
comments: false | ||
title: "Introducing the Conan Docker runners: Running Conan remotelly" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: "Introducing the Conan Docker runners: Running Conan remotelly" | |
title: "Introducing the Conan Docker runners: Running Conan remotely" |
comments: false | ||
title: "Introducing the Conan Docker runners: Running Conan remotelly" | ||
meta_title: "How to run Conan inside a Docker container" | ||
description: "Runing Conan inside a Docker container" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: "Runing Conan inside a Docker container" | |
description: "Running Conan inside a Docker container" |
|
||
**Fully integrated with Conan** | ||
|
||
When you define a docker runner inside your host profile you are saying that you want to build your code using conan inside a docker image. Conan will try to build or reuse a docker image and run a conan create conan inside it. After that, conan copy the cache information from your docker container inside your host cache, obtainig the same result like an standard conan create. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you define a docker runner inside your host profile you are saying that you want to build your code using conan inside a docker image. Conan will try to build or reuse a docker image and run a conan create conan inside it. After that, conan copy the cache information from your docker container inside your host cache, obtainig the same result like an standard conan create. | |
When you define a docker runner inside your host profile you are saying that you want to build your code using conan inside a docker image. Conan will try to build or reuse a docker image and run a conan create conan inside it. After that, conan copy the cache information from your docker container inside your host cache, obtaining the same result like an standard conan create. |
Runners provide a seamless method to execute Conan on remote build environments like Docker ones, directly from your local setup by simply configuring your host profile. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about some introduction, summarizing the problem, that this was a very requested feature, and then we released that in some Conan version...
|
||
Runners provide a seamless method to execute Conan on remote build environments like Docker ones, directly from your local setup by simply configuring your host profile. | ||
|
||
## Main features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we better remove this title and make the main features part of the introduction?
|
||
## Main features | ||
|
||
**Fully integrated with Conan** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the titles I would try to use more compact titles, like this for example:
**Fully integrated with Conan** | |
**Seamless integration** |
|
||
When you define a docker runner inside your host profile you are saying that you want to build your code using conan inside a docker image. Conan will try to build or reuse a docker image and run a conan create conan inside it. After that, conan copy the cache information from your docker container inside your host cache, obtainig the same result like an standard conan create. | ||
|
||
**Use the image you want or create one** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also make this shorter, maybe something like: "Customizable Images" ?
|
||
Finally, if you want to use a pre-existing image or you want to give a specific name to the one you are compiling, you have the variable `image` where to define it. | ||
|
||
**Full control over the management of your host chache** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like Different cache modes ?
|
||
In all cases the result of the `conan create` command will be exactly the same and will end up stored in the local host cache, what changes is the starting point of the container cache and the way the result of the command ends up in the local host cache. | ||
|
||
**Control over the lifecycle of your containers** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Control over the lifecycle of your containers** | |
**Container Lifecycle control** |
- `suffix`: *docker* by default. Define the suffix name used to create your container *conan-runner-*`suffix`. | ||
- `remove`: *false* by default. If you want to delete you container after an execution set it to *true*. | ||
|
||
**Host profile example** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should not be at the same level than the main features?
remove=true | ||
``` | ||
|
||
## Do you need more control when running or building your containers? The configfile runner is the answer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can leave this as a bonus after going through the most basic use example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can even omit this in the blogpost and just add a link to the documentation, I think the blogpost should put users to try the feature as soon in the read process as we can.
|
||
## Do you need more control when running or building your containers? The configfile runner is the answer. | ||
|
||
If you need more control over the build and execution of the container, you can define more parameters inside a configfile yaml. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need more control over the build and execution of the container, you can define more parameters inside a configfile yaml. | |
If you need more control over the build and execution of the container, you can define more parameters inside the _configfile.yaml_ file. |
$ tree | ||
. | ||
├── Dockerfile | ||
├── configfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
├── configfile | |
├── configfile.yaml |
RUN pip install conan | ||
``` | ||
|
||
Now, we need to write the `configfile` to defile the `BASE_IMAGE` variable defined inside the Dockerfile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, we need to write the `configfile` to defile the `BASE_IMAGE` variable defined inside the Dockerfile. | |
Now, we need to write the `configfile` to define the `BASE_IMAGE` variable defined inside the Dockerfile. |
remove=false | ||
``` | ||
|
||
## Lets try it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the post would benefit if you can clone code with the configuration files from the examples2 repo
type=docker | ||
configfile=</my/runner/folder>/configfile | ||
cache=copy | ||
remove=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to explain a bit further this section, to reinforce some concepts from the introduction, also for example to justify why here we want to use cache=copy
, etc.
REPOSITORY TAG IMAGE ID CREATED SIZE | ||
``` | ||
|
||
Now, lets clone and build zlib from conan-center-index and create it using our new runner definition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can explain a bit the process that is going to happen here
If we run the ``conan create`` command again we will see how Conan reuses the previous container because we have set ``remove=False``. | ||
|
||
```bash | ||
$ conan create ./conan-center-index/recipes/zlib/all --version 1.3.1 -pr:h </my/runner/folder>/docker_example_host -pr:b </my/runner/folder>/docker_example_build | ||
|
||
... | ||
|
||
┌───────────────────────────────┐ | ||
| Starting the docker container | | ||
└───────────────────────────────┘ | ||
|
||
... | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this ending is a bit abrupt? What about some conclusions or some goodbye message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably wouldn't use recipes from conan-center-index
but a simple "hello world" one created with conan new
:
- As the hooks are not in the docker, the revision created there might be different to the revision created in the host, and users will be confused (binaries that they created locally will not be listed, as they belong to an older revision)
- The paths to the recipe, the versions, etc, are in general more complicated command line. With a
conan new
template, it becomes easier.
os=Linux | ||
[runner] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os=Linux | |
[runner] | |
os=Linux | |
[runner] |
os=Linux | ||
[runner] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os=Linux | |
[runner] | |
os=Linux | |
[runner] |
No description provided.