webology, to django
@webology@mastodon.social avatar

For any + users out there, I was struggling for several days because template and code changes were only being picked up once per session and then cached to infinity.

I switched from back to vanilla Docker and that problem went away.

So I think they might have a bug or something else that's non-obvious. I checked and didn't see an issue logged yet.

I like Orbstack a lot, but what a frustrating bug to fight.

governa, to random
@governa@fosstodon.org avatar

Attackers Planted Millions of Imageless Repositories on #Docker Hub :docker:

The purported metadata for each these containers had embedded links to malicious files.

https://www.darkreading.com/cyber-risk/attackers-planted-millions-of-imageless-repositories-on-docker-hub

89luca89, to opensource
@89luca89@fosstodon.org avatar

Hi all!

Glad to announce release 1.7.2 of #distrobox

Many bugfixes, and a couple of behavioural improvements that will resolve lots of future issues!

Take a look at the changelog here!

https://github.com/89luca89/distrobox/releases/tag/1.7.2.0

#OpenSource #containers #podman #docker #linux

whydoesnothingwork, to linux
@whydoesnothingwork@mastodon.social avatar
pjk, to python
@pjk@www.peterkrupa.lol avatar

One thing you notice right away about LLMs is they bear a striking resemblance to that ubiquitous internet character, the reply-guy: they always have an answer, they are brimming with confidence, and they are often completely wrong.

It seemed only natural, then, to turn one into a full-time online version of itself, RGaaS (Reply-Guy as a Service), always on, always ready to reply to anything when summoned, with an “Actually,” followed by his (it’s always a “he”) opinion on what you should be thinking.

And so I built the Actually Bot.

https://www.peterkrupa.lol/wp-content/uploads/2024/05/actually_bot1.pngBasically, the way it works is that any user can reply to any Mastodon post (or I guess any post on the ActivityPub protocol) and tag the Actually Bot (@actuallybot) and it will reply with its most mediocre take on why everyone else is wrong, or at least not quite right.

The reply-guys can all move on to something else now, I have automated them out of a job.

This was a really fun project and has a lot of separate parts. First, I had to modify an LLM to give it the right “personality” for this job. To do this, I used Ollama, a tool for running open source LLMs locally, on your own machine. I used the “customized prompt feature”: You basically write a little file that Ollama uses to tweak the LLM of your choosing to give it certain characteristics. I went with the new Llama3:8b model from Meta as my base model, then put the following instructions in my modelfile:

FROM llama3PARAMETER temperature 3SYSTEM """You are receiving social media posts as prompts, and your job is to reply to these prompts. Please start all your replies with the word "actually". Reply as if you know more than everyone. You must recontextualize every prompt and correct or amend it, informing the prompter that they are wrong, even if ever so slightly. You write in short, sentences. Your replies must be short. Keep them to about three sentences. This is essential: keep your replies short. They must be under 500 characters."""

Then I ran the following command in the console:

ollama create actually_llama -f ./actually_llama

… and my model was ready to roll. Next, I needed a program to connect to the Ollama API to send the LLM prompts and get responses. Python was great for that, as both Ollama and Mastodon have solid Python libraries. Probably the slowest part was picking through Mastodon.py to figure out how the methods work and what exactly they return. It’s a very robust library with a million options, and fortunately it’s also extremely well documented, so while it was slow going, I was able to whack it together without too much trouble.

I’m not going to get into all the code here, but basically, I wrote a simple method that checks mentions, grabs the text of a post and the post it is replying to, and returns them for feeding into the LLM as the prompt.

Despite my very careful, detailed, and repetitive instructions to be sure replies are no more than 500 characters, LLMs can’t count, and they are very verbose, so I had to add a cleanup method that cuts the reply down to under 500 characters. Then I wrote another method for sending that cleaned-up prompt to Ollama and returning the response.

The main body starts off by getting input for the username and password for login, then it launches a while True loop that calls my two functions, checking every 60 seconds to see if there are any mentions and replying to them if there are.

OK it works! Now came the hard part, which was figuring out how to get to 100% uptime. If I want the Actually Bot to reply every time someone mentions it, I need it to be on a machine that is always on, and I was not going to leave my PC on for this (nor did I want it clobbering my GPU when I was in the middle of a game).

So my solution was this little guy:

https://www.peterkrupa.lol/wp-content/uploads/2024/05/lenovo.jpg… a Lenovo ThinkPad with a 3.3GHz quad-core i7 and 8gb of RAM. We got this refurbished machine when the pandemic was just getting going and it was my son’s constant companion for 18 months. It’s nice to be able to put it to work again. I put Ubuntu Linux on it and connected it to the home LAN.

I actually wasn’t even sure it would be able to run Llama3:8b. My workstation has an Nvidia GPU with 12gb of VRAM and it works fine for running modest LLMs locally, but this little laptop is older and not built for gaming and I wasn’t sure how it would handle such a heavy workload.

Fortunately, it worked with no problems. For running a chatbot, waiting 2 minutes for a reply is unacceptable, but for a bot that posts to social media, it’s well within range of what I was shooting for, and it didn’t seem to have any performance issues as far as the quality of the responses either.

