{"id":23247150,"url":"https://github.com/evertras/nomad-generic-device-plugin","last_synced_at":"2025-08-20T05:32:26.257Z","repository":{"id":64305583,"uuid":"372830602","full_name":"Evertras/nomad-generic-device-plugin","owner":"Evertras","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-13T03:13:35.000Z","size":38,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T10:01:50.831Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Evertras.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}},"created_at":"2021-06-01T12:57:52.000Z","updated_at":"2025-01-13T10:32:48.000Z","dependencies_parsed_at":"2023-01-15T10:30:19.160Z","dependency_job_id":null,"html_url":"https://github.com/Evertras/nomad-generic-device-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"hashicorp/nomad-skeleton-device-plugin","purl":"pkg:github/Evertras/nomad-generic-device-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evertras%2Fnomad-generic-device-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evertras%2Fnomad-generic-device-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evertras%2Fnomad-generic-device-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evertras%2Fnomad-generic-device-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Evertras","download_url":"https://codeload.github.com/Evertras/nomad-generic-device-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evertras%2Fnomad-generic-device-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271269233,"owners_count":24730097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-12-19T07:17:33.701Z","updated_at":"2025-08-20T05:32:25.933Z","avatar_url":"https://github.com/Evertras.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nomad Generic Device Plugin\n===========================\n\nNomad allows jobs to request various devices to reserve, such as GPUs.  However,\nthere is no way to specify generic devices to reserve, such as a mobile device\nor external hardware.\n\nThis plugin uses the [Nomad device plugins](https://www.nomadproject.io/docs/internals/plugins/devices.html)\nfeature to allow you to configure arbitrary hardware devices to be available\non the node for reservation.\n\nBased on [the Skeleton Device Plugin](https://github.com/hashicorp/nomad-skeleton-device-plugin)\nprovided by Hashicorp.\n\nThis repo is a bit messy/unpolished for the moment.  Don't take anything here\nas a best practice.\n\nFeatures\n--------\n\nCurrently, the plugin allows you to specify arbitrary values for a device.\nNo checks are made.  If you configure a device in the client config, the device\nwill be made available for reservation.\n\nOnly single, discrete devices are currently supported.\n\nA client config might include the following to enable the plugin and add some\ndevices to make available:\n\n```hcl\n# This particular client has two phones and a car connected to it\nplugin \"generic-device\" {\n  config {\n    device {\n      type = \"phone\"\n      vendor = \"woogle\"\n      model = \"nebula10\"\n    }\n\n    device {\n      type = \"phone\"\n      vendor = \"mango\"\n      model = \"mphone12-max\"\n    }\n\n    device {\n      type = \"car\"\n      vendor = \"doyota\"\n      model = \"mius\"\n    }\n  }\n}\n```\n\nThen a job might look like this:\n\n```hcl\njob \"self-driving-demo\" {\n  type = \"batch\"\n  datacenters = [\"dc1\"]\n\n  group \"run-stuff\" {\n    task \"drive-around\" {\n      driver = \"exec\"\n      config {\n        command = \"bash\"\n        args = [\"-c\", \"echo Circling the block... \u0026\u0026 magic-self-driving \u0026\u0026 echo Done!\"]\n      }\n\n      resources {\n        # Reserve a Doyota Mius to drive around with for the duration of this task\n        device \"doyota/car/mius\" {}\n      }\n    }\n  }\n}\n```\n\nWishlist\n--------\n\nArbitrary health check scripts to see if the device is actually healthy/available.\n\nArbitrary attributes that can be selected against, such as memory usage.\n\nAttribute/model scripts that can dynamically fill in data when fingerprinted.\n\nBetter tests and cleaner code, this was bare minimum changes from the skeleton\nreference with some manual testing to see what actually works.\n\nRequirements\n------------\n\n- [Go](https://golang.org/doc/install) 1.12 or later (to build the plugin)\n\nBuilding the Generic Device Plugin\n----------------------------------\n\n```sh\n$ make\n```\n\nRunning the Plugin in Development\n---------------------------------\n\nYou can test this plugin (and your own device plugins) in development using the\n[plugin launcher](https://github.com/hashicorp/nomad/tree/master/plugins/shared/cmd/launcher). The makefile provides\na target for this:\n\n```sh\n$ make eval\n```\n\nDeploying Device Plugins in Nomad\n---------------------------------\n\nCopy the plugin binary to the\n[plugins directory](https://www.nomadproject.io/docs/configuration/index.html#plugin_dir) and\n[configure the plugin](https://www.nomadproject.io/docs/configuration/plugin.html) in the client config. Then use the\n[device stanza](https://www.nomadproject.io/docs/job-specification/device.html) in the job file to schedule with\ndevice support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevertras%2Fnomad-generic-device-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevertras%2Fnomad-generic-device-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevertras%2Fnomad-generic-device-plugin/lists"}