Skip to content

add docs for service catalog #51

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

Merged
merged 3 commits into from
Jun 9, 2025
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
1 change: 1 addition & 0 deletions .vale/styles/spelling-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ schema_mapping
scrollbar
scrollable
sdk
Streamlit
subcommand
subnet
subtyping
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tasks.py
labeler.yml
labels.yml
workflows/
ci.yml (only adding part)
ci.yml ## only adding part
sync-docs.yml
```

Expand All @@ -63,22 +63,25 @@ tasks.py
docs/
docusaurus.config.ts
sidebars.ts
docs/<projectname> <— Put docs here
docs/ ## Put docs here
.github/
workflows/
ci.yml (only adding part)
sync-docs.yml (paths)
ci.yml ## only adding part
sync-docs.yml ## paths
```

- `chmod 755 .github/build-docs.sh`

- In `infrahub-docs`:
### In `infrahub-docs` modify the following

```console
docs/sidebars-<projectname>.ts
docs/docs-<projectname>/<projectname>/readme.mdx <-- Placeholder
docs/docusaurus.config.ts <-- Add a plugin and navbar entry
touch docs/sidebars-<projectname>.ts
mkdir docs/docs-<projectname>
touch docs/docs-<projectname>/readme.mdx ### Placeholder
vi docs/docusaurus.config.ts ### Add a plugin and navbar entry
```

### Remaining tasks

- Setup Cloudflare Pages Integration
- Create PRs and test
77 changes: 77 additions & 0 deletions docs/docs-service-catalog/readme.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: PoC for Service Catalog
---

import CodeBlock from '@theme/CodeBlock';

This repository is a proof of concept for service catalog using Infrahub and Streamlit.

## Running the demo

### Clone the repository

Clone the GitHub repository to the server you will run this demo on:

```shell
git clone https://github.com/opsmill/infrahub-demo-service-catalog.git
cd infrahub-demo-service-catalog
```

### Prerequisites

Before you get started, make sure the following tools are installed:

- ✅ **Infrahub Docker Compose Requirements**
Follow the [Infrahub installation guide](https://docs.infrahub.app/guides/installation#docker-compose) to set up the necessary Docker Compose environment.

- 🐍 **Poetry**
Install Poetry by following the [official installation guide](https://python-poetry.org/docs).

- 🧪 **Containerlab (For Lab Testing)**
If you plan to run lab topologies, you'll also need [Containerlab](https://containerlab.dev/install/).

### Set environmental variables

```shell
export INFRAHUB_ADDRESS="http://localhost:8000"
export INFRAHUB_API_TOKEN="06438eb2-8019-4776-878c-0941b1f1d1ec"
```

### Install the Infrahub SDK

Our demos use [poetry](https://python-poetry.org/) to manage the Python environment.

```shell
poetry install
```

### Start Infrahub

```shell
poetry run invoke start
```

### Load schema and data into Infrahub

```shell
infrahubctl schema load schemas/
infrahubctl object load data/
```

### Connect read-only repository

```shell
infrahubctl repository add --ref main --read-only infrahub-demo https://github.com/opsmill/infrahub-demo-service-catalog.git
```

### Spin service catalog app

```shell
streamlit run service_catalog/🏠_Home_Page.py`
```

### Login

👉 Login to [Infrahub UI](http://localhost:8000/login) on port `8000` with username `admin` and password `infrahub`

👉 You can connect to [Service catalog](http://localhost:8501/) on port `8501`
2 changes: 1 addition & 1 deletion docs/docs/getting-started/next-steps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Then you can connect the repository to Infrahub using the Infrahub CLI or the we

<ReferenceLink title="Connect a repository to Infrahub" url="../guides/repository"/>

## Going Further
## Going further

:::success

Expand Down
16 changes: 16 additions & 0 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ const config: Config = {
sidebarPath: './sidebars-infrahubctl.ts',
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'docs-service-catalog',
path: 'docs-service-catalog',
routeBasePath: 'demo-service-catalog',
sidebarCollapsed: false,
sidebarPath: './sidebars-service-catalog.ts',
},
],
],
themes: [
[
Expand Down Expand Up @@ -260,6 +270,12 @@ const config: Config = {
label: "demo-dc-fabric",
docsPluginId: "docs-demo",
},
{
type: "docSidebar",
sidebarId: "servicecatalogSidebar",
label: "demo-service-catalog",
docsPluginId: "docs-service-catalog",
},
{
type: "docSidebar",
sidebarId: "schemaSidebar",
Expand Down
9 changes: 9 additions & 0 deletions docs/sidebars-service-catalog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';

const sidebars: SidebarsConfig = {
servicecatalogSidebar: [
'readme',
]
};

export default sidebars;