The last thing I had to figure out was how to actually run everything from the Lenovo. I suppose I could have copied the Python files and tried to recreate the virtual environment locally, but I hate messing with virtual environments and dependencies, so I turned to the thing everyone says you should use in this situation: Docker.

This was actually great because I’d been wanting to learn how to use Docker for awhile but never had the need. I’d installed it earlier and used it to run the WebUI front end for Ollama, so I had a little bit of an idea how it worked, but the Actually Bot really made me get into its working parts.

So, I wrote a Docker file for my Python app, grabbed all the dependencies and plopped them into a requirements.txt file, and built the Docker image. Then I scr’d the image over to the Lenovo, spun up the container, and boom! The Actually Bot was running!

Well, OK, it wasn’t that simple. I basically had to learn all this stuff from scratch, including the console commands. And once I had the Docker container running, my app couldn’t connect to Ollama because it turns out, because Ollama is a server, I had to launch the container with a flag indicating that it shared the host’s network settings.

Then once I had the Actually Bot running, it kept crashing when people tagged it in a post that wasn’t a reply to another post. So, went back to the code, squashed bug, redeploy container, bug still there because I didn’t redeploy the container correctly. There was some rm, some prune, some struggling with the difference between “import” and “load” and eventually I got everything working.

Currently, the Actually Bot is sitting on two days of uninterrupted uptime with ~70 successful “Actually,” replies, and its little laptop home isn’t even on fire or anything!

Moving forward, I’m going to tweak a few things so I can get better logging and stats on what it’s actually doing so I don’t have to check its posting history on Mastodon. I just realized you can get all the output that a Python script running in a Docker container prints with the command docker logs [CONTAINER], so that’s cool.

The other thing I’d like to do is build more bots. I’m thinking about spinning up my own Mastodon instance on a cheap hosting space and loading it with all kinds of bots talking to each other. See what transpires. If Dead Internet Theory is real, we might as well have fun with it!

https://www.peterkrupa.lol/2024/05/01/actually-building-a-bot-is-fun/

image/jpeg

dotnet, to dotnet
@dotnet@dotnet.social avatar

🔐Secure your container build and publish with .NET 8

.NET 8 has new security features for containers, including non-root images and SDK tools. Discover how to create non-root container images, configure Kubernetes pods, and inspect images and containers for enhanced security.

https://devblogs.microsoft.com/dotnet/secure-your-container-build-and-publish-with-dotnet-8/

#dotnet #docker

mttaggart, to Cybersecurity

Okay 20% of repos is...high.

Our research reveals that nearly 20% of these public repositories (almost three million repositories!) actually hosted malicious content. The content ranged from simple spam that promotes pirated content, to extremely malicious entities such as malware and phishing sites, uploaded by automatically generated accounts.

jfrog.com/blog/attacks-on-docker-with-millions-of-malicious-repositories-spread-malware-and-phishing-scams/

#Docker #CyberSecurity #ThreatIntel

Datenproletarier, to debian German
@Datenproletarier@chaos.social avatar

The more you know, man kann Docker einfach neu installieren und alle Container bleiben bestehen!

Ich hatte Docker auf Debian über 'apt install docker.io' installiert, damit bekommt man aber eine alte, inoffizielle Version (v20.10.24).

Nun bin ich mutig der offiziellen Anleitung gefolgt, habe alle alten Pakete, die zu Docker gehören entfernt und stattdessen 'docker-ce' installiert (v26.1.0).

Und siehe da, alle Container laufen noch/wieder.

https://docs.docker.com/engine/install/debian/

#Docker #Debian #Linux

fell, to random
@fell@ma.fellr.net avatar

I'm a Docker (or containers in general) non-believer. I simply don't believe in the promises it makes.

Docker is supposed to be easy to set up, easy to update, easy to migrate and always works. However, I've head plenty of stories where a container setup doesn't want to work, doesn't want to update or doesn't work after migrating. It's the same shit.

I'll stick to plain old system packages and there is absolutely nothing that will stop me.

pieceofthepie, to Laravel
@pieceofthepie@n8e.dev avatar

#ProLifeTip. Put more effort into periodically reinforcing the learning that got you to this point in your career, because at some point you might spend a weekend implementing something from scratch and realising you've literally forgotten it all.

The wheel aren't rusty, they've fallen off.

How does one work with #Laravel?
What is a Dockerfile? WTF is Vite?

#SeniorMyArse #SoftwareDeveloper #Dev #Docker #Linux #PHP

ramikrispin, to python
@ramikrispin@mstdn.social avatar

(1/3) I am excited to share that my course - Data Pipeline Automation with GitHub Actions Using R and Python 🚀, is now available on LinkedIn Learning!

The course provides an introduction to setting up automation with GitHub Actions with both R and Python. Throughout the course, we will use a real-life example by working with the U.S. Energy Information Administration (EIA) API for data automation. 🧵👇🏼

