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

R dockerized test run gradle target and CI #4625

Merged
merged 18 commits into from
Oct 16, 2023

Conversation

jcferretti
Copy link
Member

@jcferretti jcferretti commented Oct 11, 2023

Fixes #4091

@jcferretti jcferretti added this to the October 2023 milestone Oct 11, 2023
@jcferretti jcferretti self-assigned this Oct 11, 2023
@jcferretti
Copy link
Member Author

jcferretti commented Oct 11, 2023

Not ready for review yet, thus "draft".
At this point is mostly working:

  • cpp-client/build.gradle refactoring is working; separate targets for image building (that can be used from the R build) and test run work.
  • Need to add xml2 package to r-base-image for R junit test reporter to work https://github.com/deephaven/deephaven-base-images/pull/94/files
  • Need to fix dependency at the beginning of cpp-client/build.gradle that says evaluationDependsOn Docker.registryProject('cpp-client-base') to say evaluationDependsOn Docker.registryProject('r-client-base'). The later is failing and I don't understand why.

R/build.gradle Outdated Show resolved Hide resolved
@jcferretti jcferretti marked this pull request as ready for review October 13, 2023 01:18
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

I'm missing some context. What ticket is this fixing? It looks like this is just running tests, is there a reason it needs to make this release?

alexpeters1208
alexpeters1208 previously approved these changes Oct 13, 2023
R/build.gradle Outdated Show resolved Hide resolved
R/build.gradle Outdated Show resolved Hide resolved
cpp-client/build.gradle Outdated Show resolved Hide resolved
echo "$0: Environment variable DHCPP_PREFIX is not set, aborting." 1>&2
echo "$0: Environment variable DH_PREFIX is not set, aborting." 1>&2
Copy link
Member

Choose a reason for hiding this comment

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

Would DH_CPP_PREFIX not be more appropriate? DH_PREFIX is pretty generic, but since I don't really understand the full scope of this variable, feel free to say "no, I like what I did" / just resolve my comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it because we are installing there now more than just C++, eg, also R and potentially python/cython.

Copy link
Member

@devinrsmith devinrsmith left a comment

Choose a reason for hiding this comment

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

I made a bad change to R/rdeephaven/src/client.cpp to see what would happen, and gradle still reports "success".

Internally, I see:

ERROR: compilation failed for package 'rdeephaven'

I'm assuming we need something that will complete the loop when something internally goes wrong.

@@ -60,6 +60,7 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
run: |
./docker/registry/cpp-client-base/build/crane/retag.sh
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove cpp-client-base? Here, but also delete the registry directory and make sure nothing references it?

Copy link
Member Author

@jcferretti jcferretti Oct 15, 2023

Choose a reason for hiding this comment

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

r-base is based on cpp-client-base, so I don't think we can remove it from the base-images repo. Maybe we can remove (some?) of its references from the deephaven-core repo tho... although, the tagging here I am not sure what it does, maybe we should have a short chat on slack or VC.

@jcferretti
Copy link
Member Author

I fixed the problem Devin's noted (thanks!) about a failure of compilation of the C++ code inside R's install.packages not triggering a gradle task failure. Interestingly enough, if some source fails compilation (which means the whole package won't build), install.packages only gives a warning... what? Sigh.

R/build.gradle Outdated
copyFile('rdeephaven/src/Makevars', "${prefix}/src/rdeephaven/src/")
copyFile('r-tests.sh', "${prefix}/bin/rdeephaven")
copyFile('r-build.sh', "${prefix}/bin/rdeephaven")
runCommand("PREFIX=\"" + prefix + "\"; \\\n" +
Copy link
Member

Choose a reason for hiding this comment

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

is there a strong preference for substitution in this way, injecting a groovy var into a sh env var, then consuming that sh env var (but not exporting it, so nothing else is using it)?

that is, something like this to reduce the escape-spam above

        runCommand("""set -eux ; \
                     cd "${prefix}/src/rdeephaven"; \
                     . "${prefix}/env.sh"; \
                     ${prefix}/bin/rdeephaven/r-build.sh
                   """)

Copy link
Member Author

Choose a reason for hiding this comment

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

In this block is not as obvious, but if you look at the similar (longer, more env variables) block in cpp-client/build.gradle, the issue becomes apparent: Using double quotes and allowing for groovy to make string interpolation with its own (groovy's) variables makes using the regular syntax for shell environment variables in the shell code more complicated. It also makes it harder to read; while reading shell code I expect shell syntax to mean what it means in shell.

Copy link
Member Author

Choose a reason for hiding this comment

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

I simplified the syntax of that first line a bit trying to capture the spirit of your comment.

Copy link
Member

Choose a reason for hiding this comment

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

The double quotes were a deliberate change on my part, to ensure that no shell variables existed at all in this code, but that the shell was finished while still in groovy.

That said, this is just intended as an observation/idea/suggestion and not a requirement for merging.

R/build.gradle Outdated Show resolved Hide resolved
@jcferretti
Copy link
Member Author

I'm missing some context. What ticket is this fixing? It looks like this is just running tests, is there a reason it needs to make this release?

Discussed with Mike over slack. He said he is ok deferring to Devin and/or Ryan on the .github/workflows part of the change.

Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

I defer to Devin/Ryan for changes to the deephaven-core workflows.

@jcferretti jcferretti dismissed mofojed’s stale review October 16, 2023 16:49

Mike is deferring to Devin as per his message in slack and comment above.

Copy link
Contributor

@alexpeters1208 alexpeters1208 left a comment

Choose a reason for hiding this comment

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

I only looked at the R files. LGTM.

Copy link
Member

@devinrsmith devinrsmith left a comment

Choose a reason for hiding this comment

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

Verified the points I care about - gradle now properly fails when error in R :)

Copy link
Member

@JamesXNelson JamesXNelson left a comment

Choose a reason for hiding this comment

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

Gradle wiring looks good to me

@@ -59,7 +59,7 @@ jobs:
- name: Tag upstream images
if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
run: |
./docker/registry/cpp-client-base/build/crane/retag.sh
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to remove the cpp?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I Devin request I remove earlier in this same review. The C++ build is now using the r-client-base image (which we plan to rename cpp-clients-fat-base on the py ticking coming PR).

@jcferretti jcferretti merged commit 39c5951 into deephaven:main Oct 16, 2023
9 checks passed
@jcferretti jcferretti deleted the cfs-r-ci branch October 16, 2023 17:44
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Continuous Integration for the R Client
7 participants