Skip to content

Commit

Permalink
fixed mermaid in relevant pages
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeeu committed Sep 12, 2023
1 parent 23cf170 commit 50576c5
Show file tree
Hide file tree
Showing 25 changed files with 269 additions and 227 deletions.
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,9 @@ news_link: 'https://google.com'

## Mermaid

Mermaid is loaded into content pages only when the boolean frontmatter variable `mermaid` is set to `true`.
The Docsy theme supports Mermaid diagrams. See https://www.docsy.dev/docs/adding-content/diagrams-and-formulae/#diagrams-with-mermaid

1. Use the `mermaid` shortcode to make sure your graph isn't processed as markdown:

```
{{< mermaid >}}
graph TB
clouddriver(Clouddriver) --> clouddriver-caching(Clouddriver-Caching);
clouddriver --> clouddriver-rw(Clouddriver-RW);
clouddriver --> clouddriver-ro(Clouddriver-RO);
clouddriver --> clouddriver-ro-deck(Clouddriver-RO-Deck)
classDef default fill:#d8e8ec,stroke:#39546a;
linkStyle default stroke:#39546a,stroke-width:1px,fill:none;
classDef split fill:#42f4c2,stroke:#39546a;
class clouddriver-caching,clouddriver-ro,clouddriver-ro-deck,clouddriver-rw,echo-scheduler,echo-worker split
{{< /mermaid >}}
```

2. Add the frontmatter variable to the page: `mermaid: true`.

## Custom YouTube Shortcode

Expand Down
2 changes: 1 addition & 1 deletion assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
@import 'homepage-hero';
@import 'slick-theme';
@import 'slick';
@import 'docs';
@import 'navbar';


h3 {
margin-bottom: 1.6rem;
}
Expand Down
25 changes: 0 additions & 25 deletions assets/scss/docs.scss

This file was deleted.

2 changes: 2 additions & 0 deletions assets/scss/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
margin-left: 15px;
}
}