Baa, to SCP
@Baa@mk.absturztau.be avatar

If SCP had used Docker maybe they wouldn't suffer so many breaches

ainmosni, to homelab
@ainmosni@berlin.social avatar

As my old NUC was showing its age, and didn't suffice for my #homelab needs anymore, I decided to build a new one. And because I prefer running all my #selfhosted in containers, but abhor fucking around with #docker and docker-compose, it's a single-node #k8s cluster, using #k3s, just like my old server. One big difference is that the new server has a decent amount of drives for storage. I decided to set up #zfs to manage that, and zfs is all it's cracked up to be.

#selfhosting

Baa, to random
@Baa@mk.absturztau.be avatar

Maybe the python container isn't a great use-case... is this why everyone uses alpine?

Baa,
@Baa@mk.absturztau.be avatar

ohhh OK, Python has slim and alpine images too of which Alpine is the smallest at about 20Mib
Is there a downside to using them?

https://hub.docker.com/_/python/tags?page=&page_size=&ordering=&name=3.10

#python #docker

leanpub, to devops
@leanpub@mastodon.social avatar

Learn Kubernetes & Docker - .NET Core, Java, Node.JS, PHP or Python by Arnaud Weil is free with a Leanpub Reader membership! Or you can buy it for $11.99! http://leanpub.com/k8s

vwbusguy, to random
@vwbusguy@mastodon.online avatar

It's weird that the #Docker Hub CLI tool isn't obviously hosted on Docker Hub.

schenklklopfer, to random German
@schenklklopfer@chaos.social avatar

Ich hab die Faxen mit jetzt langsam Dicke...

Jetzt wurden die Fixes für 26 nur in der kostenpflichtigen BE veröffentlicht, nicht in der kostenlosen CE.

Gibt's da eine brauchbare Alternative?

Ich brauch eigentlich nur was, das mir Infos zu laufenden Stacks im Docker Cluster anzeigt.
Logs, Inspect, Exitcodes, Overviews etc.

Logs hab ich in Loki, Overviews im Dashboard, aber den Rest bekomm ich nicht ersetzt...

Widowild1, to Synology French
@Widowild1@mastodon.xyz avatar

basculement de #gitea vers #forgejo sous #docker, c’est assez simple. #synology
il suffit de changer dans votre docker-compose l’image de gitea pour forgejo.

raulo, to linux

Do you trust #paperlessngx enough to be run with your personal documents on a public webserver?

#linux #selfhosting #docker #selfhost #podman #paperless

frankel, to random
@frankel@mastodon.top avatar
wyri, to random
@wyri@haxim.us avatar

Great, really should have a look at #chainguard based #Docker images: JavaScript Actions in Alpine containers are only supported on x64 Linux runners. Detected Linux Arm64

floehopper, to random
@floehopper@ruby.social avatar

I've yet to work on a project where the Docker / docker-compose setup actually makes setting up the development simpler or makes the developer experience more pleasant...

#docker

ramikrispin, to python
@ramikrispin@mstdn.social avatar

Thanks to @medium Staff for selecting my recent article - Introduction to Multi-Stage Image Build for Python 🐍, for a boost ❤️!

This tutorial provides a step-by-step guide for converting a regular Python Dockerfile into a multi-stage build 🚀.

🔗: https://medium.com/towards-data-science/introduction-to-multi-stage-image-build-for-python-41b94ebe8bb3

linuxmagazine, to linux
@linuxmagazine@fosstodon.org avatar
ramikrispin, to python
@ramikrispin@mstdn.social avatar

(1/4) 𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧 𝐭𝐨 𝐌𝐮𝐥𝐭𝐢-𝐒𝐭𝐚𝐠𝐞 𝐈𝐦𝐚𝐠𝐞 𝐁𝐮𝐢𝐥𝐝 🐳 𝐟𝐨𝐫 𝐏𝐲𝐭𝐡𝐨𝐧 🐍

The size of the Docker image could quickly increase during the build time. I became more mindful of the image size when I started to deploy on Github Actions. The bigger the image size, the longer the run time and the higher the runtime cost.

This is when you should consider using a multi-stage build 🚀.

🧵👇🏼

#docker #mlops #python #DataScience #medium

ramikrispin,
@ramikrispin@mstdn.social avatar

(4/4) I created the following tutorial for setting up a dockerized Python environment using a multi-stage approach 👇🏼

https://medium.com/towards-data-science/introduction-to-multi-stage-image-build-for-python-41b94ebe8bb3

Happy Build! 🐳🏗️

#Docker #MLops #Python #DataScience #medium

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • modclub
  • mdbf
  • everett
  • Youngstown
  • rosin
  • slotface
  • love
  • khanakhh
  • kavyap
  • ngwrru68w68
  • ethstaker
  • DreamBathrooms
  • anitta
  • magazineikmin
  • tester
  • tacticalgear
  • InstantRegret
  • osvaldo12
  • Durango
  • cubers
  • normalnudes
  • Leos
  • cisconetworking
  • GTA5RPClips
  • provamag3
  • JUstTest
  • All magazines