-
Notifications
You must be signed in to change notification settings - Fork 62
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
Build a catalogue in CI #1632
Build a catalogue in CI #1632
Conversation
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 cannot bump the Python version due to EBrains Lab, which is stuck at 3.6. Once the Spackified version is available, and we can easily load up more recent Pythons, we can revisit this bump.
Can we verify that Python 3.6 is a hard requirement of EBRAINS? |
That's the most recent version available in the default and only image. New images (even though I doubt this would help) or new distribution methods in the current image (Spack?) are not yet available. |
Are we going to wait this out or fix the failing script to work with Python 3.6? |
We can merge as soon as the script bumps back to 3.6 and the call to |
I think @thorstenhater already had a look and proposed a solution, cf. https://mcnest.slack.com/archives/C0176SS8Z6F/p1629447749076700
But I did not test. |
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.
Look almost good, but this looks like it will not print the build progress if run with -v
?
@brenthuisman can you have another look? |
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.
Hey @schmitts thanks for updating this, but it's not completely correct yet. Could you take another look?
scripts/build-catalogue.in
Outdated
sp.run('cmake ..', shell=True, check=True, capture_output=not verbose) | ||
sp.run('make', shell=True, check=True, capture_output=not verbose) | ||
if verbose: | ||
sp.run('cmake ..', shell=True, check=True, stdout=sp.PIPE, stderr=sp.PIPE) |
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.
This pattern captures the output streams, but it does not do anything with them.
In [1]: import subprocess as sp
In [2]: sp.run('ls', shell=True, check=True, stdout=sp.PIPE, stderr=sp.PIPE)
Out[2]: CompletedProcess(args='ls', returncode=0, stdout=b'...', stderr=b'...')
In [3]: p = sp.run('ls', shell=True, check=True, stdout=sp.PIPE, stderr=sp.PIPE)
In [4]: p.stdout
Out[4]: b'...'
In [5]: print(p.stdout.decode('utf8'))
...
...
Assigning to p
and decoding/printing the pipes contents is what you actually want to do here, I think.
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.
Actually, I needed to swap the if block around: by default things are already printed. Not setting verbose
should simply hide them.
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.
ok, that seems weird to me. I'll take a look.
scripts/build-catalogue.in
Outdated
sp.run('make', shell=True, check=True, capture_output=not verbose) | ||
if verbose: | ||
sp.run('cmake ..', shell=True, check=True, stdout=sp.PIPE, stderr=sp.PIPE) | ||
sp.run('make', shell=True, check=True, stdout=sp.PIPE, stderr=sp.PIPE) |
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.
For bonus credits: add a try
block around the whole affair, as check=True
will throw.
But that can be cleaned-up later as well, the whole script could benefit from an overhaul.
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.
That's however a change from the original script, which was not the point of this fix (which was to remove a flag because it was not in Python 3.6).
Shall we have actual changes in another PR?
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.
That's completely fine, as it was just something I noticed in passing.
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.
I have proposed a fix for this in #1679. Ignore it here and I'll merge when this in.
@brenthuisman can you recheck? |
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.
Looks good, tiny clean-ups needed. Also please open an issue for making this script better.
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.
👍 don't forget that issue ;)
…D_LIBRARY_PATH. macos doesnt pass LD_LIBRARY_PATH anyway.
In the process of testing the
Since this is up to the user in case of installs to non-standard prefixes anyway, I'll let CMake install to the default prefix and count on that to work. If it doesn't, we have another problem anyway. If we want to test to a custom prefix, I need a Macos user to help me out :) |
@brenthuisman I think the standard way would be to One final note here: I think it could be useful not only to build the catalogue, but also to execute a tiny test against it, eg |
So, as per Macos post and report above, env vars seem to be shielded in the interest of security. I'm sure there's another way to do this on Macos, but I couldn't find it. |
We can do it in CI though. See the |
Right... |
No description provided.