-
Notifications
You must be signed in to change notification settings - Fork 14
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
Showing
2 changed files
with
88 additions
and
0 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
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} | ||
``` |