14 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

6 comments

  1. hairypotter
    Link
    I released v0.5.0 of https://github.com/robinovitch61/kl, my Kubernetes log viewer for your terminal. I'm excited about optimizing it further and adding things like in-memory analysis of logs:...

    I released v0.5.0 of https://github.com/robinovitch61/kl, my Kubernetes log viewer for your terminal.

    I'm excited about optimizing it further and adding things like in-memory analysis of logs: grouping by similarity for anomaly detection, visualizations for log volume by time, etc

    5 votes
  2. xk3
    (edited )
    Link
    I've been looking into new ways to manage a few different servers that I have. Over the past year, I've really enjoyed working with immutable updates provided by ostree in Fedora IoT. It's the...

    I've been looking into new ways to manage a few different servers that I have. Over the past year, I've really enjoyed working with immutable updates provided by ostree in Fedora IoT. It's the same technology that is used in Fedora Silverblue (and the other atomic desktops).

    One interesting technology that has come out from this is ostree native containers--which are essentially bootable containers. Really cool concept but in practice it is not all that needed because everyone is already used to using the Cloud--even something like Kubernetes is seemingly a lower maintenance burden than having to know some hardware details, right?* But I still think it is interesting so I've been digging into this area... I guess one of the main reasons why it is interesting to me is cost reduction. Even something like DigitalOcean's App Platform is 2x the cost of a DigitalOcean VPS and they only give you 100 GB of egress--the pricing is much more competitive if you manage your app containers on your own.

    A couple years ago, in an effort to make ostree native containers more universal (to eventually support debian based distributions) the project bootc was created. Right now it is still a bit experimental and only supports containers which use rpm-ostree. It seems that bootc and dnf5 will eventually replace ostree native containers.

    The workflow for using bootc looks like this:

    1. Write your own base image using examples from Fedora bootc examples or CoreOS OstreeNativeContainer layering examples

    For example:

    FROM quay.io/fedora/fedora-bootc:41
    
    RUN dnf group install -y container-management workstation-product
    
    RUN dnf install -y bootc cloud-init \
            rust \
            krb5-workstation \
            ripgrep \
            tmux
    
    RUN systemctl set-default graphical.target && bootc container lint
    
    1. Build the bootable container with podman build (or podman -c podman-machine-default-root build if you want to use podman-bootc locally)
    2. (optional) Use podman-bootc run if you want to test-run the created image via libvirt
    3. bootc switch to boot into the built OS or upload the gzip'd qcow2 disk image to something like DigitalOcean as a custom OS image
    4. Switch to rpm-ostree updates if you aren't planning on making frequent container image releases with security updates...

    For example, to enable rpm-ostree auto-updates (if you aren't planning on updating the container registry which is kind of the point of deploying via container but maybe you don't know how to use PXE like me so you are using bootc instead of just using the default, more popular, OS images or learning k8s, etc):

    echo AutomaticUpdatePolicy=apply | sudo tee -a /etc/rpm-ostreed.conf
    sudo rpm-ostree reload
    sudo systemctl edit --force --full rpm-ostreed-automatic.timer  # change to however many hours or days
    sudo systemctl enable rpm-ostreed-automatic.timer --now
    rpm-ostree status
    

    This last point makes it a bit obvious why bootable containers are not super useful--but switching to frequent updates is flexible enough and the tooling might be more comfortable than something like virt-manager, QEMU, Virtualbox, etc. More details here. But if you are already used to using those technologies there is really nothing novel provided here.

    During container-driven updates (bootc), your /var/home and /etc is unchanged (3-way merge when /home or /etc files are changed within the container image); this is similar to existing rpm-ostree updates. More details here

    It's not possible to embed containers inside of bootable containers due to a limitation in the OCI container tar format--but you can write services that will pull and start containers once the bootable container has booted.

    Here are a few interesting links I've been able to gather:

    * I don't think k8s is all that bad but it's definitely trying to solve too many problems at once. Something lighter-weight like Nomad (to handle bin-packing) and bootc might work really well. But you might not even need bootc and you might not even need Nomad... etc

    edit: I put together a more complete example of how to use it here:
    https://github.com/chapmanjacobd/computer/tree/main/.github/bootc/server

    Unfortunately, it seems like bootc-image-builder wants the container image in /var/lib/containers/storage but podman-bootc run wants it inside of the podman-machine-default-root VM so you have to build it twice ?? :/

    4 votes
  3. [3]
    Wulfsta
    Link
    I wrote an extremely barebones 3D printer slicer for implicit surfaces over the course of a weekend, so here it is, I guess! Much of the reasoning can be found in the README, happy to answer any...

    I wrote an extremely barebones 3D printer slicer for implicit surfaces over the course of a weekend, so here it is, I guess! Much of the reasoning can be found in the README, happy to answer any questions.

    WeekendSlicer

    4 votes
    1. [2]
      Weldawadyathink
      Link Parent
      I looked through the implicit function website that is linked in the readme, but I’ll admit that it went way over my head. If you don’t mind, could you explain what makes this unique from typical...

      I looked through the implicit function website that is linked in the readme, but I’ll admit that it went way over my head. If you don’t mind, could you explain what makes this unique from typical cad and slicing? Like what can you do with this technique that you can’t do with current tools?

      Anyway, this looks very cool! I couldn’t imagine building a slicer myself.

      2 votes
      1. Wulfsta
        Link Parent
        Well, the core difference is that this format represents volumes rather than boundary surfaces. That is, formats like STL and STEP only hold data about the boundaries of the objects they...

        Well, the core difference is that this format represents volumes rather than boundary surfaces. That is, formats like STL and STEP only hold data about the boundaries of the objects they represent, whereas in this representation you actually have to figure out where these boundaries are (where the equation that represents the surface is satisfied). The arguably best technique used to do this (at least to my knowledge about the state of the art) is dual contouring. Since Fidget is extremely fast at this, it exposes simple manipulations of the representation (as long as the SDF is “correct”) to achieve things like determining the path of a perimeter. In my opinion, these should also allow for extremely simple manipulations for top and bottom surface detection, infill generation (of certain kinds of infill), and interesting opportunities for things like support generation. Broadly, it is interesting to me because I think these manipulations, possibly combined with some post-processing of the generated paths, would be easier to write and maintain than the alternatives that already exist. It is also not necessarily less computationally intense than current slicers, and writing transformations to go from boundary surface representations to correct SDFs is nontrivial, but I think doable. I will likely return to working on it if Fidget implements 2D path generation, so I don’t have to extract paths from generated 3D meshes, with the next milestone to be slicing a benchy.

        1 vote
  4. Akir
    Link
    So around the start of last week I thought I would do something that is both a good professional show and an interesting project for me personally. I decided to make a video game from scratch....

    So around the start of last week I thought I would do something that is both a good professional show and an interesting project for me personally. I decided to make a video game from scratch.

    Well, actually none of that is accurate. It’s not a good professional development because I’m writing it in Lua with LÖVE and I have zero intention of working for a big video game company whatsoever. I don’t think I’d even be trying to work for indie studios either because the design patterns I’ve learned in enterprise-land do not really work well for this!

    Really, this is a very challenging project for me. This is going to be the first program I’ve written at this scale. Right now I’m having a hard time even figuring out where to start. I’m copying the mechanical game design from Shining Force so I’m not blowing in the wind creatively, but I’m finding it hard to figure out how to structure things because all of the tutorials I’ve found focus on how to do action games, which are surprisingly more simple (which is good in a way, because I want to experiment with a tactics/action game at some point in the future, but it really doesn’t help me now).

    I’m taking something of a break from it at the moment because I need to make a few assets and make some decisions on how the game will look in terms of resolution and relative sizing, and before I could even get to that point I needed to clean up the room enough so that I could get to the monitor we have with the digitizer because I can only barely draw with a pen trying to use a mouse is madness. But the act of cleaning and seeing the end result has been good for my mental state because it feels like an accomplishment; a great thing to see after you’ve realized the scope of the work you’re trying to take on.

    Somewhat ironically I will likely need to learn Unity for my job so I can teach it to children. That’s going to be fun and not make me regret deciding to make the game from scratch at all.

    3 votes