{"id":36688506,"url":"https://github.com/converged-computing/flex-aws-topology","last_synced_at":"2026-01-12T11:17:10.009Z","repository":{"id":213981791,"uuid":"735270563","full_name":"converged-computing/flex-aws-topology","owner":"converged-computing","description":"Mapping AWS topology API into a fluxion graph","archived":false,"fork":false,"pushed_at":"2023-12-24T21:43:08.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-10T05:36:57.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/converged-computing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-24T09:50:00.000Z","updated_at":"2023-12-24T23:37:48.000Z","dependencies_parsed_at":"2024-06-20T23:18:48.757Z","dependency_job_id":"989cb436-c594-429d-ab90-c0abad39f032","html_url":"https://github.com/converged-computing/flex-aws-topology","commit_stats":null,"previous_names":["converged-computing/flex-aws-topology"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/converged-computing/flex-aws-topology","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fflex-aws-topology","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fflex-aws-topology/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fflex-aws-topology/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fflex-aws-topology/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/converged-computing","download_url":"https://codeload.github.com/converged-computing/flex-aws-topology/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/converged-computing%2Fflex-aws-topology/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T11:17:09.941Z","updated_at":"2026-01-12T11:17:10.000Z","avatar_url":"https://github.com/converged-computing.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flex AWS Topology\n\n\u003e Explore using the AWS topology API\n\nWe want to eventually use the [AWS Topology API](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html) to add metadata to fluence about a cluster topology.\nTo do this we can use the [Go bindings](https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/#EC2.DescribeInstanceTopology).\n\n## Design\n\n### Overview\n\nThe Flux Framework \"flux-sched\" or fluxion project provides modular bindings in different languages for intelligent,\ngraph-based scheduling. When we extend fluxion to a tool or project that warrants logic of this type, we call this a flex!\nThus, the project here demonstrates flex-archspec, or using fluxion to match some system request to what we know in the archspec graph. E.g.,\n\n\u003e Do you have an x86 system with this compiler option?\n\nThis is a simple use case that doesn't perfectly reflect the OCI container use case, but we need to start somewhere! For this very basic setup we are going to:\n\n1. Load the machines into a JSON Graph (called JGF).\n2. Try doing a query against system metadata\n\nThere will eventually be a third component - a container image specification, for which we need to include somewhere here. I am starting simple!\n\n### Concepts\n\nFrom the above, the following definitions might be useful.\n\n - **[Flux Framework](https://flux-framework.org)**: a modular framework for putting together a workload manager. It is traditionally for HPC, but components have been used in other places (e.g., here, Kubernetes, etc). It is analogous to Kubernetes in that it is modular and used for running batch workloads.\n - **[fluxion](fluxion)**: refers to [flux-framework/flux-sched](https://github.com/flux-framework/flux-sched) and is the scheduler component or module of Flux Framework. There are bindings in several languages, and specifically the Go bindings (server at [flux-framework/flux-k8s](https://github.com/flux-framework/flux-k8s)) assemble into the project \"fluence.\"\n - **flex** is an out of tree tool, plugin, or similar that uses fluxion to flexibly schedule or match some kind of graph-based resources. This project is an example of a flex!\n\n## Usage\n\n### Build\n\nThis demonstrates how to build the bindings. You will need to be in the VSCode developer container environment, or produce the same\non your host. Note that we currently are using [this commit](https://github.com/researchapps/flux-sched/commit/86f5bb331342f2883b057920cf58e2c042aef881) that\nsi a fork of [milroy's work](https://github.com/flux-framework/flux-sched/pull/1120) to ensure the module name matches what is added to go.mod (it won't work otherwise). When this is merged, we will update to flux-framework/flux-sched. Below shows the make command that builds our final binary!\n\n```bash\nmake\n```\n```console\n# This needs to match the flux-sched install and latest commit, for now we are using a fork of milroy's branch\n# that has a go.mod updated to match the org name\n# go get -u github.com/researchapps/flux-sched/resource/reapi/bindings/go/src/fluxcli@86f5bb331342f2883b057920cf58e2c042aef881\ngo mod tidy\nmkdir -p ./bin\nGOOS=linux CGO_CFLAGS=\"-I/opt/flux-sched/resource/reapi/bindings/c\" CGO_LDFLAGS=\"-L/usr/lib -L/opt/flux-sched/resource -lfluxion-resource -L/opt/flux-sched/resource/libjobspec -ljobspec_conv -L//opt/flux-sched/resource/reapi/bindings -lreapi_cli -lflux-idset -lstdc++ -lczmq -ljansson -lhwloc -lboost_system -lflux-hostlist -lboost_graph -lyaml-cpp\" go build -ldflags '-w' -o bin/aws-topology src/cmd/main.go\n```\n\nThe output is generated in bin:\n\n```bash\n$ ls bin/\naws-topology\n```\n\n### Run\n\n#### 1. Paths\n\nEnsure you have your LD library path set to find flux sched (fluxion) libraries.\n\n```bash\nexport LD_LIBRARY_PATH=/usr/lib:/opt/flux-sched/resource:/opt/flux-sched/resource/reapi/bindings:/opt/flux-sched/resource/libjobspec\n```\n\n#### 2. Credentials\n\nEnsure you have AWS credentials in your environment (I figure any cloud scheduler we use is going to have environment ephemeral secrets and not other kinds of credentials, but we can change this).\n\n```bash\nexport AWS_ACCESS_KEY_ID=xxxxxxxxxxxxx\nexport AWS_SECRET_ACCESS_KEY=xxxxxxxxxxx\nexport AWS_SESSION_TOKEN=xxxxxxxxxxxxx\n```\n\n#### 4. Nodes\n\nYou can either manually create node (be sure to choose an hpc instance family type) or create a mini cluster with the config provided here:\n\n```bash\neksctl create cluster --config-file eksctl-config.yaml \n```\n\nThat will create a cluster with 2 nodes in a placement group in us-east-2. It takes a while.\n\n#### 5. Run\n\nHere is how to run with an instance id, and note that the instance is running:\n\n```bash\n./bin/aws-topology --instance i-0cd50e305e797dde3\n```\n\nAnd here is how to run with a placement group (per the creation above):\n\n```bash\n./bin/aws-topology --group eks-efa-testing --region us-east-2\n```\n\nThis will generate the JGF to a non-temporary file for you to debug:\n\n```bash\n./bin/aws-topology --group eks-efa-testing --region us-east-2 --file ./aws-topology.json\n```\n\nThis shows simple output and you can also view the [generated topology](aws-topology.json):\n\n\u003cdetails\u003e\n\n\u003csummary\u003e Output for JGF \u003c/summary\u003e\n\n```console\nThis is the flex aws topology prototype\n Match policy: first\n Load format: JSON Graph Format (JGF)\nCreated flex resource graph \u0026{%!s(*fluxcli.ReapiCtx=\u0026{})}\nTopology Query Parameters:\n{\n  DryRun: false,\n  GroupNames: [\"eks-efa-testing\"]\n}\n{\n  Instances: [{\n      AvailabilityZone: \"us-east-2b\",\n      GroupName: \"eks-efa-testing\",\n      InstanceId: \"i-02125af4faf797399\",\n      InstanceType: \"hpc6a.48xlarge\",\n      NetworkNodes: [\"nn-ec17a935b39a06f41\",\"nn-dd9ec3119ca6ea9dc\",\"nn-a59759166e67e7c02\"],\n      ZoneId: \"use2-az2\"\n    },{\n      AvailabilityZone: \"us-east-2b\",\n      GroupName: \"eks-efa-testing\",\n      InstanceId: \"i-0fbbd476a798a3f82\",\n      InstanceType: \"hpc6a.48xlarge\",\n      NetworkNodes: [\"nn-ec17a935b39a06f41\",\"nn-dd9ec3119ca6ea9dc\",\"nn-a59759166e67e7c02\"],\n      ZoneId: \"use2-az2\"\n    }],\n  NextToken: \"...\"\n}\ni-02125af4faf797399 is not yet seen, adding with uid 1\nnn-ec17a935b39a06f41 is not yet seen, adding with uid 2\nnn-dd9ec3119ca6ea9dc is not yet seen, adding with uid 3\nnn-a59759166e67e7c02 is not yet seen, adding with uid 4\nCreating instance node for i-02125af4faf797399\nCreating network node for nn-ec17a935b39a06f41\nCreating network node for nn-dd9ec3119ca6ea9dc\nCreating network node for nn-a59759166e67e7c02\ni-0fbbd476a798a3f82 is not yet seen, adding with uid 5\nCreating instance node for i-0fbbd476a798a3f82\nCreating node 0 cluster\nCreating node 1 i-02125af4faf797399\nCreating node 2 nn-ec17a935b39a06f41\nCreating node 3 nn-dd9ec3119ca6ea9dc\nCreating node 4 nn-a59759166e67e7c02\nCreating node 5 i-0fbbd476a798a3f82\nCreating edge (4 contains-\u003e5) (5 in-\u003e 4) \nCreating edge (0 contains-\u003e2) (2 in-\u003e 0) \nCreating edge (2 contains-\u003e3) (3 in-\u003e 2) \nCreating edge (3 contains-\u003e4) (4 in-\u003e 3) \nCreating edge (4 contains-\u003e1) (1 in-\u003e 4) \n```\n\n\u003c/details\u003e\n\nNote that we could next add some kind of match - I'm guessing we care about distances in the graph more than attributes.\nI'll wait to chat with folks more about next steps, because I've accomplished the goal I set out to do.\nThis was immensely satisfying to work on.\n\n#### 6. Cleanup\n\nDon't forget to cleanup your nodes - they cost money!\n\n```bash\neksctl delete cluster --config-file eksctl-config.yaml \n```\n\n## License\n\nHPCIC DevTools is distributed under the terms of the MIT license.\nAll new contributions must be made under this license.\n\nSee [LICENSE](https://github.com/converged-computing/cloud-select/blob/main/LICENSE),\n[COPYRIGHT](https://github.com/converged-computing/cloud-select/blob/main/COPYRIGHT), and\n[NOTICE](https://github.com/converged-computing/cloud-select/blob/main/NOTICE) for details.\n\nSPDX-License-Identifier: (MIT)\n\nLLNL-CODE- 842614\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconverged-computing%2Fflex-aws-topology","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconverged-computing%2Fflex-aws-topology","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconverged-computing%2Fflex-aws-topology/lists"}