diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 871b1857d3f1e1fcd2133e376b7a05d16d9a6b8c..59f93fe35d7f0628b62cf4d2e3050080f71e6ee8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.7" + python: "3.9" # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/autosubmit/autosubmit.py b/autosubmit/autosubmit.py index b51dd91bfea63a00f918b65467043893758115cc..24ee9a83a362a7b5b15e7dc30ef056d99b054ace 100644 --- a/autosubmit/autosubmit.py +++ b/autosubmit/autosubmit.py @@ -389,7 +389,8 @@ class Autosubmit: # Describe subparser = subparsers.add_parser( 'describe', description="Show details for specified experiment") - subparser.add_argument('expid', help='experiment identifier') + subparser.add_argument('expid', help='experiment identifier, can be a list of expid separated by comma or spaces', default="*", nargs="?") + subparser.add_argument('-u','--user', help='username, default is current user or listed expid', default=""), subparser.add_argument('-v', '--update_version', action='store_true', default=False, help='Update experiment version') @@ -656,7 +657,7 @@ class Autosubmit: return Autosubmit.report(args.expid, args.template, args.show_all_parameters, args.folder_path, args.placeholders) elif args.command == 'describe': - return Autosubmit.describe(args.expid) + return Autosubmit.describe(args.expid,args.user) elif args.command == 'migrate': return Autosubmit.migrate(args.expid, args.offer, args.pickup, args.onlyremote) elif args.command == 'create': @@ -731,7 +732,7 @@ class Autosubmit: - expid_less = ["expid", "testcase", "install", "-v", + expid_less = ["expid", "describe", "testcase", "install", "-v", "readme", "changelog", "configure", "unarchive"] global_log_command = ["delete", "archive", "upgrade"] if "offer" in args: @@ -3430,61 +3431,88 @@ class Autosubmit: 7040, str(e)) @staticmethod - def describe(experiment_id): + def describe(input_experiment_list="*",get_from_user=""): """ Show details for specified experiment - :param experiment_id: experiment identifier: - :type experiment_id: str + :param experiments_id: experiments identifier: + :type experiments_id: str + :param get_from_user: user to get the experiments from + :type get_from_user: str + :return: str,str,str,str """ - try: - Log.info("Describing {0}", experiment_id) - exp_path = os.path.join(BasicConfig.LOCAL_ROOT_DIR, experiment_id) - - as_conf = AutosubmitConfig( - experiment_id, BasicConfig, YAMLParserFactory()) - as_conf.check_conf_files(False) - - user = os.stat(as_conf.experiment_file).st_uid + experiments_ids = input_experiment_list + not_described_experiments = [] + if get_from_user == "*" or get_from_user == "": + get_from_user = pwd.getpwuid(os.getuid())[0] + user ="" + created="" + model="" + branch="" + hpc="" + if ',' in experiments_ids: + experiments_ids = experiments_ids.split(',') + elif '*' in experiments_ids: + experiments_ids = [] + basic_conf = BasicConfig() + for f in Path(basic_conf.LOCAL_ROOT_DIR).glob("????"): + if f.is_dir() and f.owner() == get_from_user: + experiments_ids.append(f.name) + else: + experiments_ids = experiments_ids.split(' ') + for experiment_id in experiments_ids: try: - user = pwd.getpwuid(user).pw_name - except Exception as e: - Log.warning( - "The user does not exist anymore in the system, using id instead") + experiment_id = experiment_id.strip(" ") + exp_path = os.path.join(BasicConfig.LOCAL_ROOT_DIR, experiment_id) - created = datetime.datetime.fromtimestamp( - os.path.getmtime(as_conf.experiment_file)) + as_conf = AutosubmitConfig( + experiment_id, BasicConfig, YAMLParserFactory()) + as_conf.check_conf_files(False,no_log=True) + user = os.stat(as_conf.experiment_file).st_uid + try: + user = pwd.getpwuid(user).pw_name + except Exception as e: + Log.warning( + "The user does not exist anymore in the system, using id instead") - project_type = as_conf.get_project_type() - if as_conf.get_svn_project_url(): - model = as_conf.get_svn_project_url() - branch = as_conf.get_svn_project_url() - else: - model = as_conf.get_git_project_origin() - branch = as_conf.get_git_project_branch() - if model == "": - model = "Not Found" - if branch == "": - branch = "Not Found" + created = datetime.datetime.fromtimestamp( + os.path.getmtime(as_conf.experiment_file)) - submitter = Autosubmit._get_submitter(as_conf) - submitter.load_platforms(as_conf) - if len(submitter.platforms) == 0: - return False - hpc = as_conf.get_platform() - description = get_experiment_descrip(experiment_id) - - Log.result("Owner: {0}", user) - Log.result("Created: {0}", created) - Log.result("Model: {0}", model) - Log.result("Branch: {0}", branch) - Log.result("HPC: {0}", hpc) - Log.result("Description: {0}", description[0][0]) - except BaseException as e: - raise AutosubmitCritical( - "Couldn't get the details of this experiment. Contact with Autosubmit Developers through GitHub", 7001, - str(e)) - return user, created, model, branch, hpc + project_type = as_conf.get_project_type() + if as_conf.get_svn_project_url(): + model = as_conf.get_svn_project_url() + branch = as_conf.get_svn_project_url() + else: + model = as_conf.get_git_project_origin() + branch = as_conf.get_git_project_branch() + if model == "": + model = "Not Found" + if branch == "": + branch = "Not Found" + + submitter = Autosubmit._get_submitter(as_conf) + submitter.load_platforms(as_conf) + if len(submitter.platforms) == 0: + return False + hpc = as_conf.get_platform() + description = get_experiment_descrip(experiment_id) + Log.info("Describing {0}", experiment_id) + + Log.result("Owner: {0}", user) + Log.result("Created: {0}", created) + Log.result("Model: {0}", model) + Log.result("Branch: {0}", branch) + Log.result("HPC: {0}", hpc) + Log.result("Description: {0}", description[0][0]) + except BaseException as e: + not_described_experiments.append(experiment_id) + if len(not_described_experiments) > 0: + Log.printlog("Could not describe the following experiments:\n{0}".format(not_described_experiments),Log.WARNING) + if len(experiments_ids) == 1: + # for backward compatibility or GUI + return user, created, model, branch, hpc + elif len(experiments_ids) == 0: + Log.result("No experiments found for expid={0} and user {1}".format(input_experiment_list,get_from_user)) @staticmethod def configure(advanced, database_path, database_filename, local_root_path, platforms_conf_path, jobs_conf_path, diff --git a/docs/source/conf.py b/docs/source/conf.py index 4e55fad9b6a4e2a19220a5ce6446fd3ad2794b6e..beb4ccc4851d567863f65e8103e83621f9543f71 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -56,7 +56,7 @@ master_doc = 'index' # General information about the project. project = 'autosubmit' # noinspection PyShadowingBuiltins -copyright = u'2022, Barcelona Supercomputing Center, BSC' +copyright = u'2023, Barcelona Supercomputing Center, BSC' author = u'Earth Science Department, Barcelona Supercomputing Center, BSC' # The version info for the project you're documenting, acts as replacement for diff --git a/docs/source/index.rst b/docs/source/index.rst index 3118257ec673d38c7b624ceda96786aa229d6c6d..0271d721b0de0730ebce33aa1c5731a76335a23a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -35,13 +35,13 @@ Welcome to autosubmit's documentation! /userguide/create/index /userguide/configure/index - /userguide/defining workflows/index + /userguide/defining_workflows/index /userguide/wrappers/index /userguide/run/index - /userguide/modifying workflows/index + /userguide/modifying_workflows/index /userguide/manage/index - /userguide/monitor and check/index - /userguide/set and share the configuration/index + /userguide/monitor_and_check/index + /userguide/set_and_share_the_configuration/index .. toctree:: :caption: Database Documentation diff --git a/docs/source/userguide/defining workflows/index.rst b/docs/source/userguide/defining_workflows/index.rst similarity index 100% rename from docs/source/userguide/defining workflows/index.rst rename to docs/source/userguide/defining_workflows/index.rst diff --git a/docs/source/userguide/index.rst b/docs/source/userguide/index.rst index 68f5172cf71414788ff4997ce69dfae49de09998..bd1165b3afe70bb0bccc3d8818f218b9c53ac06c 100644 --- a/docs/source/userguide/index.rst +++ b/docs/source/userguide/index.rst @@ -7,8 +7,8 @@ Usage /userguide/configure/index /userguide/run/index /userguide/manage/index - /userguide/monitor and check/index - /userguide/set and share the configuration/index + /userguide/monitor_and_check/index + /userguide/set_and_share_the_configuration/index Command list ============ @@ -16,7 +16,7 @@ Command list -expid Create a new experiment -create Create specified experiment workflow -check Check configuration for specified experiment --describe Show details for specified experiment +-describe Show details for specified experiments -run Run specified experiment -inspect Generate cmd files -test Test experiment diff --git a/docs/source/userguide/modifying workflow/index.rst b/docs/source/userguide/modifying_workflow/index.rst similarity index 100% rename from docs/source/userguide/modifying workflow/index.rst rename to docs/source/userguide/modifying_workflow/index.rst diff --git a/docs/source/userguide/monitor and check/fig/group_automatic.png b/docs/source/userguide/monitor_and_check/fig/group_automatic.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_automatic.png rename to docs/source/userguide/monitor_and_check/fig/group_automatic.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_chunk_expand.png b/docs/source/userguide/monitor_and_check/fig/group_by_chunk_expand.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_chunk_expand.png rename to docs/source/userguide/monitor_and_check/fig/group_by_chunk_expand.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_chunk_expand_status.png b/docs/source/userguide/monitor_and_check/fig/group_by_chunk_expand_status.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_chunk_expand_status.png rename to docs/source/userguide/monitor_and_check/fig/group_by_chunk_expand_status.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_chunk_status.png b/docs/source/userguide/monitor_and_check/fig/group_by_chunk_status.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_chunk_status.png rename to docs/source/userguide/monitor_and_check/fig/group_by_chunk_status.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_date_expand.png b/docs/source/userguide/monitor_and_check/fig/group_by_date_expand.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_date_expand.png rename to docs/source/userguide/monitor_and_check/fig/group_by_date_expand.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_date_status.png b/docs/source/userguide/monitor_and_check/fig/group_by_date_status.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_date_status.png rename to docs/source/userguide/monitor_and_check/fig/group_by_date_status.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_date_status_expand.png b/docs/source/userguide/monitor_and_check/fig/group_by_date_status_expand.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_date_status_expand.png rename to docs/source/userguide/monitor_and_check/fig/group_by_date_status_expand.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_member_expand.png b/docs/source/userguide/monitor_and_check/fig/group_by_member_expand.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_member_expand.png rename to docs/source/userguide/monitor_and_check/fig/group_by_member_expand.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_member_expand_status.png b/docs/source/userguide/monitor_and_check/fig/group_by_member_expand_status.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_member_expand_status.png rename to docs/source/userguide/monitor_and_check/fig/group_by_member_expand_status.png diff --git a/docs/source/userguide/monitor and check/fig/group_by_member_status.png b/docs/source/userguide/monitor_and_check/fig/group_by_member_status.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_by_member_status.png rename to docs/source/userguide/monitor_and_check/fig/group_by_member_status.png diff --git a/docs/source/userguide/monitor and check/fig/group_date.png b/docs/source/userguide/monitor_and_check/fig/group_date.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_date.png rename to docs/source/userguide/monitor_and_check/fig/group_date.png diff --git a/docs/source/userguide/monitor and check/fig/group_member.png b/docs/source/userguide/monitor_and_check/fig/group_member.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_member.png rename to docs/source/userguide/monitor_and_check/fig/group_member.png diff --git a/docs/source/userguide/monitor and check/fig/group_synchronize.png b/docs/source/userguide/monitor_and_check/fig/group_synchronize.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/group_synchronize.png rename to docs/source/userguide/monitor_and_check/fig/group_synchronize.png diff --git a/docs/source/userguide/monitor and check/fig/pre_grouping_workflow.png b/docs/source/userguide/monitor_and_check/fig/pre_grouping_workflow.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/pre_grouping_workflow.png rename to docs/source/userguide/monitor_and_check/fig/pre_grouping_workflow.png diff --git a/docs/source/userguide/monitor and check/fig/split_group.png b/docs/source/userguide/monitor_and_check/fig/split_group.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/split_group.png rename to docs/source/userguide/monitor_and_check/fig/split_group.png diff --git a/docs/source/userguide/monitor and check/fig/split_workflow.png b/docs/source/userguide/monitor_and_check/fig/split_workflow.png similarity index 100% rename from docs/source/userguide/monitor and check/fig/split_workflow.png rename to docs/source/userguide/monitor_and_check/fig/split_workflow.png diff --git a/docs/source/userguide/monitor and check/index.rst b/docs/source/userguide/monitor_and_check/index.rst similarity index 97% rename from docs/source/userguide/monitor and check/index.rst rename to docs/source/userguide/monitor_and_check/index.rst index 06a0dae7dffc0f0666dc1481348199b6ae867509..07fe7965ad12cfeb01c9be7f1b72b21b8dbed008 100644 --- a/docs/source/userguide/monitor and check/index.rst +++ b/docs/source/userguide/monitor_and_check/index.rst @@ -436,9 +436,12 @@ How to get details about the experiment To get details about the experiment, use the command: :: - autosubmit describe EXPID + autosubmit describe {EXPID} {-u USERNAME} -*EXPID* is the experiment identifier. + + +*EXPID* is the experiment identifier, can be a list of expid separated by comma or spaces +*-u USERNAME* is the username of the user who submitted the experiment. It displays information about the experiment. Currently it describes owner,description_date,model,branch and hpc @@ -448,12 +451,18 @@ Options: usage: autosubmit describe [-h ] expid expid experiment identifier + -u USERNAME, --user USERNAME username of the user who submitted the experiment -h, --help show this help message and exit -Example: +Examples: :: +.. code-block:: bash + autosubmit describe cxxx + autosubmit describe "cxxx cyyy" + autosubmit describe cxxx,cyyy + autosubmit describe -u dbeltran How to monitor job statistics ----------------------------- diff --git a/docs/source/userguide/run/fig/monarch-da.png b/docs/source/userguide/run/fig/monarch-da.png new file mode 100644 index 0000000000000000000000000000000000000000..ff740791be2d106faa0957f33753fb43a9759771 Binary files /dev/null and b/docs/source/userguide/run/fig/monarch-da.png differ diff --git a/docs/source/userguide/set and share the configuration/fig/advanced_conf.jpg b/docs/source/userguide/set_and_share_the_configuration/fig/advanced_conf.jpg similarity index 100% rename from docs/source/userguide/set and share the configuration/fig/advanced_conf.jpg rename to docs/source/userguide/set_and_share_the_configuration/fig/advanced_conf.jpg diff --git a/docs/source/userguide/set and share the configuration/index.rst b/docs/source/userguide/set_and_share_the_configuration/index.rst similarity index 99% rename from docs/source/userguide/set and share the configuration/index.rst rename to docs/source/userguide/set_and_share_the_configuration/index.rst index 394740a04ffd2ac36fb2a77aba1545f8cb8a6c4e..db16d5a3a5cf2d17ca5ce05850adafb30cf446cd 100644 --- a/docs/source/userguide/set and share the configuration/index.rst +++ b/docs/source/userguide/set_and_share_the_configuration/index.rst @@ -245,7 +245,7 @@ Model configuration is distributed at `git. =2.9.2 +PyNaCl>=1.5.0 configobj>=5.0.6 argparse>=1.4.0 python-dateutil>=2.8.2 @@ -5,7 +8,6 @@ matplotlib==3.4.3 numpy<1.22 py3dotplus>=1.1.0 pyparsing>=3.0.7 -paramiko>=2.9.2 mock>=4.0.3 six>=1.10 portalocker>=2.3.2 @@ -21,11 +23,9 @@ pythondialog pytest nose coverage -PyNaCl==1.4.0 six>=1.10.0 requests xlib Pygments packaging==19 typing>=3.7 -autosubmitconfigparser==0.0.75 diff --git a/setup.py b/setup.py index 47ddd81a2d2ea38d38cbf91a4346da433c61adc2..1323388289eb939426f9391300ab68f1b5a4a6a3 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ setup( url='http://www.bsc.es/projects/earthscience/autosubmit/', download_url='https://earth.bsc.es/wiki/doku.php?id=tools:autosubmit', keywords=['climate', 'weather', 'workflow', 'HPC'], - install_requires=['packaging>19','six>=1.10.0','configobj>=5.0.6','argparse>=1.4.0','python-dateutil>=2.8.2','matplotlib==3.4.3','numpy<1.22','py3dotplus>=1.1.0','pyparsing>=3.0.7','paramiko>=2.9.2','mock>=4.0.3','portalocker>=2.3.2','networkx==2.6.3','requests>=2.27.1','bscearth.utils>=0.5.2','cryptography>=36.0.1','setuptools>=60.8.2','xlib>=0.21','pip>=22.0.3','ruamel.yaml','pythondialog','pytest','nose','coverage','PyNaCl==1.4.0','Pygments','autosubmitconfigparser==0.0.75'], + install_requires=['autosubmitconfigparser==0.0.77','packaging>19','six>=1.10.0','configobj>=5.0.6','argparse>=1.4.0','python-dateutil>=2.8.2','matplotlib>=3.4.3','numpy<1.22','py3dotplus>=1.1.0','pyparsing>=3.0.7','paramiko>=2.9.2','mock>=4.0.3','portalocker>=2.3.2','networkx==2.6.3','requests>=2.27.1','bscearth.utils>=0.5.2','cryptography>=36.0.1','setuptools>=60.8.2','xlib>=0.21','pip>=22.0.3','ruamel.yaml','pythondialog','pytest','nose','coverage','PyNaCl>=1.4.0','Pygments'], classifiers=[ "Programming Language :: Python :: 3.7", "License :: OSI Approved :: GNU General Public License (GPL)",