Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Jupyter notebooks integration in Testground #8

Closed

Description

@raulk

Context

The gossipsub security hardening project created a bespoke Jupyter notebooks integration that allowed users to execute test runs on cluster:k8s and analyse the outputs from within the comfort of an interactive Jupypter notebook session. It was hugely useful and successful.

We need the same for Project Oni.

Output

  • Generalise the solution, decouple it from the gossipsub project, package it so that it's project-agnostic and reusable.
  • Contribute it to testground/testground.
  • Based on conversations with Yusef, the main point to figure out is how to automatically translate the test parameters as expressed in the manifest schema into Jupyter widgets.
    • One proposal was to use a JSON schema => Jupyter Widgets library, by previously translating our super-simple manifest definitions to basic JSON schema (we really want to stay away from JSON schema in Testground).
  • Allow the user to easily process test outputs from within Jupyter Notebooks.
  • Tackle default parameters for composition groups.
  • For cluster:k8s, mount NFS into Jupyter Notebooks server so we can skip the collect outputs step.

Future

  • pandas workers.

Activity

  1. added this to the Sprint 1 milestone on Jun 15, 2020
  2. changed the title [-]Contribute Jupyter notebooks integration to Testground[/-] [+]Jupyter notebooks integration in Testground[/+] on Jun 15, 2020
  3. raulk commented on Jun 15, 2020

    @raulk
    MemberAuthor

    image

    @yusefnapora ^^ scoping by groups.

  4. yusefnapora commented on Jun 15, 2020

    @yusefnapora
    Contributor

    just dropping a link to Anton's draft infra PR: testground/infra#56

  5. yusefnapora commented on Jun 17, 2020

    @yusefnapora
    Contributor

    I've been prototyping this using the holoviz Param library, and have some basic UI generation working.

    Here's what I think we need to get working to make this functional:

    • support loading an existing composition file
    • ability to set params for each composition group, based on param definitions in manifest
    • distinguish params visually based on scope/applies-to field
    • save composition file based on UI
      • must not destructively alter unknown fields from original composition (e.g. if the UI doesn't support a field, it shouldn't remove it from the output when saving)

    Things that are nice to have but may get pushed to next week:

    • generate new composition from scratch
      • this is what I have so far in the prototype, but is less important than modifying an existing composition and will likely need rewriting
    • dynamically show/hide params based on scope

    There's also the "other half" of this story, which is collecting and processing test outputs; I'll open a new issue to track that soon.

  6. yusefnapora commented on Jun 17, 2020

    @yusefnapora
    Contributor

    Also, I've been working with a local "scrach" repo; where should this code actually live? Will it belong in the main testground repo, or should we make it a standalone tool? @raulk ?

  7. nonsense commented on Jun 18, 2020

    @nonsense
    Member

    @yusefnapora any chance we can see a demo of this today or on Friday? I think it will help if we start small with the UI, integrate it with the infrastructure, and continue from there to refine and add features.

    I can't say where the code should live, because I am not sure how much of it is testplan specific, and how much of it should be deployed alongside the infra stuff (Jupyter Hub, etc.) - I guess we can decide when we see the first iteration in action? WDYT?

  8. raulk commented on Jun 18, 2020

    @raulk
    MemberAuthor

    @yusefnapora it would be awesome if you could demo a sneak peek of this today (not excluding a demo on Friday!), as well as walking us through the codebase. Then @nonsense and I can decide where these components will be hosted.

  9. raulk commented on Jun 19, 2020

    @raulk
    MemberAuthor

    @yusefnapora as discussed yesterday, outstanding items for this sprint include:

    • Ability to create a new composition from within the tooling end-to-end, without having to put together a strawman composition file manually first.
    • Collecting outputs for analysis the naïve way (Jupyter running locally, against a remote TG daemon, downloading the outputs bundle).
    • Run Jupyter notebook reliably locally, against a local or remote TG daemon.

    Next sprint:

    • Figure out Jupyter client/server architecture so we can send computation off to a Jupyter instance running inside the TG k8s cluster so we can mount EFS directly and perform computation colocated with the data.
    • Scopes.

    Anything that I'm missing?

  10. yusefnapora commented on Jun 19, 2020

    @yusefnapora
    Contributor

    @raulk I think that basically covers it.

    I think that "run Jupyter notebook reliably locally" should include some kind of Docker magic to avoid dep hell.

    I spun my wheels a bit on that yesterday - it's more annoying than I thought, because you can't really bind mount $TESTGROUND_HOME into a container and access plan manifests that were symlink'd in with testground plan import, since the symlinks aren't traversable inside the container.

    So I may punt on that for right now and require a python virtualenv to run locally, or just force the user to manually provide the manifest file. The latter might be simpler and less "magic" anyhow, so maybe we should just do that.

  11. nonsense commented on Jun 19, 2020

    @nonsense
    Member

    I think that "run Jupyter notebook reliably locally" should include some kind of Docker magic to avoid dep hell.

    We should definitely do that - Docker is more-or-less a dependency for Testground today, so no reason to not use it and have users install manually Python and related dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions