pman icon indicating copy to clipboard operation
pman copied to clipboard

Added control of docker networks of containers

Open Sharpz7 opened this issue 6 months ago • 6 comments

Sharpz7 avatar Aug 20 '25 16:08 Sharpz7

Tested with 2 networks

[
    {
        "Id": "3a7e8780a878289ad5b5987135392d74f91ec0878cbeaba412de7ed2f2074836",
        "Created": "2025-08-24T02:38:19.15397097Z",
        "Path": "/usr/local/bin/python",
        "Args": [
            "/usr/local/bin/retuve_chris_plugin",
            "--saveinputmeta",
            "--saveoutputmeta",
            "/share/incoming",
            "/share/outgoing"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 285356,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2025-08-24T02:38:19.197930301Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Config": {
            "Hostname": "3a7e8780a878",
            "Domainname": "",
            "User": "1001",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "CHRIS_JID=chris-jid-9",
                "CHRIS_PLG_INST_ID=9",
                "CHRIS_USER_USERNAME=chris",
                "[email protected]",
                "CHRIS_PREV_PLG_INST_ID=5",
                "CHRIS_PREV_JID=chris-jid-5",
                "HOME=/tmp",
                "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LANG=C.UTF-8",
                "GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D",
                "PYTHON_VERSION=3.10.18",
                "PYTHON_SHA256=ae665bc678abd9ab6a6e1573d2481625a53719bc517e9a634ed2b9fefae3817f"
            ],
            "Cmd": [
                "/usr/local/bin/python",
                "/usr/local/bin/retuve_chris_plugin",
                "--saveinputmeta",
                "--saveoutputmeta",
                "/share/incoming",
                "/share/outgoing"
            ],
            "Image": "docker.io/sharp6292/retuve_chris_plugin:1.0.0",
            "Volumes": {
                "/share/incoming": {},
                "/share/outgoing": {}
            },
            "WorkingDir": "/usr/local/src",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {
                "org.chrisproject.miniChRIS": "plugininstance"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "ebf93481003c30184b07c3ffdada343ef0c5cb2c0e818ce7b5b60d9d6f7aba8f",
            "SandboxKey": "/var/run/docker/netns/ebf93481003c",
            "Ports": {},
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "minichris-local": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "MacAddress": "b6:0e:b3:93:9b:42",
                    "DriverOpts": null,
                    "GwPriority": 0,
                    "NetworkID": "d2a35845b484316a93251af56192ac5df34cda929f18626d781b7fe6552c9c24",
                    "EndpointID": "785c7229425324ee741b2e93861548cc3f6f5c966c36d0f3a903ea8c34dc50cb",
                    "Gateway": "172.25.0.1",
                    "IPAddress": "172.25.0.19",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "DNSNames": [
                        "chris-jid-9",
                        "3a7e8780a878"
                    ]
                },
                "nidus-infra_default": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "MacAddress": "ae:ff:7c:33:1c:09",
                    "DriverOpts": null,
                    "GwPriority": 0,
                    "NetworkID": "a2767aa328df5b82d29dc72d970b57e7d12ba0a4843b9c9a17f0d16c86620610",
                    "EndpointID": "02a64265987faf781c73755ae9754a895054046ead61e68343600e3f382cd674",
                    "Gateway": "172.19.0.1",
                    "IPAddress": "172.19.0.6",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "DNSNames": [
                        "chris-jid-9",
                        "3a7e8780a878"
                    ]
                }
            }
        }
    }
]

Sharpz7 avatar Aug 24 '25 02:08 Sharpz7

I haven't ran the tests locally - I imagine they will need some fixes.

Sharpz7 avatar Aug 24 '25 02:08 Sharpz7

Appreciate the suggestions @jennydaman

I hope you can appreciate that without a CONTRIBUTORS.md file, or some other means of telling me what the code-style requirements are for your repo, it is very difficult for me to know what you want in advance. I am happy to follow what is expected of me if I am told. I don't think OSS is standardized enough to say that all codebases follow the same pattern, or that there is any kind of default "standard" - at least not that I know of. For example, I don't think its unreasonable in main other repos to do a first test run in CI and then make changes locally, especially in cases with a finicky test setup (In openstack-ironic for example I think that is a fair comment). If you want to take more external contributions in the future and avoid this, I suggest a CONTRIBUTORS.md that you can point to.

I will work on your suggestions in time. Happy to go with the single network route for now and remove tests altogether.

Sharpz7 avatar Aug 25 '25 18:08 Sharpz7

@Sharpz7 100% agree. (If i had the authority to enforce standards and CONTRIBUTORS.md file, I would.)

jennydaman avatar Aug 26 '25 20:08 jennydaman

I apologize for my editor automatically applying formatting to the file - let me know if you would like that undone.

Sharpz7 avatar Sep 12 '25 01:09 Sharpz7

@Sharpz7 pman has been deprecated and integrated into pfcon. Any PRs should go into that repo. Thanks!

jbernal0019 avatar Oct 07 '25 22:10 jbernal0019