Commit Graph

2358 Commits

Author SHA1 Message Date
James Shubin
56e55dfad7 engine: resources: Sysctl was missing the errors 2025-10-03 01:34:26 -04:00
James Shubin
303e80dee7 engine, lang, lib, pgraph: Plumb through more ctx 2025-10-02 23:28:51 -04:00
James Shubin
6c6c9df75e engine: resources: Add a nif command and make it clearer
Let's have the opposite, and have an example so you don't forget which
is which.
2025-10-02 20:48:36 -04:00
James Shubin
5f4ae05340 readme: We moved to matrix 2025-10-02 03:05:05 -04:00
James Shubin
c48b884d16 misc: Add fpm repo script 2025-09-30 02:55:29 -04:00
James Shubin
fe77bce544 misc: Update old email address 2025-09-30 02:42:43 -04:00
James Shubin
26640df164 test: shell: Get the first ethernet device
In CI sometimes there are two, so this fails.
2025-09-30 00:27:35 -04:00
James Shubin
debd4ee653 misc: Remove old prototype language 2025-09-29 23:15:45 -04:00
James Shubin
63269fe343 spec: Small RPM fixes
In case anyone tries this.
2025-09-29 23:15:16 -04:00
James Shubin
f588703474 engine: resources: Add a gsettings resource
This adds a way to run the gsettings command for configuring dconf
settings usually used by GNOME applications.
2025-09-29 21:40:06 -04:00
James Shubin
52fbc31da7 engine: resources: Remove this noise 2025-09-29 21:26:14 -04:00
James Shubin
154f900d2a engine: resources: Add an ifequals option to block cmd
If the ifcmd returns true and this option is set, it will match that
output against this field, and if they match, then we skip cmd.

Much cleaner than needing to invoke bash to compare two strings.
2025-09-29 21:24:40 -04:00
James Shubin
bbd4f1dea1 engine: Add a utility function to copy the Init struct 2025-09-29 21:23:17 -04:00
James Shubin
22120649e5 modules: misc: Add simple flatpak management 2025-09-26 23:25:42 -04:00
James Shubin
a840dd43dd cli, tools, util, modules: Add a grow util and module
This builds in some functionality for growing the filesystem for new
machines. It also gets wrapped with an mcl module for ease of use.
2025-09-26 23:00:20 -04:00
James Shubin
83743df3e4 util: Add variant of exec cmd that returns output 2025-09-26 21:18:54 -04:00
James Shubin
15b2ff68cc lang: core: os: Simplify waitgroup
Doesn't need to be part of the struct. Maybe there are others like this
that need porting.
2025-09-26 21:18:54 -04:00
James Shubin
17544e881c test: Fix tag failures 2025-09-25 02:23:14 -04:00
James Shubin
6090517830 releases: Add release notes for 1.0.0 2025-09-25 02:11:05 -04:00
James Shubin
6a7b3d5fa9 readme: Ten 2025-09-25 01:16:03 -04:00
James Shubin
25804c71df lang: core embedded: provisioner: Work with USB-free machines
This feature was for machines that boot from USB keys. When we PXE boot,
this should not fail when the file isn't missing.
2025-09-16 01:11:32 -04:00
James Shubin
a54553c858 engine: resources: Print a warning if svc is slow
The biggest horror is blocked execution somewhere, so if the svc start,
stop or reload is being slow, then at least print a message to warn us.
2025-09-15 04:05:04 -04:00
James Shubin
ff1581be87 engine: resources: Massively refactor the svc
This was a long time coming, but now it looks to be done. It was kind of
meant as low-hanging fruit for some interested student, but in the end I
got to it first.
2025-09-15 04:05:04 -04:00
James Shubin
ec48a6944c lang: core: iter: Make map coding more consistent with filter
Keeping the code looking similar makes it easy to patch bugs that occur
in both.
2025-09-14 23:52:22 -04:00
James Shubin
df9849319d lang: core: iter: Replace graph when list length changes
The map and iter functions weren't replacing the graph if the input list
length changed. This was just an oversight in coding AFAICT, as the
sneaky case is that if the length stays the same, but the list contents
change, then it's okay to not swap.
2025-09-14 23:50:21 -04:00
James Shubin
045aa8820c engine: resources: Display tick marks for input range
This makes it prettier. We should also add the values, but this is
harder to do nicely.
2025-09-14 20:52:45 -04:00
James Shubin
a66cbc3098 engine: resources: Work around race in upstream lib
This is actually fixed in: 7d147928ee
but this is not in a release yet.
2025-09-14 19:36:57 -04:00
James Shubin
9833cb8df3 modules: virtualization: Update to Fedora 42 2025-09-14 00:06:59 -04:00
James Shubin
a73dc19ce9 engine: resources: Fix virt hotplug
At some point, this seems to have rotted, since I assume upstream
started requiring this updated XML spec. Fix it now.
2025-09-13 23:54:46 -04:00
James Shubin
bcf57f8581 engine: resources: Make the qemu guest agent automatic 2025-09-13 23:54:46 -04:00
James Shubin
611cdb3193 engine: resources: Disable buggy restart code
This was really not ever tested properly, and I worry it will deadlock.
It definitely kicks off falls positives that don't even do any harm as
far as we can tell.
2025-09-13 23:54:24 -04:00
James Shubin
1b39a780e1 engine: resources: Clean up virt code
There was and still is a bunch of terrible mess in this code. This does
some initial cleanup, and also fixes an important bug!

