From d1efa0ed675159c394c1a42c1c9366e7d0a0118e Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Wed, 23 Mar 2022 16:37:21 +0100 Subject: [PATCH 1/2] Update dependencies --- Cargo.lock | 620 ++++++++++++++++++++++-------------- k8s-deviceplugin/Cargo.toml | 6 +- plugin/Cargo.toml | 6 +- 3 files changed, 390 insertions(+), 242 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b80d6f4..409dc52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,16 +1,18 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "anyhow" -version = "1.0.38" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" [[package]] name = "async-stream" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3670df70cbc01729f901f94c887814b3c68db038aad1329a418bae178bc5295c" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" dependencies = [ "async-stream-impl", "futures-core", @@ -18,9 +20,9 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3548b8efc9f8e8a5a0a2808c5bd8451a9031b9e5b879a79590304ae928b0a70" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ "proc-macro2", "quote", @@ -29,9 +31,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.42" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2", "quote", @@ -40,9 +42,52 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab2504b827a8bef941ba3dd64bdffe9cf56ca182908a147edd6189c95fbcae7d" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde", + "sync_wrapper", + "tokio", + "tower", + "tower-http", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da31c0ed7b4690e2c78fe4b880d21cd7db04a346ebc658b4270251b695437f17" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", +] [[package]] name = "base64" @@ -52,15 +97,21 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bytes" -version = "1.0.1" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cc" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -68,17 +119,35 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] + [[package]] name = "either" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "fixedbitset" -version = "0.2.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "fnv" @@ -88,36 +157,36 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures-channel" -version = "0.3.12" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.12" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-sink" -version = "0.3.12" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.12" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.12" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures-core", "futures-task", @@ -127,20 +196,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] name = "h2" -version = "0.3.0" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" dependencies = [ "bytes", "fnv", @@ -153,38 +222,34 @@ dependencies = [ "tokio", "tokio-util", "tracing", - "tracing-futures", ] [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" -dependencies = [ - "unicode-segmentation", -] +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "http" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" dependencies = [ "bytes", "fnv", @@ -193,31 +258,38 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.0" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", + "pin-project-lite", ] +[[package]] +name = "http-range-header" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" + [[package]] name = "httparse" -version = "1.3.4" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" -version = "0.3.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.2" +version = "0.14.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12219dc884514cb4a6a03737f4413c0e01c23a1b059b0156004b23f1e19dccbe" +checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" dependencies = [ "bytes", "futures-channel", @@ -229,7 +301,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 1.0.4", + "pin-project-lite", "socket2", "tokio", "tower-service", @@ -237,30 +309,51 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "indexmap" -version = "1.6.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" +checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" dependencies = [ "autocfg", "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "itertools" -version = "0.9.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.7" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "k8s-deviceplugin" @@ -271,17 +364,6 @@ dependencies = [ "tonic-build", ] -[[package]] -name = "k8s-deviceplugin" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d21d9a346a7ecd570f424676b1ae4c1201963b3417f615e8d684ca0949fcd685" -dependencies = [ - "prost", - "tonic", - "tonic-build", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -290,73 +372,71 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.84" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cca32fa0182e8c0989459524dc356b8f2b5c10f1b9eb521b7d182c03cf8c5ff" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] +[[package]] +name = "matchit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" + [[package]] name = "memchr" -version = "2.3.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "mio" -version = "0.7.7" +name = "mime" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" -dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", -] +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] -name = "miow" -version = "0.3.6" +name = "mio" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" dependencies = [ - "socket2", - "winapi", + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", ] [[package]] name = "multimap" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" - -[[package]] -name = "ntapi" -version = "0.3.6" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi", -] +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", ] +[[package]] +name = "once_cell" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -365,9 +445,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" dependencies = [ "fixedbitset", "indexmap", @@ -375,38 +455,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" -dependencies = [ - "pin-project-internal 0.4.27", -] - -[[package]] -name = "pin-project" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" -dependencies = [ - "pin-project-internal 1.0.4", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.27" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ - "proc-macro2", - "quote", - "syn", + "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.4" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -415,9 +475,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.4" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -429,7 +489,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" name = "plugin" version = "0.1.0" dependencies = [ - "k8s-deviceplugin 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "k8s-deviceplugin", "prost", "tokio", "tonic", @@ -438,24 +498,34 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "prettyplease" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" +dependencies = [ + "proc-macro2", + "syn", +] [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "prost" -version = "0.7.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ "bytes", "prost-derive", @@ -463,27 +533,31 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.7.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" dependencies = [ "bytes", + "cfg-if", + "cmake", "heck", "itertools", + "lazy_static", "log", "multimap", "petgraph", "prost", "prost-types", + "regex", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.7.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" dependencies = [ "anyhow", "itertools", @@ -494,9 +568,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.7.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" +checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" dependencies = [ "bytes", "prost", @@ -504,30 +578,29 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.8" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] [[package]] name = "rand" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", "rand_core", - "rand_hc", ] [[package]] name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", @@ -535,31 +608,37 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ "getrandom", ] [[package]] -name = "rand_hc" -version = "0.3.0" +name = "redox_syscall" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ - "rand_core", + "bitflags", ] [[package]] -name = "redox_syscall" -version = "0.2.4" +name = "regex" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ - "bitflags", + "regex-syntax", ] +[[package]] +name = "regex-syntax" +version = "0.6.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -569,89 +648,92 @@ dependencies = [ "winapi", ] +[[package]] +name = "serde" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" + [[package]] name = "slab" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "socket2" -version = "0.3.19" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ - "cfg-if", "libc", "winapi", ] [[package]] name = "syn" -version = "1.0.60" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" + [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", + "fastrand", "libc", - "rand", "redox_syscall", "remove_dir_all", "winapi", ] -[[package]] -name = "thiserror" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tokio" -version = "1.1.1" +version = "1.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6714d663090b6b0acb0fa85841c6d66233d150cdb2602c8f9b8abb03370beb3f" +checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" dependencies = [ - "autocfg", "bytes", "libc", "memchr", "mio", "num_cpus", + "once_cell", "pin-project-lite", + "socket2", "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", ] [[package]] name = "tokio-macros" -version = "1.0.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42517d2975ca3114b22a16192634e8241dc5cc1f130be194645970cc1c371494" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2", "quote", @@ -660,9 +742,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.2" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76066865172052eb8796c686f0b441a93df8b08d40a950b062ffb9a426f00edd" +checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", "pin-project-lite", @@ -671,28 +753,27 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb971a26599ffd28066d387f109746df178eff14d5ea1e235015c5601967a4b" +checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" dependencies = [ - "async-stream", "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", - "tokio-stream", + "tracing", ] [[package]] name = "tonic" -version = "0.4.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ba8f479158947373b6df40cf48f4779bb25c99ca3c661bd95e0ab1963ad8b0e" +checksum = "5be9d60db39854b30b835107500cf0aca0b0d14d6e1c3de124217c23a29c2ddb" dependencies = [ "async-stream", "async-trait", + "axum", "base64", "bytes", "futures-core", @@ -701,14 +782,16 @@ dependencies = [ "http", "http-body", "hyper", + "hyper-timeout", "percent-encoding", - "pin-project 1.0.4", + "pin-project", "prost", "prost-derive", "tokio", "tokio-stream", "tokio-util", "tower", + "tower-layer", "tower-service", "tracing", "tracing-futures", @@ -716,10 +799,11 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.4.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e8546fd40d56d28089835c0a81bb396848103b00f888aea42d46eb5974df07" +checksum = "d9263bf4c9bfaae7317c1c2faf7f18491d2fe476f70c414b73bf5d445b00ffa1" dependencies = [ + "prettyplease", "proc-macro2", "prost-build", "quote", @@ -728,23 +812,43 @@ dependencies = [ [[package]] name = "tower" -version = "0.4.4" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd7b451959622e21de79261673d658a0944b835012c58c51878ea55957fb51a" +checksum = "9a89fd63ad6adf737582df5db40d286574513c69a11dac5214dc3b5603d6713e" dependencies = [ "futures-core", "futures-util", "indexmap", - "pin-project 1.0.4", + "pin-project", + "pin-project-lite", "rand", "slab", "tokio", - "tokio-stream", + "tokio-util", "tower-layer", "tower-service", "tracing", ] +[[package]] +name = "tower-http" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d342c6d58709c0a6d48d48dabbb62d4ef955cf5f0f3bbfd845838e7ae88dbae" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.1" @@ -759,9 +863,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.22" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" +checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" dependencies = [ "cfg-if", "log", @@ -772,9 +876,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.11" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" dependencies = [ "proc-macro2", "quote", @@ -783,20 +887,20 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" dependencies = [ "lazy_static", ] [[package]] name = "tracing-futures" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 0.4.27", + "pin-project", "tracing", ] @@ -807,16 +911,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] -name = "unicode-segmentation" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" - -[[package]] -name = "unicode-xid" -version = "0.2.1" +name = "unicode-ident" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" [[package]] name = "want" @@ -834,14 +932,21 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "which" -version = "4.0.2" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" dependencies = [ + "either", + "lazy_static", "libc", - "thiserror", ] [[package]] @@ -865,3 +970,46 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/k8s-deviceplugin/Cargo.toml b/k8s-deviceplugin/Cargo.toml index a010766..e8ea061 100644 --- a/k8s-deviceplugin/Cargo.toml +++ b/k8s-deviceplugin/Cargo.toml @@ -16,8 +16,8 @@ keywords = ["kubernetes", "k8s", "device", "plugin"] build = "build.rs" [dependencies] -tonic = "0.4" -prost = "0.7" +tonic = "0.7" +prost = "0.10" [build-dependencies] -tonic-build = "0.4" +tonic-build = "0.7" diff --git a/plugin/Cargo.toml b/plugin/Cargo.toml index d3d0cda..c158b08 100644 --- a/plugin/Cargo.toml +++ b/plugin/Cargo.toml @@ -5,8 +5,8 @@ authors = ["hasheddan "] edition = "2018" [dependencies] -k8s-deviceplugin = "0.1.0" -tonic = "0.4" -prost = "0.7" +k8s-deviceplugin = { path = "../k8s-deviceplugin" } +tonic = "0.7" +prost = "0.10" tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } tower = { version = "0.4" } From b14f805274d08fae58596f500a891f0d7295b872 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Wed, 23 Mar 2022 16:38:32 +0100 Subject: [PATCH 2/2] Generate proto code into out directory This avoids polluting the source tree. Signed-off-by: Pascal Bach --- k8s-deviceplugin/build.rs | 9 +- k8s-deviceplugin/src/deviceplugin.rs | 260 ----------------- k8s-deviceplugin/src/lib.rs | 4 +- k8s-deviceplugin/src/v1beta1.rs | 400 --------------------------- 4 files changed, 5 insertions(+), 668 deletions(-) delete mode 100644 k8s-deviceplugin/src/deviceplugin.rs delete mode 100644 k8s-deviceplugin/src/v1beta1.rs diff --git a/k8s-deviceplugin/build.rs b/k8s-deviceplugin/build.rs index bb6c76d..c8c241c 100644 --- a/k8s-deviceplugin/build.rs +++ b/k8s-deviceplugin/build.rs @@ -1,9 +1,6 @@ fn main() { tonic_build::configure() - .build_server(false) - .out_dir("src") - .compile( - &["proto/v1beta1.proto", "proto/v1alpha.proto"], - &["proto"], - ).unwrap(); + .build_server(true) + .compile(&["proto/v1beta1.proto", "proto/v1alpha.proto"], &["proto"]) + .unwrap(); } diff --git a/k8s-deviceplugin/src/deviceplugin.rs b/k8s-deviceplugin/src/deviceplugin.rs deleted file mode 100644 index 4a902fa..0000000 --- a/k8s-deviceplugin/src/deviceplugin.rs +++ /dev/null @@ -1,260 +0,0 @@ -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisterRequest { - /// Version of the API the Device Plugin was built against - #[prost(string, tag = "1")] - pub version: ::prost::alloc::string::String, - /// Name of the unix socket the device plugin is listening on - /// PATH = path.Join(DevicePluginPath, endpoint) - #[prost(string, tag = "2")] - pub endpoint: ::prost::alloc::string::String, - /// Schedulable resource name. As of now it's expected to be a DNS Label - #[prost(string, tag = "3")] - pub resource_name: ::prost::alloc::string::String, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Empty {} -/// ListAndWatch returns a stream of List of Devices -/// Whenever a Device state changes or a Device disappears, ListAndWatch -/// returns the new list -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListAndWatchResponse { - #[prost(message, repeated, tag = "1")] - pub devices: ::prost::alloc::vec::Vec, -} -/// E.g: -/// struct Device { -/// ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e", -/// Health: "Healthy", -///} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Device { - /// A unique ID assigned by the device plugin used - /// to identify devices during the communication - /// Max length of this field is 63 characters - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// Health of the device, can be healthy or unhealthy, see constants.go - #[prost(string, tag = "2")] - pub health: ::prost::alloc::string::String, -} -/// - Allocate is expected to be called during pod creation since allocation -/// failures for any container would result in pod startup failure. -/// - Allocate allows kubelet to exposes additional artifacts in a pod's -/// environment as directed by the plugin. -/// - Allocate allows Device Plugin to run device specific operations on -/// the Devices requested -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AllocateRequest { - #[prost(string, repeated, tag = "1")] - pub devices_i_ds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// AllocateResponse includes the artifacts that needs to be injected into -/// a container for accessing 'deviceIDs' that were mentioned as part of -/// 'AllocateRequest'. -/// Failure Handling: -/// if Kubelet sends an allocation request for dev1 and dev2. -/// Allocation on dev1 succeeds but allocation on dev2 fails. -/// The Device plugin should send a ListAndWatch update and fail the -/// Allocation request -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AllocateResponse { - /// List of environment variable to be set in the container to access one of more devices. - #[prost(map = "string, string", tag = "1")] - pub envs: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - /// Mounts for the container. - #[prost(message, repeated, tag = "2")] - pub mounts: ::prost::alloc::vec::Vec, - /// Devices for the container. - #[prost(message, repeated, tag = "3")] - pub devices: ::prost::alloc::vec::Vec, - /// Container annotations to pass to the container runtime - #[prost(map = "string, string", tag = "4")] - pub annotations: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, -} -/// Mount specifies a host volume to mount into a container. -/// where device library or tools are installed on host and container -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Mount { - /// Path of the mount within the container. - #[prost(string, tag = "1")] - pub container_path: ::prost::alloc::string::String, - /// Path of the mount on the host. - #[prost(string, tag = "2")] - pub host_path: ::prost::alloc::string::String, - /// If set, the mount is read-only. - #[prost(bool, tag = "3")] - pub read_only: bool, -} -/// DeviceSpec specifies a host device to mount into a container. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeviceSpec { - /// Path of the device within the container. - #[prost(string, tag = "1")] - pub container_path: ::prost::alloc::string::String, - /// Path of the device on the host. - #[prost(string, tag = "2")] - pub host_path: ::prost::alloc::string::String, - /// Cgroups permissions of the device, candidates are one or more of - /// * r - allows container to read from the specified device. - /// * w - allows container to write to the specified device. - /// * m - allows container to create device files that do not yet exist. - #[prost(string, tag = "3")] - pub permissions: ::prost::alloc::string::String, -} -#[doc = r" Generated client implementations."] -pub mod registration_client { - #![allow(unused_variables, dead_code, missing_docs)] - use tonic::codegen::*; - #[doc = " Registration is the service advertised by the Kubelet"] - #[doc = " Only when Kubelet answers with a success code to a Register Request"] - #[doc = " may Device Plugins start their service"] - #[doc = " Registration may fail when device plugin version is not supported by"] - #[doc = " Kubelet or the registered resourceName is already taken by another"] - #[doc = " active device plugin. Device plugin is expected to terminate upon registration failure"] - pub struct RegistrationClient { - inner: tonic::client::Grpc, - } - impl RegistrationClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl RegistrationClient - where - T: tonic::client::GrpcService, - T::ResponseBody: Body + HttpBody + Send + 'static, - T::Error: Into, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: impl Into) -> Self { - let inner = tonic::client::Grpc::with_interceptor(inner, interceptor); - Self { inner } - } - pub async fn register( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/deviceplugin.Registration/Register"); - self.inner.unary(request.into_request(), path, codec).await - } - } - impl Clone for RegistrationClient { - fn clone(&self) -> Self { - Self { - inner: self.inner.clone(), - } - } - } - impl std::fmt::Debug for RegistrationClient { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RegistrationClient {{ ... }}") - } - } -} -#[doc = r" Generated client implementations."] -pub mod device_plugin_client { - #![allow(unused_variables, dead_code, missing_docs)] - use tonic::codegen::*; - #[doc = " DevicePlugin is the service advertised by Device Plugins"] - pub struct DevicePluginClient { - inner: tonic::client::Grpc, - } - impl DevicePluginClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl DevicePluginClient - where - T: tonic::client::GrpcService, - T::ResponseBody: Body + HttpBody + Send + 'static, - T::Error: Into, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: impl Into) -> Self { - let inner = tonic::client::Grpc::with_interceptor(inner, interceptor); - Self { inner } - } - #[doc = " ListAndWatch returns a stream of List of Devices"] - #[doc = " Whenever a Device state changes or a Device disappears, ListAndWatch"] - #[doc = " returns the new list"] - pub async fn list_and_watch( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response>, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/deviceplugin.DevicePlugin/ListAndWatch"); - self.inner - .server_streaming(request.into_request(), path, codec) - .await - } - #[doc = " Allocate is called during container creation so that the Device"] - #[doc = " Plugin can run device specific operations and instruct Kubelet"] - #[doc = " of the steps to make the Device available in the container"] - pub async fn allocate( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/deviceplugin.DevicePlugin/Allocate"); - self.inner.unary(request.into_request(), path, codec).await - } - } - impl Clone for DevicePluginClient { - fn clone(&self) -> Self { - Self { - inner: self.inner.clone(), - } - } - } - impl std::fmt::Debug for DevicePluginClient { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "DevicePluginClient {{ ... }}") - } - } -} diff --git a/k8s-deviceplugin/src/lib.rs b/k8s-deviceplugin/src/lib.rs index 8261b40..5c8ccad 100644 --- a/k8s-deviceplugin/src/lib.rs +++ b/k8s-deviceplugin/src/lib.rs @@ -34,7 +34,7 @@ //! pub mod v1beta1 { - include!("./v1beta1.rs"); + tonic::include_proto!("v1beta1"); /// Means that the device is healthy. pub const HEALTHY: &str = "Healthy"; @@ -67,7 +67,7 @@ pub mod v1beta1 { } pub mod v1alpha { - include!("./deviceplugin.rs"); + tonic::include_proto!("deviceplugin"); /// Means that the device is healthy. pub const HEALTHY: &str = "Healthy"; diff --git a/k8s-deviceplugin/src/v1beta1.rs b/k8s-deviceplugin/src/v1beta1.rs deleted file mode 100644 index 38816d9..0000000 --- a/k8s-deviceplugin/src/v1beta1.rs +++ /dev/null @@ -1,400 +0,0 @@ -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DevicePluginOptions { - /// Indicates if PreStartContainer call is required before each container start - #[prost(bool, tag = "1")] - pub pre_start_required: bool, - /// Indicates if GetPreferredAllocation is implemented and available for calling - #[prost(bool, tag = "2")] - pub get_preferred_allocation_available: bool, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisterRequest { - /// Version of the API the Device Plugin was built against - #[prost(string, tag = "1")] - pub version: ::prost::alloc::string::String, - /// Name of the unix socket the device plugin is listening on - /// PATH = path.Join(DevicePluginPath, endpoint) - #[prost(string, tag = "2")] - pub endpoint: ::prost::alloc::string::String, - /// Schedulable resource name. As of now it's expected to be a DNS Label - #[prost(string, tag = "3")] - pub resource_name: ::prost::alloc::string::String, - /// Options to be communicated with Device Manager - #[prost(message, optional, tag = "4")] - pub options: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Empty {} -/// ListAndWatch returns a stream of List of Devices -/// Whenever a Device state change or a Device disappears, ListAndWatch -/// returns the new list -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListAndWatchResponse { - #[prost(message, repeated, tag = "1")] - pub devices: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TopologyInfo { - #[prost(message, repeated, tag = "1")] - pub nodes: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NumaNode { - #[prost(int64, tag = "1")] - pub id: i64, -} -/// E.g: -/// struct Device { -/// ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e", -/// Health: "Healthy", -/// Topology: -/// Node: -/// ID: 1 -///} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Device { - /// A unique ID assigned by the device plugin used - /// to identify devices during the communication - /// Max length of this field is 63 characters - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// Health of the device, can be healthy or unhealthy, see constants.go - #[prost(string, tag = "2")] - pub health: ::prost::alloc::string::String, - /// Topology for device - #[prost(message, optional, tag = "3")] - pub topology: ::core::option::Option, -} -/// - PreStartContainer is expected to be called before each container start if indicated by plugin during registration phase. -/// - PreStartContainer allows kubelet to pass reinitialized devices to containers. -/// - PreStartContainer allows Device Plugin to run device specific operations on -/// the Devices requested -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreStartContainerRequest { - #[prost(string, repeated, tag = "1")] - pub devices_i_ds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// PreStartContainerResponse will be send by plugin in response to PreStartContainerRequest -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreStartContainerResponse {} -/// PreferredAllocationRequest is passed via a call to GetPreferredAllocation() -/// at pod admission time. The device plugin should take the list of -/// `available_deviceIDs` and calculate a preferred allocation of size -/// 'allocation_size' from them, making sure to include the set of devices -/// listed in 'must_include_deviceIDs'. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreferredAllocationRequest { - #[prost(message, repeated, tag = "1")] - pub container_requests: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ContainerPreferredAllocationRequest { - /// List of available deviceIDs from which to choose a preferred allocation - #[prost(string, repeated, tag = "1")] - pub available_device_i_ds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// List of deviceIDs that must be included in the preferred allocation - #[prost(string, repeated, tag = "2")] - pub must_include_device_i_ds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// Number of devices to include in the preferred allocation - #[prost(int32, tag = "3")] - pub allocation_size: i32, -} -/// PreferredAllocationResponse returns a preferred allocation, -/// resulting from a PreferredAllocationRequest. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PreferredAllocationResponse { - #[prost(message, repeated, tag = "1")] - pub container_responses: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ContainerPreferredAllocationResponse { - #[prost(string, repeated, tag = "1")] - pub device_i_ds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// - Allocate is expected to be called during pod creation since allocation -/// failures for any container would result in pod startup failure. -/// - Allocate allows kubelet to exposes additional artifacts in a pod's -/// environment as directed by the plugin. -/// - Allocate allows Device Plugin to run device specific operations on -/// the Devices requested -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AllocateRequest { - #[prost(message, repeated, tag = "1")] - pub container_requests: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ContainerAllocateRequest { - #[prost(string, repeated, tag = "1")] - pub devices_i_ds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// AllocateResponse includes the artifacts that needs to be injected into -/// a container for accessing 'deviceIDs' that were mentioned as part of -/// 'AllocateRequest'. -/// Failure Handling: -/// if Kubelet sends an allocation request for dev1 and dev2. -/// Allocation on dev1 succeeds but allocation on dev2 fails. -/// The Device plugin should send a ListAndWatch update and fail the -/// Allocation request -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AllocateResponse { - #[prost(message, repeated, tag = "1")] - pub container_responses: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ContainerAllocateResponse { - /// List of environment variable to be set in the container to access one of more devices. - #[prost(map = "string, string", tag = "1")] - pub envs: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, - /// Mounts for the container. - #[prost(message, repeated, tag = "2")] - pub mounts: ::prost::alloc::vec::Vec, - /// Devices for the container. - #[prost(message, repeated, tag = "3")] - pub devices: ::prost::alloc::vec::Vec, - /// Container annotations to pass to the container runtime - #[prost(map = "string, string", tag = "4")] - pub annotations: - ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, -} -/// Mount specifies a host volume to mount into a container. -/// where device library or tools are installed on host and container -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Mount { - /// Path of the mount within the container. - #[prost(string, tag = "1")] - pub container_path: ::prost::alloc::string::String, - /// Path of the mount on the host. - #[prost(string, tag = "2")] - pub host_path: ::prost::alloc::string::String, - /// If set, the mount is read-only. - #[prost(bool, tag = "3")] - pub read_only: bool, -} -/// DeviceSpec specifies a host device to mount into a container. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DeviceSpec { - /// Path of the device within the container. - #[prost(string, tag = "1")] - pub container_path: ::prost::alloc::string::String, - /// Path of the device on the host. - #[prost(string, tag = "2")] - pub host_path: ::prost::alloc::string::String, - /// Cgroups permissions of the device, candidates are one or more of - /// * r - allows container to read from the specified device. - /// * w - allows container to write to the specified device. - /// * m - allows container to create device files that do not yet exist. - #[prost(string, tag = "3")] - pub permissions: ::prost::alloc::string::String, -} -#[doc = r" Generated client implementations."] -pub mod registration_client { - #![allow(unused_variables, dead_code, missing_docs)] - use tonic::codegen::*; - #[doc = " Registration is the service advertised by the Kubelet"] - #[doc = " Only when Kubelet answers with a success code to a Register Request"] - #[doc = " may Device Plugins start their service"] - #[doc = " Registration may fail when device plugin version is not supported by"] - #[doc = " Kubelet or the registered resourceName is already taken by another"] - #[doc = " active device plugin. Device plugin is expected to terminate upon registration failure"] - pub struct RegistrationClient { - inner: tonic::client::Grpc, - } - impl RegistrationClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl RegistrationClient - where - T: tonic::client::GrpcService, - T::ResponseBody: Body + HttpBody + Send + 'static, - T::Error: Into, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: impl Into) -> Self { - let inner = tonic::client::Grpc::with_interceptor(inner, interceptor); - Self { inner } - } - pub async fn register( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/v1beta1.Registration/Register"); - self.inner.unary(request.into_request(), path, codec).await - } - } - impl Clone for RegistrationClient { - fn clone(&self) -> Self { - Self { - inner: self.inner.clone(), - } - } - } - impl std::fmt::Debug for RegistrationClient { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "RegistrationClient {{ ... }}") - } - } -} -#[doc = r" Generated client implementations."] -pub mod device_plugin_client { - #![allow(unused_variables, dead_code, missing_docs)] - use tonic::codegen::*; - #[doc = " DevicePlugin is the service advertised by Device Plugins"] - pub struct DevicePluginClient { - inner: tonic::client::Grpc, - } - impl DevicePluginClient { - #[doc = r" Attempt to create a new client by connecting to a given endpoint."] - pub async fn connect(dst: D) -> Result - where - D: std::convert::TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl DevicePluginClient - where - T: tonic::client::GrpcService, - T::ResponseBody: Body + HttpBody + Send + 'static, - T::Error: Into, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: impl Into) -> Self { - let inner = tonic::client::Grpc::with_interceptor(inner, interceptor); - Self { inner } - } - #[doc = " GetDevicePluginOptions returns options to be communicated with Device"] - #[doc = " Manager"] - pub async fn get_device_plugin_options( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/v1beta1.DevicePlugin/GetDevicePluginOptions", - ); - self.inner.unary(request.into_request(), path, codec).await - } - #[doc = " ListAndWatch returns a stream of List of Devices"] - #[doc = " Whenever a Device state change or a Device disappears, ListAndWatch"] - #[doc = " returns the new list"] - pub async fn list_and_watch( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result< - tonic::Response>, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/v1beta1.DevicePlugin/ListAndWatch"); - self.inner - .server_streaming(request.into_request(), path, codec) - .await - } - #[doc = " GetPreferredAllocation returns a preferred set of devices to allocate"] - #[doc = " from a list of available ones. The resulting preferred allocation is not"] - #[doc = " guaranteed to be the allocation ultimately performed by the"] - #[doc = " devicemanager. It is only designed to help the devicemanager make a more"] - #[doc = " informed allocation decision when possible."] - pub async fn get_preferred_allocation( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/v1beta1.DevicePlugin/GetPreferredAllocation", - ); - self.inner.unary(request.into_request(), path, codec).await - } - #[doc = " Allocate is called during container creation so that the Device"] - #[doc = " Plugin can run device specific operations and instruct Kubelet"] - #[doc = " of the steps to make the Device available in the container"] - pub async fn allocate( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/v1beta1.DevicePlugin/Allocate"); - self.inner.unary(request.into_request(), path, codec).await - } - #[doc = " PreStartContainer is called, if indicated by Device Plugin during registeration phase,"] - #[doc = " before each container start. Device plugin can run device specific operations"] - #[doc = " such as resetting the device before making devices available to the container"] - pub async fn pre_start_container( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/v1beta1.DevicePlugin/PreStartContainer"); - self.inner.unary(request.into_request(), path, codec).await - } - } - impl Clone for DevicePluginClient { - fn clone(&self) -> Self { - Self { - inner: self.inner.clone(), - } - } - } - impl std::fmt::Debug for DevicePluginClient { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "DevicePluginClient {{ ... }}") - } - } -}