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

docs: add containercraft guide #477

Merged
merged 8 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions docs/configuration/lifecycle-identity.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
---
sidebar_position: 6
title: Lifecycle Identity
---

# Lifecycle Identity

The Lifecycle Identity feature in Runme is a tool that assigns unique identifiers and versions to individual cells, the entire file, or both, depending on your [configuration](https://docs.runme.dev/configuration/).
Expand Down Expand Up @@ -49,17 +44,3 @@ As shown in the image above, there are three levels of tracking available:
- [Cell level](https://docs.runme.dev/configuration/cell-level): This tracks changes within individual cells in a document.
- [Document level](https://docs.runme.dev/configuration/document-level): This monitors the entire document for any modifications or version changes.
- All: This tracks changes made to both [Cell level](https://docs.runme.dev/configuration/cell-level) and [document](https://docs.runme.dev/configuration/document-level) levels.

## Cell Run Grouping

Cell Run Grouping is an important tool in Runme that works together with the Lifecycle Identity feature. It improves the organization and tracking of code runs, especially when working with Markdown files or individual cells within these files. This functionality works when outputs are saved to the [Runme Cloud](https://app.runme.dev/), as it allows for a more structured and insightful analysis of the code's performance over time.

### How Cell Run Grouping Works

When a user saves the output of a cell or an entire Markdown file to the Runme Cloud, Runme assigns a unique identity to that file or cell. This identity is important for the cell run grouping process, as it ensures that any subsequent iterations or runs of that file or cell are recorded and grouped under the same identity in the cloud.

**Here is a breakdown**: Whenever a code is run, the output is stored in the same group as the previous, with the exact time of each run clearly stated. This chronological arrangement of each code provides a comprehensive view of the code's changes and performance over time.

![cell-grouping](/img/cell-run-grouping.png)

Cell grouping is not just a simple collection of executed commands in a cell or document but it is an organized, time-stamped record of each run.
11 changes: 3 additions & 8 deletions docs/getting-started/cli.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
---
sidebar_position: 2
title: CLI
---

# Runme CLI

With the CLI, you can run commands from your Notebooks in the terminal. The Runme CLI is available for MacOS, Windows, and other platforms.
Expand Down Expand Up @@ -212,6 +207,6 @@ This command opens Runme in your web browser.

See more resources on how Runme works:

[Getting started with the browser](/getting-started/web)
[Getting started in VS Code](/getting-started/vscode)
[Getting started on VS Code SSH and Remote](/getting-started/vscode-ssh)
- [Getting started with the browser](/getting-started/web)
- [Getting started in VS Code](/getting-started/vscode)
- [Getting started on VS Code SSH and Remote](/getting-started/vscode-ssh)
5 changes: 1 addition & 4 deletions docs/guide/bigquery.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
---

# BigQuery

In this guide, you will learn how to manage data queries using BigQueris and Runme.
In this guide, you will learn how to manage data queries using BigQuery and Runme.

## Prerequisites

Expand Down
8 changes: 0 additions & 8 deletions docs/guide/cloud-render/cloud-run.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: Google Cloud Run
---

# Google Cloud Run

Runme Cloud Renderers enable you to access various cloud resources directly within your Markdown files without the need to log into your cloud console. With Cloud Renderers, you can manage your Google Cloud Run resources and perform various operations without leaving your Markdown environment.
Expand Down Expand Up @@ -91,10 +87,6 @@ export PROJECT_ID="runme-ci"
echo "PROJECT_ID set to $PROJECT_ID"
```

This is how the prompt looks like.

![prompt](/img/integration/runme-set-var.png)

**Specify the Project for Visualization**

After setting your project ID, you can visualize your project. To do this, paste a link from your console that specifies the desired project for visualization, like the link below, and click run.
Expand Down
180 changes: 180 additions & 0 deletions docs/guide/containercraft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# ContainerCraft

In this guide, we'll drive a [ContainerCraft](https://containercraft.io/) development container with Runme. The ContainerCraft environment includes Runme, Kubernetes, Helm, Kubectl, K9s, Tmux, Python, Go, and more.

## Prerequisites

To get started, ensure you have the following installed on your local machine:

- Install [**Runme** for VS Code](https://marketplace.visualstudio.com/items?itemName=stateful.runme) and set it as your [default Markdown viewer](../installation/vscode#configure-your-default-markdown-editor).
- Ensure you have [**Docker** installed](https://www.docker.com/products/docker-desktop/) and running on your machine.
- Install the [**VS Code Remote—Containers** Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) to work with containers directly.

## Setting Up Your Development Container

Create a folder to contain the dockerfile and `devcontainer.json` at the end of this guide. Use this command inside of your README to create it:

```bash {"id":"01J6YWZ6PHZM16VX6EE3JYY98Y"}
mkdir -p ./.devcontainer
```

### Create and configure the `devcontainer.json`

The `devcontainer.json` file specifies how VSCode should handle the container. In your `README.md` file, run the script below. This will create the `devcontainer.json` and give it the ContainerCraft configuration.

```bash {"id":"01J7GC2HFGJXB58KQZ6M1VVJ15"}


cat <<EOF | sudo tee ./.devcontainer/devcontainer.json > /dev/null
{
"name": "konductor",
"remoteUser": "vscode",
"dockerFile": "Dockerfile",
"init": true,
"privileged": true,
"overrideCommand": false,
"updateRemoteUserUID": true,
"shutdownAction": "stopContainer",
"securityOpt": [
"seccomp=unconfined"
],
"runArgs": [
"--privileged",
"--network=host",
"--device=/dev/kvm"
],
"mounts": [
"source=dind-var-lib-docker,target=/var/lib/docker,type=volume"
],
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
},
"postCreateCommand": "devcontainer-links",
"forwardPorts": [
1313,
2222,
6000,
7681,
8080
],
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"vscodevim.vim",
"github.copilot",
"stateful.runme",
"max-ss.cyberpunk",
"ms-python.python",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"oderwat.indent-rainbow",
"okteto.kubernetes-context",
"ms-vsliveshare.vsliveshare",
"ms-azuretools.vscode-docker",
"github.vscode-github-actions",
"ms-kubernetes-tools.kind-vscode",
"ms-vscode.vscode-typescript-next",
"github.vscode-pull-request-github",
"ms-vscode-remote.remote-containers",
"randomfractalsinc.vscode-data-table",
"visualstudioexptteam.vscodeintellicode",
"ms-kubernetes-tools.vscode-kubernetes-tools"
]
}
}
}
EOF
```

### Create and configure the `Dockerfile`

The `Dockerfile` defines the base image for the development container, which is the foundation for setting up the development environment. In your `README.md` file, run the script below.

```bash {"id":"01J7GC7RQ5QRM437CJS3TCPW8B"}
cat <<EOF | sudo tee ./.devcontainer/Dockerfile > /dev/null
FROM ghcr.io/containercraft/devcontainer:latest
EOF
```

This will create a Dockerfile with the ContainerCraft image in it.

## Access your project in the development container

Now that you have set up your development container, you need to access your project in the development container. To do this, follow the steps below:

1. Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on Mac) to open the command palette. Then, search for `Remote-Explorer: Focus on Dev Containers`.

![remote-explorer](../../static/img/guide-page/runme-remote-explorer.png)

2. Now, click the `+` icon to select your project directory. If you’ve created the development container before now, you don’t need to click the `+` icon. Just selecting the container from the available list populated on the screen is enough.

![dev-containers](../../static/img/guide-page/select-devcontainer-runme.png)

## Rebuild and open the container

After selecting the folder where your project is, VS Code should prompt you to reopen the folder in a container.

If that does not happen, open the command palette (`Ctrl + Shift + P`) and select `Remote-Explorer: Focus on Dev Containers`. This will allow VS Code to build the Docker image defined in the `.devcontainer` folder and open the workspace inside the container once the build is complete.

![development container ui](../../static/img/guide-page/runme-interface-devcontainer.png)

## Test your project inside the development container

Use your DevOps tools directly within the VS Code terminal inside the container (Runme, Kubernetes, Helm, Kubectl, K9s, Tmux, Python, Go, and more)...

<video autoPlay loop muted playsInline controls>
<source src="/videos/runme-devcontainer-hello.mp4" type="video/mp4" />
<source src="../../static/videos/runme-devcontainer-hello.mp4" type="video/mp4" />
<source src="/videos/runme-devcontainer-hello.webm" type="video/webm" />
<source src="../../static/videos/runme-devcontainer-hello.webm" type="video/webm" />
</video>
<br/>

## Runme features

With Runme in your development container, you can build projects in any programming language. This is made possible with the [Shebang support feature](../usage/shebang). It allows you to easily set the code block of the specific programming language you intend to use. You can also add and run the different supported languages in one Markdown file.

Here is an example of a simple Python project showcasing how the Runme Shebang feature enables you to execute commands and scripts in a development container.

<video autoPlay loop muted playsInline controls>
<source src="/videos/Runme-python-dev-container.mp4" type="video/mp4" />
<source src="../../static/videos/Runme-python-dev-container.mp4" type="video/mp4" />
<source src="/videos/Runme-python-dev-container.webm" type="video/webm" />
<source src="../../static/videos/Runme-python-dev-container.webm" type="video/webm" />
</video>
<br/>

In addition, you can set your code block to run a command(s) in the background while you focus on other aspects of your project using the [background task feature](https://docs.runme.dev/how-runme-works/vscode#background-processes).

Below is an example video that illustrates how the background task feature works with your Go projects in a development container.

<video autoPlay loop muted playsInline controls>
<source src="/videos/go-runme-dev-container.mp4" type="video/mp4" />
<source src="../../static/videos/go-runme-dev-container.mp4" type="video/mp4" />
<source src="/videos/go-runme-dev-container.webm" type="video/webm" />
<source src="../../static/videos/go-runme-dev-container.webm" type="video/webm" />
</video>
<br/>

Here is also an example of a project on [how to handle large data efficiently with Node.js streams](https://github.com/stateful/blog-examples/tree/main/node-streams).

<video autoPlay loop muted playsInline controls>
<source src="/videos/runme-node.mp4" type="video/mp4" />
<source src="../../static/videos/runme-node.mp4" type="video/mp4" />
<source src="/videos/runme-node.webm" type="video/webm" />
<source src="../../static/videos/runme-node.webm" type="video/webm" />
</video>
<br/>

## Shutting down the container

After completing the task, you can shut down the container by closing the VS Code, which automatically stops the container. However, your project files and changes will persist on your local machine.

## Additional Resources

To learn more about using Development Containers with Runme, see more resources below:

- [Running Runme in a Development Container](../usage/devcontainers)
- [How to Integrate Python Virtual Environments with Runme](../guide/pythonenv)
- [Developing Inside Container](https://code.visualstudio.com/docs/devcontainers/containers)
6 changes: 0 additions & 6 deletions docs/guide/docker.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 3
---

# Docker

In this guide, we will walk you through the use cases of integrating Runme and Docker.
Expand Down Expand Up @@ -125,8 +121,6 @@ docker run -p 80:5000 nginx

If a cell block takes a lot of time to execute, you can also run such a cell in the background using [Runme’s background mode](/configuration/cell-level#background-task). This will enable you to save time and move on to other tasks while your previous task is still running.

![background mode](/img/runme-background.png)

### Sleep a Container

You can instruct Docker to make a container sleep.
Expand Down
22 changes: 6 additions & 16 deletions docs/guide/k8s/istio.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
---
runme:
id: 01J4PEEDGDB2XNDVEMT2A5NAY9
version: v3
---

# Istio Service Mesh

Runme interactive notebook is designed to help you execute and document your daily automation tasks.

With Runme, you can run your code and commands directly within the notebook, which makes it easy to manage and improve your workflow.
Runme is designed to help you execute and document your daily automation tasks. With Runme, you can run your code and commands directly within the notebook, which makes it easy to manage and improve your workflow.

In this guide, we will focus on integrating Istio, a powerful service mesh, into your Markdown files using Runme. Istio helps you manage and secure your microservices.

Expand All @@ -18,9 +11,8 @@ By the end of this guide, you'll be able to use Runme to efficiently set up and

To follow up on this tutorial, ensure you have the following:

**Runme Extension:** Install the [Runme extension](https://marketplace.visualstudio.com/items?itemName=stateful.runme) in your VS Code editor and set it as your [default Markdown viewer](/installation/vscode#how-to-set-vs-code-as-your-default-markdown-viewer).

**Required Packages:** Install the required packages (kind, kubectl, helm) in your Markdown file. Runme allows you to achieve this! Simply run the command below.
- **Runme Extension:** Install the [Runme extension](https://marketplace.visualstudio.com/items?itemName=stateful.runme) in your VS Code editor and set it as your [default Markdown viewer](/installation/vscode#how-to-set-vs-code-as-your-default-markdown-viewer).
- **Required Packages:** Install the required packages (kind, kubectl, helm) in your Markdown file. Runme allows you to achieve this! Simply run the command below.

```sh {"id":"01J4PEEDESRWQG8MDQNJATK6CD"}
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand Down Expand Up @@ -353,8 +345,6 @@ kind delete cluster --name my-cluster

Some other guides you may want to explore:

[Deploying and Managing Applications with Runme and Argo CD](/guide/k8s/argocd)

[Advanced Guide to Argo CD and Runme](/guide/k8s/argocd-cli)

[How to Setup a Monitoring Stack for Your Applications by Leveraging Runme](/guide/monitoring-stack)
- [Deploying and Managing Applications with Runme and Argo CD](/guide/k8s/argocd)
- [Advanced Guide to Argo CD and Runme](/guide/k8s/argocd-cli)
- [How to Setup a Monitoring Stack for Your Applications by Leveraging Runme](/guide/monitoring-stack)
6 changes: 1 addition & 5 deletions docs/resources/limitations.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
title: Limitations
---

# Known Limitations

- Runme currently only has rudimentary support for PowerShell. While PowerShell is not limited to Windows, it is its primary platform. We recommend using [WSL](https://code.visualstudio.com/docs/remote/wsl).
- Runme currently only has rudimentary support for PowerShell. While PowerShell is not limited to Windows, it is its primary platform. We recommend using [WSL](../installation/windows).
- Please [report any issues](https://github.com/stateful/runme/issues/new) you encounter, big or small, to help us make Runme better.

## Communication & Support
Expand Down
6 changes: 1 addition & 5 deletions docs/usage/auto-save.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
---
title: Auto-Save session outputs
---

# Auto-Save Auto-Save session outputs
# Auto-Save session outputs

The Runme auto-save feature efficiently saves and manages your commands and executed cells for future reference. When you run a command within your Runme Notebook, a Session Ouputs file is automatically generated. This captures a complete copy of the original Markdown document, along with the generated outputs, details on when each cell was run, the time it took to run the cell, and exit codes. You can also turn your command/generated outputs into a [Runme gist](/usage/runme-gist).

Expand Down
Binary file removed static/img/cell-run-grouping.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/guide-page/runme-remote-explorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/videos/Runme-python-dev-container.mp4
Binary file not shown.
Binary file added static/videos/Runme-python-dev-container.webm
Binary file not shown.
Binary file added static/videos/go-runme-dev-container.mp4
Binary file not shown.
Binary file added static/videos/go-runme-dev-container.webm
Binary file not shown.
Binary file added static/videos/runme-devcontainer-hello.mp4
Binary file not shown.
Binary file added static/videos/runme-devcontainer-hello.webm
Binary file not shown.
Binary file added static/videos/runme-node.mp4
Binary file not shown.
Binary file added static/videos/runme-node.webm
Binary file not shown.