.navbar-expand .navbar-nav .nav-link {
padding-right: 1rem;
padding-left: 1rem;
Expand Down
39 changes: 22 additions & 17 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
baseURL = "/"
title = "Spinnaker"

enableRobotsTXT = true
enableInlineShortcodes = true
# Will give values to .Lastmod etc.
enableGitInfo = true

# Hugo allows theme composition (and inheritance). The precedence is from left to right.
theme = ["github.com/google/docsy", "github.com/google/docsy/dependencies"]
# Language configuration
[languages]
[languages.en]
Expand Down Expand Up @@ -67,8 +67,6 @@ proxy = "direct"
[[module.mounts]]
source = "content/en"
target = "content"
# Will give values to .Lastmod etc.
enableGitInfo = true

# Language settings
contentDir = "content/en"
Expand All @@ -79,6 +77,15 @@ enableMissingTranslationPlaceholders = true

disableKinds = ["taxonomy", "taxonomyTerm"]

# Google Analytics configuration
# https://gohugo.io/templates/internal/#configure-google-analytics
# https://www.docsy.dev/docs/adding-content/feedback/#adding-analytics
googleAnalytics = "G-H0XE7ESBFR"

# Configure how URLs look like per section.
[permalinks]
blog = "/:section/:year/:month/:day/:slug/"

# Highlighting config (copied from the docsy example site, tag v0.7.1)
pygmentsCodeFences = true
pygmentsUseClasses = false
Expand Down Expand Up @@ -127,23 +134,16 @@ pygmentsStyle = "dracula"



# Configure how URLs look like per section.
[permalinks]
blog = "/:section/:year/:month/:day/:slug/"

# Image processing configuration.
[imaging]
resampleFilter = "CatmullRom"
quality = 75
anchor = "smart"

# Google Analytics configuration
# https://gohugo.io/templates/internal/#configure-google-analytics
# https://www.docsy.dev/docs/adding-content/feedback/#adding-analytics
googleAnalytics = "G-H0XE7ESBFR"
# Comment out the next line to disable GA tracking.
# This Tag ID can be found in Google Analytics -> Admin Panel -> Data Streams -> Spinnaker Website - GA4 -> Configure Tag Settings
# google_tag_id="GT-W6BN9SN" this was for a custom fix in the site with the older theme version





# Everything below this are Site Params
[params]
Expand All @@ -166,7 +166,7 @@ archived_version = false
# The version number for the version of the docs represented in this doc set.
# Used in the "version-banner" partial to display a version number for the
# current doc set.
version = "latest"
version = "Latest"

# A link to latest version of the docs. Used in the "version-banner" partial to
# point people to the main doc site.
Expand All @@ -177,6 +177,9 @@ github_repo = "https://github.com/spinnaker/spinnaker.io"
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
github_project_repo = "https://github.com/spinnaker/spinnaker"

# Enable Algolia DocSearch
algolia_docsearch = false

# Enable Lunr.js offline search
offlineSearch = true
offlineSearchMaxResults = 50
Expand All @@ -194,6 +197,8 @@ offlineSearchSummaryLength = 200
[params.ui]
# Enable to show the side bar menu in its compact state.
sidebar_menu_compact = true
sidebar_menu_foldable= true
sidebar_cache_limit = 10
# Set to true to disable breadcrumb navigation.
breadcrumb_disable = false
# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled)
Expand Down
2 changes: 2 additions & 0 deletions content/en/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ contrib_text:
who_should_use_header: 'Who should use Spinnaker?'
who_should_use_text: 'Spinnaker provides application management and deployment to help you release software changes with high velocity and confidence. Spinnaker is an open-source, multi-cloud continuous delivery platform that combines a powerful and flexible pipeline management system with integrations to the major cloud providers. If you are looking to standardize your release processes and improve quality, Spinnaker is for you. '
---

{{% promoBanner %}}
4 changes: 2 additions & 2 deletions content/en/docs/guides/runbooks/orca-quality-of-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This promotion process happens (by default) on a 5-second interval on every Orca

With both `BufferPolicy` and `PromotionPolicy`, the results of each function returns a result with a human readable "reason", which is logged out for each execution that is evaluated so it is easy to trace.

{{< mermaid >}}
```mermaid
sequenceDiagram
participant ExecutionPersister
participant ExecutionBufferActuator
Expand Down Expand Up @@ -71,7 +71,7 @@ note over ExecutionPromoter: For each promoted execution
ExecutionPromoter->>ExecutionPersister: Update Execution status to NOT_STARTED
ExecutionPromoter->>ExecutionLauncher: Start Execution
end
{{< /mermaid >}}
```

**Note**: This is the first implementation of the QoS system, we plan to iterate on this concept and make it more advanced over time.
You can read the [original proposal][proposal] to get an idea of a potential roadmap.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mermaid: true

There are three basic players in Spinnaker's authentication workflow:

{{< mermaid >}}
```mermaid
graph LR
classDef default fill:#d8e8ec,stroke:#7a8288;
linkStyle default stroke:#7a8288, stroke-width:2px, fill:none;
Expand All @@ -22,7 +22,7 @@ gate-->deck
deck-->idp
idp-->deck
{{< /mermaid >}}
```

1. **Deck**: Spinnaker's UI. Consists of a set of static HTML, JavaScript, and CSS files. Generally
served from an Apache server, but there is nothing special about Apache that makes Deck work.
Expand All @@ -41,7 +41,7 @@ Deck is a Javascript Single Page Application (SPA). This means that when a user
process below involves numerous redirects between the three parties (Deck, Gate, and the
Identity Provider).

{{< mermaid >}}
```mermaid
sequenceDiagram
participant Apache
Expand All @@ -56,7 +56,7 @@ sequenceDiagram
Note right of Gate: No or expired session cookie.
Gate->>-Deck: Returns empty response
{{< /mermaid >}}
```

1. Browser requests Deck's landing page: `https://deck.url:9000/`

Expand All @@ -68,7 +68,7 @@ sequenceDiagram

1. Without a user logged in, Deck requests a _protected_ URL: `https://gate.url:8084/auth/redirect?to=https://deck.url:9000`.

{{< mermaid >}}
```mermaid
sequenceDiagram
participant Deck
participant Gate
Expand All @@ -85,13 +85,13 @@ participant IdentityProvider
Deck->>+IdentityProvider: GET https://idp.url/?redirect_uri=gate.url/login
IdentityProvider->>-Deck: Login Page
{{< /mermaid >}}
```

1. Given that the URL is protected, Gate sees that there is no logged-in user, so it issues an HTTP 302
redirect to an authentication-method-specific page. It saves the requested URL
(`https://gate.url:8084/auth/redirect?to=https://deck.url:9000`) in the session state.

{{< mermaid >}}
```mermaid
sequenceDiagram
participant Deck
participant Gate
Expand All @@ -107,7 +107,7 @@ participant IdentityProvider
IdentityProvider->>-Gate: .
deactivate Gate
{{< /mermaid >}}
```

1. In the case of LDAP, the `/login` page is hosted in Gate and is a basic form asking for credentials. Gate attempts to
establish a session (preferably over SSL) with the LDAP server, sending the username and password. If successful,
Expand All @@ -122,7 +122,7 @@ participant IdentityProvider
1. Gate processes the received data. This can include making additional requests to confirm the
user's identity.

{{< mermaid >}}
```mermaid
sequenceDiagram
participant Deck
participant Gate
Expand All @@ -135,13 +135,13 @@ Gate->>-Deck: HTTP 302 /auth/redirect?to=deck.url
Deck->>+Gate: GET /auth/redirect?to=deck.url
Note right of Gate: URL is protected, but user is authenticated. Proceed!
Gate->>-Deck: HTTP 302 to deck.url
{{< /mermaid >}}
```

1) Upon successful processing, the user is now considered logged in. Gate retrieves the originally requested URL from the session state. It issues an HTTP 302 to that URL (`https://gate.url:8084/auth/redirect?to=https://deck.url:9000`).

