-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ca5a43
commit 36ef7ae
Showing
15 changed files
with
745 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Tests with spread | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-spread-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
spread_job: ['github-ci:ubuntu-22.04-amd64:tests/spread/', 'github-ci:ubuntu-22.04-amd64:tests/spread/scenario/'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
check-latest: true | ||
go-version: 'stable' | ||
|
||
- name: Install spread | ||
run: | | ||
go install github.com/snapcore/spread/cmd/spread@latest | ||
- name: Run tests | ||
run: | | ||
sudo adduser --gecos "" --disabled-password ubuntu | ||
echo "ubuntu:ubuntu" | sudo chpasswd | ||
spread ${{ matrix.spread_job }} | ||
- name: Tmate debugging session | ||
if: ${{ failure() }} | ||
uses: mxschmitt/action-tmate@v3 | ||
timeout-minutes: 15 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
myst-parser==4.0.0 | ||
sphinx-markdown-builder==0.6.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'NetBox' | ||
copyright = '2024, Canonical' | ||
author = 'Canonical' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [ | ||
"myst_parser", | ||
"sphinx_markdown_builder", | ||
] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'alabaster' | ||
html_static_path = ['_static'] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=. | ||
set BUILDDIR=_build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
########################################### | ||
# IMPORTANT | ||
# Comments matter! | ||
# The docs use the wrapping comments as | ||
# markers for including said instructions | ||
# as snippets in the docs. | ||
########################################### | ||
summary: Getting started with NetBox Tutorial | ||
|
||
execute: | | ||
. "$CRAFT_TEST_LIB_PATH"/test-helpers.sh | ||
# configure minio | ||
export AWS_ACCESS_KEY_ID=minio | ||
export AWS_SECRET_ACCESS_KEY=supersuperkey | ||
IPADDR=$(ip -4 -j route get 2.2.2.2 | jq -r '.[] | .prefsrc') | ||
export AWS_ENDPOINT_URL="http://${IPADDR}:9000" | ||
export AWS_BUCKET=netbox | ||
export AWS_REGION=us-west-1 | ||
mkdir -p ${HOME}/minio/data | ||
docker run -d -p 9000:9000 -p 9001:9001 --user $(id -u):$(id -g) --name minio -e "MINIO_ROOT_USER=minioadmin" -e "MINIO_ROOT_PASSWORD=minioadmin" -v ${HOME}/minio/data:/data quay.io/minio/minio server /data --console-address ":9001" | ||
retry -n 5 --wait 2 docker exec minio mc config host add minio http://127.0.0.1:9000 minioadmin minioadmin | ||
docker exec minio mc config host add minio http://127.0.0.1:9000 minioadmin minioadmin | ||
docker exec minio mc admin user svcacct add --access-key "${AWS_ACCESS_KEY_ID}" --secret-key "${AWS_SECRET_ACCESS_KEY}" minio minioadmin | ||
docker exec minio mc mb "minio/${AWS_BUCKET}" | ||
docker exec minio mc ls minio | ||
# [docs:juju-add-model] | ||
juju add-model netbox-tutorial | ||
# [docs:juju-add-model-end] | ||
# [docs:juju-deploy-netbox] | ||
juju deploy netbox | ||
# [docs:juju-deploy-netbox-end] | ||
# [docs:netbox-config-allowed-hosts] | ||
juju config netbox django-allowed-hosts='*' | ||
# [docs:netbox-config-allowed-hosts-end] | ||
# [docs:juju-deploy-redis] | ||
juju deploy redis-k8s --channel=latest/edge | ||
# [docs:juju-deploy-redis-end] | ||
# [docs:juju-integrate-redis-netbox] | ||
juju integrate redis-k8s netbox | ||
# [docs:juju-integrate-redis-netbox-end] | ||
# [docs:juju-netbox-postgresql] | ||
juju deploy postgresql-k8s --channel 14/stable --trust | ||
juju integrate postgresql-k8s netbox | ||
# [docs:juju-netbox-postgresql-end] | ||
# [docs:juju-netbox-s3] | ||
juju deploy s3-integrator --channel edge | ||
juju config s3-integrator endpoint="${AWS_ENDPOINT_URL}" bucket="${AWS_BUCKET}" path=/ region="${AWS_REGION}" s3-uri-style=path | ||
juju wait-for application s3-integrator --query='name=="s3-integrator" && (status=="active" || status=="blocked")' | ||
juju run s3-integrator/leader sync-s3-credentials access-key="${AWS_ACCESS_KEY_ID}" secret-key="${AWS_SECRET_ACCESS_KEY}" | ||
juju integrate s3-integrator netbox | ||
# [docs:juju-netbox-s3-end] | ||
# [docs:traefik] | ||
juju deploy traefik-k8s --channel edge --trust | ||
# juju config traefik-k8s external_hostname=<netbox_hostname> | ||
juju config traefik-k8s routing_mode=path | ||
juju integrate traefik-k8s netbox | ||
# [docs:traefik-end] | ||
juju wait-for application traefik-k8s | ||
juju wait-for application netbox | ||
# [docs:traefik-show-endpoints] | ||
juju run traefik-k8s/0 show-proxied-endpoints --format=yaml | ||
# [docs:traefik-show-endpoints-end] | ||
NETBOX_URL=$( juju run traefik-k8s/0 show-proxied-endpoints --format=json | jq -r '."traefik-k8s/0".results."proxied-endpoints"' | jq -r '.netbox.url' ) | ||
curl --fail "${NETBOX_URL}" | grep "Home | NetBox" | ||
COMMAND=( | ||
# [docs:netbox-create-superuser] | ||
juju run netbox/0 create-superuser username=admin [email protected] | ||
# [docs:netbox-create-superuser-end] | ||
--format=json | ||
) | ||
echo ${COMMAND[@]} | ||
PASSWORD=$( ${COMMAND[@]} | jq -r '."netbox/0".results.password' ) | ||
# just test that we can get a token with the admin user. | ||
curl -H "Accept: application/json" -H "Content-Type: application/json" --fail "${NETBOX_URL}/api/users/tokens/provision/" -X POST -d "{\"username\": \"admin\", \"password\": \"${PASSWORD}\"}" |
Oops, something went wrong.