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

Jupyter notebooks integration in Testground #8

Closed
raulk opened this issue Jun 15, 2020 · 9 comments · Fixed by #43
Closed

Jupyter notebooks integration in Testground #8

raulk opened this issue Jun 15, 2020 · 9 comments · Fixed by #43
Assignees
Labels
kind/feature Kind: Feature workstream/e2e-tests Workstream: End-to-end Tests
Milestone

Comments

@raulk
Copy link
Member

raulk commented Jun 15, 2020

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.
@raulk raulk added the kind/feature Kind: Feature label Jun 15, 2020
@raulk raulk added this to the Sprint 1 milestone Jun 15, 2020
@raulk raulk changed the title Contribute Jupyter notebooks integration to Testground Jupyter notebooks integration in Testground Jun 15, 2020
@raulk
Copy link
Member Author

raulk commented Jun 15, 2020

image

@yusefnapora ^^ scoping by groups.

@yusefnapora
Copy link
Contributor

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

@yusefnapora
Copy link
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.

@yusefnapora
Copy link
Contributor

yusefnapora commented Jun 17, 2020

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 ?

@nonsense
Copy link
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?

@raulk
Copy link
Member Author

raulk commented Jun 18, 2020

@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.

@raulk
Copy link
Member Author

raulk commented Jun 19, 2020

@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?

@yusefnapora
Copy link
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.

@nonsense
Copy link
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.

@raulk raulk added the workstream/e2e-tests Workstream: End-to-end Tests label Jul 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Kind: Feature workstream/e2e-tests Workstream: End-to-end Tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants