-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌱 updates to enable autogenerated demo, hosted out-of-tree (#212)
* updates to support automated demo generation Signed-off-by: Jordan Keister <jordan@nimblewidget.com> * review updates Signed-off-by: Jordan Keister <jordan@nimblewidget.com> --------- Signed-off-by: Jordan Keister <jordan@nimblewidget.com>
- Loading branch information
Showing
5 changed files
with
77 additions
and
40 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
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
Binary file not shown.
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,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=1m | ||
|
||
# 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 == "wavefront") | .name' | ||
|
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 |
---|---|---|
@@ -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 | ||
|