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

WIP: Introduce spack-fairsoft extension #311

Closed
wants to merge 6 commits into from

Conversation

dennisklein
Copy link
Member

@dennisklein dennisklein commented Sep 1, 2020

An attempt to improve usability:

$ spack fairsoft -h
usage: spack fairsoft [-h] SUBCOMMAND ...

manage FairSoft distros

positional arguments:
  SUBCOMMAND
    avail     show available FairSoft distros
    info      show info on a FairSoft distro
    install   install a FairSoft distro
    list      list installed FairSoft distros
    setup     setup spack for FairSoft
    view      manage symlink spack views on a FairSoft distro

optional arguments:
  -h, --help  show this help message and exit

ideas:

  • spack fairsoft avail - list available distros
$ spack fairsoft avail
==> 5 distros
    dev.sim
    dev.sim_mt
    dev.sim_mt_headless
    jun19.sim
    jun19.sim_mt
  • spack fairsoft install <distro> - creates/installs a named environment and tracks the git revision to know when to recreate the environment
  • spack fairsoft list - basically a filtered spack env list, maybe with an additional column where the view is
$ spack fairsoft list
==> 3 distros
    dev.sim       [121/132 installed packages]  linux-fedora32-skylake  [email protected]
    jun19.sim     [130 installed packages]      linux-fedora32-skylake  [email protected]
    jun19.sim_mt  [127/130 installed packages]  linux-fedora32-skylake  [email protected]
  • spack fairsoft view [--no-fairroot] [--prefix <prefix>] <distro> - mainly wrapper around spack view which hides details and platform-specific handling from user
  • spack fairsoft setup [--check-only] - move some of the thisfairsoft.sh --setup business to the python domain
$ spack fairsoft setup
==> Found no new compilers
==> Compilers are defined in the following files:
    /home/dklein/projects/FairSoft2/spack/etc/spack/compilers.yaml
==> Removing all temporary build stages
==> Removing cached information on repositories
==> Report problems at https://github.com/FairRootGroup/FairSoft/issues/new
$ spack fairsoft setup -h
usage: spack fairsoft setup [-h] [--skip-clean] [--skip-compiler] [--skip-git]
                            [--skip-repos] [--config-dir CONFIG_DIR]

setup spack for FairSoft

optional arguments:
  -h, --help            show this help message and exit
  --skip-clean          do not run `spack clean -ms`
  --skip-compiler       do not run `spack compiler find --scope site`
  --skip-git            do not run `git submodule update --init`
  --skip-repos          do not configure repos
  --config-dir CONFIG_DIR
                        symlink provided config dir

Tasks performed:
1. `git submodule update --init`
2. `spack compiler find --scope site`
3. Manage fairsoft site config dir
4. Check/Update repo config
5. `spack clean -ms`

Do not run in parallel to another running spack command!
  • spack fairsoft info <distro> - print some infos on a distro (we could add a env/<release>/<variant>/info.py for stuff we cannot compute)
$ spack fairsoft info dev.sim
Distro:   dev.sim

Description:
    FairRoot v18.4.0 + full simulation dependencies (single-threaded
    Geant4)

Release: dev

Variant: sim

Packages: TODO

Prerequisites installed: TODO

Installed: TODO

  • spack fairsoft doctor [--report] - does a number of sanity checks and reports problems, --report option can be used to generate some output to be posted with github bug reports to conveniently describe the user system/setup.
  • spack fairsoft check_prereqs <distro>

@ChristianTackeGSI I would be interested in an early comment if this goes in a direction you would like to see too.


Example:

git clone https://github.com/FairRootGroup/FairSoft && cd FairSoft
. ./thisfairsoft.sh --setup
spack fairsoft install jun19.sim
spack fairsoft view jun19.sim /some/dir

Copy link
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Yes, I like the idea!
Creating extensions felt way more complex from the docs…

Details maybe need a bit of discussion. Although I don't have any concrete points.

thisfairsoft.sh Outdated Show resolved Hide resolved
extensions/spack-fairsoft/fairsoft/cmd/fairsoft.py Outdated Show resolved Hide resolved
extensions/spack-fairsoft/fairsoft/cmd/fairsoft.py Outdated Show resolved Hide resolved
@dennisklein
Copy link
Member Author

Details maybe need a bit of discussion. Although I don't have any concrete points.

Ill go ahead and implement a bit more, so we get some more meat to discuss. Thx for the comments so far.

Copy link
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Haven't tried it. Looks good!

Return True if an update was performed.
"""
actual = config.get('repos', scope=scope) or []
if not actual == expected:
Copy link
Member

Choose a reason for hiding this comment

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

Haven't tried it. But what happens, if user adds some private repos to the site config?

  • Iff we don't support that, then we should put an error about that
  • Iff we do, we should probably iteratte over "expected" and check, that it is already in the current config.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, just the first iteration - for now, user can opt-out with --skip-repos.

If we have good ideas, we should definitely make this smarter. What makes this non-trivial is that the config sections do not override repo lists but chain. And order is important here!

@ChristianTackeGSI
Copy link
Member

One note:
The spack in VAE might be too old for some of this. (Especially, the config add is probably missing). So take a little care when touching thisvae.sh.

Or we "freeze" thisvae.sh now?

@dennisklein
Copy link
Member Author

One note:
The spack in VAE might be too old for some of this. (Especially, the config add is probably missing). So take a little care when touching thisvae.sh.

Or we "freeze" thisvae.sh now?

For now I do not plan to change it in this PR. IMHO, we should discuss and come up with a strategy for VAE spack packaging first.

@dennisklein dennisklein linked an issue Sep 11, 2020 that may be closed by this pull request
@dennisklein dennisklein added this to the sep20 milestone Sep 16, 2020
Copy link
Member

@ChristianTackeGSI ChristianTackeGSI left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I haven't tried the setup stuff. But if it works in the CI, then we're already good to go.

We can improve after that.

actual = RepoPath(*(config.get('repos') or []))

res = False
if not actual == expected:
Copy link
Member

Choose a reason for hiding this comment

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

This comparison tooling needs improvements.

Main use case: Panda adding their own repos (say in the user scope).

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed. For now there is the opt-out flag --skip-repos until we have something smarter.

extensions/spack-fairsoft/fairsoft/__init__.py Outdated Show resolved Hide resolved
extensions/spack-fairsoft/fairsoft/__init__.py Outdated Show resolved Hide resolved
@dennisklein dennisklein changed the title Introduce spack-fairsoft extension WIP: Introduce spack-fairsoft extension Sep 25, 2020
@dennisklein dennisklein force-pushed the fairsoft_ext branch 2 times, most recently from f454f93 to 0f8b147 Compare September 29, 2020 13:40
@dennisklein
Copy link
Member Author

Closing, we will re-visit in Q2/21.

@dennisklein dennisklein closed this Nov 1, 2020
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.

Docs section "IV.1. Spack view"
2 participants