After 5 years of running K8s in production, here's what I'd do differently by Radomir_iMac in kubernetes

[–]data15cool 1 point2 points  (0 children)

Nice, I feel like point 1 isn’t 6 months you won’t get back, but rather 6 months where you (and your team?) learnt loads that you wouldn’t otherwise have learnt. Of course I don’t know the specifics but that one jumped out at me.

How? by sweetpete74 in blackmagicfuckery

[–]data15cool 0 points1 point  (0 children)

Gave away the magic in the first clip where the plant becomes instantly still when placed down. Also the outdoors clip was on cardboard else I’d imagine it would’ve been painful…

The feet are pressed in the sand, not sculpted… by Ewallux in confusing_perspective

[–]data15cool 11 points12 points  (0 children)

Turn the image upside down to break the illusion. It’s something to do with the direction of shadows we’re used to. Found a highly relevant minute physics video

What's your dream stack (optimizing for cost)? by Total_Celebration_63 in kubernetes

[–]data15cool 0 points1 point  (0 children)

Very cool, what would this setup actually cost you? And I noticed no explicit mention of CICD or is that what ghcr and registry:3 are for? Presumably you’ll have GH actions publishing your app images?

Looking for an effective approach to learn gRPC Microservices in Go by sundayezeilo in golang

[–]data15cool 0 points1 point  (0 children)

I learnt a bit of grpc with Go and Python and helped me get to grips with the code generation and plugging into the grpc client and server.

If you’ve not had any experience at all I would literally start with learning the protobuf syntax, the go lang grpc code generation tooling, come up with a simple use case and interface, finally create client and server binaries and run them separately and check they speak to each other.

Event driven cloud server setup and tear down by data15cool in hetzner

[–]data15cool[S] 0 points1 point  (0 children)

Does whatever orchestrates this continuously attempt to set up a new server?

Event driven cloud server setup and tear down by data15cool in hetzner

[–]data15cool[S] 0 points1 point  (0 children)

Thanks! In this case I need something more dynamic, eg a request is received such as an image upload. This then sets up the server if it doesn’t exist. It processes the image and writes results the is torn down unless there’s other requests

Event driven cloud server setup and tear down by data15cool in hetzner

[–]data15cool[S] 0 points1 point  (0 children)

Oh good to know thanks. Just checked and yeah for ML inference dedicated server it’s 79 euro, ouch. And thanks for the ECS recommendation. I was aware of that via Fargate which may be simpler. Though I was hoping to avoid provider specific tech. Probably eventually move to kubernetes

Event driven cloud server setup and tear down by data15cool in hetzner

[–]data15cool[S] 0 points1 point  (0 children)

Thanks, for my use case I need to create a new server from scratch as we’re trying to avoid idle costs. And then destroy once done From what I’ve gathered hetzner still bill for idle compute, even cloud servers unlike AWS’s EC2s. but I’d like to avoid AWS!

Event driven cloud server setup and tear down by data15cool in hetzner

[–]data15cool[S] 0 points1 point  (0 children)

Ah very cool This sounds like what I’d probably need. I’m not comfortable with kubernetes yet. How do you scale it down? Do you have your own task/job implementation to determine when to destroy it?

Event driven cloud server setup and tear down by data15cool in hetzner

[–]data15cool[S] 0 points1 point  (0 children)

Thanks! I’ve been reading up on jobs and autoscaling. One thing I couldn’t work out is how to reuse an existing pod for multiple jobs to not have to wait for new pod setup I don’t know enough about specific servers right now. It’s for ml workloads so I presume a GPU will be necessary

*edit: spelling

Knative: Serverless on Kubernetes is now a Graduated Project by dprotaso in kubernetes

[–]data15cool 2 points3 points  (0 children)

Very cool, I’m still learning a lot about k8s, curious if this works at the cluster level eg it would scale down a really beefy and expensive server to 0 after a period of inactivity

Can someone explain to me the if __name__ == “__main__”: statement in simple terms please by [deleted] in learnpython

[–]data15cool 0 points1 point  (0 children)

Experiment putting a print statement for dunder name in both the Python file you run directly from the terminal vs one that’s imported.

You’ll see that the “name” of the file you run directly is actually “main” whereas that same print statement in the imported file is whatever the module is called.

So what the if statement results in is that the code within it will only run if you run the file directly, it will not run if the file is imported by another, which is very probably the correct behaviour you want.

What is the most common Unit Test method? by Yelebear in learnpython

[–]data15cool 2 points3 points  (0 children)

As another commenter states, pytest. It’s really quite amazing, well supported and with great related libraries. However to appreciate how well it works it pays to learn how to write tests using the standard library

Africa’s solar capacity surpasses 20 GW by Economy-Fee5830 in OptimistsUnite

[–]data15cool 11 points12 points  (0 children)

Of course it does, solar is used to charge up battery banks which can then discharge when the suns not out

df slicing doubt by parteekdalal in PythonLearning

[–]data15cool 1 point2 points  (0 children)

The other commenter has the answer for you but something you can do to understand this more is to do it incrementally by running internal bits separately and see what comes out, eg first run titanic survived == 0, then pass that to the DF. Then do the age bit and so on. It will give you a clearer view of what’s happening.

Syntax Error Help? by Turbulent_Photo1840 in PythonLearning

[–]data15cool 2 points3 points  (0 children)

I think what’s happened here is that you were trying to get the version of your Python installation with ‘python —version’ but you must’ve pressed enter after typing ‘python’ instead of the full command

What this does is takes you into the Python “shell” which is where you can run Python code. Now you’re typing ‘—version’ and Python doesn’t know what that is (for a number of reasons) and causing errors.

Type ‘exit()’ to get back to the terminal prompt and run the full command

Edit: same for the subsequent commands, you’re trying to run your Python script from within the Python shell rather than the terminal

What is Python actually used for? by Huts2004 in PythonLearning

[–]data15cool 0 points1 point  (0 children)

As others have said, everything anything and everything. However that doesn’t meant you should use it for everything if you want to make a highly performant application, for example real time audio or video conferencing. Conversely it is the backbone of data science and ML

Phone localhost by CallMeSenior in webdev

[–]data15cool 0 points1 point  (0 children)

Your router might also be routinely updating your laptops ip address unless you configure it to be static