Skip to content
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

Doc 182 share data between sessions #87

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

oojo12
Copy link
Contributor

@oojo12 oojo12 commented Feb 10, 2022

What does this PR do?

Currently, there is a lack of documentation enabling users to share data between sessions. This PR addresses that by adding instructions for doing this to the datastores section of the documentation.

@oojo12 oojo12 self-assigned this Feb 10, 2022
@linear
Copy link

linear bot commented Feb 10, 2022

DOC-182 Share Data Between Sessions

The Problem

Customer wants to be able to share data between two different sessions.

The Impact

The resolution will expand the use cases customers are able to use Grid for. Below is the community members use case.

Use Case:

  1. Session GitBook: [master] 2 pages modified #1: 8x GPU Session being used to partially train a model for before large run.
  2. Session Master #2: 4x GPU session being used to evaluate model checkpoints as the model trains (without stopping the short test training in the Session 1)

The reason not to use datastores is that both Session 1 and Session 2 share the same dataset, and only 1 datastore can be attached per session. Therefore, I cannot move between Session 1&2 without being able to hot swap datastores or have multiples

Evidence

This message comes from Paul Szerlip in the grid community channel.

Suggested Solution (optional)

Neven suggested the following solution: "…technically after grid sync ssh config to ~/.ssh/config he could use sshfs <>"

Documentation related to his proposed solution can also be added to the datastores section of the documentation.

Tracked

https://lightning-grid.freshdesk.com/a/tickets/258

Copy link
Contributor

@essiequoi essiequoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

product first pass

@@ -49,3 +49,15 @@ The equivalent CLI command:
grid session delete $INTERACTIVE_NODE_ID
```

## Share Data Between Sessions
At this time the only supported way to share data between sessions is to mount the sessions locally and copy files to the local mounts. Establishing SSH connection to your sessions is a prerequisite to this. See these [steps](https://github.com/gridai/grid-docs/blob/doc-182-share-data-between-sessions/docs/products/sessions/how-to-ssh-into-a-session.md) to set up SSH connection with your sessions. **Be sure to logout of the interactive session before attempting the next step**. After that you can do the following to create your session mounts:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oojo12 when hyperlinking to an internal link, use relative markdown path so you can update the link here to
(./how-to-ssh-into-a-session.md) otherwise the link will take them to the page in Github

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, why do you need to logout of ixsession before this step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@essiequoi making the change now

@nmiculinic because running grid session ssh logs you into the session. Attempting to perform a session mount from within the session gives you an aws public key error. See the screenshot. Thus the provided instructions are workaround for that by doing it from your local machine.
error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed @essiequoi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh....first things first

Attempting to perform a session mount from within the session gives you an aws public key error

This is not AWS public key error. It has nothing to do with AWS. It's SSH public key error, since a valid private key isn't present on the session; you'd have to use ssh-agent forwarding for this perhaps, this would require CLI changes to include agent forwarding. What do you think @rusenask ?

The second error for modprobe fuse is...interesting. Since we're running sessions within a container, can we use a fuse to mount something using it within a non-privileged container?

https://stackoverflow.com/questions/48402218/fuse-inside-docker This is interesting, albeit a bit dated (2018).

This seems to be a more recent find, 2021 https://stackoverflow.com/questions/68709395/how-to-mount-a-fuse-based-filesystem-on-docker-container-running-on-aws but it still gives a lot of permissions to the session container. CC @filintod for any thoughts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmiculinic @filintod how would you like to proceed? If it is additional content I would ask that you just commit it directly instead of placing in the comment something for me to copy + paste. It will be more efficient that way. @essiequoi says this is important for the bug bash.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding fuse; currently mounting fusefs within session will fail since fuse device isn't exposed within the container. Though there's:
https://github.com/JasonChenY/fuse-device-plugin
https://github.com/kuberenetes-learning-group/fuse-device-plugin

fuse device plugins for k8s we could investigate and potentially add; allowing users to use fusefs within the sessions (and mount other sessions within original session, to remind we're using sshfs, that is fuse filesystem when doing session mounting)


# to share data from a session to another session
cp -R <dir of interest in created session mount dir> <other session mount dir>/shared_data
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oojo12 I like how you used the concepts of Session A and Session B in your testing. It makes it clear and easy to use the commands. Could you incorporate that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda wanted to stay away from that here and use more general language. @essiequoi if you still would like the concept of Session A Session B here let me know and I will make that change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<dir of interest in created session mount dir> is unclear. you could also use the language source and target (or destination to distinguish between the two sessions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Copy link

@nmiculinic nmiculinic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments attached

@essiequoi
Copy link
Contributor

@oojo12 do you need another review? if so, re-request

@essiequoi
Copy link
Contributor

@oojo12 is this one still in progress? we'll want to merge before the docs bug bash

@oojo12 oojo12 requested a review from nmiculinic March 28, 2022 01:40
@oojo12
Copy link
Contributor Author

oojo12 commented Mar 28, 2022

@oojo12 is this one still in progress? we'll want to merge before the docs bug bash

rerequested review from Neven. I am not sure the path forward requested.

Copy link

@nmiculinic nmiculinic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll put this on hold until we support fuse fs within sessions

@rlizzo rlizzo removed their request for review May 9, 2022 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants