Not crazy at all, actually, I can relate to some extent š although, I am super happy with Talos on my nodes š
I feel like I amā¦staying familiar - love the optimism! - by building container images based on different distros simply because, depending on what you want to package, youāreā¦encouraged by the individual devs to use this or that package manager anyway š but sounds like you do enjoy pain, so go for it š
Regarding different distros: yes, absolutely possible! Considering that swarm development is basically stopped the risk of inconsistencies is lower than back in the days but Iād pin the engine version on all nodes and only explicitly upgrade all at the same time to a newer version.
Regarding swarm itself, even though I understand your desire, Iād recommend to have a look at something else. Have you had a look at Nomad for instance? Itās not compose compatible but I guess these days itās a simple prompt to convert the compose files, itās supposed to be simpler than K8s and still offers many perks (like the failover you are looking for).
Also, from what I just read, Proxmox is working on improving the container support to allow ānativeā containers (inside VMs similar to Kata containers). Theyāre not there yet but I am wondering if itās worth the effort from your side right now š
If you donāt mind Iād be interested in how the cloudinit for proxmox looks like š
So far I only used it for Azure and Hetzner Cloud to bootstrap Coder machines but from your description Iād expect that should work.
Very cool approach!
I tend to do manual bootstrapping with local execution as well but when using Forgejo/Gitea and corresponding actions you could also init the repo, start building your pipeline and use act to run it (locally at first if course) and as soon as you have your infrastructure in place you could continue to use the same pipeline there?
Still not ideal/perfect but if you donāt want to depend on some SaaS then this at least already runs the automation as it will be later?
I can imagine howā¦exhausting these discussions were š
Apart from the more synthetic examples and the obvious things like iterating custom containers - I understand your argument that this is not a every day use case but there are certainly some use cases - there are things like:
iterating a bufio.Scanner
iterating SQL results
streaming chunked HTTP results
That can benefit from the range-over-func approach.
Furthermore thereās another āclassā of tasks that are quite a good fit: generators š
Think of an infinite slice of random numbers or Fibonacci numbers or prime numbersā¦all of this can be expressed as a function you can iterate and ājust stopā as soon as you have enough.
Probably this gives you an idea what else the whole experiment is good for š
Edit: thereās for instance a Python library letting you generate the holidays of a state for the next 1000 years based on some algorithm without having the data pre-calculated/stored anywhere but you can iterate/filter/⦠whatever you want
Iād like to add that in my perception youāre a little bit overreacting. I canāt say that I got the same impression that you apparently got from the first comment. To me it sounds as if itās primarily about missing some depth and could use some more advanced examples - especially when compared to the post Russ Cox wrote š no offense!
Havenāt copied it yet to an editor so just a few things:
naming convention in Go is camelCase not snake_case
prefer to accept io.Reader over opening files in every function. Improves testability but also is best practice
return errors whenever possible instead of just logging them or do something about if you can (like creating a file if it doesnāt exist yet if it makes sense) - donāt use panic if you donāt have to! Panics are only a last resort if thereās no way to handle the error gracefully, think: compile a regex as a global variable that you need and thatās static, the expression wonāt change magically so thereās no way the program can continue without a valid expression
move logic to some package (== sub-directory with a package name != main) and have at least one function with a PascalCase name to call from you main package. Functions starting with a capital letter are public whereas functions starting with a lowercase letter are private - not by convention but enforced by the compiler!
For a more thorough review Iāve to get to a computer but probably someone else has some more tips for you :)
Not crazy at all, actually, I can relate to some extent š although, I am super happy with Talos on my nodes š I feel like I amā¦staying familiar - love the optimism! - by building container images based on different distros simply because, depending on what you want to package, youāreā¦encouraged by the individual devs to use this or that package manager anyway š but sounds like you do enjoy pain, so go for it š
Regarding different distros: yes, absolutely possible! Considering that swarm development is basically stopped the risk of inconsistencies is lower than back in the days but Iād pin the engine version on all nodes and only explicitly upgrade all at the same time to a newer version.
Regarding swarm itself, even though I understand your desire, Iād recommend to have a look at something else. Have you had a look at Nomad for instance? Itās not compose compatible but I guess these days itās a simple prompt to convert the compose files, itās supposed to be simpler than K8s and still offers many perks (like the failover you are looking for).
Also, from what I just read, Proxmox is working on improving the container support to allow ānativeā containers (inside VMs similar to Kata containers). Theyāre not there yet but I am wondering if itās worth the effort from your side right now š
Either way, have fun! A fellow homelab buddy š
If you donāt mind Iād be interested in how the cloudinit for proxmox looks like š So far I only used it for Azure and Hetzner Cloud to bootstrap Coder machines but from your description Iād expect that should work. Very cool approach!
I tend to do manual bootstrapping with local execution as well but when using Forgejo/Gitea and corresponding actions you could also init the repo, start building your pipeline and use act to run it (locally at first if course) and as soon as you have your infrastructure in place you could continue to use the same pipeline there?
Still not ideal/perfect but if you donāt want to depend on some SaaS then this at least already runs the automation as it will be later?
I can imagine howā¦exhausting these discussions were š
Apart from the more synthetic examples and the obvious things like iterating custom containers - I understand your argument that this is not a every day use case but there are certainly some use cases - there are things like:
That can benefit from the range-over-func approach.
Furthermore thereās another āclassā of tasks that are quite a good fit: generators š Think of an infinite slice of random numbers or Fibonacci numbers or prime numbersā¦all of this can be expressed as a function you can iterate and ājust stopā as soon as you have enough.
Probably this gives you an idea what else the whole experiment is good for š
Edit: thereās for instance a Python library letting you generate the holidays of a state for the next 1000 years based on some algorithm without having the data pre-calculated/stored anywhere but you can iterate/filter/⦠whatever you want
I think this https://github.com/golang/go/discussions/56413 is the discussion.
Also an interesting read from Russ Cox: https://research.swtch.com/coro
Iād like to add that in my perception youāre a little bit overreacting. I canāt say that I got the same impression that you apparently got from the first comment. To me it sounds as if itās primarily about missing some depth and could use some more advanced examples - especially when compared to the post Russ Cox wrote š no offense!
Havenāt copied it yet to an editor so just a few things:
For a more thorough review Iāve to get to a computer but probably someone else has some more tips for you :)
Also check out the docs for testing https://pkg.go.dev/testing should hopefully get you started
Thereās also an experiment from the core dev team now: https://go.dev/blog/gonew that comes with 2 very basic templates that might be worth a look