Skip to content

Commit

Permalink
add: practices doc
Browse files Browse the repository at this point in the history
  • Loading branch information
codekow committed Sep 16, 2023
1 parent 95dcc6a commit 1dacc3b
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .wordlist-md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ UI
Weaviate
Workspaces
ack
addr
adhoc
adm
alongsecret
Expand Down Expand Up @@ -110,6 +111,7 @@ cli
clientSecret
clusterissuer
clusterrolebinding
conf
config
configmap
configs
Expand Down Expand Up @@ -141,6 +143,7 @@ godmode
gp
gpus
grafana
gui
homelab
html
htpass
Expand Down Expand Up @@ -193,12 +196,14 @@ oc
ocp
ocs
odf
ok
opendatahub
openshift
opentlc
operatorGroup
operatorGroups
patchesJson
podman
popd
postgres
pre
Expand All @@ -207,11 +212,16 @@ priorityclass
prometheus
pushd
pvc
pwd
quickstart
rbac
rc
rcd
rclone
redhat
redistributions
repo
reusability
rhdp
rhel
rhods
Expand Down Expand Up @@ -242,6 +252,7 @@ sublicense
tekton
templating
thanos
tmp
traefik
triggerer
useable
Expand Down
77 changes: 77 additions & 0 deletions docs/PRACTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Recommended Practices (Draft)

Below are recommended practices or references.

## Building Demos

Common cli tools across platforms:

- `git`
- `bash`
- `oc` / `kubectl`
- `python` (v3)

Considerations

- ALWAYS **start** with a `README.md`
- One sentence is ok
- Ex: Title: Weather Toaster, Body: I want to build a toaster that controls the weather
- ALWAYS commit to `git` - do you see what I did there? :)
- Use a public `git` location - We can always rewrite (git) history to make it look perfect
- One click solutions - Ex: `scripts/bootstrap.sh`
- Offer a solution that takes less than 5 minutes of user interaction to complete (your automation can take longer)
- Exception: When you are building training into your demo
- Make friends / Collaborate - Have ~~strange people~~ others test your work
- Regular peer reviews (short and frequent)
- 3 days max between peer review
- Goal: avoid *"it worked on my machine..."*
- Modular design - Build for reuse
- *How can I make this easy for someone to reuse my work?*

Architecture

- Assume minimum privilege for the user / demo
- Ex: may only have access to namespace vs `cluster-admin`
- Use appropriate role bindings (avoid admin)
- Use the minimum number of cli tools and dependencies
- Scripting - avoid complex functions (`bash`, `python`, `Makefile`)
- Attempt to show commands for manual operations
- Use functions for reusability
- *Can I cut and paste?*

## Data Science

Recommendations

- Data sets as container images
- Use a container to store your data set
- Serve via `http` protocol - `s3`, `webdav`
- `minio`, `rclone serve`, `httpd`
- Push to public repo (`quay.io`, `ghcr.io`)

TODO

- Build an example of containerizing a data set

```
RC_USER=admin
RC_PASS=rclone
cat > rclone.conf <<CONFIG
[local]
type = local
CONFIG
podman run \
-it \
--rm \
-v $(pwd):/data \
-p 8080:8080 \
docker.io/rclone/rclone \
rcd \
--config /tmp/rclone.conf \
--rc-web-gui \
--rc-addr :8080 \
--rc-user ${RC_USER} \
--rc-pass ${RC_PASS}
```

0 comments on commit 1dacc3b

Please sign in to comment.