TRITON-2497

Static IP support for sdc-docker

Status:
In Progress
Created:
2025-08-11T10:03:51.486-0400
Updated:
2026-01-12T09:34:00.777-0500

Description

157
158

From the Github issue:

Now that sdc-cloudapi has network objects we can support static addresses.

Comments (5)

Dan McDonald commented on 2025-08-11T15:49:03.042-0400:

Two repos will require changes: sdc-docker AND its dependency for the new tag, node-triton-tags.

Dan McDonald commented on 2025-09-02T13:09:54.679-0400:

Test results from Bruce in the PR:

Fabrics:

# test output in /var/tmp/dockertest:
api-create.test.js.tap

# test results:
# Completed in 736 seconds.
# PASS: 240 / 240

Non-Fabrics:

# test output in /var/tmp/dockertest:
api-create.test.js.tap

# test results:
# Completed in 220 seconds.
# PASS: 132 / 132

Dan McDonald commented on 2025-09-02T14:28:43.767-0400:

A concern address that’s worth pasting here:

Making sure we keep the old semantics about port-publishing as we move to new & improved things.

The API is a bit weird with non fabrics. Folks can use the label trtion.network.public to create a single network. To keep that behavior Introduced the following function to ensure we don't provision when creates come in with 2 networks.

That test ensures we get back the following validation error:
format('(Validation) both networks are of uuid: %s, ' + 'networks must be distinct', externalNetworkOwner.uuid);

        // Enforce 2 distinct networks
        function enforceDistinctNetworks(_, next) {
            if (payload.networks.length === 2) {
                var prevUUID;
                for (var i = 0; i < payload.networks.length; i++) {
                    var nw = payload.networks[i];
                    // Handle both network and network obj
                    var netUUID = nw.ipv4_uuid || nw.uuid;
                    if (prevUUID === netUUID) {
                        next(new errors.ValidationError(util.format(
                            'both networks are of uuid: %s, networks must be '
                                + 'distinct',
                            netUUID)));
                        return;
                    }
                    prevUUID = netUUID;
                }
            }
            next();
        },

files#diff-c4f1b8ae2e26da3e65179085fe7f84e4ac8205918e572e888f2c82824f403868R850

We also have the same with enforcingPublishedPorts when we have 2 networks.

        // Enforce Publishing Ports for Non Fabric with > 1 network
        function enforcePublishingPorts(_, next) {
            // Handle publishing ports for non fabrics
            if (payload.networks.length === 2
                && !containers.publishingPorts(container)) {
                next(new errors.ValidationError(util.format(
                    'non fabrics with 2 networks requires a container with '
                        + 'published ports'
                )));
                return;
            }
            next();
        },

Dan McDonald commented on 2025-09-10T08:35:51.947-0400:

Third repo (sdc-vmapi) will also need a change to include the triton-tags changes.

Dan McDonald commented on 2025-09-10T11:54:19.065-0400:

Both triton-tags and sdc-vmapi now have their portions of this issue integrated. The big one of sdc-docker awaits testing notes, and a small overview about those changes (including their existing operational experience, which is noteworthy).

Related Links