diff --git a/docs/architecture/_category_.json b/docs/architecture/_category_.json index ffe42308..997d96eb 100644 --- a/docs/architecture/_category_.json +++ b/docs/architecture/_category_.json @@ -1,4 +1,4 @@ { "label": "Architecture", - "position": 6 + "position": 8 } diff --git a/docs/architecture/assets/components.svg b/docs/architecture/assets/components.svg index 29c5b203..d722313c 100644 --- a/docs/architecture/assets/components.svg +++ b/docs/architecture/assets/components.svg @@ -1,3 +1,4 @@ + -
Engine
Engine
CLI
CLI
Gateway
Gateway
calls
calls
interacts with
interacts with
manages Action CRs
manages Action CRs
GraphQL API
GraphQL API
watches Action CRs and executes Actions
watches Action CRs and executes Actions
K8s Controller
K8s Controller
Local Hub
Local Hub
GraphQL API
GraphQL API
reads OCF manifests
reads OCF manifests
Public Hub
Public Hub
GraphQL API
GraphQL API
aggregates
aggregates
Kubernetes
API Server
Kubernetes...
Database with read-only manifests
Database with...
manages TypeInstances
manages TypeInstances
consumes Local
and Public Hub API
consumes Local...
Database with TypeInstance manifests
Database with...
Kubernetes cluster
Kubernetes cluster
Go SDK
Go SDK
utilizes
utilizes
utilizes
utilizes
utilizes
utilizes
utilizes
utilizes
Viewer does not support full SVG 1.1
\ No newline at end of file +
Engine
Engine
CLI
CLI
Gateway
Gateway
calls
calls
interacts with
interacts with
manages Action CRs
manages Action CRs
GraphQL API
GraphQL API
watches Action CRs and executes Actions
watches Action CRs and executes Actions
K8s Controller
K8s Controller
Local Hub
Local Hub
GraphQL API
GraphQL API
reads OCF manifests
reads OCF manifests
Public Hub
Public Hub
GraphQL API
GraphQL API
aggregates
aggregates
Kubernetes
API Server
Kubernetes...
Database with read-only manifests
Database with...
manages TypeInstances
manages TypeInstances
consumes Local
and Public Hub API
consumes Local...
Database with TypeInstance manifests
Database with...
Kubernetes cluster
Kubernetes cluster
Go SDK
Go SDK
utilizes
utilizes
utilizes
utilizes
utilizes
utilizes
utilizes
utilizes
Dashboard
Dashboard
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/docs/architecture/e2e-architecture.md b/docs/architecture/e2e-architecture.md index 78b59818..01c4dc20 100644 --- a/docs/architecture/e2e-architecture.md +++ b/docs/architecture/e2e-architecture.md @@ -19,12 +19,18 @@ OCF manifests are stored in [Hub](#hub). ### CLI -CLI is command line tool which makes easier with working the [OCF](#ocf) manifests and Actions. +CLI is command line tool which makes easier to manage [OCF](#ocf) manifests and Actions. To read the documentation about CLI tool, see the [Getting started](../cli/getting-started.mdx) document. CLI utilizes [SDK](#sdk). +### Dashboard + +Dashboard is a web-based user interface for managing Capact resources, such as Actions. + +To read more about Dashboard, see the [Overview](../dashboard-ui/overview.md) document. + ### Gateway Gateway is a GraphQL reverse proxy. It aggregates multiple remote GraphQL schemas into a single endpoint. It enables [CLI](#cli) and other clients to have a single destination for all GraphQL operations. diff --git a/docs/cli/_category_.json b/docs/cli/_category_.json index fd511884..8292952b 100644 --- a/docs/cli/_category_.json +++ b/docs/cli/_category_.json @@ -1,4 +1,4 @@ { "label": "CLI", - "position": 7 + "position": 6 } diff --git a/docs/cli/getting-started.mdx b/docs/cli/getting-started.mdx index d9b528a0..b6aebfd2 100644 --- a/docs/cli/getting-started.mdx +++ b/docs/cli/getting-started.mdx @@ -4,7 +4,7 @@ sidebar_position: 1 # Getting Started -In addition to a Capact GraphQL API, Capact features a command-line interface that wraps common functionality and formats output. The Capact CLI is a single static binary. It is a wrapper around the Capact GraphQL API and Kubernetes API. +Capact features a command-line interface that wraps common functionality and formats output. The Capact CLI is a single static binary. It is a wrapper around the Capact GraphQL API and Kubernetes API. ## Install @@ -272,3 +272,7 @@ Use the `CAPACT_CREDENTIALS_STORE_BACKEND` environment variable to change the de ## Next steps ✨ After setting up Capact CLI, you are ready to start a journey with the Capact project. Check out our [Mattermost installation example](../example/mattermost-installation.md) to learn how to use Capact CLI to provision an example application. + +## See also + +If you would rather manage Capact resources using UI, read the [Dashboard Overview](../dashboard-ui/overview.md) document. \ No newline at end of file diff --git a/docs/content-development/_category_.json b/docs/content-development/_category_.json index f7a9d7c3..9d48e1c0 100644 --- a/docs/content-development/_category_.json +++ b/docs/content-development/_category_.json @@ -1,4 +1,4 @@ { "label": "Content development", - "position": 5 + "position": 8 } diff --git a/docs/dashboard-ui/_category_.json b/docs/dashboard-ui/_category_.json new file mode 100644 index 00000000..1f19a911 --- /dev/null +++ b/docs/dashboard-ui/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Dashboard UI", + "position": 7 +} diff --git a/docs/dashboard-ui/action-management.md b/docs/dashboard-ui/action-management.md new file mode 100644 index 00000000..9d7a359f --- /dev/null +++ b/docs/dashboard-ui/action-management.md @@ -0,0 +1,86 @@ +# Action management + +This document describes how to manage Actions from the Capact Dashboard UI. + +## Prerequisites + +- Cluster with Capact installation. See the [installation](../installation/local.mdx) tutorial. +- An user logged in Dashboard. See the [Getting started](./overview.md#) guide. + +## Create Action + +1. Click on the **Hub** section on the left-side menu. + + You will see all InterfaceGroups available in the Hub. + + ![InterfaceGroups](./assets/hub-interfacegroups.png) + + Click on one of the InterfaceGroups tiles, for example **PostgreSQL**. + +1. See the list of all Interfaces within a given InterfaceGroup. + + ![Interfaces](./assets/hub-interfaces.png) + + - You can toggle list/card view using the icons (1) on the right top side. + - Create Action for a given Interface using the **Create Action** link (2). + +1. If the selected Interface requires input parameters, you will be asked to provide them. + + ![InputParameters](./assets/action-create-params.png) + + Fill the form with input parameters for Interface, and click **Next**. + +1. If the selected Interface requires input TypeInstances, you will be asked to provide them. + + ![TypeInstances](./assets/action-create-tis.png) + + Provide all required input TypeInstances and click **Next**. + +1. Verify the Action details on the Action Summary. + + ![Summary](./assets/action-create-summary.png) + + - To edit Action name, click on the pen icon (1) next to the generated Action name. + - Switch to **Advanced Settings** (2) tab, to optionally select a specific Implementation and provide Implementation-specific input if needed. + - To create the Action, click the **Submit** button (3). + +## List Actions + +To see the list of Actions, navigate to the **Actions** section on the left-side menu. +You can sort Actions by a given table column by clicking on the specific table header. + +![Action List](./assets/action-list.png) + +## Manage single Action + +To see the details of a single Action, navigate to the **Actions** section on the left-side menu, and click either on the Action name or the eye icon: + +![Action Details Navigation](./assets/action-details-navigation.png) + +Then you will be navigated to the Action details view, where you can display all data about a given Action - including rendered workflow, inputs and outputs. + +![Action Details view](./assets/action-details.png) + +### Run Action + +To run a given Action, click the **Run** button. The button is enabled only if Action is runnable, that is, in the "Ready to Run" state. + +![Action run](./assets/action-details-buttons.png) + +### See Action workflow + +1. To be able to use Argo Workflows UI link in the Action details view, make the Argo Workflows UI accessible with the following command: + + ```bash + kubectl -n capact-system port-forward svc/argo-argo-workflows-server 2746 + ``` + +1. To see the Action workflow, switch to the **Workflow** tab in Action details view, and click the **See workflow in Argo UI** button. The button is clickable only if Action has been already run. + + ![Action Argo workflow](./assets/action-details-argo-workflow.png) + +### Delete Action + +To delete a given Action, click the **Delete** button. Click **Yes** button in the confirmation tooltip. + +![Action delete](./assets/action-details-buttons.png) \ No newline at end of file diff --git a/docs/dashboard-ui/assets/action-create-params.png b/docs/dashboard-ui/assets/action-create-params.png new file mode 100644 index 00000000..24a8ae72 Binary files /dev/null and b/docs/dashboard-ui/assets/action-create-params.png differ diff --git a/docs/dashboard-ui/assets/action-create-summary.png b/docs/dashboard-ui/assets/action-create-summary.png new file mode 100644 index 00000000..bd94c91f Binary files /dev/null and b/docs/dashboard-ui/assets/action-create-summary.png differ diff --git a/docs/dashboard-ui/assets/action-create-tis.png b/docs/dashboard-ui/assets/action-create-tis.png new file mode 100644 index 00000000..23f43f12 Binary files /dev/null and b/docs/dashboard-ui/assets/action-create-tis.png differ diff --git a/docs/dashboard-ui/assets/action-details-argo-workflow.png b/docs/dashboard-ui/assets/action-details-argo-workflow.png new file mode 100644 index 00000000..998abda4 Binary files /dev/null and b/docs/dashboard-ui/assets/action-details-argo-workflow.png differ diff --git a/docs/dashboard-ui/assets/action-details-buttons.png b/docs/dashboard-ui/assets/action-details-buttons.png new file mode 100644 index 00000000..3358d918 Binary files /dev/null and b/docs/dashboard-ui/assets/action-details-buttons.png differ diff --git a/docs/dashboard-ui/assets/action-details-navigation.png b/docs/dashboard-ui/assets/action-details-navigation.png new file mode 100644 index 00000000..f3e7c3b5 Binary files /dev/null and b/docs/dashboard-ui/assets/action-details-navigation.png differ diff --git a/docs/dashboard-ui/assets/action-details.png b/docs/dashboard-ui/assets/action-details.png new file mode 100644 index 00000000..28f0d4be Binary files /dev/null and b/docs/dashboard-ui/assets/action-details.png differ diff --git a/docs/dashboard-ui/assets/action-list.png b/docs/dashboard-ui/assets/action-list.png new file mode 100644 index 00000000..422fdd0f Binary files /dev/null and b/docs/dashboard-ui/assets/action-list.png differ diff --git a/docs/dashboard-ui/assets/hub-interfacegroups.png b/docs/dashboard-ui/assets/hub-interfacegroups.png new file mode 100644 index 00000000..b4464fd0 Binary files /dev/null and b/docs/dashboard-ui/assets/hub-interfacegroups.png differ diff --git a/docs/dashboard-ui/assets/hub-interfaces.png b/docs/dashboard-ui/assets/hub-interfaces.png new file mode 100644 index 00000000..be3fbd92 Binary files /dev/null and b/docs/dashboard-ui/assets/hub-interfaces.png differ diff --git a/docs/dashboard-ui/assets/login.png b/docs/dashboard-ui/assets/login.png new file mode 100644 index 00000000..aa2acf75 Binary files /dev/null and b/docs/dashboard-ui/assets/login.png differ diff --git a/docs/dashboard-ui/overview.md b/docs/dashboard-ui/overview.md new file mode 100644 index 00000000..071791b8 --- /dev/null +++ b/docs/dashboard-ui/overview.md @@ -0,0 +1,57 @@ +--- +sidebar_position: 1 +--- + +# Overview + +Dashboard is a convenient, web-based UI for managing Capact resources. It comes as a built-in Capact component, enabled by default. + +> **NOTE:** Capact Dashboard is still at an early stage of development and has a basic set of features. Over time it will become more powerful, and our documentation will be updated to describe how it can be used as an alternative for CLI. + +## Prerequisites + +- Cluster with Capact installation. See the [installation tutorial](../installation/local.mdx). + +## Get started + +1. Get credentials for login to the Capact Dashboard. + + Run the following command to obtain and print user credentials: + + ```bash + export GATEWAY_USER=$(kubectl -n capact-system get secret capact-gateway -ogo-template='{{.data.username | base64decode }}') + export GATEWAY_PASS=$(kubectl -n capact-system get secret capact-gateway -ogo-template='{{.data.password | base64decode }}') + print "Username: ${GATEWAY_USER}\nPassword: ${GATEWAY_PASS}" + ``` + + Note the output of this command. + +1. Navigate to the `https://dashboard.{domain}` URL, where the `{domain}` is the domain used for Capact installation. + + For example, for local installation, the Dashboard URL is `https://dashboard.capact.local`. + +1. You will see Capact Dashboard login form. + + ![Login form](./assets/login.png) + + Use the credentials from the first step of this instruction to log in. + +1. As now you are logged in, you are ready to explore the Capact Dashboard features! + + ![Hub](./assets/hub-interfacegroups.png) + +## Advanced configuration + +You can configure Capact Dashboard in runtime, by editing ConfigMap: + +```bash +kubectl edit configmap -n capact-system capact-dashboard-runtime-cfg +``` + +To read possible configuration options, see the [Configuration](https://github.com/capactio/dashboard#configuration) section in Dashboard Readme. + +Currently, these settings won't be preserved between Capact installation upgrades. + +## See also + +If you would rather manage Capact resources with CLI tool, read the [Getting started](../cli/getting-started.mdx) document. As Capact CLI is more mature, currently it is packed with more features. diff --git a/docs/operation/_category_.json b/docs/operation/_category_.json index 05d3ec5b..7ae2cbda 100644 --- a/docs/operation/_category_.json +++ b/docs/operation/_category_.json @@ -1,4 +1,4 @@ { "label": "Operations", - "position": 8 + "position": 9 } diff --git a/hack/make-release.sh b/hack/make-release.sh index 6a732074..4710ecad 100755 --- a/hack/make-release.sh +++ b/hack/make-release.sh @@ -5,7 +5,8 @@ release::generate_docs() { local -r version="$1" npm run docusaurus docs:version "${version}" - sed -i.bak -E "s|...generateDocsRedirectsForVersion\(\"(.+)\", true\)|...generateDocsRedirectsForVersion(\"\1\"),\n ...generateDocsRedirectsForVersion(\"${version}\", true)|" "./redirects.js" + sed -i.bak -E "s|const versions = \[|const versions = \[\n \"${version}\",|" "./redirects.js" + sed -i.bak -E "s|next: true,|${version}: true,\n next: true,|" "./redirects.js" } release::update_binary_links() { diff --git a/redirects.js b/redirects.js index c743aaaa..667403cd 100644 --- a/redirects.js +++ b/redirects.js @@ -1,80 +1,165 @@ -// Remove the custom redirects until the issue is resolved: https://github.com/facebook/docusaurus/issues/3407 +// WARNING: This file is modified automatically when the `hack/make-release.sh` script is executed: +// - New version is appended to the `versions` array +// - Wherever there is a redirect with the `next: true` version rule, the new release is appended +// +// We need to maintain custom redirects as it's not handled automatically by Docusaurus: https://github.com/facebook/docusaurus/issues/3407 // NOTE: Redirects don't work in development mode. Use `npm run build` and `npm run serve` to see them in action. // // https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-client-redirects -module.exports = () => { - const redirects = [ - ...generateDocsRedirectsForVersion(""), // latest version - ...generateDocsRedirectsForVersion("next"), // unreleased version - ...generateLegacyDocsRedirectsForVersion("0.4"), - ...generateDocsRedirectsForVersion("0.5", true), // redirect from x.y version to latest - ]; +const versions = [ + "0.5", + "0.4", + "", // latest + "next", // unreleased +]; + +const latestVersion = findLatestVersion(versions); + +function generateDocsRedirectsForVersions(versions) { + const redirects = []; + for (let version of versions) { + redirects.push(...generateDocsRedirectsForVersion(version)); + } return redirects; -}; +} + +function findLatestVersion(versions) { + if (!versions) { + throw new Error("versions cannot be empty"); + } + + return ( + versions + .filter((item) => item != "" && item != "next") + // source for this basic one-line semver comparison: https://stackoverflow.com/a/65687141 + .sort((a, b) => + b.localeCompare(a, undefined, { numeric: true, sensitivity: "base" }) + )[0] + ); +} -const generateDocsRedirectsForVersion = (version, useLatestVersionAsTarget) => { +function generateDocsRedirectsForVersion(version) { const fromPrefix = version != "" ? `/docs/${version}` : "/docs"; - const toPrefix = useLatestVersionAsTarget ? `/docs` : fromPrefix; + let toPrefix = fromPrefix; - return [ + if (version === latestVersion) { + // for the latest version, redirect to URL without version number + toPrefix = "/docs"; + } + + const mapping = [ { from: `${fromPrefix}`, to: `${toPrefix}/getting-started`, + versions: { + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/installation`, to: `${toPrefix}/installation/local`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/example`, to: `${toPrefix}/example/mattermost-installation`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/content-development`, to: `${toPrefix}/content-development/guide`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/feature`, to: `${toPrefix}/feature/policies/overview`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/architecture`, to: `${toPrefix}/architecture/e2e-architecture`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/cli/commands`, to: `${toPrefix}/cli/commands/capact`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/operation`, to: `${toPrefix}/operation/common-problems`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, { from: `${fromPrefix}/cli`, to: `${toPrefix}/cli/getting-started`, + versions: { + 0.4: true, + 0.5: true, + next: true, + }, }, - ]; -}; - -const generateLegacyDocsRedirectsForVersion = (version, useLatestVersionAsTarget) => { - const fromPrefix = version != "" ? `/docs/${version}` : "/docs"; - const toPrefix = useLatestVersionAsTarget ? `/docs` : fromPrefix; - - const currentRedirect = generateDocsRedirectsForVersion(version, useLatestVersionAsTarget).filter( item => { - return item.to !== `${toPrefix}/getting-started`; - }) - - return [ - ...currentRedirect, + { + from: `${fromPrefix}/dashboard-ui`, + to: `${toPrefix}/dashboard-ui/overview`, + versions: { + next: true, + }, + }, + // legacy redirects { from: `${fromPrefix}`, to: `${toPrefix}/introduction`, + versions: { + 0.4: true, + }, }, { from: `${fromPrefix}/development`, to: `${toPrefix}/development/development-guide`, + versions: { + 0.4: true, + }, }, ]; + + const versionToCheck = version != "" ? version : latestVersion; + return mapping + .filter((item) => item.versions[versionToCheck]) + .map(({ from, to }) => ({ from, to })); +} + +module.exports = () => { + return generateDocsRedirectsForVersions(versions); }; diff --git a/versioned_docs/version-0.5/getting-started.mdx b/versioned_docs/version-0.5/getting-started.mdx index 7c8fde7a..998114e3 100644 --- a/versioned_docs/version-0.5/getting-started.mdx +++ b/versioned_docs/version-0.5/getting-started.mdx @@ -92,6 +92,6 @@ Capact Developer is a person who develops Capact themself. We use GitHub to host ## Staying Informed -Follow the [@capcatio](https://twitter.com/capactio) account on Twitter to get the latest Capact news. You can also subscribe for new [Capact](https://github.com/capactio/capact) releases on GitHub. We post there a detailed changelog for every release. +Follow the [@capactio](https://twitter.com/capactio) account on Twitter to get the latest Capact news. You can also subscribe for new [Capact](https://github.com/capactio/capact) releases on GitHub. We post there a detailed changelog for every release. For more additional content check the [Capact blog](/blog) and our [YouTube](https://www.youtube.com/channel/UCajXtDttqVuZ_Bl7M3_qA8w) channel.