Giter Club home page Giter Club logo

aiidalab's Introduction

Documentation Status codecov

AiiDAlab package

The aiidalab package sets up the python environment found on the AiiDAlab.

Installation

Install latest version from pypi:

pip install aiidalab

or from the conda-forge conda channel:

conda install -c conda-forge aiidalab

Documentation

The documentation can be found on the following web page.

For maintainers

To create a new release, clone the repository, install development dependencies with pip install -e '.[dev]', and then execute bumpver update. This will:

  1. Create a tagged release with bumped version and push it to the repository.
  2. Trigger a GitHub actions workflow that creates a GitHub release.

Additional notes:

  • Use the --dry option to preview the release change.
  • The release tag (e.g. a/b/rc) is determined from the last release. Use the --tag option to switch the release tag.

License

MIT

Citation

Users of AiiDAlab are kindly asked to cite the following publication in their own work:

A. V. Yakutovich et al., Comp. Mat. Sci. 188, 110165 (2021). DOI:10.1016/j.commatsci.2020.110165

Contact

[email protected]

Acknowledgements

This work is supported by the MARVEL National Centre for Competency in Research funded by the Swiss National Science Foundation, as well as by the MaX European Centre of Excellence funded by the Horizon 2020 EINFRA-5 program, Grant No. 676598.

MARVEL MaX

aiidalab's People

Contributors

adegomme avatar casperwa avatar chrisjsewell avatar crivella avatar csadorf avatar danielhollas avatar dependabot[bot] avatar dou-du avatar ltalirz avatar mahhheshh avatar pre-commit-ci[bot] avatar superstar54 avatar trellixvulnteam avatar unkcpz avatar yakutovicha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aiidalab's Issues

AiiDAlab Applications: Intro

Some short introduction about what is an AiiDAlab app.

AiiDAlab application is...

It consists of...

It is tightly bound with git...

etc.

when server with apps_meta.json is unavailable, home page doesn't start

I got an error:

---------------------------------------------------------------------------
ConnectionRefusedError                    Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
    159             conn = connection.create_connection(
--> 160                 (self._dns_host, self.port), self.timeout, **extra_kw
    161             )

/opt/conda/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     83     if err is not None:
---> 84         raise err
     85 

/opt/conda/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
     73                 sock.bind(source_address)
---> 74             sock.connect(sa)
     75             return sock

ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

NewConnectionError                        Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    676                 headers=headers,
--> 677                 chunked=chunked,
    678             )

/opt/conda/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    380         try:
--> 381             self._validate_conn(conn)
    382         except (SocketTimeout, BaseSSLError) as e:

/opt/conda/lib/python3.7/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
    975         if not getattr(conn, "sock", None):  # AppEngine might not have  `.sock`
--> 976             conn.connect()
    977 

/opt/conda/lib/python3.7/site-packages/urllib3/connection.py in connect(self)
    307         # Add certificate verification
--> 308         conn = self._new_conn()
    309         hostname = self.host

/opt/conda/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
    171             raise NewConnectionError(
--> 172                 self, "Failed to establish a new connection: %s" % e
    173             )

NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fe6d9686190>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

MaxRetryError                             Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    448                     retries=self.max_retries,
--> 449                     timeout=timeout
    450                 )

/opt/conda/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    724             retries = retries.increment(
--> 725                 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
    726             )

/opt/conda/lib/python3.7/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    438         if new_retry.is_exhausted():
--> 439             raise MaxRetryError(_pool, url, error or ResponseError(cause))
    440 

MaxRetryError: HTTPSConnectionPool(host='aiidalab.materialscloud.org', port=443): Max retries exceeded with url: /appsdata/apps_meta.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe6d9686190>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

ConnectionError                           Traceback (most recent call last)
<ipython-input-2-0fca0ee7d45a> in <module>
     35 else:
     36     from aiidalab.home import AiidaLabHome
---> 37     home = AiidaLabHome()
     38     if 'move_up' in parsed_url:
     39         home.move_updown(parsed_url['move_up'][0], -1)

