Skip to content

add option to not copy the license file for Gurobi#2639

Merged
wpoely86 merged 4 commits intoeasybuilders:developfrom
smoors:20211215173702_new_pr_gurobi
Dec 16, 2021
Merged

add option to not copy the license file for Gurobi#2639
wpoely86 merged 4 commits intoeasybuilders:developfrom
smoors:20211215173702_new_pr_gurobi

Conversation

@smoors
Copy link
Copy Markdown
Contributor

@smoors smoors commented Dec 15, 2021

(created using eb --new-pr)

rationale: with multiple Gurobi installations using the same license file, defined by GRB_LICENSE_FILE, only one file needs to be updated.

@smoors smoors changed the title add option to create a symlink instead of copying the license file for Gurobi add option to not copy the license file for Gurobi Dec 15, 2021
@smoors
Copy link
Copy Markdown
Contributor Author

smoors commented Dec 15, 2021

Test report by @smoors

Overview of tested easyconfigs (in order)

  • SUCCESS Gurobi-9.1.2-GCCcore-10.2.0.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
node378.hydra.os - Linux centos linux 7.9.2009, x86_64, Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz (skylake_avx512), Python 2.7.5
See https://gist.github.com/3e7f7e768c844f0c9038f61a96c703ce for a full test report.

@boegel boegel added this to the next release (4.5.2?) milestone Dec 15, 2021
"""Easyblock constructor, define custom class variables specific to Gurobi."""
super(EB_Gurobi, self).__init__(*args, **kwargs)

self.license_file = 'UNKNOWN'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not None? You run a check for is None below?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it doesn't matter what the value is here, because it is always reassigned to self.cfg['license_file'].
it's not strictly necessary to initialize it here, but github tests complain if I don't.
I just used 'UNKNOWN' because that's what the other easyblocks do.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, it does matter: if --module-only is used, we'll now end up with UNKNOWN in the module file, because install_step is never run.

You can actually use self.cfg['license_file'] already here, because the easyconfig file is already parsed when the easyblock is initialized (the parsed easyconfig is an input for the easyblock initialization):

self.license_file = self.cfg['license_file']

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@boegel
ah good point, I'll fix it.
then the pgi.py easyblock has the same problem?

Comment thread easybuild/easyblocks/g/gurobi.py Outdated
@smoors
Copy link
Copy Markdown
Contributor Author

smoors commented Dec 16, 2021

Test report by @smoors

Overview of tested easyconfigs (in order)

  • SUCCESS Gurobi-9.1.2-GCCcore-10.2.0.eb
  • SUCCESS Gurobi-9.1.2-GCCcore-10.2.0.eb.orig

Build succeeded for 2 out of 2 (2 easyconfigs in total)
node301.hydra.os - Linux centos linux 7.9.2009, x86_64, Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz (skylake_avx512), Python 2.7.5
See https://gist.github.com/a302f8c1dcb8b21abc6da49f62b3a0d0 for a full test report.

@wpoely86 wpoely86 merged commit a2afb62 into easybuilders:develop Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants