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

Port createmodule.py to albion? #3

Open
cmarqu opened this issue Nov 11, 2016 · 2 comments
Open

Port createmodule.py to albion? #3

cmarqu opened this issue Nov 11, 2016 · 2 comments

Comments

@cmarqu
Copy link

cmarqu commented Nov 11, 2016

If you are looking for ideas to make adoption of albion easier, one would be to port the createmodule.py script from Environment Modules over. See https://lists.fedoraproject.org/pipermail/scm-commits/2012-October/893142.html

For my use case however, this alone would not help, since setting a project up here does not just involve a single script, but some interactive menu structure thing.
I thought of two invocations of createmodule.py, one before entering the project, one after, where createmodule.py would use Python's pickle to save/restore the old state to/from a file. But AFAIK, pickle is not guaranteed to be compatible between different Python versions, so maybe that's not the best option if entering a project changes the default Python version...

Having such a script would even make switching from modules to albion easy - just use createalbion.py "module load foo/1.23".

@krupan
Copy link
Owner

krupan commented Aug 1, 2017

So sorry I'm so late to respond to this. One of the big benefits of albion over Modules is that you don't have to convert your shell init files over to tcl or any other language, albion just sources your shell script directly.

Oh, I guess you are saying that if someone is already using Modules they could use a script to convert from Modules' tcl syntax back over to shell syntax...yeah, I suppose that would be useful for people that no longer have the shell script that Xilinx or whoever gave them that they had to convert to tcl, or if they actually wrote modulefiles by hand.

I don't fully understand your interactive menu workflow with two invocations of createmodule.py. Not sure if that's still a concern almost a year later. Let me know if it is.

@cmarqu
Copy link
Author

cmarqu commented Aug 7, 2017

Yes, I'm imagining case where someone is using some project setup system (Modules most often) and wants to introduce Albion gradually, project by project, needing to support both systems in parallel for some time.

My setup here is some self-written thing (not invented by myself, and not using Modules or anything like that). It interactively asks you for project name, project version, and potentially other things.
There is no way to let it run in "batch mode", and thus there is no way to run createmodule.py that doesn't require user input - it would just hang at where it expects me to input something.
So the idea was to record the environment in a fresh shell (env > before.txt), then I would enter the project interactively, and record the environment again (env > after.txt). The diff of these two files would be what is needed in a module file or albionrc.

Actually... some things are still missing then, for instance: copied/removed/modified files, declared aliases. Anything else?

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

No branches or pull requests

2 participants