/opt/conda/lib/python3.7/site-packages/aiidalab/home.py in __init__(self)
     60         self.config_fn = ".launcher.json"
     61         self.output = ipw.Output()
---> 62         self.app_registry = load_app_registry()['apps']
     63         self._app_widgets = dict()
     64 

/opt/conda/lib/python3.7/site-packages/aiidalab/utils.py in load_app_registry()
     47     else:
     48         try:
---> 49             return requests.get(AIIDALAB_REGISTRY).json()
     50         except ValueError:
     51             print("Registry server is unavailable! Can't check for the updates")

/opt/conda/lib/python3.7/site-packages/requests/api.py in get(url, params, **kwargs)
     74 
     75     kwargs.setdefault('allow_redirects', True)
---> 76     return request('get', url, params=params, **kwargs)
     77 
     78 

/opt/conda/lib/python3.7/site-packages/requests/api.py in request(method, url, **kwargs)
     59     # cases, and look like a memory leak in others.
     60     with sessions.Session() as session:
---> 61         return session.request(method=method, url=url, **kwargs)
     62 
     63 

/opt/conda/lib/python3.7/site-packages/requests_cache/core.py in request(self, method, url, params, data, **kwargs)
    134             _normalize_parameters(params),
    135             _normalize_parameters(data),
--> 136             **kwargs
    137         )
    138         if self._is_cache_disabled:

/opt/conda/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    528         }
    529         send_kwargs.update(settings)
--> 530         resp = self.send(prep, **send_kwargs)
    531 
    532         return resp

/opt/conda/lib/python3.7/site-packages/requests_cache/core.py in send(self, request, **kwargs)
    107 
    108         if response is None:
--> 109             return send_request_and_cache_response()
    110 
    111         if self._cache_expire_after is not None:

/opt/conda/lib/python3.7/site-packages/requests_cache/core.py in send_request_and_cache_response()
     95 
     96         def send_request_and_cache_response():
---> 97             response = super(CachedSession, self).send(request, **kwargs)
     98             if response.status_code in self._cache_allowable_codes:
     99                 self.cache.save_response(cache_key, response)

/opt/conda/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
    641 
    642         # Send the request
--> 643         r = adapter.send(request, **kwargs)
    644 
    645         # Total elapsed time of the request (approximately)

/opt/conda/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    514                 raise SSLError(e, request=request)
    515 
--> 516             raise ConnectionError(e, request=request)
    517 
    518         except ClosedPoolError as e:

ConnectionError: HTTPSConnectionPool(host='aiidalab.materialscloud.org', port=443): Max retries exceeded with url: /appsdata/apps_meta.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe6d9686190>: Failed to establish a new connection: [Errno 111] Connection refused'))

one-line description of AiiDAlab

The AiiDAlab is currently described in the docs as

AiiDAlab is an environment for users with diverse expertise to access and run computational workflows embedded in AiiDAlab apps.