1) The request from the browser hits the API gateway, along with the session cookie from the newly logged in user. The `to` query parameter is validated to be the associated Deck instance, and a final HTTP 302 is sent, directing the user to the `https://deck.url:9000`.

{{< mermaid >}}
```mermaid
sequenceDiagram
participant Apache
participant Deck
Expand All @@ -156,7 +156,7 @@ Gate->>-Deck: HTTP 302 to deck.url
activate Deck
Note right of Deck: User logged in! Huzzah!
deactivate Deck
{{< /mermaid >}}
```

1) Repeat this process from step 1. Now, the response from `https://gate.url:8084/auth/user` will contain a proper JSON object and the rest of the application will proceed to load.

Expand All @@ -167,7 +167,7 @@ The OAuth specification defines numerous flows for various scenarios. Spinnaker
OAuth
flow looks like:

{{< mermaid >}}
```mermaid
sequenceDiagram
participant Deck
Expand All @@ -183,7 +183,7 @@ flow looks like:
Deck->>+IdentityProvider: GET https://idp.url/userLogin?client_id=foo...
IdentityProvider->>-Deck: Returns login page
{{< /mermaid >}}
```

1. User attempts to access a protected resource.

Expand All @@ -202,7 +202,7 @@ flow looks like:
`email profile` to access the user's email address.

1. OAuth provider prompts user for username & password.
{{< mermaid >}}
```mermaid
sequenceDiagram
participant Deck
Expand All @@ -215,14 +215,14 @@ flow looks like:
Deck->>+IdentityProvider: User confirms
IdentityProvider->>-Deck: HTTP 302 to https://gate.url/login?code=abcdef
{{< /mermaid >}}
```

1. OAuth provider confirms that the user is granting Gate access to their profile.

1. Using the `redirect_uri`, the OAuth provider redirects the user to this address, providing an
additional `code` parameter.

{{< mermaid >}}
```mermaid
sequenceDiagram
participant Deck
Expand All @@ -237,7 +237,7 @@ flow looks like:
ResourceServer->>-Gate: Respondes with JSON of user profile information
Note left of Gate: Gate extracts data based on userInfoMapping
Gate->>-Deck: HTTP 302 to originally requested URL
{{< /mermaid >}}
```

1. Gate uses this `code` parameter to request an _access token_ from the OAuth provider's token
server.
Expand Down
5 changes: 2 additions & 3 deletions content/en/docs/reference/architecture/loab/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description:
mermaid: true
---

{{< mermaid >}}
```mermaid
sequenceDiagram
Title: Life of a Bake
Expand Down Expand Up @@ -49,5 +49,4 @@ Orca->>Rosco: Poll until task completion
Rosco->>Redis: Query bake status
Orca->>Redis: Update execution state
end

{{< /mermaid >}}
```
4 changes: 2 additions & 2 deletions content/en/docs/reference/architecture/load/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mermaid: true
description:
---

{{< mermaid >}}
```mermaid
sequenceDiagram
Title: Life of a deployment
Expand Down Expand Up @@ -49,4 +49,4 @@ Deck->>Gate: Poll until orchestration completion
Gate->>Orca: Query orchestration status
Orca->>Redis: Query execution status
end
{{< /mermaid >}}
```
Loading

0 comments on commit 50576c5

Please sign in to comment.