-
Notifications
You must be signed in to change notification settings - Fork 3
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
Warning no version #55
Open
mboisson
wants to merge
2
commits into
main
Choose a base branch
from
warning-no-version
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
function intel_old_stack_warning(t) | ||
local moduleName = myModuleName() | ||
-- only go further for intel | ||
if (moduleName ~= "intel") then return end | ||
local vendor_cpu_id = os.getenv("RSNT_CPU_VENDOR_ID") or get_cpu_vendor_id() | ||
if vendor_cpu_id == "amd" then | ||
local myFileName = myFileName() | ||
if string.match(myFileName, "/cvmfs/soft.computecanada.ca/easybuild/modules/2017/Core") then | ||
local lang = os.getenv("LANG") or "en" | ||
if (string.sub(lang,1,2) == "fr") then | ||
LmodWarning([[Vous tentez de charger le module d'un compilateur intel sur un ordinateur doté de processeurs AMD. | ||
Les logiciels compilés à l'aide des compilateurs Intel dans les environnements standard StdEnv/2016.4 et StdEnv/2018.3 ne sont pas | ||
compatibles avec les processeurs AMD. Veuillez plutôt charger l'environnement StdEnv/2020 et un compilateur plus récent. | ||
]]) | ||
else | ||
LmodWarning([[You are attempting to load the intel compiler on a computer equiped with AMD processors. | ||
Software compiled with the Intel compiler in the standard environments StdEnv/2016.4 and StdEnv/2018.3 are not compatible | ||
with AMD processors. Please instead use the StdEnv/2020 standard environment and a more recent compiler. | ||
]]) | ||
end | ||
end | ||
end | ||
end | ||
function default_module_change_warning(t) | ||
local moduleName = myModuleName() | ||
|
||
-- only go further for StdEnv | ||
if (moduleName ~= "StdEnv" and moduleName ~= "python") then return end | ||
-- allow to completely disable the upcoming transition | ||
local enableStdEnv2020Transition = os.getenv("RSNT_ENABLE_STDENV2020_TRANSITION") or "unknown" | ||
if (enableStdEnv2020Transition == "unknown") then | ||
-- Niagara sets the variable locally | ||
local cccluster = os.getenv("CC_CLUSTER") or "computecanada" | ||
if (cccluster == "cedar" or cccluster == "graham" or cccluster == "beluga") then | ||
enableStdEnv2020Transition = "yes" | ||
else | ||
enableStdEnv2020Transition = "no" | ||
end | ||
end | ||
if (enableStdEnv2020Transition == "no") then return end | ||
|
||
local FrameStk = require("FrameStk") | ||
local frameStk = FrameStk:singleton() | ||
local userProvidedName = frameStk:userName() | ||
local moduleFullName = t.modFullName | ||
-- do not go further if the user provided the name with the version | ||
if (userProvidedName == moduleFullName) then return end | ||
|
||
local moduleVersion = myModuleVersion() | ||
local defaultKind | ||
if convertToCanonical(LmodVersion()) >= convertToCanonical("8.4.20") then | ||
defaultKind = t.mname:defaultKind() | ||
else | ||
defaultKind = "unknown" -- before 8.4.20, we can not detect if the default comes from the user, so we display the warning regardless | ||
end | ||
|
||
local lang = os.getenv("LANG") or "en" | ||
|
||
-- only show the warning if the user provided "StdEnv" as load, if the defaultKind is system, and if it does not result in 2020 | ||
if (userProvidedName == "StdEnv" and moduleVersion ~= "2020" and (defaultKind == "system" or defaultKind == "unknown")) then | ||
--color_banner("red") | ||
if (string.sub(lang,1,2) == "fr") then | ||
LmodWarning([[Attention, le 1er avril 2021, la version par défaut de l'environnement standard sera mise à jour. | ||
Pour tester vos tâches avec le nouvel environnement, exécutez la commande : | ||
module load StdEnv/2020 | ||
|
||
Pour changer votre version par défaut immédiatement, exécutez la commande suivante : | ||
|
||
echo "module-version StdEnv/2020 default" >> $HOME/.modulerc | ||
|
||
Pour davantage d'information, visitez : | ||
https://docs.computecanada.ca/wiki/Standard_software_environments/fr]]) | ||
else | ||
LmodWarning([[Warning, April 1st 2021, the default standard environment module will be changed to a more recent one. | ||
To test your jobs with the new environment, please run: | ||
module load StdEnv/2020 | ||
|
||
To change your default version immediately, please run the following command: | ||
|
||
echo "module-version StdEnv/2020 default" >> $HOME/.modulerc | ||
|
||
For more information, please see: | ||
https://docs.computecanada.ca/wiki/Standard_software_environments]]) | ||
end | ||
--color_banner("red") | ||
end | ||
|
||
-- only show the warning if the user provided a shortened version of python as load, if the defaultKind is system or marked, and if it does not result in 3.10.2 | ||
if (userProvidedName == "python" or userProvidedName == "python/3" or userProvidedName == "python/3.") then | ||
if (moduleVersion ~= "3.10.2" and (defaultKind == "system" or defaultKind == "unknown" or defaultKind == "marked")) then | ||
if (string.sub(lang,1,2) == "fr") then | ||
LmodWarning([[Attention, le 4 avril 2023, la version par défaut de python deviendra 3.10. | ||
Pour continuer d'utiliser la version 3.8, veuillez charger le module python/3.8 explicitement. | ||
]]) | ||
else | ||
LmodWarning([[Warning. On April 4th 2023, the default version of python will become 3.10. | ||
To keep using python 3.8, please load the python/3.8 module explicitly. | ||
]]) | ||
end | ||
end | ||
--color_banner("red") | ||
end | ||
end | ||
|
||
function incomplete_version_warning(t) | ||
local min_digits = { | ||
[ { "python", "arrow" } ] = 2, | ||
[ { "scipy-stack", "StdEnv" } ] = 1, | ||
} | ||
|
||
for modules,min_digit in pairs(min_digits) do | ||
------------------------------------------------------------ | ||
-- Look for fullName first otherwise sn | ||
if (has_value(modules,myModuleFullName()) or has_value(modules,myModuleName())) then | ||
---------------------------------------------------------- | ||
local FrameStk = require("FrameStk") | ||
local frameStk = FrameStk:singleton() | ||
local userProvidedName = frameStk:userName() | ||
local userProvidedVersion = string.match(userProvidedName, "/(.*)") or "" | ||
local num_digit = 0 | ||
if userProvidedVersion == "" then | ||
num_digit = 0 | ||
else | ||
local _, num_dot = string.gsub(userProvidedVersion, "%.", "") | ||
num_digit = num_dot+1 | ||
end | ||
if (num_digit < min_digit) then | ||
local lang = os.getenv("LANG") or "en" | ||
if (string.sub(lang,1,2) == "fr") then | ||
LmodWarning([[Attention, vous avez chargé le module ]] .. myModuleName() .. [[ en spécifiant une version incomplète: "]] .. userProvidedVersion .. [[". | ||
Nous vous recommandons fortement de spécifier au moins ]] .. min_digit .. [[ chiffres pour la version de ce module. Dans le cas contraire, une future mise à jour | ||
de ce module pourrait faire échouer vos tâches.]]) | ||
else | ||
LmodWarning([[Warning, you have loaded the module ]] .. myModuleName() .. [[ by specifying an incomplete version: "]] .. userProvidedVersion .. [[". | ||
We strongly recommend that you specify at least ]] .. min_digit .. [[ digits for the version of this module. Not doing this could crash your jobs when we install a newer version in the future.]]) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a word about reproducibility of jobs/submission scripts as it a strong argument along with job crashes.
Something like?
`... Not doing this could crash or make your jobs non-reproducible when we install a newer version in the future.