Skip to content

Commit

Permalink
docs: offline docs (#1830)
Browse files Browse the repository at this point in the history
* chore: verify CI/CD

* save

* chore: verify CI/CD-2

* chore: verify CI/CD-2

* chore: verify CI/CD-2

* ci: update correct file arg

* chore: verify CI/CD-3

* chore: verify CI/CD-4

* chore: verify CI/CD-5

* chore: verify CI/CD-5

* docs: added documentation

* docs: clarified container spect

* Apply suggestions from code review

Co-authored-by: Lenny Chen <[email protected]>

---------

Co-authored-by: Lenny Chen <[email protected]>
  • Loading branch information
karl-cardenas-coding and lennessyy authored Nov 21, 2023
1 parent a5dd504 commit bfaa981
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/nightly-docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Nighly Docker Build

on:
schedule:
- cron: '15 22 * * 1-5' # 22:15 UTC, Monday through Friday
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# We cannot use our production values for nightly Docker builds as that would leak our production secrets.
ALGOLIA_ADMIN_KEY: "123456789"
ALGOLIA_APP_ID: "123456789"
ALGOLIA_SEARCH_KEY: "123456789"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"

- run: npm ci

- name: Compile
run: |
make build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-offline
# build-args:
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:nightly
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# This is the default workflow that uses the self-hosted runner. The self-hosted runner is slower than the GitHub-hosted large runner, but it does not incurr additional charges.
build-self-hosted-runner:
if: ${{ github.event.inputs.useGitHubHostedLargeRunner != 'true' || github.event_name == 'schedule' }}
name: Build Website
name: Build Website (Self-Hosted Runner)
runs-on: ["self-hosted", "linux", "x64", "vcenter3"]
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
# Use this workflow if you want to use the GitHub-hosted large runner. Useful for scenarios when you need a change to deploy faster than the self-hosted runner can build it.
build-large-runner:
if: ${{ github.event.inputs.useGitHubHostedLargeRunner == 'true' && github.event_name != 'schedule' }}
name: Build Website
name: Build Website (GitHub-Hosted Large Runner)
runs-on:
group: 'Doc Runners'
labels: docbot
Expand Down
4 changes: 4 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:80 {
root * /srv
file_server
}
8 changes: 8 additions & 0 deletions Dockerfile-offline
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM caddy:latest

COPY build /srv
COPY Caddyfile /etc/caddy/Caddyfile

EXPOSE 80 443 2015 2019

CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ Each platform guide provides detailed instructions on how to complete the pre-in

- [Checklist](checklist.md)

- [Additional Packs](supplemental-packs.md)
- [Additional Packs](supplemental-packs.md)

- [Offline Documentation](offline-docs.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
sidebar_label: "Offline Documentation"
title: "Offline Documentation"
description: "Learn how to use the Palette Vertex documentation offline."
icon: ""
hide_table_of_contents: false
sidebar_position: 60
tags: ["vertex", "enterprise", "airgap", "kubernetes", "offline"]
keywords: ["self-hosted", "vertex"]
---


If you are in an environment that requires the Palette Vertex documentation to be available offline, you can use our offline Docker image to serve the documentation locally. The image is updated nightly to ensure that the latest documentation is available. When you start the container, the documentation is available at `http://localhost:8080` and you can access it using your browser.

### Limitations

The following limitations apply when using the offline documentation:

- Only the latest version of the documentation is available.

- The search functionality is not available.

- The documentation AI helper is not available.


### Prerequisites

The following software must be installed on your system:


- A Linux environment in an AMD64 or ARM64 architecture. The Docker image is only available for Linux AMD64 and ARM64 architectures.


- [Docker](https://docs.docker.com/get-docker/) - The offline documentation is provided as a Docker image.

- A web browser.

- [tar](https://www.gnu.org/software/tar/) - This is only required if you need to deploy the offline documentation to a device without internet access.


## Deploy the Offline Documentation

1. Download and start the offline documentation container. Use the following command to start the container.

```shell
docker run --publish 8080:80 --publish 2019:2019 --rm ghcr.io/spectrocloud/librarium:nightly
```

:::info

If another process is using port `8080`, you can change the port mapping to use a different port. For example, to use port `8081`, use the following command:

```shell
docker run --publish 8081:80 --publish 2019:2019 --rm ghcr.io/spectrocloud/librarium:nightly
```

:::

2. Open a browser and navigate to `http://localhost:8080` to view the documentation.


3. If you need to deploy the offline documentation to a device without internet access, you can use the following command to save the container image to a tar file.

```shell
docker save ghcr.io/spectrocloud/librarium:nightly > docs.tar
```

4. Copy the **docs.tar** file to the device without internet access.


5. Once the **docs.tar** file is on the target device, you can load the container image using the following command.

```shell
docker load < docs.tar
```

```shell hideClipboard
5f4d9fc4d98d: Loading layer [==================================================>] 7.949MB/7.949MB
1a76f1c3e1ac: Loading layer [==================================================>] 1.369MB/1.369MB
810693419710: Loading layer [==================================================>] 28.67kB/28.67kB
ba48f3160731: Loading layer [==================================================>] 39.59MB/39.59MB
9097de2c1f3e: Loading layer [==================================================>] 523.2MB/523.2MB
0ca22615467b: Loading layer [==================================================>] 3.072kB/3.072kB
Loaded image: ghcr.io/spectrocloud/librarium:nightly
```

6. You can then start the container using the same command from step 1.

```shell
docker run --publish 8080:80 --publish 2019:2019 --rm ghcr.io/spectrocloud/librarium:nightly
```

## Validation

To validate that the offline documentation is working, open a browser and navigate to `http://localhost:8080`. The documentation should be displayed in the browser.

0 comments on commit bfaa981

Please sign in to comment.