-
Notifications
You must be signed in to change notification settings - Fork 0
CPL-6984: Dockerized compilations #38
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
Conversation
spirsch
left a comment
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.
Mostly minor things, so already approving. 👍
README.md
Outdated
| compiler=g++ | ||
| timeout=60 | ||
| compression=lzo | ||
| profile=jammy |
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.
| profile=jammy | |
| schroot_profile=jammy |
README.md
Outdated
| $ sudo schroot -c jammy -- apt -y install build-essential | ||
| ``` | ||
| - Execute *schrooted* compilations by specifying `--profile=jammy` via the CLI or in the `client.conf` file | ||
| - Execute *schrooted* compilations by specifying `--schroot-profile=jammy` via the CLI or in the `client.conf` file |
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.
A change I apparently missed in my PR a while ago:
| - Execute *schrooted* compilations by specifying `--schroot-profile=jammy` via the CLI or in the `client.conf` file | |
| - Execute *schrooted* compilations by specifying `--schroot-profile=jammy` via the CLI or in the `homcc.conf` file |
| return f"""[{level_format}%(levelname)s{self.RESET}] %(asctime)s - %(threadName)s | ||
| - %(pathname)s:%(lineno)d:\n%(message)s""" |
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.
Good idea to add thread information as well! 👍
| # schroot profiles | ||
| schroot_profiles: List[str] = load_schroot_profiles() |
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.
Just a mention that I created CPL-7103 ticket to improve our current schroot profile loading (and parsing) in the future.
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.
Good idea, thanks for creating the ticket
homcc/server/server.py
Outdated
| def check_schroot_profile_argument(self, schroot_profile: Optional[str]) -> bool: | ||
| """Checks whether the specified schroot profile requested by the client can be used. | ||
| It can not be used if the schroot profile with the given name is not set up on the server.""" | ||
| if schroot_profile is not None: |
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 schroot_profile is not None: | |
| if schroot_profile is None: | |
| return False |
to reduce indention level like you did in check_docker_container_argument.
homcc/server/server.py
Outdated
|
|
||
| return True | ||
|
|
||
| def check_docker_container_argument(self, docker_container: Optional[str]): |
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.
| def check_docker_container_argument(self, docker_container: Optional[str]): | |
| def check_docker_container_argument(self, docker_container: Optional[str]) -> bool: |
tests/conftest.py
Outdated
|
|
||
| def pytest_addoption(parser: pytest.Parser): | ||
| parser.addoption( | ||
| "--runschroot", action="store", type=str, metavar="PROFILE", help="run e2e schroot tests with specified 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.
Only for internal consistency:
| "--runschroot", action="store", type=str, metavar="PROFILE", help="run e2e schroot tests with specified PROFILE" | |
| "--runschroot", action="store", type=str, metavar="SCHROOT_PROFILE", help="run e2e schroot tests with specified PROFILE" |
and in the marker documentation above and usage below (reason="specify --runschroot=SCHROOT_PROFILE)
tests/server/docker_test.py
Outdated
| class TestIsValidContainer: | ||
| """Tests the method that checks if a docker container is a valid (existing and running) 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.
| class TestIsValidContainer: | |
| """Tests the method that checks if a docker container is a valid (existing and running) container.""" |
can be removed.
tests/e2e/e2e_test.py
Outdated
| "--no-schroot-profile" if self.schroot_profile is None else f"--schroot-profile={self.schroot_profile}", | ||
| "--no-docker-container" | ||
| if self.docker_container is None | ||
| else f"--docker-container={self.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.
We should probably extract these lines (like compression_arg above) to improve visual clarity.
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.
Good hint, this makes things more readable
tests/e2e/e2e_test.py
Outdated
| def cpp_end_to_end_no_linking( | ||
| self, | ||
| compiler: str, | ||
| unused_tcp_port: int, | ||
| compression: Compression = NoCompression(), | ||
| profile: Optional[str] = None, | ||
| basic_arguments: BasicClientArguments, | ||
| ): |
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.
Minor formatting to a single line here (and for cpp_end_to_end_preprocessor_side_effects).
def cpp_end_to_end_no_linking(self, basic_arguments: BasicClientArguments):
This PR adds support for remote compilations inside a docker container specified by the client.
E2E tests for the docker compilation are executed by the CI only in the
mainbranch due to longer runtime. (similar toschroot)Instructions on how to use the feature can be found in the
README.Furthermore, the
.pylintrcfile is updated according to the latest available version from Google, and E2E tests were refactored a bit to reduce code duplication that would else have been added by introducing this feature.During testing I noticed that reading the server logs is quite hard for clients simultaneously compiling. Therefore, I changed the logging on the server slightly (1-liner) so that one can match every log line to a certain client by including the thread name, which is different for every thread (and therefore client) that the server starts. This way we can analyze logs much better, especially for simultaneous requests.