Skip to content

Make clingo the default solver#25502

Merged
tgamblin merged 9 commits intospack:developfrom
alalazo:features/make_clingo_default
Sep 15, 2021
Merged

Make clingo the default solver#25502
tgamblin merged 9 commits intospack:developfrom
alalazo:features/make_clingo_default

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Aug 19, 2021

Modifications:

  • Change defaults/config.yaml
  • Add a fix for bootstrapping patchelf from sources if compilers.yaml is empty
  • Make SPACK_TEST_SOLVER=clingo the default for unit-tests
  • Fix package failures in the e4s pipeline

Caveats:

  1. CentOS 6 still uses the original concretizer as it can't connect to the buildcache due to issues with ssl (bootstrapping from sources requires a C++14 capable compiler)
  2. I had to update the image tag for GitlabCI in e699f14. I did this since Radiuss is using that image and is already working with clingo, but it's not clear to me what are the differences between the two tags, so asked for @scottwittenburg review of that change. Thanks for the review @scottwittenburg
  3. libtool v2.4.2 has been deprecated and other packages received some update

@spackbot-app spackbot-app bot added defaults tests General test capability(ies) workflow gitlab Issues related to gitlab integration labels Aug 19, 2021

default:
image: { "name": "ghcr.io/scottwittenburg/ecpe4s-ubuntu18.04-runner-x86_64:2020-09-01", "entrypoint": [""] }
image: { "name": "ghcr.io/scottwittenburg/ecpe4s-ubuntu18.04-runner-x86_64:2021-05-15", "entrypoint": [""] }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you already check that the compilers this image has are the same as the 2020-09-01 tagged image? If not, pipeline jobs will end up doing a lot of duplicated bootstrapping. So in that case, we would either need to change the compiler we specify in the stacks that use the default image (at least share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml, but also maybe others), or else make a new image with the desired compilers already installed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, I didn't. For build-systems it might not matter but I think it matters for e4s. I'll stop the pipeline.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@tgamblin Would it be fine with you if in this PR I add logic to use the original concretizer for the e4s pipeline, until #25287 is ready to be merged?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Phew, that explains why it was canceled! 😅 I was worried there for a sec, when I didn't see any new push or request for spackbot to start a pipeline.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So, after a chat on slack with @eugeneswalker it seems to me that we'll be using the same compilers as before, so I'll restart the pipeline and see how many rebuilds it triggers.

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Aug 19, 2021

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Aug 19, 2021

I've started that pipeline for you!

@alalazo alalazo requested review from becker33 and tgamblin August 19, 2021 16:27
Comment on lines +421 to +428
# We may need to compile code from sources, so ensure we have compilers
# for the current platform before switching parts. We use "spack compiler
# list" as it searches for compilers lazily i.e. only if we don't have
# them already in compilers.yaml
compiler_cmd = spack.main.SpackCommand('compiler')
compiler_cmd(
'list', output=os.devnull, error=os.devnull, fail_on_error=False
)
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.

This doesn't actually ensure we have any compilers available for the current architecture -- if you have only compilers for a different OS, spack compiler list still won't find new ones.

We should explicitly call into the spack.compilers module and check whether we have any compilers for the current architecture.

Copy link
Copy Markdown
Member Author

@alalazo alalazo Aug 20, 2021

Choose a reason for hiding this comment

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

Updated the logic in 96ac691. Spack looks into compilers.yaml first and calls:

spack compiler find

only if we don't have a compiler for the current host.

@alalazo alalazo force-pushed the features/make_clingo_default branch from cf4ccb8 to 9924ab5 Compare August 23, 2021 15:33
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Aug 24, 2021

@becker33 @tgamblin Tests are passing, let me know if there are further modifications to be done here.

arch = spack.architecture.default_arch()
arch = spack.spec.ArchSpec(str(arch)) # The call below expects an ArchSpec object
if not spack.compilers.compilers_for_arch(arch):
compiler_cmd = spack.main.SpackCommand('compiler')
Copy link
Copy Markdown
Member

@haampie haampie Aug 24, 2021

Choose a reason for hiding this comment

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

are we using SpackCommand in our code directly now?

Callable object that invokes a spack command (for testing).

is in its docstring

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.

Would rather not use it in the code, but in a pinch we can. It would be better to factor this so that it does not go through SpackCommand IMO.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We use SpackCommand in two places in bootstrap.py. The fact is our cli commands are not always thin wrappers of API calls but they may have a fair amount of logic in them. I agree this should be refactored, but I'd prefer to do it in a PR focused on refactoring the API - so that it wouldn't be out of place refactoring other related calls in an internal module and the PR would be focused on a single objective.

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Aug 28, 2021

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Aug 28, 2021

I've started that pipeline for you!

@scottwittenburg
Copy link
Copy Markdown
Contributor

fyi @eugeneswalker

tldahlgren
tldahlgren previously approved these changes Sep 13, 2021
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Copy Markdown
Member

@becker33 becker33 left a comment

Choose a reason for hiding this comment

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

Are the libtool/numactl changes really a part of this PR? Is that something that currently fails in clingo?

Mostly LGTM.

git fetch origin ${{ github.ref }}:test-branch
git checkout test-branch
share/spack/qa/run-unit-tests
bin/spack unit-test -x -m "not maybeslow" -k "package_sanity"
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.

Is there a reason we're not running the shell tests anymore?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The libtool change was a quick workaround a month ago to not select libtool 2.4.2 in DAGs. The real issue has been then fixed in #25585 but since the package update also made sense in itself I kept it. I can extract that into another PR if it makes more sense.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is there a reason we're not running the shell tests anymore?

It's because of point 1. in the description (note that we are not running shell tests anymore only in the CentOS 6 tests):

CentOS 6 still uses the original concretizer as it can't connect to the buildcache due to issues with ssl (bootstrapping from sources requires a C++14 capable compiler)

I encountered issues with CentOS 6 in CI due apparently to using an old Python interpreter. Since it is my understanding (or maybe it's just a strong hope 😬 ) that the second after we release v0.17.0 we also drop Python 2.6 I worked around that issue by using the original concretizer and avoiding the:

$ spack spec mpileaks

we have in the fast shell tests. Honestly I didn't investigate further the SSL error that was reported with Python 2.6, but let me know if I should dig deeper into it.

- [x] Change defaults/config.yaml
- [x] Add a fix for bootstrapping patchelf from sources
      if compilers.yaml is empty
- [x] Make SPACK_TEST_SOLVER=clingo the default for unit-tests
We cannot download information from the binary caches:

==> [2021-08-19-09:26:29.002062] Unable to read index hash https://mirror.spack.io/bootstrap/github-actions/v0.1/build_cache/index.json.hash
  Download failed: <urlopen error [Errno 1] _ssl.c:492: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol>
  1
Remove preferences that may direct the solver
towards libtool@develop

Add a conflict to numactl
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Sep 14, 2021

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Sep 14, 2021

I've started that pipeline for you!

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Sep 14, 2021

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Sep 14, 2021

I've started that pipeline for you!

@alalazo alalazo mentioned this pull request Sep 14, 2021
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Sep 14, 2021

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Sep 14, 2021

I've started that pipeline for you!

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.

6 participants