Skip to content

[OMEGA-482] Fix: Migrate memory transfer to Docker volumes - #397

Open
blackhammer116 wants to merge 8 commits into
singnet:mainfrom
iCog-Labs-Dev:dev/bug-fix
Open

blackhammer116 wants to merge 8 commits into
singnet:mainfrom
iCog-Labs-Dev:dev/bug-fix

Conversation

@blackhammer116

Copy link
Copy Markdown
Collaborator

Description

Move memory archives from host bind mounts to a Docker volume to address the reported export permission failures with Landlock on macOS.

  • Store archives in omega-memory-transfer, mounted at /memory-transfer.
  • Add memory-list, memory-upload, and memory-download launcher commands.
  • Prepare private volume permissions, stage uploads, and check import archives before replacing the existing agent container.
  • Preserve exported archives when running omega clean.
  • Replace --memory-transfer-dir and --memory-transfer-gid with --memory-transfer-volume.
  • Update setup, transfer, and migration documentation, including Windows usage through WSL2 with Docker Desktop.

How Has This Been Tested?

On the current PR branch, 64 tests passed. One optional Docker integration test was skipped. Shell syntax and whitespace checks also passed.
The tests cover archive commands, volume mounts, duplicate uploads, interrupted uploads, failed-download cleanup, startup import checks, and archive preservation during cleanup.

Checklist

  • PR contains autogenerated code
  • Self-review completed
  • Test scenarios above are passed with the version of the code from PR

Bereket-Eshete and others added 4 commits October 15, 2026 13:13
Store archives in omega-memory-transfer at /memory-transfer and expose
memory-list, memory-upload, and memory-download through the launcher.
Prepare private volume access, stage uploads before publication, and
preserve exported archives when cleaning live memory. Remove the obsolete
host-group setup from the entrypoint.

BREAKING CHANGE: Replace --memory-transfer-dir and --memory-transfer-gid
with --memory-transfer-volume. Upload existing host archives before import.
Verify named volume mounts, archive commands, private permissions,
duplicate protection, and upload failure cleanup. Cover startup import
preflight and preserve the existing agent when an import is missing.
Describe archive storage, launcher transfer commands, startup import,
private permissions, and migration from host bind mounts. Document the
Windows workflow as WSL2 with Docker Desktop.
…-volumes

[OMEGA-482] Fix: Migrate memory transfer to Docker volumes
@aquashade
aquashade requested a review from paul-v-snet October 15, 2026 15:02
Comment thread scripts/omega Outdated
${log_config_volume[@]+"${log_config_volume[@]}"}
${memory_transfer_volume[@]+"${memory_transfer_volume[@]}"}
${memory_transfer_env[@]+"${memory_transfer_env[@]}"}
--mount "type=volume,source=${memory_transfer_volume_name},target=/memory-transfer"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The volume is always mounted, although the docs say:

--enable-memory-export is required because export is disabled by default.

I suggest mounting the volume only when --enable-memory-export is passed.

Comment thread scripts/omega
Comment on lines +801 to +829
prepare_memory_transfer_volume() {
docker run --rm --pull=never --network none --read-only --user 0:0 \
--entrypoint /bin/sh \
--mount "type=volume,source=${memory_transfer_volume_name},target=/memory-transfer" \
"${image}" -c 'chown 65534:65534 /memory-transfer && chmod 0700 /memory-transfer'
}

require_memory_transfer_volume() {
if ! docker volume inspect "${memory_transfer_volume_name}" >/dev/null 2>&1; then
echo "Memory transfer volume not found: ${memory_transfer_volume_name}" >&2
return 1
fi
}

memory_transfer_run() {
local mode="${1}"
shift
local mount="type=volume,source=${memory_transfer_volume_name},target=/memory-transfer"
local input=()
if [[ "${mode}" == "ro" ]]; then
mount+=",readonly"
else
input=(-i)
fi
docker run --rm --pull=never --network none --read-only --user 65534:65534 \
--security-opt no-new-privileges:true \
${input[@]+"${input[@]}"} --mount "${mount}" \
--entrypoint python3 "${image}" -B "$@"
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why --pull=never used here?

Potential case: a user transfers an archive to another machine and then runs:

image="singularitynet/omega:<tag>"
archive="memory-archive.tar.gz"
scripts/omega memory-upload "$HOME/Downloads/$archive" -d "$image"

In this case, the image doesn't exist on that machine, and these commands won't pull it automatically, so the memory-upload command (as well as memory-list) will fail with a No such image error.

I suggest automatically pulling images passed via -d.

Comment thread scripts/omega Outdated
Comment thread scripts/omega
Comment on lines +508 to +510
echo -e "\tmemory-list list available memory archives"
echo -e "\tmemory-upload <host-archive> copy an archive into the transfer volume"
echo -e "\tmemory-download <filename> <host-destination> copy an archive to your computer"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a memory-delete command.

Currently, there is only one way to delete an archive - by using docker volume rm, but this will remove all archives. In addition, archives accumulate indefinitely, and I think this is not an optimal approach.

So I believe a command like memory-delete is necessary.

@aquashade aquashade added the fix label Oct 16, 2026
Bereket-Eshete and others added 4 commits October 17, 2026 11:07
Co-authored-by: paul-v-snet <paul.vasiletz@singularitynet.io>
Mount the transfer volume at startup only when export is enabled or an
import is requested. Let archive helpers pull missing images while
reusing locally available images.

Add memory-delete to remove one validated archive without removing
the transfer volume or other archives.
Check export/import mount combinations, helper image availability,
pull-failure cleanup, and single-archive deletion. Cover invalid
filenames, non-regular targets, custom volumes, and live-memory
preservation.

Extend the Docker transfer round-trip to verify that deleting one
archive preserves another downloadable archive.
Clarify when the agent mounts the archive volume and how missing
helper images are pulled. Document memory-delete and update the
README restore workflow.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants