Skip to content
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

Refactor docker runner: new logging system and fixed several bugs #17542

Open
wants to merge 10 commits into
base: develop2
Choose a base branch
from
7 changes: 5 additions & 2 deletions conan/api/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def rewrite_line(self, line):
self.stream.flush()
self._color = tmp_color

def _write_message(self, msg, fg=None, bg=None):
def _write_message(self, msg, fg=None, bg=None, newline=True):
if isinstance(msg, dict):
# For traces we can receive a dict already, we try to transform then into more natural
# text
Expand All @@ -206,8 +206,11 @@ def _write_message(self, msg, fg=None, bg=None):
else:
ret += "{}".format(msg)

if newline:
ret = "%s\n" % ret

with self.lock:
self.stream.write("{}\n".format(ret))
self.stream.write(ret)
self.stream.flush()

def trace(self, msg):
Expand Down
10 changes: 10 additions & 0 deletions conan/internal/model/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@
"tools.build:linker_scripts": "List of linker script files to pass to the linker used by different toolchains like CMakeToolchain, AutotoolsToolchain, and MesonToolchain",
# Package ID composition
"tools.info.package_id:confs": "List of existing configuration to be part of the package ID",
# Runners
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we need @memsharded 's approval. I don't know if we want to add the config to the builtins, because the runners are going to be extra things that will need to install their dependencies separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely, I added them as extra documentation but they should probably be moved somewhere else or just removed.

"runner.type": "Type of runner to use. Possible values: 'docker'",
"runner.docker.dockerfile": "Path to the Dockerfile to use in case of building a docker image",
"runner.docker.image": "Image name to download from registry or the name of the built image in case of defining dockerfile path",
"runner.docker.name": "Name of the container to be used (conan-runner-docker by default)",
"runner.docker.cache": "Host's conan cache behavior. Possible values: 'clean' (use empty cache), 'copy' (copy whole cache) or 'shared' (mount chache as shared volume)",
"runner.docker.remove": "(boolean) Remove the container after running the Conan command",
"runner.docker.configfile": "Path to a configuration file with extra parameters (https://containers.dev/implementors/json_reference/#image-specific)",
"runner.docker.build_context": "Docker build context",
"runner.docker.platform": "Docker platform to build the image for, e.g. 'linux/amd64'",
Comment on lines +136 to +145
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not go here, I know. But right now conan's client does not have any command to display extra information about profiles configuration.
Should we create it?
The same occurs with the SSH runner here: https://github.com/conan-io/conan/pull/17357/files#diff-c91d5fdfb0f1effa668199823027b39224920aebeb9db78f13a19abbe5e50be9R136-R139

}

BUILT_IN_CONFS = {key: value for key, value in sorted(BUILT_IN_CONFS.items())}
Expand Down
Loading
Loading