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

Modal #197

Open
ngupta23 opened this issue Dec 16, 2024 · 0 comments
Open

Modal #197

ngupta23 opened this issue Dec 16, 2024 · 0 comments

Comments

@ngupta23
Copy link
Owner

ngupta23 commented Dec 16, 2024

Overview

API Reference

Playground

  • Try out your code snippets here.

Examples

Deployment

Secrets and Environment Variables

Webhooks (endpoints)

Commands

Setting & activating the token

  • Profile >> Settings >> {Go to right workspace} >> API Tokens >> New Token
  • Run this command to store the token on your computer.
  • Refer to the documentation about configuration for how to set credentials via environment variables instead.
# set the token
modal token set --token-id {token-id} --token-secret {token-secret} --profile={profile-name}

# This stores the token in a profile named {profile-name}. To activate, run:
modal profile activate {profile-name}

Working with containers

Once the profile has been activated, you can connect to a container in that workspace and run commands as follows.

# list the containers
modal container list

# connect to a container and open a shell
modal container exec {container-id} /bin/bash /bin/bash

NOTE: if you do not see your container in the list, you can find the container ID from modal website directly.

  1. Go to the Apps and click on the app
  2. Under "Overview" click on the "App Functions"
  3. Click "Containers"
  4. Click on one that is "Live". The ID will be displayed there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant