2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-04-29 20:07:46 +00:00
Commit Graph

48 Commits

Author SHA1 Message Date
Jarrod Johnson
8e5ee6c9d8 Make orphaned sync runner retire on new sync request 2024-04-10 13:54:06 -04:00
Jarrod Johnson
ceaf641c1a Keep reap loop going on error 2024-04-09 16:18:24 -04:00
Jarrod Johnson
01722c18c4 Fix location of idle sleep in syncfiles cleaner 2024-04-09 15:40:40 -04:00
Jarrod Johnson
8fb889ba73 Correct syntax error 2024-04-09 15:27:20 -04:00
Jarrod Johnson
eaffb342b2 Reap stale sync runners after a minute dead
If the client never claims the result, delete the sync task.
2024-04-09 15:19:38 -04:00
Jarrod Johnson
8ca9a44476 Provide more interesting response body to syncfileclient 2024-04-09 14:27:00 -04:00
Jarrod Johnson
f68f9f4693 Make syncfile step robust or pause
If syncfiles fails, keep it retrying.

Also, slow down sync checking to avoid hammering the system.

Further, randomized delay to spread highly synchronized requestors.

Block attempts to do multiple concurrent syncfile runs.
2024-04-09 11:07:11 -04:00
Jarrod Johnson
13fc5d9f37 Capture better error data on failed syncfiles
syncfiles can often hang up in unexpected ways,
provide a catch-all.
2024-03-20 09:49:25 -04:00
Jarrod Johnson
60fe306890 Numerous fixes
Normalize cloning by wipefs prior to image2disk

Have imgutil filter out zram mounts.

Fix syncfiles error handling.
2024-03-15 13:03:46 -04:00
Jarrod Johnson
a1ac234b73 Enhance error message for authentication issue during syncfiles 2023-10-27 15:31:14 -04:00
Jarrod Johnson
90af99e864 Add more clear error on syncfile mistake
If a bad node was included in
a syncfile, the error was highly misleading.

Provide a more clear indicaiton of the problem on failure.
2023-02-14 14:53:40 -05:00
Jarrod Johnson
57b6d8677b Fix syncfiles compatibility with IPv6 2023-01-06 09:33:06 -05:00
Jarrod Johnson
6eb4bf28e5 Another iteration to try to have IP adaptive syncfiles
It is likely that a client connects from fe80::, which
is explicitly omitted from ssh principals.

This time, have the client provide all currently set IP addresses
and the server will make a determination.

There remains the possibility it misconfigures a nic and tries to use that,
inducing failure.  One strategy would be to filter the addresses and
only provide from the 'current' interface.  Another is to just take
the hit as the node is likely going to suffer a lot from such a
misconfiguration anyway.
2022-10-05 12:23:47 -04:00
Jarrod Johnson
c612129d64 Have syncfiles attempt to use client ip, if feasible
When a node installs, it may not have it's node mapped address up,
or may not have one at all. Try to use the ip if it would be in the
same set that produced it's ssh certificate.

There remains a gap if a system has no static addressing *and* doesn't
map nodename to IP, but we have an impasse as the situation is too fuzzy
to grant a prinicpal in an SSH cert, and without that we can't securely
attempt rsync.  For now, this scenario would still fail and I will
just hope that doesn't come up.
2022-10-05 08:31:37 -04:00
Jarrod Johnson
f10a27fd7a Switch to mkstemp
Use mkstemp to more confidently reserve a filename as expected.
2022-02-15 17:13:04 -05:00
Jarrod Johnson
fbd3a442ac Support numeric owner/group in syncfile list 2022-02-08 17:38:01 -05:00
Jarrod Johnson
3f90c35bc9 Raise error on missing piece of syncfiles entry 2022-01-20 13:13:04 -05:00
Jarrod Johnson
8d5d8ef5ed Have later syncfiles entries supersede earlier
This allows a vague entry to
be followed by a specific
entry to allow 'common' content
and then a specific override.
2022-01-13 16:52:10 -05:00
Jarrod Johnson
343e5eabe5 Utility function for running commands
Given the python2/3 differences, good to have a single run
that returns stdout and stderr.

This should trigger the same behavior as timeout did, but
in a manner consistent between 2 and 3.
2021-12-08 10:20:34 -05:00
Jarrod Johnson
d59ac74f3a Support relative path on < include
For pkglist and syncfile, detect
relative path and interpret relative
to the file that does the include.
2021-11-15 11:34:34 -05:00
Jarrod Johnson
ce8e671584 Have includes interpret section names
If <including> a syncfiles, then
be sure to honor MERGE/APPENDONCE in those files without perturbing flow
of the parent file.
2021-10-27 15:47:52 -04:00
Jarrod Johnson
ce9b0bf556 Support terminating include with >
The previous thought of <base.pkglist is fine, but upon seing <base.pkglist>, that looks better.
2021-10-27 14:21:30 -04:00
Jarrod Johnson
0d53612e9c Fix variable yielded when not including 2021-10-25 11:57:18 -04:00
Jarrod Johnson
412e2aaf76 Add '<' include syntax to syncfiles and pkglist
Provide means of combining
multiple pkglist and syncfiles
based on hierarchy.

This enables construction of
a more complex structure of
images for those that may want it.
2021-10-22 13:11:50 -04:00
Jarrod Johnson
40dea6a747 Support older python subprocess
Older python did not provide timeout.  Keep the timeout
for the modern python that skips select without a timeout,
but try again without timeout to retain compatibility.
2021-10-20 18:23:35 -04:00
Jarrod Johnson
1d71cee61d Fix syncfiles not running with just APPENDONCE 2021-10-15 16:37:02 -04:00
Jarrod Johnson
2e7b315f29 Add 'APPENDONCE:' section to syncfiles
This will APPEND if the target file doesn't
already have the entire source contents in
a contiguous location already. This makes
it more safe to rerun without negative consequence.
2021-10-15 15:48:49 -04:00
Jarrod Johnson
7ccaa245b6 Provide both string and numeric for owner/group
To provide a fallback for unrecognized user/group,
provide an id for syncfileclient to resort for.
2021-10-08 10:02:13 -04:00
Jarrod Johnson
52a7921676 Correct mistakes in syncfile option passing 2021-10-07 18:23:57 -04:00
Jarrod Johnson
3f7a7d09dd Correct mistake in referencing option string 2021-10-07 18:02:56 -04:00
Jarrod Johnson
c0287e93ed Roll back rsync ownership
Unfortunately, it will try to change parent directories on the way to
the files actually being written.
2021-10-07 16:34:37 -04:00
Jarrod Johnson
a676eb0b83 Syncfile option passing to client
Provide a mechanism for a syncfiles to indicate options to the client.

This will be used for owner=, group=, and permissions=
options.
2021-10-07 15:54:53 -04:00
Jarrod Johnson
e52a9ff70f Have syncfiles attempt to preserve more
We cannot preserve symlinks (since we need them intact),
but we can use other rsync features to make synchronization work
better by default.
2021-10-07 13:01:48 -04:00
Jarrod Johnson
26c6f1407b Add syntax for noderange filtering
/etc/passwd -> compute,-n11:/etc/passwd

Will cause the line to be used only when the node matches the
compute,-n11 noderange.
2021-10-07 11:26:13 -04:00
Jarrod Johnson
398c8b3a71 Improve syncfiles permission denied reporting
When a non-readable file was
encountered, confluent would
cryptically report rsync failure.

Check for the usual culprit, unreadable files if rsync fails.

Cause this error to manifest with clearer text.
2021-09-30 12:01:29 -04:00
Jarrod Johnson
929392c746 Fix hangs on check_output
Eventlet narrowly targets overriding
select in subprocess, to avoid rewriting adequate functions.

However, subprocess does an 'optimization' to skip
select if there's fewer than 3 pipes to juggle and no timeout specified.

Induce python to always use select
by specifying a very long timeout.

This causes confluent to be able to spawn multiple subprocesses and
not be hung waiting for input.
2021-09-23 10:42:47 -04:00
Jarrod Johnson
6bb6b362ab Provide support for merging multiple sources to single destination 2021-08-24 17:39:06 -04:00
Jarrod Johnson
b604ec4773 Fix detection of missing sync source
Rather than just assume we want a directory when glob
finds no matches, just take the empty result.
2021-08-02 11:33:08 -04:00
Jarrod Johnson
d3fa08d78b Amend syncfiles to handle directory targets better
Rather than using symlinks for directories, recursively recreate tree
and symlink only the non-directory
entries.

This improves mixing and matching
files and directories to target a directory.
2021-04-27 12:48:27 -04:00
Jarrod Johnson
38eb88249e Permit wildcard in syncfiles
This was a supported and used feature in xCAT
syncfiles, carry it into confluent syncfiles.
2021-04-27 09:12:11 -04:00
Jarrod Johnson
45cc4b7788 Add documentation syncfiles examples
Also, check to make sure a syncfiles has actual
work to do before triggering a greenthread and
the client to start polling.
2021-04-23 11:09:35 -04:00
Jarrod Johnson
ca0c592044 Commence work on syncfileclient
This will be used to wait for deployer
to finish, then execute handlers
for 'MERGE' entries.
2021-03-25 16:55:56 -04:00
Jarrod Johnson
829d1316b2 Remove 'APPEND:'
If possible, we wannt to stick to 'MERGE', since the handlers
are designed to make that
idempotent for repeat.

APPEND: would not be idempotent...
2021-03-25 12:37:21 -04:00
Jarrod Johnson
c2c1c85651 Increase verbosity of syncfiles 2021-03-25 08:59:16 -04:00
Jarrod Johnson
c5833f1417 Reserve some characters for special syntax
May need to modify some behaviors in future, provide
a healthy supply of reserved characters toward that end.
2021-03-25 08:57:48 -04:00
Jarrod Johnson
07ae3593c3 Syncfiles fixes 2021-03-24 17:33:26 -04:00
Jarrod Johnson
35ef6170ba Implement syncfiles server side 2021-03-24 16:00:54 -04:00
Jarrod Johnson
d650f11255 Begin work on syncfiles concept for confluent 2021-03-23 17:32:45 -04:00