-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc/tutorial/kubernetes: tidy up and move to github.com/cue-examples #824
Comments
Original reply by @pfiaux in cuelang/cue#824 (comment) Hey, I'm not sure if this is the right place to post but I recently completed the tutorial (this weekend) and ran into a few issues. Let me know if I should create a separate issue instead. There are the ones I remember, I looked at a few commits above and didn't see them sorry if I missed them. The dump command uses After generating definitions from the go code and adding k8s_defs.cue I couldn't dump anymore (i.e.
|
Original reply by @myitcv in cuelang/cue#824 (comment) Thanks @pfiaux. One of the challenges with the tutorial is that we do not, currently, faithfully execute each command as the user would. This issue is precisely about fixing it so that we do, in order that we don't run into problems of the sort you have reported. One way of achieving that would be to re-run the tutorial within a docker container that has |
Original reply by @pfiaux in cuelang/cue#824 (comment) From what I remember with dry run you don't actually need much from the cluster itself, just a connection (I think at the time I ran it against an empty minikube cluster i had locally). I've had some luck getting k3s/k3d (https://github.com/rancher/k3d) running locally, I haven't tried in a pipeline tho. I'm not familiar with github actions would https://github.com/AbsaOSS/k3d-action be a possible solution? There's also https://kind.sigs.k8s.io/ but image looks bigger and I have no idea how easy it is. |
Original reply by @myitcv in cuelang/cue#824 (comment)
Thanks, this is useful. I just managed to get
I'm sure something like that works, yes, but we need something that will work client side here, in case changes need to be made to the tutorial. The Appreciate your suggestions! |
Original reply by @myitcv in cuelang/cue#824 (comment) Whilst waiting at the dentist (random, I realise) I made a bit more progress on this using The Docker image I am using is defined here: https://github.com/play-with-go/docker/tree/cue-kubernetes-tutorial/cue-kubernetes-tutorial A partially converted guide can be found here: As an aide memoire, that guide can be regenerated via:
Proof that this setup works with |
Over time the Kubernetes tutorial has gone a bit stale: * the output from commands has gone stale; * we have larger diffs than expected in some situations; * we are not asserting the success of each step, which means that steps can fail and it go unnoticed; * we are not re-running the tutorial as part of CI; * we are not running the entire tutorial, we skip certain commands; * the tests in doc/tutorial/kubernetes pass even when critical files are missing (again because we ignore the exit code of all commands we run). The ultimate fix is to migrate to a living tutorial at: https://github.com/cue-examples/kubernetes-tutorial (which follows the same pattern as our FOSDEM 2022 talk). For now, this CL patches things up to reduce the diffs between what the end user sees in real life and the guide. Changes include: * reordering of original YAML inputs so that the first the first trim (effectively a key part of the ) For #824 Signed-off-by: Paul Jolly <paul@myitcv.io> Change-Id: Ie965fd24d710da69b18f0108e5415e6321859f8d
Over time the Kubernetes tutorial has gone a bit stale: * the output from commands has gone stale; * we have larger diffs than expected in some situations; * we are not asserting the success of each step, which means that steps can fail and it go unnoticed; * we are not re-running the tutorial as part of CI; * we are not running the entire tutorial, we skip certain commands; * the tests in doc/tutorial/kubernetes pass even when critical files are missing (again because we ignore the exit code of all commands we run). The ultimate fix is to migrate to a living tutorial at: https://github.com/cue-examples/kubernetes-tutorial (which follows the same pattern as our FOSDEM 2022 talk). For now, this CL patches things up to reduce the diffs between what the end user sees in real life and the guide. Changes include the following. Reordering of original YAML inputs so that the first the first trim shows zero diff output. This is a hack for now but important because cue trim being lossless is a key part of the demo. cue diff (or some variant of that command) will obviate the need for fixing the order like this. Fixing kubectl --dry-run flag to match the current standard. Updating the number of lines in the output of wc post-cue trim. Add a couple of missing re-baselines of snapshot. Fix various typos. Consistently use `wc -l` and `diff -wu` for readability purposes. Format all CUE code consistently with cue fmt. Use a stable version of k8s.io/api/apps/v1@v0.23.4 for the cue get go step. For #824 Signed-off-by: Paul Jolly <paul@myitcv.io> Change-Id: Ie965fd24d710da69b18f0108e5415e6321859f8d
Over time the Kubernetes tutorial has gone a bit stale: * the output from commands has gone stale; * we have larger diffs than expected in some situations; * we are not asserting the success of each step, which means that steps can fail and it go unnoticed; * we are not re-running the tutorial as part of CI; * we are not running the entire tutorial, we skip certain commands; * the tests in doc/tutorial/kubernetes pass even when critical files are missing (again because we ignore the exit code of all commands we run). The ultimate fix is to migrate to a living tutorial at: https://github.com/cue-examples/kubernetes-tutorial (which follows the same pattern as our FOSDEM 2022 talk). For now, this CL patches things up to reduce the diffs between what the end user sees in real life and the guide. Changes include the following. Reordering of original YAML inputs so that the first the first trim shows zero diff output. This is a hack for now but important because cue trim being lossless is a key part of the demo. cue diff (or some variant of that command) will obviate the need for fixing the order like this. Fixing kubectl --dry-run flag to match the current standard. Updating the number of lines in the output of wc post-cue trim. Add a couple of missing re-baselines of snapshot. Fix various typos. Consistently use `wc -l` and `diff -wu` for readability purposes. Format all CUE code consistently with cue fmt. Use a stable version of k8s.io/api/apps/v1@v0.23.4 for the cue get go step. For #824 Signed-off-by: Paul Jolly <paul@myitcv.io> Change-Id: Ie965fd24d710da69b18f0108e5415e6321859f8d
Over time the Kubernetes tutorial has gone a bit stale: * the output from commands has gone stale; * we have larger diffs than expected in some situations; * we are not asserting the success of each step, which means that steps can fail and it go unnoticed; * we are not re-running the tutorial as part of CI; * we are not running the entire tutorial, we skip certain commands; * the tests in doc/tutorial/kubernetes pass even when critical files are missing (again because we ignore the exit code of all commands we run). The ultimate fix is to migrate to a living tutorial at: https://github.com/cue-examples/kubernetes-tutorial (which follows the same pattern as our FOSDEM 2022 talk). For now, this CL patches things up to reduce the diffs between what the end user sees in real life and the guide. Changes include the following. Reordering of original YAML inputs so that the first the first trim shows zero diff output. This is a hack for now but important because cue trim being lossless is a key part of the demo. cue diff (or some variant of that command) will obviate the need for fixing the order like this. Fixing kubectl --dry-run flag to match the current standard. Updating the number of lines in the output of wc post-cue trim. Add a couple of missing re-baselines of snapshot. Fix various typos. Consistently use `wc -l` and `diff -wu` for readability purposes. Format all CUE code consistently with cue fmt. Use a stable version of k8s.io/api/apps/v1@v0.23.4 for the cue get go step. For #824 Signed-off-by: Paul Jolly <paul@myitcv.io> Change-Id: Ie965fd24d710da69b18f0108e5415e6321859f8d
Over time the Kubernetes tutorial has gone a bit stale: * the output from commands has gone stale; * we have larger diffs than expected in some situations; * we are not asserting the success of each step, which means that steps can fail and it go unnoticed; * we are not re-running the tutorial as part of CI; * we are not running the entire tutorial, we skip certain commands; * the tests in doc/tutorial/kubernetes pass even when critical files are missing (again because we ignore the exit code of all commands we run). The ultimate fix is to migrate to a living tutorial at: https://github.com/cue-examples/kubernetes-tutorial (which follows the same pattern as our FOSDEM 2022 talk). For now, this CL patches things up to reduce the diffs between what the end user sees in real life and the guide. Changes include the following. Reordering of original YAML inputs so that the first the first trim shows zero diff output. This is a hack for now but important because cue trim being lossless is a key part of the demo. cue diff (or some variant of that command) will obviate the need for fixing the order like this. Fixing kubectl --dry-run flag to match the current standard. Updating the number of lines in the output of wc post-cue trim. Add a couple of missing re-baselines of snapshot. Fix various typos. Consistently use `wc -l` and `diff -wu` for readability purposes. Format all CUE code consistently with cue fmt. Use a stable version of k8s.io/api/apps/v1@v0.23.4 for the cue get go step. For #824 Signed-off-by: Paul Jolly <paul@myitcv.io> Change-Id: Ie965fd24d710da69b18f0108e5415e6321859f8d Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/533453 Unity-Result: CUEcueckoo <cueckoo@cuelang.org> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
Update: I've retitled this to better reflect the goal to move the Kubernetes tutorial outside of the main repo. A WIP translation to a |
I believe https://review.gerrithub.io/c/cue-lang/cue/+/1192692 and https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1192689 resolved this issue :) |
Originally opened by @myitcv in cuelang/cue#824
Here are the remaining TODOs following a recent review of the Kubernetes tutorial as part of https://cue-review.googlesource.com/c/cue/+/8961:
doc/tutorial/kubernetes
pass even when critical files are missing (again because we ignore the exit code of all commands we run)The tutorial still "works" it's just that a user following along might well, understandably, be thrown by discrepancies.
Fundamentally we need to fix the scenario where today, running
CUE_UPDATE=1 go test ./...
using Go 1.16 breaks by removing a series of files indoc/tutorial/kubernetes/quick/**/*.cue
.Ideally we fix this by making the tutorial a guide that is re-run with an appropriate Docker image using
preguide
. That however raises the question of whether the tutorial should continue to live as part of the main repo:We could/should use something like https://github.com/thetirefire/badidea for a minimal Kubernetes setup so that the guide can run
kubectl
2022-05-19 update: progress being made over in https://github.com/cue-examples/kubernetes-tutorial.
The text was updated successfully, but these errors were encountered: