-
Notifications
You must be signed in to change notification settings - Fork 3
Phani/GitHub deploy docs #80
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
Changes from all commits
d0def05
946865c
d9ed45f
fa5a277
b1207f2
0e7259f
36db6ef
ad4c9a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,38 +9,74 @@ Once you deploy an app on Kernel, you can schedule its actions on a job or run t | |
|
|
||
| ## Deploy the app | ||
|
|
||
| ### From local directory | ||
|
|
||
| Use our CLI from the root directory of your project: | ||
| ```bash | ||
| # entrypoint_file_name should be where you've defined your Kernel app | ||
| kernel deploy <entrypoint_file_name> | ||
| ``` | ||
|
|
||
| #### Notes | ||
|
|
||
| - The `entrypoint_file_name` is the file name where you [defined](/apps/develop) your app. | ||
| - Include a `.gitignore` file to exclude dependency folders like `node_modules` and `.venv`. | ||
|
|
||
| ### From GitHub | ||
|
|
||
| You can deploy an app directly from a public or private GitHub repository using the Kernel CLI — no need to clone or manually push code. | ||
|
|
||
| ```bash | ||
| kernel deploy github \ | ||
| --url https://github.com/<owner>/<repo> \ | ||
| --ref <branch|tag|commit> \ | ||
| --entrypoint <path/to/entrypoint> \ | ||
| [--path <optional/subdir>] \ | ||
| [--github-token <token>] \ | ||
| [--env KEY=value ...] \ | ||
| [--env-file .env] \ | ||
| [--version latest] \ | ||
| [--force] | ||
| ``` | ||
|
|
||
| #### Notes | ||
| - **`--path` vs `--entrypoint`:** Use `--path` to specify a subdirectory within the repo (useful for monorepos), and `--entrypoint` for the path to your app's entry file relative to that directory (or repo root if no `--path` is specified). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this apply to local directory deployment too? If so, I would suggest moving it to the Deployment Notes section that is more general.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The local directory deployment only uses entrypoint_file_name. It is specific to the github approach only. |
||
| - The CLI automatically downloads and extracts the GitHub source code and uploads your app for deployment. | ||
| - For private repositories, provide a `--github-token` or set the `GITHUB_TOKEN` environment variable. | ||
|
|
||
| ## Environment variables | ||
|
|
||
| You can set environment variables for your app using the `--env` flag. For example: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also show an example using I find this is an easier pattern to replicate and one I use most consistently. I know this isn't exactly related to the branch, but thought I would just ask to have it included.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added! Now showing both --env inline and --env-file .env examples in the CodeGroup. |
||
|
|
||
| <CodeGroup> | ||
| ```bash Typescript/Javascript | ||
| ```bash Typescript/Javascript (inline) | ||
| kernel deploy my_app.ts --env MY_ENV_VAR=my_value # Can add multiple env vars delimited by space | ||
| ``` | ||
|
|
||
| ```bash Python | ||
| ```bash Typescript/Javascript (from file) | ||
| kernel deploy my_app.ts --env-file .env | ||
| ``` | ||
|
|
||
| ```bash Python (inline) | ||
| kernel deploy my_app.py --env MY_ENV_VAR=my_value # Can add multiple env vars delimited by space | ||
| ``` | ||
|
|
||
| ```bash Python (from file) | ||
| kernel deploy my_app.py --env-file .env | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
| ## Deployment notes | ||
|
|
||
| - The `entrypoint_file_name` is the file name where you [defined](/apps/develop) your app. | ||
| - **The entrypoint file and dependency manifest (`package.json` for JS/TS, `pyproject.toml` for Python) must both be in the root directory of your project.** | ||
| - Include a `.gitignore` file to exclude dependency folders like `node_modules` and `.venv`. | ||
| - **The dependency manifest (`package.json` for JS/TS, `pyproject.toml` for Python) must be present in the root directory of your project.** | ||
| - View deployment logs using: `kernel deploy logs <deployment_id> --follow` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a bullet here that says something like "If you see
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's a nice to have! Something like this should be good:-
lmk what you think? |
||
| - If you encounter a 500 error during deployment, verify that your entrypoint file name and extension are correct (e.g., `app.py` not `app` or `app.js`). | ||
| - Kernel assumes the root directory contains at least this file structure: | ||
jarugupj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <CodeGroup> | ||
| ```bash Typescript/Javascript | ||
| project-root/ | ||
| ├─ .gitignore # Exclude dependency folders like node_modules | ||
| ├─ my_app.ts # Entrypoint file | ||
| ├─ my_app.ts # Entrypoint file (can be located in a subdirectory, e.g. src/my_app.ts) | ||
| ├─ package.json | ||
| ├─ tsconfig.json # If using TypeScript | ||
| └─ bun.lock | package-lock.json | pnpm-lock.yaml # One of these lockfiles | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.