I propose to try and make this sentence as bit more concrete ("users with diverse expertise" isn't clear to me; and "AiiDAlab apps" is self-referencing).

The paper describes it as

AiiDAlab is a web platform that enables computational scientists to package scientific workflows and computational environments and share them with their collaborators and peers.

I like this already a lot better. I think it captures the purpose of the AiiDAlab quite precisely, and I propose we use it in the docs as well.

To me, jupyter is a core part of the AiiDAlab infrastructure, so if it was up to me I would probably mention it in the sentence but I recall that @csadorf may disagree

Watchdog: inotify watch limit reached

From time to time I am getting the following error on AiiDA lab:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/aiidalab/home.py in render(self)
    107                 # Create app widget if it has not been created yet.
    108                 if name not in self._app_widgets:
--> 109                     self._app_widgets[name] = self._create_app_widget(name)
    110 
    111                 display(self._app_widgets[name])

/opt/conda/lib/python3.7/site-packages/aiidalab/home.py in _create_app_widget(self, name)
     67         config = self.read_config()
     68         app_data = self.app_registry.get(name, None)
---> 69         app = AiidaLabApp(name, app_data, AIIDALAB_APPS)
     70 
     71         if name == 'home':

/opt/conda/lib/python3.7/site-packages/aiidalab/app.py in __init__(self, name, app_data, aiidalab_apps_path)
    123         self.path = os.path.join(aiidalab_apps_path, self.name)
    124         self.refresh_async()
--> 125         self._watch_repository()
    126 
    127     @traitlets.default('modified')

/opt/conda/lib/python3.7/site-packages/aiidalab/app.py in _watch_repository(self)
    154             self._observer = Observer()
    155             self._observer.schedule(event_handler, self.path, recursive=True)
--> 156             self._observer.start()
    157 
    158         if self._check_install_status_changed_thread is None:

/opt/conda/lib/python3.7/site-packages/watchdog/observers/api.py in start(self)
    251         for emitter in self._emitters.copy():
    252             try:
--> 253                 emitter.start()
    254             except Exception:
    255                 self._remove_emitter(emitter)

/opt/conda/lib/python3.7/site-packages/watchdog/utils/__init__.py in start(self)
    108 
    109     def start(self):
--> 110         self.on_thread_start()
    111         threading.Thread.start(self)
    112 

/opt/conda/lib/python3.7/site-packages/watchdog/observers/inotify.py in on_thread_start(self)
    119     def on_thread_start(self):
    120         path = unicode_paths.encode(self.watch.path)
--> 121         self._inotify = InotifyBuffer(path, self.watch.is_recursive)
    122 
    123     def on_thread_stop(self):

/opt/conda/lib/python3.7/site-packages/watchdog/observers/inotify_buffer.py in __init__(self, path, recursive)
     33         BaseThread.__init__(self)
     34         self._queue = DelayedQueue(self.delay)
---> 35         self._inotify = Inotify(path, recursive)
     36         self.start()
     37 

/opt/conda/lib/python3.7/site-packages/watchdog/observers/inotify_c.py in __init__(self, path, recursive, event_mask)
    198         self._event_mask = event_mask
    199         self._is_recursive = recursive
--> 200         self._add_dir_watch(path, recursive, event_mask)
    201         self._moved_from_events = dict()
    202 

/opt/conda/lib/python3.7/site-packages/watchdog/observers/inotify_c.py in _add_dir_watch(self, path, recursive, mask)
    386         if not os.path.isdir(path):
    387             raise OSError(errno.ENOTDIR, os.strerror(errno.ENOTDIR), path)
--> 388         self._add_watch(path, mask)
    389         if recursive:
    390             for root, dirnames, _ in os.walk(path):

/opt/conda/lib/python3.7/site-packages/watchdog/observers/inotify_c.py in _add_watch(self, path, mask)
    407         wd = inotify_add_watch(self._inotify_fd, path, mask)
    408         if wd == -1:
--> 409             Inotify._raise_error()
    410         self._wd_for_path[path] = wd
    411         self._path_for_wd[wd] = path

/opt/conda/lib/python3.7/site-packages/watchdog/observers/inotify_c.py in _raise_error()
    419         err = ctypes.get_errno()
    420         if err == errno.ENOSPC:
--> 421             raise OSError(errno.ENOSPC, "inotify watch limit reached")
    422         elif err == errno.EMFILE:
    423             raise OSError(errno.EMFILE, "inotify instance limit reached")

OSError: [Errno 28] inotify watch limit reached

@csadorf any ideas?

Add readthedocs

The readthedocs for this repository should be the main documentation for AiiDA lab.

Update python requirements for ipython

ipython==7.18.1; python_version >= '3.3'

This Python requirement should be changed to "3.7", since this is the minimum requirement for this version of ´ipython` (see also here).

I found this issue when trying to install the latest version of aiidalab in a Python 3.6 environment, which now doesn't work, because the latest ipython version here is 7.16.1 (not 7.18.1 as required above).

Furthermore, it would be good to write the minimum required Python version for aiidalab in the README clearly as well as in setup() in setup.py.

AiiDAlab apps: My first app

An extremely simplistic example of how an app may be set up after having created an app with either the cookiecutter or the manual way.

The "scaffolding" for this is/has been added in #161.

ReadTheDocs CI not triggering

In #162 I turned on https://docs.readthedocs.io/en/latest/pull-requests.html (see https://readthedocs.org/dashboard/aiidalab/advanced/), but it does not seem to be triggering in e.g. #166
This should trigger like, for example, in aiidateam/plumpy#216:

image

I'm not admin on this package, so I can't have a look at the webhook settings, to see if there are any issues there (see https://docs.readthedocs.io/en/stable/pull-requests.html#troubleshooting)

Note I had an issue with the PR CI in quantum-mobile (readthedocs/readthedocs.org#7381), but I don't think this is the same, and I've used it fine in many other packages

cc @yakutovicha @csadorf

App managing interface.

  • Add a possibility to install an app via the URL. tracked in #213

  • Add a checkbox in GUI to install prereleases.

  • Add a button to reset the changes.

pip automatically installs into `/.local` directory

Observed behavior

Installing a Python package with pip install <package> installs the package into the site.USER_SITE path as if the --user argument was provided.

Expected behavior

Installing a Python package with pip install <package> should install the package into the environment prefixed path.

Additional notes

This might not actually a bug, but at least to me presents unexpected behavior with potential negative consequences. This should be further investigated.

Are we approaching dependency hell?

While doing aiidalab maintenance I discovered a very frustrating thing that potentially can lead to a considerable amount of problems in the future.

In our dependency stack we have aiida-vasp plugin. Aiida-vasp, in turn, depends on pymatgen that failed to build.

The frustrating thing is: I am not developer/maintainer of any of those packages, but I have to "manually" fix the dependency.

As the number of plugins will grow, the problem will get more and more pronounced.

Another frustrating thing is that aiidalab-metapkg tests could not catch the problem. The problem appeared during the build of aiidalab Docker file. I assume that pip does not have a fixed order of how to install dependencies of dependencies:

  • In the first case the aiidalab-metapkg test could pass because another package depends on a specific version of pymatgen that was built before aiida-vasp dependencies.
  • In the second case aiida-vasp dependencies were built earlier. Aiida-vasp plugin does not specify the exact version of pymatgen, so the latest was taken and this caused the build to fail.

For the moment I can't propose any solution, I should think a bit more on how to approach that.

@giovannipizzi, @ltalirz, @CasperWA any ideas/thoughts? Maybe it was already solved somewhere else? :)

`AppBase`: force app deletion

For the moment the AppBase class does not allow to delete an app if it has any modifications. Sometimes it creates problems, since the Jupyter can change the notebook's version. Therefore, one should allow for force-deletion of apps (maybe also showing the changes).

pytest installation is broken

As of 20.10.0b0 the installation of pytest is broken. Trying to execute pytest (even without any arguments) leads to the following traceback:

$ pytest -v
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 689, in import_plugin
    __import__(importspec)
ModuleNotFoundError: No module named 'pytest_tornasync'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/aiida/.local/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 180, in console_main
    code = main()
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 136, in main
    config = _prepareconfig(args, plugins)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 314, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/opt/conda/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/opt/conda/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/opt/conda/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/opt/conda/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/helpconfig.py", line 99, in pytest_cmdline_parse
    config = outcome.get_result()  # type: Config
  File "/opt/conda/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/opt/conda/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 932, in pytest_cmdline_parse
    self.parse(args)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1204, in parse
    self._preparse(args, addopts=addopts)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1097, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/opt/conda/lib/python3.7/site-packages/pluggy/manager.py", line 300, in load_setuptools_entrypoints
    self.register(plugin, name=ep.name)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 431, in register
    self.consider_module(plugin)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 656, in consider_module
    self._import_plugin_specs(getattr(mod, "pytest_plugins", []))
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 663, in _import_plugin_specs
    self.import_plugin(import_spec)
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 693, in import_plugin
    ).with_traceback(e.__traceback__) from e
  File "/opt/conda/lib/python3.7/site-packages/_pytest/config/__init__.py", line 689, in import_plugin
    __import__(importspec)
ImportError: Error importing plugin "pytest_tornasync": No module named 'pytest_tornasync'

Develop AiiDAlab: Docker Stack

Everything one needs to know about the AiiDAlab docker container: based on AiiDA-core, can be run on Kubernetes cluster and locally, etc.

Enable the deprecation warnings in Jupyter notebooks.

Showing the deprecation warnings by default was disabled with the release of Python 2.7 and 3.2. See the changelog for the motivation of this change and here for a discussion of this topic.

However, in aiidalab with the appmode enabled the warnings are not visible anyways. So it makes total sense to enable them when working with the source code of the notebooks (appmode disabled).

To see the beginning of the discussion, go here: aiidalab/aiidalab-optimade#11

aiida plugins compatible with aiida-core 1.0.0b

This is a list of plugins that are compatible with aiida-core 1.0.0b2 (or lated) and can therefore be included in the develop branch of the AiiDA lab:

  • aiida-bands-inspect: new release v0.2.0b1
  • aiida-castep: new release v1.0.0b1
  • aiida-cp2k: new release v1.0.0b4
  • aiida-codtools: new release v2.0.0b1
  • aiida-crystal17: new release v0.9.0b5
  • aiida-ddec: new release v1.0.0a1
  • aiida-diff: new release v1.0.0a1
  • aiida-fleur: new release v1.0.0a
  • aiida-lammps: new release v0.4.1b3
  • aiida-optimize: new release 0.2.0
  • aiida-quantumespresso: new release v3.0.0a5
  • aiida-qeq: new release v1.0.0a1
  • aiida-raspa: new release v1.0.0a1
  • aiida-siesta: progress in branch workflow-migration
  • aiida-tbmodels: new release 0.2.0
  • aiida-vasp: in progress in branch migrate_beta
  • aiida-yambo: in progress in branch dev_aiida1.x
  • aiida-zeopp: new release v1.0.0a2

@sphuber @yakutovicha @greschd @broeder-j @AntimoMarrazzo @zhubonan @abelcarreras @DanielMarchand @chrisjsewell @espenfl @vdikan @borellim
Please let me know by replying to this issue once you have plugin releases (or commits) that can be added here.
I will be updating this list as we proceed.

Home App design

The aim of the issue is to bring together the design decisions and open questions related to the aiidalab-home app. Once they are discussed and agreed - they will go into the this wiki page to be the main reference point.

Key components of the home app

  • Home page
  • App Store
  • Linux terminal
  • File manager
  • Task manager
  • App home page (better name for this?)
  • AppBase class

Tight binding with Git

  • Any app is a Git repository
  • App versions are Git tags (lightweight or annotated)
  • Check for updates by comparing remote and local git branches
  • Uses dulwich package to get the Git functionality (motivation is provided in aiidalab/aiidalab-home#11)

AppBase class

  • Install/uninstall/update apps
  • Looks for the available app updates
  • Gets app-related meta information.
  • Does not allow to delete an app if Git has detected modifications.
  • Future plans:
    • Install app dependencies (#12)
    • Check for newer tagged versions (#21)
    • Allow to "force delete" the apps (#22)

App home page

  • Contains basic information about an app: authors, description, logo, external URL, repository/Git URL, and Git information.
  • Allows to select a particular version of an app (selection among Git tags and Git branches)
  • Allows to install/uninstall/update app
  • Future plans:
    • Redirect to this page if the link references an app that is not installed (#17)

App Store

  • Install/uninstall/update apps
  • Show minimal info about an App (logo, authors, short description)
  • Allows to show filter only installed apps
  • Allows to filter apps by categories
  • Allows to show a given number apps per page
  • Future plans:
    • Consider to replace install/uninstall/update buttons with "Manage" button that lead to the App home page. This will make the App Store more lightweight. (#20)
    • Select app by typing its name (#19)
    • Show the latest app version

Home page

  • Shows installed apps
  • Allows to modify the apps order
  • Future plans:
    • Allow to change the current AiiDA profile (#23)

Dependencies

  • apps_meta.json that is generated on the AiiDA lab server. It contains basic information about an app, app-related metadata, Git information.
  • aiidalab-registry is used for the generation of apps_meta.json. It contains two main files:
    • apps.json that has all the available apps and basic info:
      • git_url [mandatory]- link to the git repository
      • meta_url [mandatory] - link to the metadata.json file inside each repository
      • categories [optional] - list of categories this app belongs to.
    • categories.json file that lists all the possible app categories (with title and description)
  • App-specific metadata.json file, that has can contain the following fields:
    • title
    • description
    • version - I think this one should be removed. The version is already provided as a Git tag
    • authors
    • logo
    • state - can be registered, development, stable
    • documentation_url
    • external_url

App update is not working.

I realised that apps update on the AiiDalab is broken.

I just released a new version of the aiidalab-empa-nanoribbons app (1.1.2). The update was successfully detected by the app:

Screenshot 2021-01-14 at 17 02 33

When I clicked on the update button I got the following error:

---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in findvalue(array, value, compare)
    136     try:
--> 137         return next(x for x in array if compare(x, value))
    138     except StopIteration:

StopIteration: 

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in _validate_value(self, proposal)
    240         try:
--> 241             return findvalue(self._options_values, value, self.equals) if value is not None else None
    242         except ValueError:

/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in findvalue(array, value, compare)
    138     except StopIteration:
--> 139         raise ValueError('%r not in array'%value)
    140 

ValueError: 'git:refs/tags/v1.1.2' not in array

During handling of the above exception, another exception occurred:

TraitError                                Traceback (most recent call last)
/opt/aiidalab-home/home/app_manager.py in _update_app(self, _)
    279             self._show_msg_failure(str(error))
    280         else:
--> 281             self.version_selector.version_to_install.value = version
    282             self._show_msg_success("Updated app.")
    283 

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in __set__(self, obj, value)
    602             raise TraitError('The "%s" trait is read-only.' % self.name)
    603         else:
--> 604             self.set(obj, value)
    605 
    606     def _validate(self, obj, value):

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in set(self, obj, value)
    576 
    577     def set(self, obj, value):
--> 578         new_value = self._validate(obj, value)
    579         try:
    580             old_value = obj._trait_values[self.name]

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in _validate(self, obj, value)
    610             value = self.validate(obj, value)
    611         if obj._cross_validation_lock is False:
--> 612             value = self._cross_validate(obj, value)
    613         return value
    614 

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in _cross_validate(self, obj, value)
    616         if self.name in obj._trait_validators:
    617             proposal = Bunch({'trait': self, 'value': value, 'owner': obj})
--> 618             value = obj._trait_validators[self.name](obj, proposal)
    619         elif hasattr(obj, '_%s_validate' % self.name):
    620             meth_name = '_%s_validate' % self.name

/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in __call__(self, *args, **kwargs)
    973         """Pass `*args` and `**kwargs` to the handler's function if it exists."""
    974         if hasattr(self, 'func'):
--> 975             return self.func(*args, **kwargs)
    976         else:
    977             return self._init_call(*args, **kwargs)

/opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in _validate_value(self, proposal)
    241             return findvalue(self._options_values, value, self.equals) if value is not None else None
    242         except ValueError:
--> 243             raise TraitError('Invalid selection: value not found')
    244 
    245     @observe('value')

TraitError: Invalid selection: value not found

@csadorf can you please have a look?

P.S. The update did happen, though. When I reload the page I see the updated version of the app:

Screenshot 2021-01-14 at 17 07 12

Add more 'global' variables to `config.py`

For example, we can add AIIDALAB_DEFAULT_GIT_BRANCH to specify which default branch should be used when installing an app. Also, it might be useful to have AIIDALAB_DEFAULT_APPS to provide a list of apps to be installed by default.

Execute setup.py if present

To allow installing dependencies we should run:

python -m pip install -I -e .

if setup.py is present in the app's folder.

Presence of both: app title and app name is a bit confusing.

Currently, we have app name and app title concepts.

App name is one word that is used to name the folder where the app is installed. Also, under this name the app is registered in the aiidalab registry.

The title is a human-readable title that is only used to provide information for the users.

After some considerations, I would advocate for removing the "title" and making it a part of the description.

docs top-level organisation

This is just recording a first impression of the docs page:

Starting with "deployment" felt a bit strange to me - I would have expected "how to use" first.
On reading through the docs I think I understood the thought process behind the layout a bit better (this follows the standard pattern for a python package: install, how to use, how to develop)... however, many users of the AiiDA lab will actually never install it - they just log in.

For a python package, you typically have roughly two different types of users

  • some users are going to install and use the package
  • some users are going to want to develop the package

Both of these user types have in common that they are likely familiar with python and bash.

For the AiiDAlab, the situation is quite a bit more diverse:

  1. some users are going to log into an existing instance and use the AIiDAlab (may not know any python or bash)
  2. some users are going to want to develop apps
  3. some users may want to run a docker container locally
  4. administrators will want to deploy a multi-user instance
  5. some admins/users will want to develop the AiiDAlab itself

It seems to me that in writing the docs we need to pay particular attention to ensure that the user group 1. is guided well and knows where to look for information.

I'll continue thinking a bit about this, input welcome.

Extend metadata.json with commit/branch/tag field

It would be extremely useful for my OPTIMADE Client app to be able to direct the AiiDA lab app store to install a specific commit/branch/tag as the default, instead of my repository's default branch on GitHub.

I would imagine this to be a very useful feature for other applications as well, e.g., in order to more easily have the distinction of keeping GitHub for developers/developing and AiiDA lab for stable releases.
As it is now, AiiDA lab will install the application using the default branch and then one can change this after the fact, which is not always ideal.
This means that if one want an AiiDA lab app to always work by default, one MUST set keep the default branch on GitHub a stable release branch, which is not desired for development, where one would like the automation of closing issues, i.e., having a develop branch be the default (since this is how GitHub works).

Support installation from PEP 508 compliant URL

Extend the aiidalab installation API to support the installation of AiiDAlab apps directly for a PEP 508 compliant URL, e.g.

aiidalab install git+https://github.com/aiidalab/[email protected]
aiidalab install https://github.com/aiidalab/aiidalab-hello-world/archive/refs/heads/master.zip
aiidalab install /path/to/aiidalab-hello-world

etc.

This is related to #201 .

add python3 build

@yakutovicha

just to mention what the develop-py3 branch was about:

When you run pipenv on python3, you will get different dependencies (e.g. lots of the dependencies you get for python2.7 are backports of python3 functionality).

When I created the develop-py3 branch, the Pipfile approach was broken, so I updated the requirements.txt by hand. If I understand correctly, it is working again now, correct?

If yes, then perhaps it would make sense to create a requirements3.txt which is the result of the same command run under python3.

We would then need to release a wheel for py2 and one for py3...
not so urgent perhaps, since it seems that travis currently checks installing under python 3.7 and it seems to work fine
https://github.com/aiidalab/aiidalab-https://github.com/aiidalab/aiidalab-metapkg/blob/e7bd3c3b7085145c4b62347c43f4d7cf9b8590c6/.travis.yml#L2-L3

The 'check-manifest' pre-commit hook is very slow

Running this pre-commit hook sometimes takes more than two minutes (see log below) – significantly slowing down my development workflow – and its benefit is not entirely clear to me. @chrisjsewell Since you originally introduced this hook, could you briefly comment what we use it for in this project and whether we could maybe limit it to run when only certain files are changed, such as setup.cfg?

% pre-commit run -v check-manifest
check-manifest...........................................................Passed
- hook id: check-manifest
- duration: 129.4s

lists of files in version control and sdist match

Use local metadata file to better support non-registered apps

thanks to Dave Wecker for raising this

If you use the cookie cutter to create an app, meta data (like title, author…) won’t show up correctly in the home page because it assumes that it’s in the app registry (and thus fails). It would be good for it to fall back to the local app instance where all the information already exists (since we aren’t going to be using the registry (at least for now)).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.