Wednesday, January 1, 2025

troubleshooting docker and podman on MacAirbook M2

I have an old MacBook Air running 

  • macOS Catalina v10.15.7 with a 1.8GHz Intel Core i5 and 4GB of RAM
  • `docker compose version` = 2.2.1
  • `docker --version` = 20.10.11

I have a new MacBook Air running 

  • macOS Sonoma v14.6.1 with an Apple M2 and 8GB of RAM

Podman on the new MacBook M2

Downloaded 
Confusingly, 1.15.0 provides Podman 4.9.0 (?)


As per https://stackoverflow.com/a/76488304 I tried
% podman machine stop; podman machine start

Waiting for VM to exit...
Machine "podman-machine-default" stopped successfully
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users:/Users
chattr: Operation not supported while reading flags on /
mkdir: cannot create directory ‘/Users’: Read-only file system
chattr: Operation not supported while reading flags on /
Error: exit status 1

I then tried
% podman machine stop
Waiting for VM to exit...
Machine "podman-machine-default" stopped successfully

% podman machine rm
The following files will be deleted:
...
Are you sure you want to continue? [y/N] y

% podman machine init                                         
Extracting compressed file: podman-machine-default_fedora-coreos-41.20241215.2.0-qemu.aarch64.qcow2: done  
Image resized.
Machine init complete
To start your machine run:
	podman machine start
    
% podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users:/Users
chattr: Operation not supported while reading flags on /
mkdir: cannot create directory ‘/Users’: Read-only file system
chattr: Operation not supported while reading flags on /
Error: exit status 1

Running as root doesn't help
% sudo podman machine start
Error: cannot run command "podman machine start" as root

As per https://stackoverflow.com/a/71576242 I tried
% podman machine init --cpus=4 --disk-size=60 --memory=6096 -v $HOME:$HOME
Extracting compressed file: podman-machine-default_fedora-coreos-41.20241215.2.0-qemu.aarch64.qcow2: done  
Image resized.
Machine init complete
To start your machine run:
	podman machine start

% podman machine start
Starting machine "podman-machine-default"
Waiting for VM ...
Mounting volume... /Users/myinitials:/Users/myinitials
chattr: Operation not supported while reading flags on /
mkdir: cannot create directory ‘/Users’: Read-only file system
chattr: Operation not supported while reading flags on /
Error: exit status 1
As a consequence, while I can run the container,
% podman run -it --rm localhost/ui_v8_website_flask_neo4j_webserver /bin/bash 
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
root@4d006ef73e19:/code# 

I am unable to mount the local directory
% podman run -it --rm -v `pwd`:/scratch localhost/ui_v8_website_flask_neo4j_webserver /bin/bash
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
Error: statfs /Users/bhp/version_control/allofphysicsgraph/ui_v8_website_flask_neo4j: no such file or directory

Uninstall Podman

podman machine stop podman-machine-default
podman machine rm podman-machine-default
podman machine rm
sudo /opt/podman/bin/podman-mac-helper uninstall
sudo rm /etc/paths.d/podman-pkg
sudo rm -rfv /opt/podman
sudo rm -rf /Applications/Podman\ Desktop.app/
sudo rm /var/run/docker.sock
rm -fr ~/.local/share/containers/

Docker on the new MacBook M2

Downloaded https://desktop.docker.com/mac/main/arm64/Docker.dmg from https://docs.docker.com/desktop/setup/install/mac-install/

roles, use cases, and requirements

Tests are based on validating requirements. Requirements are derived from use cases that address the needs of people in specific roles.


Roles

  • Viewer: sees content on web UI, reads PDF versions. Uses either the web UI or the API. 
  • Editor: adds equations, inference rules, and derivations. Uses either the web UI or the API
  • Developer: uses the API to build an alternative web UI or runs a service that leverages the PDG
  • Contributor: edits documentation and source code, fixes bugs. Uses github issue tracker. 

Use cases per role

  • Viewer
    • reads documentation about PDG
    • sees the number of derivations
      • on the navigation page
    • sees the number of symbols
      • on the navigation page
    • sees the number of inference rules
      • on the navigation page
    • sees the number of expressions
      • on the navigation page
    • sees a list of derivations
      • accessed from the navigation page
    • sees a list of expressions
      • accessed from the navigation page
    • sees a list of inference rules
      • accessed from the navigation page
    • sees a list of symbols
      • accessed from the navigation page
    • see a list of derivations that use a specific symbol
    • see a list of derivations that use a specific inference rule
    • see a list of derivations that use a specific expression
    • see the steps of a specific derivation
      • accessed from the list of derivations
  • Editor has same as Viewer, plus:
    (the following actions require being logged in)
    • adds a new derivation
      • accessed from the navigation page
      • next page is create new step
    • edits an existing derivation
      • accessed from the list of derivations
      • after edit is submitted, return to viewing that derivation
    • deletes an derivation
      • accessed from the list of derivations
      • after delete is confirmed, return to list of derivations
    • adds a new step
      • return to derivation
    • edits an existing step
    • deletes a step
      • return to derivation
    • adds a new expression
      • return to derivation step
    • edits an existing expression
      • change Latex
      • change relation (e.g., = to >)
      • change label
    • deletes an expression
    • adds a new inference rule
    • edits an existing inference rule
      • change number of arguments
    • deletes an inference rule. (What happens to all the instances of use in various derivations?)
    • adds a new symbol
    • edits an existing symbol
      • change the latex
      • change the sympy
    • deletes a symbol. (What happens to all the instances of use in various expressions?)
    • delete all database content
      • return to navigation page
For each of the use cases per role,
  • test in web UI
  • test in API

what should I work on? many options for tasks TODO

  • separate the property graph backend from an API and have the web interface call the API
  • find a lighter weight alternative to neo4j backend
  • get a minimum viable product working using the existing property graph backend
  • separate static documentation pages from the dynamic paths
  • get docker working on my new Mac

That last one is the blocker for everything else, so get docker working on my new Mac is priority. The good news is that the code does run on my old MacBook Air.

Next I'll work on getting a minimum viable product working using the existing property graph backend