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

Load hulpke/extraperfect as lazy artifact #2432

Merged
merged 8 commits into from
Jun 20, 2023

Conversation

lgoettgens
Copy link
Member

@lgoettgens lgoettgens commented May 29, 2023

Resolves #1245.

Hook into GAP's PerfGrpLoad to create a symlink to a lazy artifact instead of throwing the error shown in #1245.
lazy = true for an artifact needs LazyArtifacts to be imported, and only downloads the artifact the first time the artifact string (the artifact"gap_hulpke_extraperfect") is encountered.

I used a fixed commit of hulpke/extraperfect instead of master to avoid hash mismatches once there is a new commit on hulpke/extraperfect#master. This means that the used version of hulpke/extraperfect has to be actively updated in Artifacts.toml.

@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #2432 (95f2ef9) into master (04c90ae) will decrease coverage by 0.03%.
The diff coverage is 81.25%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2432      +/-   ##
==========================================
- Coverage   73.15%   73.12%   -0.03%     
==========================================
  Files         400      401       +1     
  Lines       53607    53623      +16     
==========================================
- Hits        39215    39213       -2     
- Misses      14392    14410      +18     
Impacted Files Coverage Δ
src/Oscar.jl 34.54% <ø> (ø)
src/Groups/libraries/perfectgroups.jl 72.22% <57.14%> (-3.64%) ⬇️
src/GAP/utils.jl 100.00% <100.00%> (ø)
src/Groups/libraries/libraries.jl 96.00% <100.00%> (+0.08%) ⬆️

... and 4 files with indirect coverage changes

@lgoettgens lgoettgens force-pushed the lg/perfgrp branch 2 times, most recently from c80e3a2 to 338c5c0 Compare May 31, 2023 12:50
@lgoettgens lgoettgens closed this May 31, 2023
@lgoettgens lgoettgens reopened this May 31, 2023
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Great, this is looking pretty nice now! I have one minor concern about the test which includes network access (CC @ThomasBreuer @thofma @benlorenz )

@@ -108,6 +108,9 @@ end
@test number_perfect_groups(ZZRingElem(60)^3) == 1
@test_throws ArgumentError number_perfect_groups(0) # invalid argument
@test_throws ArgumentError number_perfect_groups(ZZRingElem(60)^10) # result not known

# lazy artifact loading
@test perfect_group(1376256, 1) isa PermGroup
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, that adds (another?) network access to the test suite, as such the tests may fail if one is offline. And of course it increases disk usage for the testing machine (which is fine for me locally, it's CI jobs I am very slightly worried about).

Dunno if this is a problem with e.g. NanoSoldier.

Anyway, one way to try to deal with this might be to modify this to catch whatever exception is thrown when a download fails, and just accept that?

Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to introduce a global offline flag for the tests, meaning that if the flag is set to true then all those tests that (may) require network access are not executed?

Then we would get an overview of those situations that are expected to require network access, and we can exclude such tests from the CI runs.

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 could imagine 3 ways how to handle this

  1. Add some global bool is_offline to the tests and replace the test by is_offline || @test ...
  2. Add a macro @test_if_online that decides based on either a global bool or some heuristic (e.g. test network access by pinging something) if the test gets executed or not.
  3. Add a macro @test_online that tries to run the tests and catches whatever exceptions may occur while using the network, and does not fail in the case of such an exception.

Names are of course open to discussion. What would be your preferred way?

Copy link
Member

Choose a reason for hiding this comment

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

I am open to all. Let's ask @thofma @fieker @benlorenz if they have thoughts on this, too?

Copy link
Collaborator

@thofma thofma Jun 12, 2023

Choose a reason for hiding this comment

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

I lean towards 3. (with a @warning or @info when the exceptions occur), but have no strong opinion.

Although things will get messy once people start writing (and testing) functions, which might require indirectly network access. It is not obvious to a caller which function might have this problem.

Copy link
Member

Choose a reason for hiding this comment

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

Whatever way this is implemented, I would prefer not to run this by default for users testing this (even with a network check, I might be using a limited mobile hotspot since my office doesn't have WiFi...). For github actions CI we may run this but I think this should not fail the CI for a pull request.

But this leads to the question when would this really run and how would it be noticed if it fails? Another separate job which will only run the network dependent jobs and is allowed to fail?

There is the possibility to set a warning in github actions, this would add a small icon to the job: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message

I think the NanoSoldier environment does allow network access, but again I would prefer if it does not fail due to network issues.

Copy link
Member

Choose a reason for hiding this comment

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

In order to not let this patch bit-rot, I suggest we comment this test out for now, file an issue to remind us about the possibility for optional online tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

See #2480.

@@ -108,6 +108,9 @@ end
@test number_perfect_groups(ZZRingElem(60)^3) == 1
@test_throws ArgumentError number_perfect_groups(0) # invalid argument
@test_throws ArgumentError number_perfect_groups(ZZRingElem(60)^10) # result not known

# lazy artifact loading
@test perfect_group(1376256, 1) isa PermGroup
Copy link
Member

Choose a reason for hiding this comment

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

Whatever way this is implemented, I would prefer not to run this by default for users testing this (even with a network check, I might be using a limited mobile hotspot since my office doesn't have WiFi...). For github actions CI we may run this but I think this should not fail the CI for a pull request.

But this leads to the question when would this really run and how would it be noticed if it fails? Another separate job which will only run the network dependent jobs and is allowed to fail?

There is the possibility to set a warning in github actions, this would add a small icon to the job: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message

I think the NanoSoldier environment does allow network access, but again I would prefer if it does not fail due to network issues.

src/GAP/utils.jl Outdated Show resolved Hide resolved
Artifacts.toml Outdated Show resolved Hide resolved
@lgoettgens
Copy link
Member Author

I updated the artifact location, included the generation script as a comment in the Artifacts.toml, and commented out the test in favor of #2480.

@benlorenz
Copy link
Member

nightly failure is: oscar-system/GAP.jl#901 / #2476
doctest-nightly failure is: Nemocas/Nemo.jl#1497

@fingolfin fingolfin merged commit 436a22f into oscar-system:master Jun 20, 2023
@lgoettgens lgoettgens deleted the lg/perfgrp branch June 20, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

perfect groups: add additional data as lazy artifacts
5 participants