If you're provisioning a vmhost from scratch, then the function engine
might do some work to get the libvirt related services running before
the virt resource is used to build a vm. Since we had connection code in
Init() it would fail if it wasn't up already, meaning we'd have to write
fancy mcl code to avoid this, or we could do this refactor and keep
things more logical.
2025-09-13 23:28:33 -04:00
James Shubin
d59ae2e007 engine: graph: We shouldn't complain on context cancellation
These are expected from our engine. We do care about timeout's and so
on. This allows os to return ctx.Err() whenever a <-ctx.Done() happens,
which is more idiomatic for what we really want, but which we weren't
thorough with before.
2025-09-13 23:28:33 -04:00
James Shubin
b9363a3463 go: Update systemd dep to fix race
Hopefully this race is fixed upstream. Let's see.
2025-09-11 23:22:45 -04:00
James Shubin
a5f89d8d7b lang: funcs: dage: Use lazy freshness check
Not sure if this would introduce a glitch or not. Does seem to work
correctly. Without this, examples/lang/datetime2.mcl don't update
properly.
2025-09-11 23:19:45 -04:00
James Shubin
790b7199ca lang: New function engine
This mega patch primarily introduces a new function engine. The main
reasons for this new engine are:

1) Massively improved performance with lock-contended graphs.

Certain large function graphs could have very high lock-contention which
turned out to be much slower than I would have liked. This new algorithm
happens to be basically lock-free, so that's another helpful
improvement.

2) Glitch-free function graphs.

The function graphs could "glitch" (an FRP term) which could be
undesirable in theory. In practice this was never really an issue, and
I've not explicitly guaranteed that the new graphs are provably
glitch-free, but in practice things are a lot more consistent.

3) Simpler graph shape.

The new graphs don't require the private channels. This makes
understanding the graphs a lot easier.

4) Branched graphs only run half.

Previously we would run two pure side of an if statement, and while this
was mostly meant as an early experiment, it stayed in for far too long
and now was the right time to remove this. This also means our graphs
are much smaller and more efficient too.

Note that this changed the function API slightly. Everything has been
ported. It's possible that we introduce a new API in the future, but it
is unexpected to cause removal of the two current APIs.

In addition, we finally split out the "schedule" aspect from
world.schedule(). The "pick me" aspects now happen in a separate
resource, rather than as a yucky side-effect in the function. This also
lets us more precisely choose when we're scheduled, and we can observe
without being chosen too.

As usual many thanks to Sam for helping through some of the algorithmic
graph shape issues!
2025-09-11 23:19:45 -04:00
James Shubin
1e2db5b8c5 gapi: New API
Clear out lots of cruft and mistakes in this old API. The language GAPI
isn't updated with this commit, and as a result, this won't build, but
the fixes for it are coming shortly. We could have merged the two
commits, but it's easier to show them separately for clarity.
2025-09-09 02:21:59 -04:00
James Shubin
6041c5dc22 puppet: langpuppet: Nuke due to porting difficulties
Porting of the GAPI will cause challenging refactoring for me, so I'm
removing this for now, but happy to have it back if someone wants to
port it.
2025-09-09 02:21:59 -04:00
James Shubin
a668cd847e util: New buffered infinite chan primitive
I'm sure there are better implementations, but this feels clean enough
for now. Let's see if this is useful or not.
2025-09-09 02:21:59 -04:00
James Shubin
474df66ca0 lang: types: Add nil type for placeholder
The nil type is being added, but only slightly. It is not meant for real
use in the language. It will not work in all situations, and it isn't
implemented for many methods.

It is being added only for being a "dummy" placeholder value in the
engine when we have an unused value being propagated along an edge.
2025-09-09 02:21:59 -04:00
James Shubin
2022a31820 make: Leave race detector on by default
Maybe this will help us shake out some bugs.
2025-09-09 02:21:59 -04:00
James Shubin
71756df815 mod: Update fsnotify
This should fix a race condition in that library.

Likely fixed in: https://github.com/fsnotify/fsnotify/pull/678
2025-09-09 02:21:59 -04:00
James Shubin
f808c1ea0c converger: Wrap atomic lookup
Avoid this race. Maybe this code should be revisited with a mutex.
2025-09-09 02:21:59 -04:00
James Shubin
6c206b8010 util: Prevent unlikely race on easy exit
Race detector hit this up once, and I can see how it would be possible.
2025-09-09 02:21:59 -04:00
James Shubin
fb8958f192 engine: graph: Add err mutex
Here's a race that pops up. This is suboptimal locking, but it's not
important for now.
2025-09-09 02:21:59 -04:00
James Shubin
a070722937 etcd: Lock around read to prevent race 2025-09-09 02:21:59 -04:00
James Shubin
b02363ad0d etcd: scheduler: Use atomic to prevent race
This code should be rewritten, but in the meantime, at least avoid the
race detector issues.
2025-09-09 00:04:22 -04:00
James Shubin
bed7e6be79 etcd: Pass through the namespace
This is a bit tricky, and we should nuke and redo some of this API. The
sneaky bit has to do with whether we've already added the namespace
magic into our etcd client or not.
2025-09-09 00:04:22 -04:00
James Shubin
0031acbcbc lang: funcs: structs: Map indexes use half the integers
We want the pattern to be key:0, val:0, key:1, val:1, and so on... This
was previously using 0,1,2,3...

When we use Call directly, we need to fix this. Previously this was dead
code which is why the bug wasn't caught.
2025-09-09 00:04:22 -04:00
James Shubin
4e523231d6 engine: graph: Avoid race on fast pause variable
This code is basically unused, but let's keep it in for now in case we
eventually replace it with some contextual ctx code instead.
2025-09-09 00:04:22 -04:00