Repository navigation
Conversation
6ea352e to
a74052b
Compare
c5d4708 to
2b57142
Compare
54ceeef to
7748b30
Compare
485d949 to
094034f
Compare
094034f to
8417f60
Compare
8417f60 to
d7a5b47
Compare
Signed-off-by: Ernesto Puerta <[email protected]>
d7a5b47 to
70f2511
Compare
phlogistonjohn
left a comment
There was a problem hiding this comment.
Hi,
I finally got to time to mess around with your PR. I think it's a really cool start. Especially reusing the function prepare which I learned about just by reading the source to this dockerfile.
I had to hack up the dockerfile a bit but I did eventually get ceph building using this dockerfile as a base! Unfortunately, certain dependencies didn't seem to get installed by the existing rules. So I ended up with the somewhat messy RUN line:
RUN true \
&& dnf install -y epel-release 'dnf-command(config-manager)' \
&& dnf config-manager --set-enabled epel \
&& dnf install -y gcc-toolset-11{,-libatomic-devel} \
&& dnf install -y java-1.8.0-openjdk-headless \
&& source ./run-make-check.sh \
&& prepare \
&& ( if [ "${CLEAN_DNF}" != no ]; then dnf clean all && rm -rf /var/cache/dnf/* ; fi ) \
&& true
Obviously, this isn't very nice, but it got me to the point where do_cmake.sh and make/ninja would run.
I've started reading more into the scripts run-make-check.sh and src/script/run-make.sh to see why certain things (installing ccache, installing gcc-toolset, etc) don't work out of the box.
My interest is getting builds going locally, so I don't have a strong opinion on the jenkins part. I wonder if it might make sense to first get the dockerfile/scripts working for local builds of centos8, and ubuntu and then circle back to jenkins? Regardless, this is pretty cool and I want to continue poking at it until I can really use it as a base for my local builds!
|
|
||
| COPY ./ ./ | ||
| ARG FOR_MAKE_CHECK=1 | ||
| RUN source run-make-check.sh && prepare |
There was a problem hiding this comment.
I did some digging and found that the pepare function is actually in src/script/run-make.sh. So that script could sourced rather than run-make-check.sh.
| COPY ./ ./ | ||
| ARG FOR_MAKE_CHECK=1 | ||
| RUN source run-make-check.sh && prepare | ||
| RUN dnf clean all && rm -rf /var/cache/dnf/* |
There was a problem hiding this comment.
We generally want to run cleanup commands in the same RUN statement as the commands that dirty the state, right now the RUN statement above creates a layer with the results of prepare including the dnf cache. This line then creates a new layer that will remove the files... but they'll continue to exist in the parent layer.
It may also be nice to have a ARG to disable this cleanup... I use this myself when I need to iterate on building a container so I bind mount a directory for the dnf cache dirs and then reuse them over multiple runs. It significantly cuts down on the time needed to run the build command, not downloading the dnf metadata and files over and over again.
There was a problem hiding this comment.
You're right.
In Docker I think they (recently?) added the --mount=cache option to the RUN command in order to keep an external caching layer for these kind of commands.
There was a problem hiding this comment.
Interesting. Thanks for the pointer. I think this will be also in recent podman versions, but I have not tested it. I definitely want the containerfile and supporting bits to also work with podman, even if docker is used on the jenkins builders.
| ARG JENKINS_USER_GID=100 | ||
|
|
||
|
|
||
| SHELL ["bash", "-x", "-c"] |
There was a problem hiding this comment.
This line generates warnings for me - using podman.
There was a problem hiding this comment.
Can be removed. Just added to dump traces.
|
|
||
| SHELL ["bash", "-x", "-c"] | ||
|
|
||
| COPY ./ ./ |
There was a problem hiding this comment.
This line is going to stash the entire ceph source tree at the root of the container. It's probably fine to begin with, but it might be nice to put it in a particular dir and maybe only copy only the files necessary to set up the environment?
There was a problem hiding this comment.
With the .dockerignore defined in this PR actually this is just a few files. The repo files are actually mounted in the container run stage.
There was a problem hiding this comment.
Gotcha, I missed that, thanks!
|
@phlogistonjohn would you like to take over here? Honestly I'm not finding time to work on this (and it's high-prio as we discussed in one recent CLT meeting), so if someone else is willing to, I'll be more than happy to hand it over to you and help you as much as I can. Regarding the Jenkins vs. local, the truth is that we really need this in the CI environment, and the Jenkins pipeline worked good in the past (I broke this when I removed the EPEL install from the Dockerfile, with the goal of having a distro-neutral Dockerfile)... |
I'd be willing to take the lead on this. If you don't mind I would prefer to create my own branch/pr - in the "compile cephadm" PR I took it over fully intact but it caused some workflow issues for me.
I'm 100% behind getting it integrated with jenkins. I personally think getting it working locally first is faster and simpler and works as a glide path to also getting it working in jenkins too. I'd also need to rely more on your help and others when it comes to jenkins integration. |
|
Replying to myself, I want to create a branch under my own fork based on this branch, not just starting from scratch. |
@phlogistonjohn great, all yours then! I'll close this PR.
Regarding the Jenkins thing: the Jenkinsfile is already complete there (only a few things are left to achieve feature parity with the current Jenkins job: a) trigger phrases support, like the Good thing of conveying the Jenkins support is that it automatically becomes the validation step for this change (no need to add any further testing)... And I also found that Jenkins nodes built Ceph faster than my laptop ;-) Besides, if you need to keep any artifacts of the build for local testing, Jenkins also allows you to do that. |
|
Cool, thanks. I will probably have additional jenkins specific questions I'll need to ask you in the future. For those, I'll use chat/email from this point on. :-) |
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]>
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]>
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]>
jenkins do not test
There was a first try of this (but without the containerized approach): #37425
New Pipeline View
Security
Unlike the non-containerized approach, which required 'sudo' and made changes to the host environment, this version intentionally removes the requirement for sudo.
TODO
docker build)makemake check)/librbd/migration/test_mock_HttpClient.cc: TestMockMigrationHttpClient.OpenConnectFail: expectsECONNREFUSED 111but getsEADDRNOTAVAIL 99(when trying to open"http://localhost:2/")run_rbd_unit_tests_*.sh--no-cache=true)/var/cache/dnf)Jenkinsfiledeclarative pipeline syntax referenceSigned-off-by: Ernesto Puerta [email protected]
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