• Picked up my new work machine for Callisto last night; ended up finding an acceptable Mac Mini M1 with 16GB of RAM.

  • Working on pleasings/bin/push today.

    • I’m going to translate my old Python code into Go for this- it’s small enough that I should be able to get it done in a day.

    • x/crypto/ssh and github.com/pkg/sftp should be all I need for this, honestly.

    • Realizing that adding the --arch option to the push alias might not be the best idea, since I think it will also compile the Go code in pleasings/bin/push/internal to be linux_amd64… which would make it impossible to run on my Mac. Looking into how to selectively set architectures for targets.

      • It looks like this IS possible, but requires some finagling. I had to setup an arch() in the root-level BUILD, as well as set architectures for the go_toolchain to actually allow cross-compilation.

      • Once these were setup, using the ///<arch>//<target> syntax for a build target worked.

    • Got targeted cross-compilation working without requiring nested plz invocations.

    • Interesting little snippet for dealing with splitting a newline-delimited string into an array in Bash, stolen from here:

      set -o noglob
      IFS=$'\n' paths=($PATHS)
      set +o noglob
      
    • I discovered an interesting bit in my Goodwater code archive- a set of BUILD targets that creates and pushes a Docker image. Code can be found in @operations//common/docker, and contains a Python 3-compatible image setup. Should be pretty easy to adapt this for use in Go projects like Callisto.

    • Still worried about DNS lookups, wondering if there are additional flags I need to add, maybe to go_stdlib?

    • In porting this code to Go, I’m going to drop some of the additional sysadmin work that I have coded in the original. I think the ideal workflow right now is:

      • Upload all the files into a common service account, let’s call it svc.
      • /home/svc/versions/{target}/{version} will be the filename for the binary itself.
      • /home/svc/{target} will be symlinked to the just-uploaded binary.
      • /home/svc/defaults will contain the default environment variables for systemd to pick up.
      • Kick systemd to pick up the new symlinks.
    • We’re going to just assume that the database is properly setup for access from svc user, and that systemd targets are already configured for them.

    • I can work on more bootstrapping stuff when I have time.

    • Open question: How to handle systemd unit files when the time comes to write those? I need to support both service and timer files (the latter for cleanup).

      • For now, I think it’s easy enough to generate the files in pleasings/lib/ensure and just hardcode what I need.

      • Eventually, I’d be interested in working with something like Starlark to describe the desired state of a system and have a project that can apply those. Maybe ensure will grow into that.

        • Various Starlark libraries found while I sidetracked for this:

          • Protoconf is still going strong! I don’t think I’ll ever use it directly, since it doesn’t quite match how my systems are architected, but I would love to adapt its ideas into something minimal and usable.

          • Starlib is a “standard library” for Starlark programs.

          • Starlight implements a wrapper around Starlark to make it easier to pass data in/out.

          • Skycfg is probably a good basis for something hand-written, as it makes it much easier to work with Protobuf messages.

          • Sun isn’t useful on its own but it does have some good ideas on how to add built-in functions to a Starlark interpreter.

    • Need to figure out a way to get ssh-add automatically run? Seems very dumb that it doesn’t.

    • ensure with overridable Starlark configs per-environments and per-host could be a very powerful tool and help me with managing the dev and prod environments.

      • Mostly ruminating on this since I’ll have different machines with different roles, particularly when it comes to hosting the DB.
    • Stopping work today with pleasings/bin/push not quite finished. The work is mostly done, but there are some odd errors I need to track down. I’ve put some tasks on tomorrow’s diary to remind myself.