diff --git a/Makefile b/Makefile index b725d1f7..267735cb 100644 --- a/Makefile +++ b/Makefile @@ -175,3 +175,8 @@ release: $(GORELEASER) ## Runs goreleaser for catalogd. By default, this will ru quickstart: $(KUSTOMIZE) generate ## Generate the installation release manifests and scripts $(KUSTOMIZE) build config/default | sed "s/:devel/:$(GIT_VERSION)/g" > catalogd.yaml + +.PHONY: demo-update +demo-update: + hack/scripts/generate-asciidemo.sh + diff --git a/README.md b/README.md index ced6775b..f78a1d7a 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,10 @@ Catalogd is a Kubernetes extension that unpacks [file-based catalog (FBC)](https Catalogd helps customers discover installable content by hosting catalog metadata for Kubernetes extensions, such as Operators and controllers. For more information on the Operator Lifecycle Manager (OLM) v1 suite of microservices, see the [documentation](https://github.com/operator-framework/operator-controller/tree/main/docs) for the Operator Controller. -## Quick start +## Quickstart DEMO +[![asciicast](https://asciinema.org/a/623845.svg)](https://asciinema.org/a/623845) +## Quickstart Steps **NOTE:** Procedure steps marked with an asterisk (`*`) are likely to change with future API updates. 1. To install catalogd, navigate to the [releases](https://github.com/operator-framework/catalogd/releases/) page, and follow the install instructions included in the release you want to install. diff --git a/docs/demo.gif b/docs/demo.gif deleted file mode 100644 index f2128908..00000000 Binary files a/docs/demo.gif and /dev/null differ diff --git a/hack/scripts/demo-script.sh b/hack/scripts/demo-script.sh new file mode 100755 index 00000000..416c1798 --- /dev/null +++ b/hack/scripts/demo-script.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT +# Welcome to the catalogd demo +make kind-cluster-cleanup +kind delete cluster +make kind-cluster +kubectl cluster-info --context kind-catalogd +sleep 10 +make install +sleep 10 +# inspect crds (catalog) +kubectl get crds -A + +# create a catalog +kubectl apply -f config/samples/core_v1alpha1_catalog.yaml +# shows catalog-sample +kubectl get catalog -A +# waiting for catalog to report ready status +time kubectl wait --for=condition=Unpacked catalog/operatorhubio --timeout=1h + +# port forward the catalogd-catalogserver service to interact with the HTTP server serving catalog contents +(kubectl -n catalogd-system port-forward svc/catalogd-catalogserver 8080:80)& + +# check what 'packages' are available in this catalog +curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.package") | .name' +# check what channels are included in the wavefront package +curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.channel") | select(.package == "wavefront") | .name' +# check what bundles are included in the wavefront package +curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.bundle") | select(.package == "ack-acm-controller") | .name' + diff --git a/hack/scripts/generate-asciidemo.sh b/hack/scripts/generate-asciidemo.sh index ccc80c61..5b0a29c4 100755 --- a/hack/scripts/generate-asciidemo.sh +++ b/hack/scripts/generate-asciidemo.sh @@ -1,45 +1,44 @@ #!/usr/bin/env bash -# run against a local copy of https://github.com/grokspawn/asciidemo-tools -# ../asciidemo-tools/generate-gif.sh hack/scripts/generate-asciidemo.sh docs/demo.gif + +set -v + +trap cleanup SIGINT SIGTERM EXIT SCRIPTPATH="$( cd -- "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )" -ASCIIDEMO_TOOLS=../asciidemo-tools/demo-functions.sh -REPO="https://github.com/operator-framework/catalogd" - -. $ASCIIDEMO_TOOLS - -function run() { - typeline -x "# Welcome to the catalogd demo" - typeline "make kind-cluster-cleanup" - typeline "kind delete cluster" - typeline "make kind-cluster" - typeline "kubectl cluster-info --context kind-catalogd" - sleep 10 - typeline "make install" - sleep 10 - # inspect crds (catalog) - typeline 'kubectl get crds -A' - - typeline -x "# create a catalog" - typeline "kubectl apply -f config/samples/core_v1alpha1_catalog.yaml" # or other - typeline "kubectl get catalog -A" # shows catalog-sample - typeline -x "# waiting for catalog to report ready status" - typeline "time kubectl wait --for=condition=Unpacked catalog/operatorhubio --timeout=1h" - - # port forward the catalogd-catalogserver service - typeline -x "# port forward the catalogd-catalogserver service to interact with the HTTP server serving catalog contents" - typline "kubectl -n catalogd-system port-forward svc/catalogd-catalogserver 8080:80" - - # inspect packages - typeline -x "# check what 'packages' are available in this catalog" - typeline "curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == \"olm.package\") | .name'" - # inspect channels - typeline -x "# check what channels are included in the wavefront package" - typeline "curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == \"olm.channel\") | select(.package == \"wavefront\") | .name'" - # inspect bundles - typeline -x "# check what bundles are included in the wavefront package" - typeline "curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == \"olm.bundle\") | select(.package == \"ack-acm-controller\") | .name'" +function check_prereq() { + prog=$1 + if ! command -v ${prog} &> /dev/null + then + echo "unable to find prerequisite: $1" + exit 1 + fi } -run +function cleanup() { + if [ -d $WKDIR ] + then + rm -rf $WKDIR + fi +} + + +WKDIR=$(mktemp -td generate-asciidemo.XXXXX) +if [ ! -d ${WKDIR} ] +then + echo "unable to create temporary workspace" + exit 2 +fi + +for prereq in "asciinema curl" +do + check_prereq ${prereq} +done + + +curl https://raw.githubusercontent.com/zechris/asciinema-rec_script/main/bin/asciinema-rec_script -o ${WKDIR}/asciinema-rec_script +chmod +x ${WKDIR}/asciinema-rec_script +screencast=${WKDIR}/catalogd-demo.cast ${WKDIR}/asciinema-rec_script ${SCRIPTPATH}/demo-script.sh + +asciinema upload ${WKDIR}/catalogd-demo.cast +