Skip to content

Conversation

olethanh
Copy link
Collaborator

Add a news endpoints /about/executions/resources to expose resources for instances

Related ClickUp, GitHub or Jira tickets : ALEPH-615

Opening this PR so we can discuss what info we need and the format.

Examples of what this endpoint currently return, this is basically the v2 endpoint with added message and resource fields (those contain duplicate info so we might not need both but I'm including them for discussions)

{
  "decadecadecadecadecadecadecadecadecadecadecadecadecadecadecadeca": {
    "networking": {
      "ipv4_network": "172.16.4.0/24",
      "host_ipv4": "64.227.122.196",
      "ipv6_network": "2a01:e0a:8b1:95e1:3:deca:deca:dec0/124",
      "ipv6_ip": "2a01:e0a:8b1:95e1:3:deca:deca:dec1",
      "ipv4_ip": "172.16.4.2",
      "mapped_ports": {
        "22": {
          "host": 24001,
          "tcp": true,
          "udp": false
        }
      }
    },
    "status": {
      "defined_at": "2025-09-16 13:35:18.983564+00:00",
      "preparing_at": "2025-09-16 13:35:19.012594+00:00",
      "prepared_at": "2025-07-29 11:11:35.853427",
      "starting_at": "2025-07-29 11:11:35.891511",
      "started_at": "2025-09-16 13:35:19.075488+00:00",
      "stopping_at": null,
      "stopped_at": null
    },
    "message": {
      "address": "0x9319Ad3B7A8E0eE24f2E639c40D8eD124C5520Ba",
      "time": 1619017773.8950517,
      "allow_amend": false,
      "metadata": null,
      "authorized_keys": [
        "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDj95BHGUx0/z2G/tTrEi8o49i70xvjcEUdSs3j4A33jE7pAphrfRVbuFMgFubcm8n9r5ftd/H8SjjTL4hY9YvWV5ZuMf92GUga3n4wgevvPlBszYZCy/idxFl0vtHYC1CcK9v4tVb9onhDt8FOJkf2m6PmDyvC+6tl6LwoerXTeeiKr5VnTB4KOBkammtFmix3d1X1SZd/cxdwZIHcQ7BNsqBm2w/YzVba6Z4ZnFUelBkQtMQqNs2aV51O1pFFqtZp2mM71D5d8vn9pOtqJ5QmY5IW6NypcyqKJZg5o6QguK5rdXLkc7AWro27BiaHIENl3w0wazp9EDO9zPAGJ6lz olivier@lanius"
      ],
      "variables": {
        "VM_CUSTOM_NUMBER": "32"
      },
      "environment": {
        "internet": true,
        "aleph_api": true,
        "hypervisor": "qemu",
        "trusted_execution": null,
        "reproducible": true,
        "shared_cache": true
      },
      "resources": {
        "vcpus": 1,
        "memory": 512,
        "seconds": 30,
        "published_ports": null
      },
      "payment": null,
      "requirements": null,
      "volumes": [
        {
          "comment": null,
          "mount": "/opt/venv",
          "ref": "5f31b0706f59404fad3d0bff97ef89ddf24da4761608ea0646329362c662ba51",
          "use_latest": false
        },
        {
          "comment": "Working data persisted on the VM supervisor, not available on other nodes",
          "mount": "/var/lib/example",
          "parent": null,
          "persistence": "host",
          "name": "data",
          "size_mib": 5
        }
      ],
      "replaces": "0x9319Ad3B7A8E0eE24f2E639c40D8eD124C5520Ba",
      "rootfs": {
        "parent": {
          "ref": "549ec451d9b099cad112d4aaa2c00ac40fb6729a92ff252ff22eef0b5c3cb613",
          "use_latest": false
        },
        "persistence": "host",
        "size_mib": 5000,
        "forgotten_by": null
      }
    },
    "resources": {
      "message_content": {
        "address": "0x9319Ad3B7A8E0eE24f2E639c40D8eD124C5520Ba",
        "time": 1619017773.8950517,
        "allow_amend": false,
        "metadata": null,
        "authorized_keys": [
          "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDj95BHGUx0/z2G/tTrEi8o49i70xvjcEUdSs3j4A33jE7pAphrfRVbuFMgFubcm8n9r5ftd/H8SjjTL4hY9YvWV5ZuMf92GUga3n4wgevvPlBszYZCy/idxFl0vtHYC1CcK9v4tVb9onhDt8FOJkf2m6PmDyvC+6tl6LwoerXTeeiKr5VnTB4KOBkammtFmix3d1X1SZd/cxdwZIHcQ7BNsqBm2w/YzVba6Z4ZnFUelBkQtMQqNs2aV51O1pFFqtZp2mM71D5d8vn9pOtqJ5QmY5IW6NypcyqKJZg5o6QguK5rdXLkc7AWro27BiaHIENl3w0wazp9EDO9zPAGJ6lz olivier@lanius"
        ],
        "variables": {
          "VM_CUSTOM_NUMBER": "32"
        },
        "environment": {
          "internet": true,
          "aleph_api": true,
          "hypervisor": "qemu",
          "trusted_execution": null,
          "reproducible": true,
          "shared_cache": true
        },
        "resources": {
          "vcpus": 1,
          "memory": 512,
          "seconds": 30,
          "published_ports": null
        },
        "payment": null,
        "requirements": null,
        "volumes": [
          {
            "comment": null,
            "mount": "/opt/venv",
            "ref": "5f31b0706f59404fad3d0bff97ef89ddf24da4761608ea0646329362c662ba51",
            "use_latest": false
          },
          {
            "comment": "Working data persisted on the VM supervisor, not available on other nodes",
            "mount": "/var/lib/example",
            "parent": null,
            "persistence": "host",
            "name": "data",
            "size_mib": 5
          }
        ],
        "replaces": "0x9319Ad3B7A8E0eE24f2E639c40D8eD124C5520Ba",
        "rootfs": {
          "parent": {
            "ref": "549ec451d9b099cad112d4aaa2c00ac40fb6729a92ff252ff22eef0b5c3cb613",
            "use_latest": false
          },
          "persistence": "host",
          "size_mib": 5000,
          "forgotten_by": null
        }
      },
      "namespace": "decadecadecadecadecadecadecadecadecadecadecadecadecadecadecadeca",
      "gpus": [],
      "volumes": [
        {
          "mount": "/opt/venv",
          "path_on_host": "/var/cache/aleph/vm/data/5f31b0706f59404fad3d0bff97ef89ddf24da4761608ea0646329362c662ba51",
          "read_only": true,
          "size_mib": null
        },
        {
          "mount": "/var/lib/example",
          "path_on_host": "/var/lib/aleph/vm/volumes/persistent/decadecadecadecadecadecadecadecadecadecadecadecadecadecadecadeca/data.ext4",
          "read_only": false,
          "size_mib": 5
        }
      ],
      "rootfs_path": "/var/lib/aleph/vm/volumes/persistent/decadecadecadecadecadecadecadecadecadecadecadecadecadecadecadeca/rootfs.qcow2"
    }
  }
}

Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.83%. Comparing base (c79a8cc) to head (d76df62).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/aleph/vm/orchestrator/views/__init__.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #833      +/-   ##
==========================================
- Coverage   64.84%   64.83%   -0.01%     
==========================================
  Files          87       87              
  Lines        8095     8099       +4     
  Branches      723      723              
==========================================
+ Hits         5249     5251       +2     
- Misses       2620     2622       +2     
  Partials      226      226              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@olethanh olethanh force-pushed the ol-aleph-615-executions-resources branch from d76df62 to c515807 Compare September 18, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant