Skip to content

HP2706/modal-ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modal SSH

A simple Python package for SSH-ing into a Modal container.

Installation

pip install modal-ssh

Or install from source:

git clone https://github.com/yourusername/modal-ssh.git
cd modal-ssh
pip install -e .

For development, install with pytest:

pip install -e ".[dev]"

Prerequisites

  1. You need to have Modal CLI set up and authenticated
  2. You need to have SSH keys set up on your local machine

Usage

Custom Image Example

import modal
from modal import App, Image, Volume
from modal_ssh import configure_ssh_image, ssh_function_wrapper

# Create a Modal app
app = App(name="my-ssh-app")

# Create a custom image with additional dependencies
base_image = Image.debian_slim(python_version="3.10").pip_install(
    "numpy",
    "pandas",
    "scikit-learn"
)
ssh_image = configure_ssh_image(base_image=base_image)
volume = Volume.from_name("ssh-volume", create_if_missing=True)

@app.function(
    gpu="A10G",
    timeout=14400,
    image=ssh_image,
    volumes={
        "/root/entry": volume
    }
)
def ssh_function():
    ssh_function_wrapper()

License

MIT

About

Utils for ssh'ing into your modal container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages