Skip to content

Commit

Permalink
Docker & Public Apps & Cleaning app doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hcourdent committed Sep 13, 2023
1 parent a71f617 commit f0f71ea
Show file tree
Hide file tree
Showing 41 changed files with 425 additions and 75 deletions.
Binary file modified docs/advanced/7_docker/as_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/advanced/7_docker/as_flow.png.avif
Binary file not shown.
Binary file removed docs/advanced/7_docker/as_flow.png.webp
Binary file not shown.
Binary file modified docs/advanced/7_docker/as_flow2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/advanced/7_docker/as_flow2.png.avif
Binary file not shown.
Binary file removed docs/advanced/7_docker/as_flow2.png.webp
Binary file not shown.
Binary file modified docs/advanced/7_docker/as_script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/advanced/7_docker/as_script.png.avif
Binary file not shown.
Binary file removed docs/advanced/7_docker/as_script.png.webp
Binary file not shown.
Binary file modified docs/advanced/7_docker/as_script2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/advanced/7_docker/as_script2.png.avif
Binary file not shown.
Binary file removed docs/advanced/7_docker/as_script2.png.webp
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import DocCard from '@site/src/components/DocCard';

# Run Docker Containers

Windmill support running any docker container through its bash support. As a pre-requisite, the host docker daemon need to be mounted into the worker container. This is done through a simple volume mount: `/var/run/docker.sock:/var/run/docker.sock`.
Windmill supports running any [Docker](https://www.docker.com/) container through its [Bash](../../getting_started/0_scripts_quickstart/4_bash_quickstart/index.mdx) support. As a pre-requisite, the host docker daemon needs to be mounted into the worker container. This is done through a simple volume mount: `/var/run/docker.sock:/var/run/docker.sock`.

Once Docker is set up, see:

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
title="Docker Quickstart"
description="Learn to run a script using from Docker containers."
href="/docs/getting_started/scripts_quickstart/docker"
/>
</div>

## Setup

### Docker compose

On the docker-compose, it is enough to uncomment the volume mount of the windmill worker
On the docker-compose, it is enough to uncomment the volume mount of the Windmill worker

```dockerfile
# mount the docker socket to allow to run docker containers from within the workers
Expand All @@ -15,7 +27,7 @@ On the docker-compose, it is enough to uncomment the volume mount of the windmil

### Helm charts

In the charts values of our [helm charts](https://github.com/windmill-labs/windmill-helm-charts), set `windmill.exposeHostDocker` to `true`
In the charts values of our [helm charts](https://github.com/windmill-labs/windmill-helm-charts), set `windmill.exposeHostDocker` to `true`.

### Remote Docker Daemon

Expand All @@ -39,7 +51,6 @@ spec:
privileged: true
```
## Use
The default code is as follows:
Expand Down Expand Up @@ -70,15 +81,15 @@ Like any bash script, it will return the last line of the stdout. So be sure to

As a script:

![script 1](./as_script.png.webp)
![script 1](./as_script.png)

![script 2](./as_script2.png.webp)
![script 2](./as_script2.png)

As a flow step:

![flow step 1](./as_flow.png.webp)
![flow step 1](./as_flow.png)

![flow step 2](./as_flow2.png.webp)
![flow step 2](./as_flow2.png)

## Use with Remote Docker Daemon

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Windmill's most advanced guides.
</a>
<a href="/docs/advanced/docker" class="rounded-md p-6 border border-gray-200 hover:border-blue-500 transition-all cursor-pointer flex flex-col gap-2 !no-underline" >
<div class="text-lg font-semibold text-gray-900">Run Docker Containers</div>
<div class="text-sm text-gray-500">Windmill support running any docker container through its bash support.</div>
<div class="text-sm text-gray-500">Windmill supports running any docker container through its Bash support.</div>
</a>
</div>
39 changes: 30 additions & 9 deletions docs/apps/0_app_editor/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ The app editor is a low-code builder to create apps with components, create inte

<br />

The app editor is composed of 5 main sections:
The app editor is composed of 6 main sections:

1. [Toolbar](/docs/apps/app_editor#toolbar)
2. [Canvas](#canvas)
3. [Outputs](#outputs)
4. [Runnables panel](#runnables-panel)
5. [Component Library and Settings](#component-library-and-settings)
6. [App Styling]

![App Editor](../../assets/apps/0_app_editor/plain-app-editor.png.webp)

## Toolbar

The topbar helps you in your app editing.

![App Menu](../../assets/apps/1_app_toolbar/app-toolbar.png.webp)
![App Menu](../../assets/apps/1_app_toolbar/app-toolbar.png)

#### Learn more

Expand Down Expand Up @@ -79,7 +80,7 @@ The canvas at the center of the editor is where you design and see the overall U

## Outputs

On the left panel of the editor, you can see the list of outputs of the app. These outputs represent the state of the app and are categorized into four types:
On the left panel of the editor, you can see the list of outputs of the app. These outputs represent the states & results of the app and are categorized into four types:

- **Context**: The context holds information such as the user email, username, workspace, query parameters, and more.
- **State**: The state holds the app's current state, which can be manipulated by the frontend scripts.
Expand All @@ -100,8 +101,8 @@ You can perform the following actions with the outputs:
<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
color="orange"
title="Context"
description="The context holds such information as the user email, username, the workspace, the query parameters, etc."
title="Outputs"
description="The outputs represent the states & results of the app"
href="/docs/apps/outputs"
/>
<DocCard
Expand Down Expand Up @@ -152,16 +153,36 @@ Finally, on the right panel of the editor, you can insert a new component, confi
description="Learn how to trigger a runnable."
href="/docs/apps/app_configuration-settings/app_runnable_triggers"
/>
</div>

## Styling

Styling on the app editor can be managed at the component and app-level, with pre-set configurations or using CSS & [Tailwind](https://tailwindcss.com/).

#### Learn more

<div class="grid grid-cols-2 gap-2 my-4">
<DocCard
color="orange"
title="Styling"
description="Learn how to edit the component styles."
href="/docs/apps/app_configuration-settings/app_styling"
/>
</div>

## Other app features

<div class="grid grid-cols-2 gap-2 my-4">
<DocCard
title="Group of Components"
description="Components can be grouped within containers."
href="/docs/apps/app_configuration-settings/components_groups"
color="orange"
/>
<DocCard
title="Public Apps"
description="Apps can be accessed as a standalone app by anyone who has the secret URL"
href="/docs/apps/public_apps"
color="orange"
title="Styling"
description="Learn how to edit the component styles."
href="/docs/apps/app_configuration-settings/app_styling"
/>
</div>
</div>
40 changes: 13 additions & 27 deletions docs/apps/0_toolbar.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
# Toolbar Guide

The app toolbar is located at the top of the app editor. It enables you to adjust app settings, toggle between desktop/mobile preview, and debug runs.

![App Menu](../assets/apps/1_app_toolbar/app-toolbar.png.webp)

- [App Summary](#app-summary): The summary is the name that will be displayed for your app.
- [Undo/Redo](#app-summary): Perform undo or redo actions.
- [Desktop/Mobile Mode](#desktopmobile-mode): Switch between Mobile and Desktop layout.
- [Width](#width): Switch between full and max width.
- [Deployement history](#deployement-history): View the deployment history of the app.
- [JSON](#json): Export your app as a JSON or [Hub](https://hub.windmill.dev/) compatible file.
- [Hub compatible JSON](#hub-compatible-json): View the JSON representation of the app in a format that is compatible with the [Windmill Hub](https://hub.windmill.dev/).
- [App Inputs Configuration](#app-inputs-configuration): the app inputs menu displays a list of all the inputs of each component.
- [Debugging](#debug-runs): Open the debugging panel.
- [Editor/Preview Mode](#preview-mode): Toggle between the Editor and Preview modes.
- [Save as Draft](#save-as-draft): Save your app as a [draft](../core_concepts/0_draft_and_deploy/index.mdx#draft).
- [Deploy](#deploy): [Deploy](../core_concepts/0_draft_and_deploy/index.mdx#deployed-version) your app.
The app toolbar is located at the top of the app editor. It enables you to adjust app settings.

![App Menu](../assets/apps/1_app_toolbar/app-toolbar.png)

## App Summary

Expand All @@ -41,19 +28,19 @@ The `⋮` menu provides access to the following options:

### Deployement history

In the menu, you can view the deployment history of the app. It displays the date and time of the deployment, the user who deployed the app, and the version of the app.
In the menu, you can view the [deployment](./6_app_deployment.mdx) history of the app. It displays the date and time of the deployment, the user who deployed the app, and the version of the app.

You can:

- View the app at a specific version.
- Restore a fork
- Restore here
- Restore a fork.
- Restore here.

![Deployement history](../assets/apps/1_app_toolbar/deployement-history.png.webp)

### JSON

View the JSON representation of the app.
View the [JSON representation](../core_concepts/13_json_schema_and_parsing/index.md) of the app.

### Hub compatible JSON

Expand All @@ -67,7 +54,7 @@ The app inputs menu displays a list of all the inputs of each component. A toggl

## Debug Runs

The app builder enables you to examine recent runs to identify potential bugs.
The app builder enables you to examine recent runs to [identify potential bugs](./5_app_debugging.md).

![App Debug Runs](../assets/apps/1_app_toolbar/app-debug-runs.png.webp)

Expand All @@ -77,13 +64,12 @@ The app editor mode can be toggled between `Editor` and `Preview` modes. The pre

## Save as draft

You can [save](../core_concepts/0_draft_and_deploy/index.mdx) the app. The first time you save the app, you'll be asked to select the owner of the app. You can choose either a user or a [folder](../core_concepts/8_groups_and_folders/index.mdx#folders).
You can [save](./6_app_deployment.mdx) the app. The first time you save the app, you'll be asked to select the owner of the app. You can choose either a user or a [folder](../core_concepts/8_groups_and_folders/index.mdx#folders).

## Deploy

You can [deploy](../core_concepts/0_draft_and_deploy/index.mdx#deployed-version) the app as a standalone app via a URL. There are two ways to publish an app:

- Read-Access Required: The app can be accessed by anyone who has read access to the app.
- Publish Publicly: The app can be accessed by anyone who knows the secret URL. If set to `Publish Publicly`, the secret URL will be displayed here.
Windmill apps are custom-made user interfaces meant to interact with scripts and flows.

![App Publish](../assets/apps/1_app_toolbar/app-publish.png.webp)
There are two ways to [deploy](./6_app_deployment.mdx) an app:
- **Read-Access Required**: The app can be accessed & triggered by anyone who has [read access](../core_concepts/16_roles_and_permissions/index.mdx) to the app.
- **Publish Publicly**: The app can be accessed as a standalone app by anyone who has the secret URL.
4 changes: 3 additions & 1 deletion docs/apps/2_outputs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Outputs Guide

On the left-hand side of the app editor, you can find the app outputs. They are three kind of outputs:
The outputs represent the states & results of the app.

All outputs can be found on the left-hand side of the app editor. There are three kind of outputs:

- Context and state
- Component outputs
Expand Down
15 changes: 13 additions & 2 deletions docs/apps/6_app_deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,27 @@ import DocCard from '@site/src/components/DocCard';

# Deployment

Apps can be saved as draft before being published.
Windmill apps are custom-made user interfaces meant to interact with scripts and flows.

There are two ways to [deploy](../core_concepts/0_draft_and_deploy/index.mdx) an app:
- **Read-Access Required**: The app can be accessed & triggered by anyone who has [read access](../core_concepts/16_roles_and_permissions/index.mdx) to the app.
- **Publish Publicly**: The app can be accessed as a standalone app by anyone who has the secret URL.

Apps can be saved as [draft](../core_concepts/0_draft_and_deploy/index.mdx#draft) before being published.

### Learn more

<div class="grid grid-cols-2 gap-6 mb-4">

<DocCard
title="Draft and Deploy"
description="Learn how to draft and deploy apps."
href="/docs/core_concepts/draft_and_deploy"
color="orange"
/>
<DocCard
title="Public Apps"
description="Apps can be accessed as a standalone app by anyone who has the secret URL"
href="/docs/apps/public_apps"
color="orange"
/>
</div>
12 changes: 12 additions & 0 deletions docs/apps/8_public_apps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Public Apps

Windmill apps are custom-made user interfaces meant to interact with scripts and flows.

There are two ways to [deploy](./6_app_deployment.mdx) an app:
- **Read-Access Required**: The app can be accessed & triggered by anyone who has [read access](../core_concepts/16_roles_and_permissions/index.mdx) to the app.
- **Publish Publicly**: The app can be accessed as a standalone app by anyone who has the secret URL.
This feature requires saving the app at least to [draft](../core_concepts/0_draft_and_deploy/index.mdx#draft) before.

![Read-Access App](../assets/apps/8_public_apps/read_only_app.png "Read-Access App")

![Public App](../assets/apps/8_public_apps/public_app.png "Public App")
Binary file removed docs/assets/apps/1_app_toolbar/app-publish.png
Binary file not shown.
Binary file removed docs/assets/apps/1_app_toolbar/app-publish.png.avif
Binary file not shown.
Binary file removed docs/assets/apps/1_app_toolbar/app-publish.png.webp
Binary file not shown.
Binary file modified docs/assets/apps/1_app_toolbar/app-toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/apps/1_app_toolbar/app-toolbar.png.avif
Binary file not shown.
Binary file removed docs/assets/apps/1_app_toolbar/app-toolbar.png.webp
Binary file not shown.
Binary file added docs/assets/apps/8_public_apps/public_app.png
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 docs/assets/apps/8_public_apps/read_only_app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/compared_to/retool.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ However, the possibilities with code on Retool will be much more limited:

Retool only supports JavaScript and SQL. Windmill supports JavaScript ([TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx)), [SQL](../getting_started/0_scripts_quickstart/5_sql_quickstart/index.mdx), but also [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx), [Go](../getting_started/0_scripts_quickstart/3_go_quickstart/index.mdx), [Bash](../getting_started/0_scripts_quickstart/4_bash_quickstart/index.mdx).
For each of those languages, scripts can be run [without having to deal with separate dependency files](../advanced/6_imports/index.md).
For other languages, Windmill supports [running any docker container](../advanced/7_docker/index.md) through its bash support.
For other languages, Windmill supports [running any docker container](../advanced/7_docker/index.mdx) through its bash support.

All operations in Windmill are based on scripts. Unlike Retool, scripts in Windmill can be considered as standalone endpoints:
executable through [autogenerated UIs](../core_concepts/6_auto_generated_uis/index.md), [webhooks](../core_concepts/4_webhooks/index.md), etc.
Expand Down
44 changes: 33 additions & 11 deletions docs/core_concepts/0_draft_and_deploy/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Draft, test, and deploy scripts, flows, and apps Windmill to iterate and save sa

Each script, flow or app can be saved (sometimes concurrently) in 3 fashions, by your browser in `local storage`, by the backend as a `draft`, and `deployed`.

Once deployed, scripts, flows and apps will be visible, editable and/or runnable by users [with the right permissions](../16_roles_and_permissions/index.mdx).

<video
className="border-2 rounded-xl object-cover w-full h-full dark:border-gray-800"
autoPlay
Expand Down Expand Up @@ -36,22 +38,16 @@ Drafts can be run and tested only from the editor (script, flow or app) with the

## Deployed Version

The deployed version is the authoritative version of a runnable. Once deployed, it is not only visible by workspace members but has its own [auto-generated UI](../6_auto_generated_uis/index.md), [webhooks](../4_webhooks/index.md), or can be called from flows and apps (for sripts and flows). This also means that local edits and drafts can be made in parallel to a deployed version of a runnable without affecting its behavior.
The deployed version is the authoritative version of a runnable. Once deployed, it is not only visible by workspace members [with the right permissions](../16_roles_and_permissions/index.mdx) but has its own [auto-generated UI](../6_auto_generated_uis/index.md), [webhooks](../4_webhooks/index.md), or can be called from flows and apps (for sripts and flows). This also means that local edits and drafts can be made in parallel to a deployed version of a runnable without affecting its behavior.

If you want to have several versions of the same runnable, just fork it with the `Fork` button on the drop down menu of `Deploy`.

## Special case: Deployed versions of scripts

Apps and Flows only have one deployed version at a given path and doing a new deployment overwrite the previous one.

Scripts are special because each deployment of a script creates an immutable hash that will never be overwritten. The path of a script serves as a redirection to the last deployed hash, but all hashes live permanently forever. This ensures that if you refer to a script by its hash, its behavior is guaranteed to remain the same even if a new hash is deployed at the same path.

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
title="Versioning"
description="Scripts, when deployed, can have a parent script identified by its hash."
href="/docs/script_editor/versioning"
/>
title="Roles and Permissions"
description="Control access and manage permissions within your instance and workspaces."
href="/docs/core_concepts/roles_and_permissions"
/>
</div>

## Diff Viewer
Expand All @@ -68,6 +64,32 @@ A diff viewer is available when loading scripts from autosave or draft.

> Changes can then be reversed to previous version.
## Special case: Deployed versions of scripts

Apps and Flows only have one deployed version at a given path and doing a new deployment overwrite the previous one.

Scripts are special because each deployment of a script creates an immutable hash that will never be overwritten. The path of a script serves as a redirection to the last deployed hash, but all hashes live permanently forever. This ensures that if you refer to a script by its hash, its behavior is guaranteed to remain the same even if a new hash is deployed at the same path.

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
title="Versioning"
description="Scripts, when deployed, can have a parent script identified by its hash."
href="/docs/script_editor/versioning"
/>
</div>

## Special case: Public Apps

Windmill apps can be [Published Publicly](../../apps/8_public_apps.md). It means that the app can be accessed as a standalone app by anyone who has the secret URL.

<div class="grid grid-cols-2 gap-6 mb-4">
<DocCard
title="Public Apps"
description="Apps can be accessed as a standalone app by anyone who has the secret URL"
href="/docs/apps/public_apps"
/>
</div>

## Recap

![Recap Draft and Deploy](./recap_draft_and_deploy.png.webp)
5 changes: 3 additions & 2 deletions docs/core_concepts/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@ All details on Apps can be found in the [Apps section](../apps/0_app_editor/inde
color="orange"
/>
<DocCard
title="Example: E-commerce CRM app"
description="Tutorial on how to build a CRM with Windmill."
title="Public Apps"
description="Apps can be accessed as a standalone app by anyone who has the secret URL"
href="/docs/apps/public_apps"
color="orange"
/>
</div>
2 changes: 1 addition & 1 deletion docs/flows/16_architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In Windmill, a workflow is a JSON serializable value in the [OpenFlow](../openfl

1. Reference to a Script from the [Hub](https://hub.windmill.dev/).
2. Reference to a Script in your [workspace](../core_concepts/16_roles_and_permissions/index.mdx#workspace).
3. Inlined Script in [TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) (Deno), [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx), [Go](../getting_started/0_scripts_quickstart/3_go_quickstart/index.mdx), [Bash](../getting_started/0_scripts_quickstart/3_go_quickstart/index.mdx), [SQL](../getting_started/0_scripts_quickstart/5_sql_quickstart/index.mdx) or [non-supported languages](../advanced/7_docker/index.md).
3. Inlined Script in [TypeScript](../getting_started/0_scripts_quickstart/1_typescript_quickstart/index.mdx) (Deno), [Python](../getting_started/0_scripts_quickstart/2_python_quickstart/index.mdx), [Go](../getting_started/0_scripts_quickstart/3_go_quickstart/index.mdx), [Bash](../getting_started/0_scripts_quickstart/3_go_quickstart/index.mdx), [SQL](../getting_started/0_scripts_quickstart/5_sql_quickstart/index.mdx) or [non-supported languages](../advanced/7_docker/index.mdx).
4. [Trigger Scripts](./10_flow_trigger.md) which are a kind of Scripts that are meant to be first step of a scheduled Flow, that watch for external events and early exit the Flow if there is no new events.
5. [For loop](./12_flow_loops.md) that iterates over elements and triggers the execution of an embedded flow for each element. The list is calculated dynamically as an [input transform](#input-transform).
6. [Branch](./13_flow_branches.md#branch-one) to the first subflow that has a truthy predicate (evaluated in-order).
Expand Down
Loading

0 comments on commit f0f71ea

Please sign in to comment.