I’m doing a bunch of AI stuff that needs compiling to try various unrelated apps. I’m making a mess of config files and extras. I’ve been using distrobox and conda. How could I do this better? Chroot? Different user logins for extra home directories? Groups? Most of the packages need access to CUDA and localhost. I would like to keep them out of my main home directory.

    • Lily33@kbin.social
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      NixOS containers could do what OP’s asking for, but it’ll be trickier with just nix (on other distro). It’ll handle build dependencies and such, but you’ll still need to keep your home or other directories clean some other way.

      • demesisx@infosec.pub
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 year ago

        OP could use flakes to create these dev environments and clean them up without a trace once done.

            • Lily33@kbin.social
              link
              fedilink
              arrow-up
              3
              ·
              edit-2
              1 year ago

              Does NOT delete any files that were written to, for example, ~/.local or ~/.config from dev shell.

              One of OP’s problems was,

              I’m making a mess of config files and extras.

  • voluntaryexilecat@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    I use a mixture of systemd-nspawn and different user logins. This is sufficient for experimentation, for actual use I try to package (makepkg) those tools to have them organized by my package manager.

    Also LVM thinpools with snapshots are a great tool. You can mount a dedicated LV to each single user home to keep everything separated.

  • jet@hackertalks.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 year ago

    Qubes: you can install software inside of its own disposable VM. Or it can be a persistent VM we’re only the data in home persists. Or it can be a VM where the root persists. You have a ton of control. And it’s really useful to see what’s changed in the system.

    All the other solutions here are talking about in the operating system, qubes is doing it outside the operating system

  • Kangie@lemmy.srcfiles.zip
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    I use Gentoo where builds from source are supported by the package manager. ;)

    Overall though, any containerisation option such as Docker / Podman or Singularity is what I would typically do to put things in boxes.

    For semi-persistent envs a chroot is fine, and I have a nice Gentoo-specific chroot script that makes my life easier when reproing bugs or testing software.

    • j4k3@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Wait. Does emerge support building packages natively when they are not from Gentoo?

      Most of the stuff I’m messing with is mixed repos with entire projects that include binaries for the LLMs, weights, and such. Most of the “build” is just setting up the python environment with the right dependency versions for each tool. The main issues are the tools and libraries like transformers, pytorch, and anything that interacts with CUDA. These get placed all over the file system for each build.

      • Kangie@lemmy.srcfiles.zip
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Ebuilds (Gentoo packages) are trivial to create for almost anything, so while the answer is ‘no the package manager doesn’t manage non PM packages’, typically you’ll make an ebuild (or two or three) to handle that because it’s (typically) as easy as running make yourself. :)

  • Gamey@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    I think Podman should do a good job but I never used it myself, Distrobox is build on it and a lot easier to use so that’s what I would recommend!

  • Sneaky Bastard@feddit.de
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    Not sure if that’s a good idea but if you use Fedora, you also have your root on a BTRFS partition after a default installation. You could utilize the snapshot features of BTRFS to roll back after testing.

    • j4k3@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      I need to explore this BTRFS feature, I just don’t have a good place or reason to start Dow that path yet. I’ve been on Silverblue for years, but decided to try Workstation for now. Someone in the past told me I should have been using BTRFS for FreeCAD saves, but I never got around to trying it.

  • Reborn2966@feddit.it
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    it it does not need a gui, use docker and log in into it. do the stuff and when you are done, docker rm and everything disappear.

    you can enable cuda inside the container, follow the docs for that.

    bonus point, vs code can open itself inside a container.

  • InverseParallax@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Have an lxc config that enables glx on x11 in the container, spin one up and throw stuff in there, temp zfs volume.

    Lxc-rm when done.

  • Sims@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Haven’t tried it (and don’t use docker), so a wild shot: https://github.com/jupyterhub/repo2docker

    ‘repo2docker fetches a repository (from GitHub, GitLab, Zenodo, Figshare, Dataverse installations, a Git repository or a local directory) and builds a container image in which the code can be executed. The image build process is based on the configuration files found in the repository.’

    That way you can perhaps just delete the docker image and everything is gone. Doesn’t seem to depend on jupyter…

  • Justin@apollo.town
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    I’ve never worried about this but I’d use Flatpak. The whole install goes in a specific directory and the metadata/config/data files go in their own specific directory.

    • j4k3@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Those Flatpak configs are not quite as scattered, most are in .config .var or .local. Most Flatpaks leave junk behind in these directories. I just deleted a few today. A lot of the problems start happening when you need to compile stuff where each package has the same dependency but a different version of the dep in each one. Then you have a problem and need to track down some related library that is not in the execution path and suddenly there are 10 copies of a dozen files all related to the stupid thing on your system and scattered all over the place. It becomes nearly impossible to track down which file is related to the container with the problem.

      This is only an issue if you find yourself playing in software that is not yet supported directly my any packagers for Linux distros; stuff like FOSS AI right now.

  • akik@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    edit-2
    1 year ago
    export LDFLAGS="-Wl,-rpath=/sw/app/version/lib"
    ./configure --prefix=/sw/app/version
    make
    sudo make install
    unset LDFLAGS