Repository navigation
build scripts: various cleanups and minor changes preparing for containerized build and test - #48697
Conversation
2fdaa2d to
a88392a
Compare
|
jenkins test make check |
|
last make check failure |
|
Same failure. I didn't think my compiler selection patches should have an externally visible result... but now I'm not so sure. I will just restart the job a couple more times but if it keeps failing this way, I'll drop the compiler related patches from the branch and see if that makes a difference. |
|
jenkins test make check |
|
Different this time: |
|
jenkins test make check |
|
Now another error (?): PS. This was actually the very first failure case which I hadn't captured in a comment. |
|
jenkins test make check |
Again |
a88392a to
50ca88d
Compare
|
I've dropped 2 compiler detection related patches from the series, to see if there's any impact on the failures of |
|
First run after dropping the two compiler related patches worked. Will add them back one at a time now (half-baked bisect like). |
|
Hmm. This time it failed but got past the compile. It died at unittest_osdmap. |
epuertat
left a comment
There was a problem hiding this comment.
Great work, @phlogistonjohn! I just left some suggestions, think-aloud ideas, ...
There was a problem hiding this comment.
Why not enabling this here? We could do that either inside our cmake infra, or in Github via ReviewDog (that works better for incremental fixes): rhcs-dashboard/ceph-dev#63 (comment)
There was a problem hiding this comment.
OK, I'll think about it. I usually try to make smaller patches and PRs that only do one thing at a time, but if its not a huge effort, and I can borrow from something existing, I can add it to this pr too.
There was a problem hiding this comment.
I know it's not POSIX/sh compatible, but source is easier to read/spot and makes it easier identify what external scripts are being invoked. Searching for ". " also catches comments and things like pushd . > /dev/null.
There was a problem hiding this comment.
I'll think about it. Since these are all bash scripts, I don't think we should hesitate to use bash specific features. Personally, I think some of the code could be improved by use of bash arrays, for example.
There was a problem hiding this comment.
For backward compatibility we should keep this, but if we plan to go containerized, probably we should leverage the implicit caching of each tool (/var/lib/dnf, /root/.cache/pip, etc) and mount those inside the container or using COPY --mount=type=cache. I'm experimenting with those for the ceph/spdk containerized build and that reduces (not yet completely) network activity.
There was a problem hiding this comment.
Right. FWIW, I have ccache enabled in the container workflow, based on your original patches, but unfortunately it doesn't seem to work as desired. It's one of those things I want to look into soon. But since I don't want to keep sitting on all the work done so far this PRs about getting some of the script improvements out sooner. :-)
There was a problem hiding this comment.
Nice! I racked my brains trying to remove package installs from here!
There was a problem hiding this comment.
And we should probably rewrite this... Dashboard used git long time ago since some NPM dependency was pinned to a github repo, instead to an npmjs published package, but not anymore. However, git is used by the run-make-check script to obtain the SHA of the current branch.
There was a problem hiding this comment.
OK, good to know.
There was a problem hiding this comment.
Once we move to containers, we should remove this... I'd be worried if some building script would mess with my sysctl settings (and that's only for the testing stage). In fact, we should be able to run these scripts without sudo.
There was a problem hiding this comment.
Yep. One thing I almost did for this series but skipped for now was to replace calls to sudo to a function like try_sudo which checks the EUID by default and can be forced on/off by a variable. Again, to keep the series smaller and easier to review I defered that until later. As for this particular line, I agree that it's not good to do inside the container... but I left it for now.
dd37b16 to
b04e9e4
Compare
|
jenkins test make check |
89ac7f4 to
b04e9e4
Compare
|
jenkins test make check |
|
I'm unsure if I'm massively unlucky or somehow a code path that is not taken, as indicated by the logging, is somehow making the builds fail. I'm going to gather some stats on these failures in an offline file. Expect to see a fair bit of noise on this PR for a while. Thanks for your patience. |
|
jenkins test make check |
b04e9e4 to
e1e147d
Compare
|
jenkins test make check |
d9584b3 to
64060b1
Compare
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
I fixed up the commit message on the patch that moves that code around. I've also rebased. |
In preparation for running builds and tests in containers, make some organizational changes to the run-make-*.sh scripts. Original version of the patch can be found at ceph#46071 Original-version-by: Ernesto Puerta <[email protected]> Co-authored-by: Ernesto Puerta <[email protected]> Co-authored-by: John Mulligan <[email protected]> Signed-off-by: Ernesto Puerta <[email protected]> Signed-off-by: John Mulligan <[email protected]>
The BUILD_DIR environment variable is honored by do_cmake.sh in order to create multiple build output directories. Before this change run-make.sh did not support BUILD_DIR the same way as do_cmake.sh. This change makes it possible to use BUILD_DIR with run-make.sh. Signed-off-by: John Mulligan <[email protected]>
Previously, the main part (top level body) of the script started and then some function definitions occurred and then the main part of the script resumed after that. I, and others, find this confusing so this change moves the function definitions to occur before the main body of the install-deps.sh script. Signed-off-by: John Mulligan <[email protected]>
Instead of requiring other scripts to install packages independently, teach install-deps.sh to install additional packages from the variable INSTALL_EXTRA_PKGS. Now, other scripts should just set INSTALL_EXTRA_PKGS and call install-deps.sh. In particular, this fixes an issue installing packages in a clean (ex. container) system that doesn't yet have repositories set up. Since this task is performed by install-deps.sh already we avoid a chicken-and-egg issue (or doing redundant work of setting up repos) in other scripts. Signed-off-by: John Mulligan <[email protected]>
Copy the logic from run-make.sh into install-deps.sh so that we can later remove it from run-make.sh. It helps prevent breakage when apt-get is interrupted. Signed-off-by: John Mulligan <[email protected]>
…ake.sh The run-make.sh script's prepare method pulls in additional dependencies that are needed by the CI build and tests. To avoid issues such as these packages not being available until after install-deps.sh being run in a container environment, we allow install-deps.sh and its new INSTALL_EXTRA_PKGS input variable to handle all of the dependency installation. Signed-off-by: John Mulligan <[email protected]>
The intention of this file is collect some of the most basic or common shell functions used across the various build scripts. I would also like to ensure that functions added here are validated using `shellcheck`. Currently, there's no automation for this, just the honor system, but eventually we can start automating validating this and other scripts with shellcheck. Signed-off-by: John Mulligan <[email protected]>
Currently, only in_jenkins is used. More will come later. Signed-off-by: John Mulligan <[email protected]>
Reduces some of the boilerplate around emitting the "CI_DEBUG:" prefixed debug lines for the CI. Additionally, enables using the FORCE_CI_DEBUG var to enable ci debug lines even when not in a jenkins environment. Signed-off-by: John Mulligan <[email protected]>
Replace a number of boilerplate CI_DEBUG lines with the recently added ci_debug function. Signed-off-by: John Mulligan <[email protected]>
This function can be more useful because the NPROC value can be provided regardless of how many cores nproc actually detects and may be handy in a restricted environment like a container. The new version quotes some values and uses $((...)) as per shellcheck warning that "expr is antiquated". Signed-off-by: John Mulligan <[email protected]>
Signed-off-by: John Mulligan <[email protected]>
The discover_compiler function is an abstraction over the current
compiler detection code in run-make.sh. It is intended to be flexible
enough to work on {centos,rhel} systems, but currently is just an
updated version of the logic from run-make.sh. The intent is that this
function will grow and become useful for other scripts used for
building (possibly do_cmake.sh for example).
Signed-off-by: John Mulligan <[email protected]>
In order to configure, build, and run tests in a CentOS 8 (or similar) container we need a functioning gcc-toolset compiler. This relies on the environment script being sourced as well. cmake does not appear to be able to discover this compiler own its own. Signed-off-by: John Mulligan <[email protected]>
f680bb3 to
435d4c7
Compare
|
Well, it looks like it's been a month or so since I last pinged on this PR. I thought it was shorter. Anyway, I just rebased for good measure. @adk3798 if I don't get any additional attention from @epuertat or @tchaikov - because they've approved but (maybe?) don't want to be involved in merging this, is there a typical process in ceph for this situation? |
|
@phlogistonjohn hi John, i am sorry for keeping you waiting and waiting. this is frustrating. and i can feel what you feel. but i don't have enough bandwidth working on this project as a responsible maintainer anymore. i could merge your PR but IMHO, that implies more responsibilities. could you ping @ceph/core for assistance on this? |
|
@tchaikov thanks I appreciate the response. I'll ping that group and I may also mail the devel list as well. @ceph/core any thoughts on how to make progress on the PR. Its part of a general effort I took on (that Ernesto started) to make the build (and unit tests) work within containers to decouple the build from the host OS and make it easier to build locally. |
|
11 failures, one dead job
For this PR in particular, I think I'll also run a few tests that use the ubuntu packages and get back to this |
aforementioned set of jobs run on ubuntu packages https://pulpito.ceph.com/adking-2023-02-27_15:21:08-fs-wip-adk-testing-2023-02-20-1650-distro-default-smithi. Will see how those go. I don't know what known failures exist in that suite but I'm assuming if this really broke something it would affect all or most of the tests so as long as we're mostly green I think we're okay. |
14/15 passed, looks like we're doing okay there |
The first patch is directly from @epuertat original patch, but just the shell script parts.
The remainder is a bunch of small things that I found while working on running the build and test scripts within a centos8 container. Some of them fix actual blockers to running in the container. Others are there to try and slightly clean up, reorganise, and de-duplicate parts of the scripts.
In particular, I'm adding a new src/script/lib-build.sh to share some common bits and parts of the current scripts pulled into new functions. Beyond getting some things to work in the centos 8 container environment there should be no externally visible behavior changes to the existing scripts.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows