@akashnetwork/chain-sdk 1.0.0-alpha.43 → 1.0.0-alpha.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/generated/createNodeSDK.cjs +5 -328
- package/dist/cjs/generated/createNodeSDK.cjs.map +2 -2
- package/dist/cjs/generated/createProviderSDK.cjs +19 -36
- package/dist/cjs/generated/createProviderSDK.cjs.map +2 -2
- package/dist/cjs/generated/patches/nodeCustomTypePatches.cjs +0 -6
- package/dist/cjs/generated/patches/nodeCustomTypePatches.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/base/attributes/v1/attribute.cjs +2 -18
- package/dist/cjs/generated/protos/akash/base/attributes/v1/attribute.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/inventory/v1/cpu.cjs +17 -2
- package/dist/cjs/generated/protos/akash/inventory/v1/cpu.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/market/v1/types.cjs +0 -6
- package/dist/cjs/generated/protos/akash/market/v1/types.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/market/v1beta5/query.cjs +1 -139
- package/dist/cjs/generated/protos/akash/market/v1beta5/query.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/market/v1beta5/query_akash.cjs +0 -9
- package/dist/cjs/generated/protos/akash/market/v1beta5/query_akash.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/event.cjs +0 -266
- package/dist/cjs/generated/protos/akash/provider/v1beta4/event.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/genesis.cjs +2 -71
- package/dist/cjs/generated/protos/akash/provider/v1beta4/genesis.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/msg.cjs +0 -321
- package/dist/cjs/generated/protos/akash/provider/v1beta4/msg.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/provider.cjs +1 -88
- package/dist/cjs/generated/protos/akash/provider/v1beta4/provider.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query.cjs +1 -462
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query_akash.cjs +0 -36
- package/dist/cjs/generated/protos/akash/provider/v1beta4/query_akash.cjs.map +2 -2
- package/dist/cjs/generated/protos/akash/provider/v1beta4/service_akash.cjs +0 -25
- package/dist/cjs/generated/protos/akash/provider/v1beta4/service_akash.cjs.map +2 -2
- package/dist/cjs/generated/protos/index.akash.v1.cjs +25 -166
- package/dist/cjs/generated/protos/index.akash.v1.cjs.map +3 -3
- package/dist/cjs/generated/protos/index.akash.v1beta4.cjs +0 -25
- package/dist/cjs/generated/protos/index.akash.v1beta4.cjs.map +3 -3
- package/dist/cjs/generated/protos/index.akash.v1beta5.cjs +0 -2
- package/dist/cjs/generated/protos/index.akash.v1beta5.cjs.map +2 -2
- package/dist/cjs/generated/protos/index.provider.akash.v1.cjs +0 -9
- package/dist/cjs/generated/protos/index.provider.akash.v1.cjs.map +2 -2
- package/dist/cjs/sdl/manifest/generateManifest.cjs +20 -51
- package/dist/cjs/sdl/manifest/generateManifest.cjs.map +2 -2
- package/dist/cjs/sdl/manifest/manifestUtils.cjs +64 -24
- package/dist/cjs/sdl/manifest/manifestUtils.cjs.map +2 -2
- package/dist/cjs/sdl/validateSDL/validateSDLInput.cjs +1426 -1450
- package/dist/cjs/sdl/validateSDL/validateSDLInput.cjs.map +2 -2
- package/dist/esm/{chunk-AKNHD3CM.js → chunk-2IHQEHWT.js} +19 -4
- package/dist/esm/chunk-2IHQEHWT.js.map +7 -0
- package/dist/esm/{chunk-MIJCN6AD.js → chunk-3K7Q5MUF.js} +2 -2
- package/dist/esm/{chunk-GRGSTKN3.js → chunk-3QS3CMF4.js} +2 -2
- package/dist/esm/{chunk-3U5XKNEU.js → chunk-4SZHF6SE.js} +3 -3
- package/dist/esm/{chunk-W3TLZPTC.js → chunk-4TSICBUM.js} +3 -3
- package/dist/esm/{chunk-P64VHYRM.js → chunk-5ODS4QTF.js} +2 -2
- package/dist/esm/{chunk-OJ54L3XZ.js → chunk-7XXZVOOW.js} +4 -4
- package/dist/esm/{chunk-F4IQOYFH.js → chunk-AR26HCRY.js} +2 -2
- package/dist/esm/chunk-C3WV6GJ6.js +234 -0
- package/dist/esm/chunk-C3WV6GJ6.js.map +7 -0
- package/dist/esm/{chunk-PYD5MY63.js → chunk-CZGHFBAO.js} +9 -131
- package/dist/esm/chunk-CZGHFBAO.js.map +7 -0
- package/dist/esm/{chunk-IEWLP7PR.js → chunk-E7KECYS7.js} +1 -7
- package/dist/esm/chunk-E7KECYS7.js.map +7 -0
- package/dist/esm/{chunk-DCLXPAMC.js → chunk-EJQUNX4L.js} +3 -3
- package/dist/esm/{chunk-F7KT5EX5.js → chunk-ENZ3OBCL.js} +2 -2
- package/dist/esm/{chunk-54RECHZZ.js → chunk-IKTMMFJ5.js} +2 -2
- package/dist/esm/chunk-IVLF3VVZ.js +364 -0
- package/dist/esm/chunk-IVLF3VVZ.js.map +7 -0
- package/dist/esm/{chunk-5VWXQLXG.js → chunk-JN5DGAQY.js} +1585 -1927
- package/dist/esm/chunk-JN5DGAQY.js.map +7 -0
- package/dist/esm/{chunk-7F3NJG67.js → chunk-LLM2VXJM.js} +3 -3
- package/dist/esm/{chunk-WNFIFYG2.js → chunk-M2RS2IFR.js} +2 -2
- package/dist/esm/{chunk-PAOVIX5L.js → chunk-MFZVOFPX.js} +3 -3
- package/dist/esm/chunk-MV27RM25.js +368 -0
- package/dist/esm/chunk-MV27RM25.js.map +7 -0
- package/dist/esm/{chunk-M5P5LAJJ.js → chunk-N42ATJOO.js} +2 -2
- package/dist/esm/{chunk-RJZ46VHV.js → chunk-NP4QQMME.js} +2 -2
- package/dist/esm/{chunk-XP2XNYEA.js → chunk-OWB6ZEHB.js} +2 -2
- package/dist/esm/{chunk-NNB5QBR2.js → chunk-OYI3IQIV.js} +2 -2
- package/dist/esm/chunk-S2CZQ6AM.js +211 -0
- package/dist/esm/chunk-S2CZQ6AM.js.map +7 -0
- package/dist/esm/{chunk-Y7BVCD32.js → chunk-SGDEIQ7L.js} +3 -3
- package/dist/esm/chunk-SXGU4O34.js +258 -0
- package/dist/esm/chunk-SXGU4O34.js.map +7 -0
- package/dist/esm/{chunk-HRN6NSO2.js → chunk-TTQ36NQ5.js} +2 -2
- package/dist/esm/chunk-V42TLXWK.js +177 -0
- package/dist/esm/chunk-V42TLXWK.js.map +7 -0
- package/dist/esm/{chunk-57534UAR.js → chunk-WCUR732W.js} +2 -2
- package/dist/esm/{chunk-CFEWW2ER.js → chunk-YBRE4XNB.js} +2 -2
- package/dist/esm/{chunk-BQNJHJXY.js → chunk-ZGK4PJCD.js} +3 -3
- package/dist/esm/{chunk-TN4W5NLC.js → chunk-ZRZ6LUI2.js} +1 -7
- package/dist/esm/chunk-ZRZ6LUI2.js.map +7 -0
- package/dist/esm/{chunk-PWXFQ5FI.js → chunk-ZXN75Q55.js} +3 -3
- package/dist/esm/generated/protos/index.akash.v1.js +75 -2986
- package/dist/esm/generated/protos/index.akash.v1.js.map +4 -4
- package/dist/esm/generated/protos/index.akash.v1beta4.js +13 -58
- package/dist/esm/generated/protos/index.akash.v1beta5.js +12 -17
- package/dist/esm/generated/protos/index.akash.v1beta5.js.map +1 -1
- package/dist/esm/generated/protos/index.akash.v2.js +4 -4
- package/dist/esm/generated/protos/index.provider.akash.v1.js +10 -29
- package/dist/esm/generated/protos/index.provider.akash.v2beta3.js +4 -5
- package/dist/esm/index.js +36 -54
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.web.js +13 -14
- package/dist/esm/index.web.js.map +1 -1
- package/dist/esm/{query_akash-HCIMNA7T.js → query_akash-44SHG3FL.js} +3 -4
- package/dist/esm/{query_akash-HCIMNA7T.js.map → query_akash-44SHG3FL.js.map} +1 -1
- package/dist/esm/{query_akash-SOJJMCBH.js → query_akash-54EYS6GQ.js} +7 -8
- package/dist/esm/{query_akash-SOJJMCBH.js.map → query_akash-54EYS6GQ.js.map} +1 -1
- package/dist/esm/{query_akash-HN4NCENR.js → query_akash-72TFPQBZ.js} +4 -4
- package/dist/esm/{query_akash-SVNQ4S67.js → query_akash-EGFDDA4L.js} +4 -4
- package/dist/esm/{query_akash-BTYAA6UN.js → query_akash-I3RPHLVA.js} +5 -5
- package/dist/esm/query_akash-N3FPIXVQ.js +39 -0
- package/dist/esm/query_akash-N3FPIXVQ.js.map +7 -0
- package/dist/esm/{query_akash-EG43V2QH.js → query_akash-QF2LHJQN.js} +4 -4
- package/dist/esm/{query_akash-LSGWB5MI.js → query_akash-TZ6F7OO4.js} +12 -24
- package/dist/esm/query_akash-TZ6F7OO4.js.map +7 -0
- package/dist/esm/service_akash-5AUMDLU5.js +46 -0
- package/dist/esm/service_akash-5AUMDLU5.js.map +7 -0
- package/dist/esm/{service_akash-43EJ5RKY.js → service_akash-EPHAYZEJ.js} +7 -8
- package/dist/esm/{service_akash-43EJ5RKY.js.map → service_akash-EPHAYZEJ.js.map} +1 -1
- package/dist/esm/{service_akash-T36Y5DCD.js → service_akash-FX24P5VG.js} +3 -4
- package/dist/esm/{service_akash-T36Y5DCD.js.map → service_akash-FX24P5VG.js.map} +1 -1
- package/dist/esm/{service_akash-HFGWADC2.js → service_akash-JQKI2SJP.js} +4 -4
- package/dist/esm/{service_akash-3R3TC3PH.js → service_akash-KRCYHNCN.js} +3 -4
- package/dist/esm/{service_akash-3R3TC3PH.js.map → service_akash-KRCYHNCN.js.map} +1 -1
- package/dist/esm/{service_akash-QTGRTXLG.js → service_akash-PFTEVUGK.js} +4 -4
- package/dist/esm/{service_akash-X4HCN3EG.js → service_akash-S73VJW6Q.js} +8 -9
- package/dist/esm/{service_akash-X4HCN3EG.js.map → service_akash-S73VJW6Q.js.map} +1 -1
- package/dist/esm/{service_akash-KAJJV7LX.js → service_akash-SXXXZL6K.js} +4 -4
- package/dist/esm/{service_akash-AXWB3IDG.js → service_akash-YXSRY4G3.js} +6 -7
- package/dist/esm/{service_akash-AXWB3IDG.js.map → service_akash-YXSRY4G3.js.map} +1 -1
- package/dist/esm/{service_akash-BZTUHKJO.js → service_akash-Z4CR3DWY.js} +7 -8
- package/dist/esm/{service_akash-BZTUHKJO.js.map → service_akash-Z4CR3DWY.js.map} +1 -1
- package/dist/sdl-schema.yaml +56 -73
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/generated/createNodeSDK.d.ts +0 -473
- package/dist/types/generated/createProviderSDK.d.ts +0 -31
- package/dist/types/generated/patches/nodeCustomTypePatches.d.ts +0 -8
- package/dist/types/generated/protos/akash/base/attributes/v1/attribute.d.ts +0 -3
- package/dist/types/generated/protos/akash/inventory/v1/cpu.d.ts +1 -0
- package/dist/types/generated/protos/akash/market/v1/types.d.ts +3 -5
- package/dist/types/generated/protos/akash/market/v1beta5/query.d.ts +0 -29
- package/dist/types/generated/protos/akash/market/v1beta5/query_akash.d.ts +1 -8
- package/dist/types/generated/protos/akash/provider/v1beta4/event.d.ts +0 -40
- package/dist/types/generated/protos/akash/provider/v1beta4/genesis.d.ts +1 -11
- package/dist/types/generated/protos/akash/provider/v1beta4/msg.d.ts +0 -57
- package/dist/types/generated/protos/akash/provider/v1beta4/provider.d.ts +0 -13
- package/dist/types/generated/protos/akash/provider/v1beta4/query.d.ts +1 -93
- package/dist/types/generated/protos/akash/provider/v1beta4/query_akash.d.ts +1 -29
- package/dist/types/generated/protos/akash/provider/v1beta4/service_akash.d.ts +1 -20
- package/dist/types/generated/protos/index.akash.v1.d.ts +0 -9
- package/dist/types/generated/protos/index.akash.v1beta4.d.ts +4 -7
- package/dist/types/generated/protos/index.akash.v1beta5.d.ts +1 -1
- package/dist/types/generated/protos/index.provider.akash.v1.d.ts +0 -1
- package/dist/types/sdk/chain/createChainNodeSDK.d.ts +0 -45
- package/dist/types/sdk/chain/createChainNodeWebSDK.d.ts +0 -45
- package/dist/types/sdl/manifest/manifestUtils.d.ts +12 -0
- package/dist/types/sdl/validateSDL/validateSDLInput.d.ts +93 -110
- package/package.json +1 -1
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot.cjs +0 -943
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot_akash.cjs +0 -50
- package/dist/cjs/generated/protos/akash/inventory/v1/snapshot_akash.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/market/v1/stats.cjs +0 -248
- package/dist/cjs/generated/protos/akash/market/v1/stats.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/provider/v1beta4/maintenance.cjs +0 -417
- package/dist/cjs/generated/protos/akash/provider/v1beta4/maintenance.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/provider/v1beta4/params.cjs +0 -96
- package/dist/cjs/generated/protos/akash/provider/v1beta4/params.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/provider/v1beta4/paramsmsg.cjs +0 -132
- package/dist/cjs/generated/protos/akash/provider/v1beta4/paramsmsg.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/event.cjs +0 -2525
- package/dist/cjs/generated/protos/akash/verification/v1/event.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/genesis.cjs +0 -253
- package/dist/cjs/generated/protos/akash/verification/v1/genesis.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/msg.cjs +0 -2774
- package/dist/cjs/generated/protos/akash/verification/v1/msg.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/params.cjs +0 -1044
- package/dist/cjs/generated/protos/akash/verification/v1/params.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/query.cjs +0 -1559
- package/dist/cjs/generated/protos/akash/verification/v1/query.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/query_akash.cjs +0 -147
- package/dist/cjs/generated/protos/akash/verification/v1/query_akash.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/service.cjs +0 -17
- package/dist/cjs/generated/protos/akash/verification/v1/service.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/service_akash.cjs +0 -190
- package/dist/cjs/generated/protos/akash/verification/v1/service_akash.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/state.cjs +0 -2018
- package/dist/cjs/generated/protos/akash/verification/v1/state.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/types.cjs +0 -1071
- package/dist/cjs/generated/protos/akash/verification/v1/types.cjs.map +0 -7
- package/dist/cjs/generated/protos/akash/verification/v1/verificationrequirement.cjs +0 -148
- package/dist/cjs/generated/protos/akash/verification/v1/verificationrequirement.cjs.map +0 -7
- package/dist/esm/chunk-2NPYA3YV.js +0 -1563
- package/dist/esm/chunk-2NPYA3YV.js.map +0 -7
- package/dist/esm/chunk-474YCD2T.js +0 -356
- package/dist/esm/chunk-474YCD2T.js.map +0 -7
- package/dist/esm/chunk-4CTTYO4O.js +0 -890
- package/dist/esm/chunk-4CTTYO4O.js.map +0 -7
- package/dist/esm/chunk-5VWXQLXG.js.map +0 -7
- package/dist/esm/chunk-AIWCRXMP.js +0 -672
- package/dist/esm/chunk-AIWCRXMP.js.map +0 -7
- package/dist/esm/chunk-AKNHD3CM.js.map +0 -7
- package/dist/esm/chunk-BI4YL5KH.js +0 -2742
- package/dist/esm/chunk-BI4YL5KH.js.map +0 -7
- package/dist/esm/chunk-IEWLP7PR.js.map +0 -7
- package/dist/esm/chunk-IFKY7FXY.js +0 -484
- package/dist/esm/chunk-IFKY7FXY.js.map +0 -7
- package/dist/esm/chunk-J4CJEGEM.js +0 -3016
- package/dist/esm/chunk-J4CJEGEM.js.map +0 -7
- package/dist/esm/chunk-PEHPXXTS.js +0 -1053
- package/dist/esm/chunk-PEHPXXTS.js.map +0 -7
- package/dist/esm/chunk-PTMMQODC.js +0 -760
- package/dist/esm/chunk-PTMMQODC.js.map +0 -7
- package/dist/esm/chunk-PYD5MY63.js.map +0 -7
- package/dist/esm/chunk-SK7LOVVI.js +0 -660
- package/dist/esm/chunk-SK7LOVVI.js.map +0 -7
- package/dist/esm/chunk-TN4W5NLC.js.map +0 -7
- package/dist/esm/chunk-VYCICKFV.js +0 -698
- package/dist/esm/chunk-VYCICKFV.js.map +0 -7
- package/dist/esm/query_akash-KU4YCMUU.js +0 -85
- package/dist/esm/query_akash-KU4YCMUU.js.map +0 -7
- package/dist/esm/query_akash-LSGWB5MI.js.map +0 -7
- package/dist/esm/query_akash-XYSUQTZC.js +0 -164
- package/dist/esm/query_akash-XYSUQTZC.js.map +0 -7
- package/dist/esm/service_akash-KYLB3OP3.js +0 -78
- package/dist/esm/service_akash-KYLB3OP3.js.map +0 -7
- package/dist/esm/service_akash-LJBOWZZG.js +0 -221
- package/dist/esm/service_akash-LJBOWZZG.js.map +0 -7
- package/dist/esm/snapshot_akash-KH5X5W3B.js +0 -41
- package/dist/esm/snapshot_akash-KH5X5W3B.js.map +0 -7
- package/dist/types/generated/protos/akash/inventory/v1/snapshot.d.ts +0 -112
- package/dist/types/generated/protos/akash/inventory/v1/snapshot_akash.d.ts +0 -22
- package/dist/types/generated/protos/akash/market/v1/stats.d.ts +0 -35
- package/dist/types/generated/protos/akash/provider/v1beta4/maintenance.d.ts +0 -87
- package/dist/types/generated/protos/akash/provider/v1beta4/params.d.ts +0 -17
- package/dist/types/generated/protos/akash/provider/v1beta4/paramsmsg.d.ts +0 -22
- package/dist/types/generated/protos/akash/verification/v1/event.d.ts +0 -339
- package/dist/types/generated/protos/akash/verification/v1/genesis.d.ts +0 -45
- package/dist/types/generated/protos/akash/verification/v1/msg.d.ts +0 -614
- package/dist/types/generated/protos/akash/verification/v1/params.d.ts +0 -147
- package/dist/types/generated/protos/akash/verification/v1/query.d.ts +0 -290
- package/dist/types/generated/protos/akash/verification/v1/query_akash.d.ts +0 -97
- package/dist/types/generated/protos/akash/verification/v1/service.d.ts +0 -1
- package/dist/types/generated/protos/akash/verification/v1/service_akash.d.ts +0 -126
- package/dist/types/generated/protos/akash/verification/v1/state.d.ts +0 -320
- package/dist/types/generated/protos/akash/verification/v1/types.d.ts +0 -348
- package/dist/types/generated/protos/akash/verification/v1/verificationrequirement.d.ts +0 -36
- /package/dist/esm/{chunk-MIJCN6AD.js.map → chunk-3K7Q5MUF.js.map} +0 -0
- /package/dist/esm/{chunk-GRGSTKN3.js.map → chunk-3QS3CMF4.js.map} +0 -0
- /package/dist/esm/{chunk-3U5XKNEU.js.map → chunk-4SZHF6SE.js.map} +0 -0
- /package/dist/esm/{chunk-W3TLZPTC.js.map → chunk-4TSICBUM.js.map} +0 -0
- /package/dist/esm/{chunk-P64VHYRM.js.map → chunk-5ODS4QTF.js.map} +0 -0
- /package/dist/esm/{chunk-OJ54L3XZ.js.map → chunk-7XXZVOOW.js.map} +0 -0
- /package/dist/esm/{chunk-F4IQOYFH.js.map → chunk-AR26HCRY.js.map} +0 -0
- /package/dist/esm/{chunk-DCLXPAMC.js.map → chunk-EJQUNX4L.js.map} +0 -0
- /package/dist/esm/{chunk-F7KT5EX5.js.map → chunk-ENZ3OBCL.js.map} +0 -0
- /package/dist/esm/{chunk-54RECHZZ.js.map → chunk-IKTMMFJ5.js.map} +0 -0
- /package/dist/esm/{chunk-7F3NJG67.js.map → chunk-LLM2VXJM.js.map} +0 -0
- /package/dist/esm/{chunk-WNFIFYG2.js.map → chunk-M2RS2IFR.js.map} +0 -0
- /package/dist/esm/{chunk-PAOVIX5L.js.map → chunk-MFZVOFPX.js.map} +0 -0
- /package/dist/esm/{chunk-M5P5LAJJ.js.map → chunk-N42ATJOO.js.map} +0 -0
- /package/dist/esm/{chunk-RJZ46VHV.js.map → chunk-NP4QQMME.js.map} +0 -0
- /package/dist/esm/{chunk-XP2XNYEA.js.map → chunk-OWB6ZEHB.js.map} +0 -0
- /package/dist/esm/{chunk-NNB5QBR2.js.map → chunk-OYI3IQIV.js.map} +0 -0
- /package/dist/esm/{chunk-Y7BVCD32.js.map → chunk-SGDEIQ7L.js.map} +0 -0
- /package/dist/esm/{chunk-HRN6NSO2.js.map → chunk-TTQ36NQ5.js.map} +0 -0
- /package/dist/esm/{chunk-57534UAR.js.map → chunk-WCUR732W.js.map} +0 -0
- /package/dist/esm/{chunk-CFEWW2ER.js.map → chunk-YBRE4XNB.js.map} +0 -0
- /package/dist/esm/{chunk-BQNJHJXY.js.map → chunk-ZGK4PJCD.js.map} +0 -0
- /package/dist/esm/{chunk-PWXFQ5FI.js.map → chunk-ZXN75Q55.js.map} +0 -0
- /package/dist/esm/{query_akash-HN4NCENR.js.map → query_akash-72TFPQBZ.js.map} +0 -0
- /package/dist/esm/{query_akash-SVNQ4S67.js.map → query_akash-EGFDDA4L.js.map} +0 -0
- /package/dist/esm/{query_akash-BTYAA6UN.js.map → query_akash-I3RPHLVA.js.map} +0 -0
- /package/dist/esm/{query_akash-EG43V2QH.js.map → query_akash-QF2LHJQN.js.map} +0 -0
- /package/dist/esm/{service_akash-HFGWADC2.js.map → service_akash-JQKI2SJP.js.map} +0 -0
- /package/dist/esm/{service_akash-QTGRTXLG.js.map → service_akash-PFTEVUGK.js.map} +0 -0
- /package/dist/esm/{service_akash-KAJJV7LX.js.map → service_akash-SXXXZL6K.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/generated/protos/index.akash.v1beta4.ts"],
|
|
4
|
-
"sourcesContent": ["export { ResourceValue } from \"./akash/base/resources/v1beta4/resourcevalue.ts\";\nexport { CPU } from \"./akash/base/resources/v1beta4/cpu.ts\";\nexport { Endpoint, Endpoint_Kind } from \"./akash/base/resources/v1beta4/endpoint.ts\";\nexport { GPU } from \"./akash/base/resources/v1beta4/gpu.ts\";\nexport { Memory } from \"./akash/base/resources/v1beta4/memory.ts\";\nexport { Storage } from \"./akash/base/resources/v1beta4/storage.ts\";\nexport { Resources } from \"./akash/base/resources/v1beta4/resources.ts\";\nexport { ResourceUnit } from \"./akash/deployment/v1beta4/resourceunit.ts\";\nexport { GroupSpec } from \"./akash/deployment/v1beta4/groupspec.ts\";\nexport { MsgCreateDeployment, MsgCreateDeploymentResponse, MsgUpdateDeployment, MsgUpdateDeploymentResponse, MsgCloseDeployment, MsgCloseDeploymentResponse } from \"./akash/deployment/v1beta4/deploymentmsg.ts\";\nexport { DeploymentFilters, GroupFilters } from \"./akash/deployment/v1beta4/filters.ts\";\nexport { Group, Group_State } from \"./akash/deployment/v1beta4/group.ts\";\nexport { Params } from \"./akash/deployment/v1beta4/params.ts\";\nexport { GenesisDeployment, GenesisState } from \"./akash/deployment/v1beta4/genesis.ts\";\nexport { MsgCloseGroup, MsgCloseGroupResponse, MsgPauseGroup, MsgPauseGroupResponse, MsgStartGroup, MsgStartGroupResponse } from \"./akash/deployment/v1beta4/groupmsg.ts\";\nexport { MsgUpdateParams, MsgUpdateParamsResponse } from \"./akash/deployment/v1beta4/paramsmsg.ts\";\nexport { QueryDeploymentsRequest, QueryDeploymentsResponse, QueryDeploymentRequest, QueryDeploymentResponse, QueryGroupRequest, QueryGroupResponse, QueryParamsRequest, QueryParamsResponse } from \"./akash/deployment/v1beta4/query.ts\";\nexport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["export { ResourceValue } from \"./akash/base/resources/v1beta4/resourcevalue.ts\";\nexport { CPU } from \"./akash/base/resources/v1beta4/cpu.ts\";\nexport { Endpoint, Endpoint_Kind } from \"./akash/base/resources/v1beta4/endpoint.ts\";\nexport { GPU } from \"./akash/base/resources/v1beta4/gpu.ts\";\nexport { Memory } from \"./akash/base/resources/v1beta4/memory.ts\";\nexport { Storage } from \"./akash/base/resources/v1beta4/storage.ts\";\nexport { Resources } from \"./akash/base/resources/v1beta4/resources.ts\";\nexport { ResourceUnit } from \"./akash/deployment/v1beta4/resourceunit.ts\";\nexport { GroupSpec } from \"./akash/deployment/v1beta4/groupspec.ts\";\nexport { MsgCreateDeployment, MsgCreateDeploymentResponse, MsgUpdateDeployment, MsgUpdateDeploymentResponse, MsgCloseDeployment, MsgCloseDeploymentResponse } from \"./akash/deployment/v1beta4/deploymentmsg.ts\";\nexport { DeploymentFilters, GroupFilters } from \"./akash/deployment/v1beta4/filters.ts\";\nexport { Group, Group_State } from \"./akash/deployment/v1beta4/group.ts\";\nexport { Params } from \"./akash/deployment/v1beta4/params.ts\";\nexport { GenesisDeployment, GenesisState } from \"./akash/deployment/v1beta4/genesis.ts\";\nexport { MsgCloseGroup, MsgCloseGroupResponse, MsgPauseGroup, MsgPauseGroupResponse, MsgStartGroup, MsgStartGroupResponse } from \"./akash/deployment/v1beta4/groupmsg.ts\";\nexport { MsgUpdateParams, MsgUpdateParamsResponse } from \"./akash/deployment/v1beta4/paramsmsg.ts\";\nexport { QueryDeploymentsRequest, QueryDeploymentsResponse, QueryDeploymentRequest, QueryDeploymentResponse, QueryGroupRequest, QueryGroupResponse, QueryParamsRequest, QueryParamsResponse } from \"./akash/deployment/v1beta4/query.ts\";\nexport { EventProviderCreated, EventProviderUpdated, EventProviderDeleted } from \"./akash/provider/v1beta4/event.ts\";\nexport { Info, Provider } from \"./akash/provider/v1beta4/provider.ts\";\nexport { GenesisState as Provider_GenesisState } from \"./akash/provider/v1beta4/genesis.ts\";\nexport { MsgCreateProvider, MsgCreateProviderResponse, MsgUpdateProvider, MsgUpdateProviderResponse, MsgDeleteProvider, MsgDeleteProviderResponse } from \"./akash/provider/v1beta4/msg.ts\";\nexport { QueryProvidersRequest, QueryProvidersResponse, QueryProviderRequest, QueryProviderResponse } from \"./akash/provider/v1beta4/query.ts\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA8B;AAC9B,iBAAoB;AACpB,sBAAwC;AACxC,iBAAoB;AACpB,oBAAuB;AACvB,qBAAwB;AACxB,uBAA0B;AAC1B,0BAA6B;AAC7B,uBAA0B;AAC1B,2BAAmK;AACnK,qBAAgD;AAChD,mBAAmC;AACnC,oBAAuB;AACvB,qBAAgD;AAChD,sBAAiI;AACjI,uBAAyD;AACzD,mBAAmM;AACnM,mBAAiF;AACjF,sBAA+B;AAC/B,IAAAA,kBAAsD;AACtD,iBAAyJ;AACzJ,IAAAC,gBAA2G;",
|
|
6
|
+
"names": ["import_genesis", "import_query"]
|
|
7
7
|
}
|
|
@@ -56,8 +56,6 @@ __export(index_akash_v1beta5_exports, {
|
|
|
56
56
|
QueryOrdersResponse: () => import_query.QueryOrdersResponse,
|
|
57
57
|
QueryParamsRequest: () => import_query.QueryParamsRequest,
|
|
58
58
|
QueryParamsResponse: () => import_query.QueryParamsResponse,
|
|
59
|
-
QueryProviderLeaseStatsRequest: () => import_query.QueryProviderLeaseStatsRequest,
|
|
60
|
-
QueryProviderLeaseStatsResponse: () => import_query.QueryProviderLeaseStatsResponse,
|
|
61
59
|
ResourceOffer: () => import_resourcesoffer.ResourceOffer,
|
|
62
60
|
StorageOfferPrice: () => import_resourcesoffer.StorageOfferPrice
|
|
63
61
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/generated/protos/index.akash.v1beta5.ts"],
|
|
4
|
-
"sourcesContent": ["export { StorageOfferPrice, EndpointOfferPrice, OfferPrices, ResourceOffer } from \"./akash/market/v1beta5/resourcesoffer.ts\";\nexport { Bid, Bid_State } from \"./akash/market/v1beta5/bid.ts\";\nexport { MsgCreateBid, MsgCreateBidResponse, MsgCloseBid, MsgCloseBidResponse } from \"./akash/market/v1beta5/bidmsg.ts\";\nexport { BidFilters, OrderFilters } from \"./akash/market/v1beta5/filters.ts\";\nexport { Params } from \"./akash/market/v1beta5/params.ts\";\nexport { Order, Order_State } from \"./akash/market/v1beta5/order.ts\";\nexport { GenesisState } from \"./akash/market/v1beta5/genesis.ts\";\nexport { MsgCreateLease, MsgCreateLeaseResponse, MsgWithdrawLease, MsgWithdrawLeaseResponse, MsgCloseLease, MsgCloseLeaseResponse, MsgLeaseStartReclaim, MsgLeaseStartReclaimResponse } from \"./akash/market/v1beta5/leasemsg.ts\";\nexport { MsgUpdateParams, MsgUpdateParamsResponse } from \"./akash/market/v1beta5/paramsmsg.ts\";\nexport { QueryOrdersRequest, QueryOrdersResponse, QueryOrderRequest, QueryOrderResponse, QueryBidsRequest, QueryBidsResponse, QueryBidRequest, QueryBidResponse, QueryLeasesRequest, QueryLeasesResponse, QueryLeaseRequest, QueryLeaseResponse,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["export { StorageOfferPrice, EndpointOfferPrice, OfferPrices, ResourceOffer } from \"./akash/market/v1beta5/resourcesoffer.ts\";\nexport { Bid, Bid_State } from \"./akash/market/v1beta5/bid.ts\";\nexport { MsgCreateBid, MsgCreateBidResponse, MsgCloseBid, MsgCloseBidResponse } from \"./akash/market/v1beta5/bidmsg.ts\";\nexport { BidFilters, OrderFilters } from \"./akash/market/v1beta5/filters.ts\";\nexport { Params } from \"./akash/market/v1beta5/params.ts\";\nexport { Order, Order_State } from \"./akash/market/v1beta5/order.ts\";\nexport { GenesisState } from \"./akash/market/v1beta5/genesis.ts\";\nexport { MsgCreateLease, MsgCreateLeaseResponse, MsgWithdrawLease, MsgWithdrawLeaseResponse, MsgCloseLease, MsgCloseLeaseResponse, MsgLeaseStartReclaim, MsgLeaseStartReclaimResponse } from \"./akash/market/v1beta5/leasemsg.ts\";\nexport { MsgUpdateParams, MsgUpdateParamsResponse } from \"./akash/market/v1beta5/paramsmsg.ts\";\nexport { QueryOrdersRequest, QueryOrdersResponse, QueryOrderRequest, QueryOrderResponse, QueryBidsRequest, QueryBidsResponse, QueryBidRequest, QueryBidResponse, QueryLeasesRequest, QueryLeasesResponse, QueryLeaseRequest, QueryLeaseResponse, QueryParamsRequest, QueryParamsResponse } from \"./akash/market/v1beta5/query.ts\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAkF;AAClF,iBAA+B;AAC/B,oBAAqF;AACrF,qBAAyC;AACzC,oBAAuB;AACvB,mBAAmC;AACnC,qBAA6B;AAC7B,sBAA6L;AAC7L,uBAAyD;AACzD,mBAAgS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -31,10 +31,6 @@ __export(index_provider_akash_v1_exports, {
|
|
|
31
31
|
ForwarderPortStatus: () => import_service.ForwarderPortStatus,
|
|
32
32
|
GPU: () => import_gpu.GPU,
|
|
33
33
|
GPUInfo: () => import_gpu.GPUInfo,
|
|
34
|
-
GetCommittedInventorySnapshotRequest: () => import_snapshot.GetCommittedInventorySnapshotRequest,
|
|
35
|
-
GetCommittedInventorySnapshotResponse: () => import_snapshot.GetCommittedInventorySnapshotResponse,
|
|
36
|
-
GetInventorySnapshotRequest: () => import_snapshot.GetInventorySnapshotRequest,
|
|
37
|
-
GetInventorySnapshotResponse: () => import_snapshot.GetInventorySnapshotResponse,
|
|
38
34
|
Inventory: () => import_status.Inventory,
|
|
39
35
|
LeaseIPStatus: () => import_service.LeaseIPStatus,
|
|
40
36
|
LeaseServiceStatus: () => import_service.LeaseServiceStatus,
|
|
@@ -58,10 +54,6 @@ __export(index_provider_akash_v1_exports, {
|
|
|
58
54
|
ServiceStatusRequest: () => import_service.ServiceStatusRequest,
|
|
59
55
|
ServiceStatusResponse: () => import_service.ServiceStatusResponse,
|
|
60
56
|
ShellRequest: () => import_service.ShellRequest,
|
|
61
|
-
SnapshotEvidenceSection: () => import_snapshot.SnapshotEvidenceSection,
|
|
62
|
-
SnapshotPayload: () => import_snapshot.SnapshotPayload,
|
|
63
|
-
SnapshotResourceSummary: () => import_snapshot.SnapshotResourceSummary,
|
|
64
|
-
SoftwareIdentity: () => import_snapshot.SoftwareIdentity,
|
|
65
57
|
Status: () => import_status.Status,
|
|
66
58
|
Storage: () => import_storage.Storage,
|
|
67
59
|
StorageInfo: () => import_storage.StorageInfo
|
|
@@ -75,7 +67,6 @@ var import_resources = require("./akash/inventory/v1/resources.cjs");
|
|
|
75
67
|
var import_node = require("./akash/inventory/v1/node.cjs");
|
|
76
68
|
var import_storage = require("./akash/inventory/v1/storage.cjs");
|
|
77
69
|
var import_cluster = require("./akash/inventory/v1/cluster.cjs");
|
|
78
|
-
var import_snapshot = require("./akash/inventory/v1/snapshot.cjs");
|
|
79
70
|
var import_service = require("./akash/provider/lease/v1/service.cjs");
|
|
80
71
|
var import_status = require("./akash/provider/v1/status.cjs");
|
|
81
72
|
var import_validation = require("./akash/provider/v1/validation.cjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/generated/protos/index.provider.akash.v1.ts"],
|
|
4
|
-
"sourcesContent": ["export { ResourcePair } from \"./akash/inventory/v1/resourcepair.ts\";\nexport { CPUInfo, CPU } from \"./akash/inventory/v1/cpu.ts\";\nexport { GPUInfo, GPU } from \"./akash/inventory/v1/gpu.ts\";\nexport { MemoryInfo, Memory } from \"./akash/inventory/v1/memory.ts\";\nexport { NodeResources } from \"./akash/inventory/v1/resources.ts\";\nexport { NodeCapabilities, Node } from \"./akash/inventory/v1/node.ts\";\nexport { StorageInfo, Storage } from \"./akash/inventory/v1/storage.ts\";\nexport { Cluster } from \"./akash/inventory/v1/cluster.ts\";\nexport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["export { ResourcePair } from \"./akash/inventory/v1/resourcepair.ts\";\nexport { CPUInfo, CPU } from \"./akash/inventory/v1/cpu.ts\";\nexport { GPUInfo, GPU } from \"./akash/inventory/v1/gpu.ts\";\nexport { MemoryInfo, Memory } from \"./akash/inventory/v1/memory.ts\";\nexport { NodeResources } from \"./akash/inventory/v1/resources.ts\";\nexport { NodeCapabilities, Node } from \"./akash/inventory/v1/node.ts\";\nexport { StorageInfo, Storage } from \"./akash/inventory/v1/storage.ts\";\nexport { Cluster } from \"./akash/inventory/v1/cluster.ts\";\nexport { LeaseServiceStatus, LeaseIPStatus, ForwarderPortStatus, ServiceStatus, SendManifestRequest, SendManifestResponse, ServiceLogsRequest, ServiceLogs, ServiceLogsResponse, ShellRequest, ServiceStatusRequest, ServiceStatusResponse, AttestationQuoteRequest, AttestationGPUReport, AttestationQuoteResponse } from \"./akash/provider/lease/v1/service.ts\";\nexport { ResourcesMetric, Leases, ReservationsMetric, Reservations, Inventory, ClusterStatus, BidEngineStatus, ManifestStatus, Status } from \"./akash/provider/v1/status.ts\";\nexport { BidScreeningRequest, BidScreeningResponse } from \"./akash/provider/v1/validation.ts\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;AAC7B,iBAA6B;AAC7B,iBAA6B;AAC7B,oBAAmC;AACnC,uBAA8B;AAC9B,kBAAuC;AACvC,qBAAqC;AACrC,qBAAwB;AACxB,qBAA2T;AAC3T,oBAA6I;AAC7I,wBAA0D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,8 +33,6 @@ var import_resourceunit = require("../../generated/protos/akash/deployment/v1bet
|
|
|
33
33
|
var import_group = require("../../generated/protos/akash/manifest/v2beta3/group.cjs");
|
|
34
34
|
var import_service = require("../../generated/protos/akash/manifest/v2beta3/service.cjs");
|
|
35
35
|
var import_serviceexpose = require("../../generated/protos/akash/manifest/v2beta3/serviceexpose.cjs");
|
|
36
|
-
var import_types = require("../../generated/protos/akash/verification/v1/types.cjs");
|
|
37
|
-
var import_verificationrequirement = require("../../generated/protos/akash/verification/v1/verificationrequirement.cjs");
|
|
38
36
|
var import_utils = require("../utils.cjs");
|
|
39
37
|
var import_validateSDL = require("../validateSDL/validateSDL.cjs");
|
|
40
38
|
var import_manifestUtils = require("./manifestUtils.cjs");
|
|
@@ -57,9 +55,9 @@ function generateManifest(sdl) {
|
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
for (const list of deploymentsByPlacement.values()) {
|
|
60
|
-
list.sort(([a], [b]) =>
|
|
58
|
+
list.sort(([a], [b]) => (0, import_manifestUtils.compareStrings)(a, b));
|
|
61
59
|
}
|
|
62
|
-
const services = Object.entries(sdl.services).sort(([a], [b]) =>
|
|
60
|
+
const services = Object.entries(sdl.services).sort(([a], [b]) => (0, import_manifestUtils.compareStrings)(a, b));
|
|
63
61
|
for (const [svcName, service] of services) {
|
|
64
62
|
for (const [placementName, svcdepl] of Object.entries(sdl.deployment[svcName])) {
|
|
65
63
|
const compute = sdl.profiles.compute[svcdepl.profile];
|
|
@@ -80,8 +78,7 @@ function generateManifest(sdl) {
|
|
|
80
78
|
signedBy: import_attribute.SignedBy.fromPartial({
|
|
81
79
|
allOf: infra.signedBy?.allOf,
|
|
82
80
|
anyOf: infra.signedBy?.anyOf
|
|
83
|
-
})
|
|
84
|
-
verification: buildVerificationRequirement(infra.verification)
|
|
81
|
+
})
|
|
85
82
|
})
|
|
86
83
|
}),
|
|
87
84
|
boundComputes: {},
|
|
@@ -93,7 +90,7 @@ function generateManifest(sdl) {
|
|
|
93
90
|
if (teeType && !group.teeType) {
|
|
94
91
|
group.teeType = teeType;
|
|
95
92
|
group.dgroup.requirements.attributes.push({ key: "tee/type", value: teeType });
|
|
96
|
-
group.dgroup.requirements.attributes.sort((a, b) => a.key
|
|
93
|
+
group.dgroup.requirements.attributes.sort((a, b) => (0, import_manifestUtils.compareStrings)(a.key, b.key));
|
|
97
94
|
}
|
|
98
95
|
const profileKey = `${placementName}:${svcdepl.profile}`;
|
|
99
96
|
const location = group.boundComputes[svcdepl.profile];
|
|
@@ -117,16 +114,12 @@ function generateManifest(sdl) {
|
|
|
117
114
|
group.dgroup.resources[location].resource.endpoints.push(
|
|
118
115
|
...(0, import_manifestUtils.buildServiceEndpoints)(service, endpointSequenceNumbers)
|
|
119
116
|
);
|
|
117
|
+
group.dgroup.resources[location].resource.endpoints.sort(
|
|
118
|
+
(a, b) => a.sequenceNumber - b.sequenceNumber
|
|
119
|
+
);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
for (const group of groupsMap.values()) {
|
|
124
|
-
for (const resourceUnit of group.dgroup.resources) {
|
|
125
|
-
resourceUnit.resource.endpoints.sort(
|
|
126
|
-
(a, b) => a.kind - b.kind || a.sequenceNumber - b.sequenceNumber
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
123
|
const sortedGroupNames = [...groupsMap.keys()].sort();
|
|
131
124
|
let groups;
|
|
132
125
|
let groupSpecs;
|
|
@@ -174,22 +167,6 @@ function generateManifest(sdl) {
|
|
|
174
167
|
};
|
|
175
168
|
return { ok: true, value: manifest };
|
|
176
169
|
}
|
|
177
|
-
const CAPABILITY_FLAGS = {
|
|
178
|
-
tee_hardware_attestation: import_types.CapabilityFlag.capability_tee_hardware_attestation,
|
|
179
|
-
confidential_computing: import_types.CapabilityFlag.capability_confidential_computing,
|
|
180
|
-
persistent_storage: import_types.CapabilityFlag.capability_persistent_storage,
|
|
181
|
-
bare_metal: import_types.CapabilityFlag.capability_bare_metal
|
|
182
|
-
};
|
|
183
|
-
function buildVerificationRequirement(requirement) {
|
|
184
|
-
if (!requirement || requirement.min_tier === 0) return void 0;
|
|
185
|
-
return import_verificationrequirement.VerificationRequirement.fromPartial({
|
|
186
|
-
minTier: (0, import_types.verificationTierFromJSON)(requirement.min_tier),
|
|
187
|
-
requiredCapabilities: (requirement.capabilities ?? []).map((capability) => CAPABILITY_FLAGS[capability]),
|
|
188
|
-
requiredAuditors: requirement.auditors,
|
|
189
|
-
auditorMode: requirement.auditor_mode === "all" ? import_types.AuditorSelectionMode.auditor_selection_mode_all : import_types.AuditorSelectionMode.auditor_selection_mode_any,
|
|
190
|
-
minAuditorCount: requirement.min_auditor_count
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
170
|
function buildResources(id, compute, service, endpointSequenceNumbers) {
|
|
194
171
|
const res = compute.resources;
|
|
195
172
|
const cpuAttributes = (0, import_manifestUtils.buildResourceAttributes)(res.cpu.attributes);
|
|
@@ -263,26 +240,18 @@ function buildParams(service) {
|
|
|
263
240
|
return result;
|
|
264
241
|
}
|
|
265
242
|
function buildManifestExpose(service, endpointSequenceNumbers) {
|
|
266
|
-
return (
|
|
267
|
-
(expose) =>
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
)
|
|
280
|
-
).sort((a, b) => {
|
|
281
|
-
if (a.service !== b.service) return a.service.localeCompare(b.service);
|
|
282
|
-
if (a.port !== b.port) return a.port - b.port;
|
|
283
|
-
if (a.proto !== b.proto) return a.proto.localeCompare(b.proto);
|
|
284
|
-
if (a.global !== b.global) return a.global ? -1 : 1;
|
|
285
|
-
return 0;
|
|
286
|
-
});
|
|
243
|
+
return (0, import_manifestUtils.sortedExposeTargets)(service).map(
|
|
244
|
+
({ expose, to }) => import_serviceexpose.ServiceExpose.fromPartial({
|
|
245
|
+
port: expose.port,
|
|
246
|
+
externalPort: expose.as,
|
|
247
|
+
proto: (0, import_manifestUtils.parseServiceProto)(expose.proto),
|
|
248
|
+
service: to.service || "",
|
|
249
|
+
global: to.global || false,
|
|
250
|
+
hosts: expose.accept || [],
|
|
251
|
+
httpOptions: (0, import_manifestUtils.buildHttpOptions)(expose.http_options),
|
|
252
|
+
ip: to.ip || "",
|
|
253
|
+
endpointSequenceNumber: endpointSequenceNumbers[to.ip]
|
|
254
|
+
})
|
|
255
|
+
);
|
|
287
256
|
}
|
|
288
257
|
//# sourceMappingURL=generateManifest.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/sdl/manifest/generateManifest.ts"],
|
|
4
|
-
"sourcesContent": ["import { PlacementRequirements, SignedBy } from \"../../generated/protos/akash/base/attributes/v1/attribute.ts\";\nimport { CPU } from \"../../generated/protos/akash/base/resources/v1beta4/cpu.ts\";\nimport { GPU } from \"../../generated/protos/akash/base/resources/v1beta4/gpu.ts\";\nimport { Memory } from \"../../generated/protos/akash/base/resources/v1beta4/memory.ts\";\nimport { Resources } from \"../../generated/protos/akash/base/resources/v1beta4/resources.ts\";\nimport { Storage } from \"../../generated/protos/akash/base/resources/v1beta4/storage.ts\";\nimport { DeploymentReclamation } from \"../../generated/protos/akash/deployment/v1/deployment.ts\";\nimport { GroupSpec } from \"../../generated/protos/akash/deployment/v1beta4/groupspec.ts\";\nimport { ResourceUnit } from \"../../generated/protos/akash/deployment/v1beta4/resourceunit.ts\";\nimport { Group } from \"../../generated/protos/akash/manifest/v2beta3/group.ts\";\nimport { ImageCredentials, Service, ServiceParams, StorageParams, TEEParams } from \"../../generated/protos/akash/manifest/v2beta3/service.ts\";\nimport { ServiceExpose } from \"../../generated/protos/akash/manifest/v2beta3/serviceexpose.ts\";\nimport { AuditorSelectionMode, CapabilityFlag, verificationTierFromJSON } from \"../../generated/protos/akash/verification/v1/types.ts\";\nimport { VerificationRequirement } from \"../../generated/protos/akash/verification/v1/verificationrequirement.ts\";\nimport type { ValidationError } from \"../../utils/jsonSchemaValidation.ts\";\nimport { castArray } from \"../utils.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport { validateSDL } from \"../validateSDL/validateSDL.ts\";\nimport {\n buildHttpOptions,\n buildResourceAttributes,\n buildServiceEndpoints,\n buildStorageAttributes,\n computeEndpointSequenceNumbers,\n parseCpuUnits,\n parseGpuUnits,\n parseMemoryBytes,\n parseServiceProto,\n parseStorageBytes,\n resolveInterconnectGroup,\n type SDLCompute,\n type SDLService,\n transformGpuAttributes,\n} from \"./manifestUtils.ts\";\nimport { minWindowToDuration } from \"./reclamationDuration.ts\";\n\nexport interface GenerateManifestOkResult {\n groups: Group[];\n groupSpecs: GroupSpec[];\n reclamation?: DeploymentReclamation;\n}\n\nexport type Manifest = GenerateManifestOkResult[\"groups\"];\nexport type GenerateManifestResult =\n | { ok?: false; value: ValidationError[] }\n | { ok: true; value: GenerateManifestOkResult };\nexport function generateManifest(sdl: SDLInput): GenerateManifestResult {\n const errors = validateSDL(sdl);\n if (errors) return { ok: false, value: errors };\n\n const endpointSequenceNumbers = computeEndpointSequenceNumbers(sdl.services);\n const groupsMap = new Map<string, {\n dgroup: GroupSpec;\n boundComputes: Record<string, number>;\n teeType?: string;\n }>();\n const resourceIds = new Map<string, number>();\n\n const deploymentsByPlacement = new Map<string, [string, { profile: string; count: number }][]>();\n for (const [svcName, placements] of Object.entries(sdl.deployment)) {\n for (const [placementName, deployment] of Object.entries(placements)) {\n let list = deploymentsByPlacement.get(placementName);\n if (!list) {\n list = [];\n deploymentsByPlacement.set(placementName, list);\n }\n list.push([svcName, deployment]);\n }\n }\n for (const list of deploymentsByPlacement.values()) {\n list.sort(([a], [b]) => a.localeCompare(b));\n }\n\n const services = Object.entries(sdl.services).sort(([a], [b]) => a.localeCompare(b));\n\n for (const [svcName, service] of services) {\n for (const [placementName, svcdepl] of Object.entries(sdl.deployment[svcName])) {\n const compute = sdl.profiles.compute[svcdepl.profile];\n const infra = sdl.profiles.placement[placementName];\n const pricing = infra.pricing[svcdepl.profile];\n const price = {\n denom: pricing.denom,\n amount: pricing.amount?.toString(),\n };\n\n let group = groupsMap.get(placementName);\n\n if (!group) {\n group = {\n dgroup: GroupSpec.fromPartial({\n name: placementName,\n resources: [],\n requirements: PlacementRequirements.fromPartial({\n attributes: buildResourceAttributes(infra.attributes),\n signedBy: SignedBy.fromPartial({\n allOf: infra.signedBy?.allOf,\n anyOf: infra.signedBy?.anyOf,\n }),\n verification: buildVerificationRequirement(infra.verification),\n }),\n }),\n boundComputes: {},\n teeType: undefined,\n };\n\n groupsMap.set(placementName, group);\n }\n\n const teeType = service.params?.tee;\n if (teeType && !group.teeType) {\n group.teeType = teeType;\n group.dgroup.requirements!.attributes.push({ key: \"tee/type\", value: teeType });\n group.dgroup.requirements!.attributes.sort((a, b) => a.key.localeCompare(b.key));\n }\n\n const profileKey = `${placementName}:${svcdepl.profile}`;\n const location = group.boundComputes[svcdepl.profile];\n\n if (location === undefined) {\n const resId = group.dgroup.resources.length > 0\n ? group.dgroup.resources.length + 1\n : 1;\n\n resourceIds.set(profileKey, resId);\n\n const resources = buildResources(resId, compute, service, endpointSequenceNumbers);\n\n group.dgroup.resources.push(\n ResourceUnit.fromPartial({\n resource: resources,\n count: svcdepl.count,\n price,\n }),\n );\n\n group.boundComputes[svcdepl.profile] = group.dgroup.resources.length - 1;\n } else {\n if (!resourceIds.has(profileKey)) {\n resourceIds.set(profileKey, group.dgroup.resources[location].resource!.id);\n }\n\n group.dgroup.resources[location].count += svcdepl.count;\n group.dgroup.resources[location].resource!.endpoints.push(\n ...buildServiceEndpoints(service, endpointSequenceNumbers),\n );\n }\n }\n }\n\n for (const group of groupsMap.values()) {\n for (const resourceUnit of group.dgroup.resources) {\n resourceUnit.resource!.endpoints.sort(\n (a, b) => a.kind - b.kind || a.sequenceNumber - b.sequenceNumber,\n );\n }\n }\n\n const sortedGroupNames = [...groupsMap.keys()].sort();\n let groups: Group[] | undefined;\n let groupSpecs: GroupSpec[] | undefined;\n let reclamation: DeploymentReclamation | undefined;\n\n const manifest = {\n // reclamation is a `MsgCreateDeployment` field, not a manifest group, and is\n // not needed in every call \u2014 so it's lazy like `groups`/`groupSpecs`.\n // `validateSDL` (run above) already guaranteed `min_window` is valid, so\n // `minWindowToDuration` never throws here.\n get reclamation() {\n if (sdl.reclamation && !reclamation) {\n reclamation = DeploymentReclamation.fromPartial({\n minWindow: minWindowToDuration(sdl.reclamation.min_window),\n });\n }\n return reclamation;\n },\n get groups() {\n groups ??= sortedGroupNames.map((placementName) => {\n const deployments = deploymentsByPlacement.get(placementName)!;\n\n return Group.fromPartial({\n name: placementName,\n services: deployments.map(([svcName]) => {\n const service = sdl.services[svcName];\n const deployment = sdl.deployment[svcName][placementName];\n const compute = sdl.profiles.compute[deployment.profile];\n const resourceId = resourceIds.get(`${placementName}:${deployment.profile}`) || 1;\n\n return buildManifestService(\n resourceId,\n svcName,\n service,\n compute,\n deployment.count,\n endpointSequenceNumbers,\n );\n }),\n });\n });\n return groups;\n },\n get groupSpecs() {\n groupSpecs ??= sortedGroupNames.map((name) => groupsMap.get(name)!.dgroup);\n return groupSpecs;\n },\n };\n\n return { ok: true, value: manifest };\n}\n\ntype SDLVerificationRequirement = NonNullable<SDLInput[\"profiles\"][\"placement\"][string][\"verification\"]>;\n\nconst CAPABILITY_FLAGS: Record<NonNullable<SDLVerificationRequirement[\"capabilities\"]>[number], CapabilityFlag> = {\n tee_hardware_attestation: CapabilityFlag.capability_tee_hardware_attestation,\n confidential_computing: CapabilityFlag.capability_confidential_computing,\n persistent_storage: CapabilityFlag.capability_persistent_storage,\n bare_metal: CapabilityFlag.capability_bare_metal,\n};\n\nfunction buildVerificationRequirement(requirement?: SDLVerificationRequirement): VerificationRequirement | undefined {\n if (!requirement || requirement.min_tier === 0) return undefined;\n\n return VerificationRequirement.fromPartial({\n minTier: verificationTierFromJSON(requirement.min_tier),\n requiredCapabilities: (requirement.capabilities ?? []).map((capability) => CAPABILITY_FLAGS[capability]),\n requiredAuditors: requirement.auditors,\n auditorMode: requirement.auditor_mode === \"all\"\n ? AuditorSelectionMode.auditor_selection_mode_all\n : AuditorSelectionMode.auditor_selection_mode_any,\n minAuditorCount: requirement.min_auditor_count,\n });\n}\n\nfunction buildResources(\n id: number,\n compute: SDLCompute,\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Resources {\n const res = compute.resources;\n const cpuAttributes = buildResourceAttributes(res.cpu.attributes);\n const gpuAttributes = res.gpu?.attributes ? transformGpuAttributes(res.gpu.attributes) : [];\n\n return Resources.fromPartial({\n id,\n cpu: CPU.fromPartial({\n units: { val: parseCpuUnits(res.cpu) },\n attributes: cpuAttributes,\n }),\n memory: Memory.fromPartial({\n quantity: { val: parseMemoryBytes(res.memory) },\n }),\n storage: castArray(res.storage).map((s) =>\n Storage.fromPartial({\n name: s.name || \"default\",\n quantity: { val: parseStorageBytes(s.size) },\n attributes: buildStorageAttributes(s.attributes),\n }),\n ),\n gpu: GPU.fromPartial({\n units: { val: parseGpuUnits(res.gpu) },\n attributes: gpuAttributes,\n }),\n endpoints: buildServiceEndpoints(service, endpointSequenceNumbers),\n });\n}\n\nfunction buildManifestService(\n resourceId: number,\n name: string,\n service: SDLService,\n compute: SDLCompute,\n count: number,\n endpointSequenceNumbers: Record<string, number>,\n): Service {\n const credentials = service.credentials\n ? ImageCredentials.fromPartial({\n host: service.credentials.host,\n email: service.credentials.email || \"\",\n username: service.credentials.username,\n password: service.credentials.password,\n })\n : undefined;\n\n const params = buildParams(service);\n\n // The interconnect group lives under gpu.attributes.interconnect (either\n // `[]` for the implicit `auto` group or `{ group: <name> }` for an\n // explicit name) and propagates to the off-chain manifest's\n // Service.interconnectGroup field so the provider's workload builder\n // can label pods for per-group anti-affinity. The same value is also\n // emitted into Resources.GPU.Attributes by transformGpuAttributes \u2014\n // both consumers (bid engine vs. workload builder) see it.\n const interconnectGroup = resolveInterconnectGroup(compute.resources.gpu?.attributes?.interconnect);\n\n return Service.fromPartial({\n name,\n image: service.image,\n command: service.command || [],\n args: service.args || [],\n env: service.env || [],\n resources: buildResources(resourceId, compute, service, endpointSequenceNumbers),\n count,\n expose: buildManifestExpose(service, endpointSequenceNumbers),\n params,\n credentials,\n interconnectGroup,\n });\n}\n\nfunction buildParams(service: SDLService): ServiceParams | undefined {\n if (!service.params) return undefined;\n\n const storage = service.params.storage || {};\n const storageNames = service.params.storage ? Object.keys(storage).sort() : [];\n const result = ServiceParams.fromPartial({\n storage: storageNames.map((name) => {\n const config = storage[name];\n return StorageParams.fromPartial({\n name,\n mount: config.mount || \"\",\n readOnly: config.readOnly || false,\n });\n }),\n });\n\n // Permissions are not in the protobuf type but need to be preserved\n if (service.params.permissions) {\n (result as unknown as Record<string, unknown>).permissions = service.params.permissions;\n }\n\n // Project TEE onto the manifest, mirroring Go's groupBuilder\n // (params.TEE = {Type, Attestation: true}). `attestation` is hard-coded true\n // (not an input knob); the provider injects the attestation sidecar.\n if (service.params.tee) {\n result.tee = TEEParams.fromPartial({ type: service.params.tee, attestation: true });\n }\n\n return result;\n}\n\nfunction buildManifestExpose(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): ServiceExpose[] {\n return (service.expose ?? [])\n .flatMap((expose) =>\n (expose.to ?? []).map((to) =>\n ServiceExpose.fromPartial({\n port: expose.port,\n externalPort: expose.as,\n proto: parseServiceProto(expose.proto),\n service: to.service || \"\",\n global: to.global || false,\n hosts: expose.accept || [],\n httpOptions: buildHttpOptions(expose.http_options),\n ip: to.ip || \"\",\n endpointSequenceNumber: endpointSequenceNumbers[to.ip!],\n }),\n ),\n )\n .sort((a, b) => {\n if (a.service !== b.service) return a.service.localeCompare(b.service);\n if (a.port !== b.port) return a.port - b.port;\n if (a.proto !== b.proto) return a.proto.localeCompare(b.proto);\n if (a.global !== b.global) return a.global ? -1 : 1;\n return 0;\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAgD;AAChD,iBAAoB;AACpB,iBAAoB;AACpB,oBAAuB;AACvB,uBAA0B;AAC1B,qBAAwB;AACxB,wBAAsC;AACtC,uBAA0B;AAC1B,0BAA6B;AAC7B,mBAAsB;AACtB,qBAAmF;AACnF,2BAA8B;
|
|
4
|
+
"sourcesContent": ["import { PlacementRequirements, SignedBy } from \"../../generated/protos/akash/base/attributes/v1/attribute.ts\";\nimport { CPU } from \"../../generated/protos/akash/base/resources/v1beta4/cpu.ts\";\nimport { GPU } from \"../../generated/protos/akash/base/resources/v1beta4/gpu.ts\";\nimport { Memory } from \"../../generated/protos/akash/base/resources/v1beta4/memory.ts\";\nimport { Resources } from \"../../generated/protos/akash/base/resources/v1beta4/resources.ts\";\nimport { Storage } from \"../../generated/protos/akash/base/resources/v1beta4/storage.ts\";\nimport { DeploymentReclamation } from \"../../generated/protos/akash/deployment/v1/deployment.ts\";\nimport { GroupSpec } from \"../../generated/protos/akash/deployment/v1beta4/groupspec.ts\";\nimport { ResourceUnit } from \"../../generated/protos/akash/deployment/v1beta4/resourceunit.ts\";\nimport { Group } from \"../../generated/protos/akash/manifest/v2beta3/group.ts\";\nimport { ImageCredentials, Service, ServiceParams, StorageParams, TEEParams } from \"../../generated/protos/akash/manifest/v2beta3/service.ts\";\nimport { ServiceExpose } from \"../../generated/protos/akash/manifest/v2beta3/serviceexpose.ts\";\nimport type { ValidationError } from \"../../utils/jsonSchemaValidation.ts\";\nimport { castArray } from \"../utils.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport { validateSDL } from \"../validateSDL/validateSDL.ts\";\nimport {\n buildHttpOptions,\n buildResourceAttributes,\n buildServiceEndpoints,\n buildStorageAttributes,\n compareStrings,\n computeEndpointSequenceNumbers,\n parseCpuUnits,\n parseGpuUnits,\n parseMemoryBytes,\n parseServiceProto,\n parseStorageBytes,\n resolveInterconnectGroup,\n type SDLCompute,\n type SDLService,\n sortedExposeTargets,\n transformGpuAttributes,\n} from \"./manifestUtils.ts\";\nimport { minWindowToDuration } from \"./reclamationDuration.ts\";\n\nexport interface GenerateManifestOkResult {\n groups: Group[];\n groupSpecs: GroupSpec[];\n reclamation?: DeploymentReclamation;\n}\n\nexport type Manifest = GenerateManifestOkResult[\"groups\"];\nexport type GenerateManifestResult =\n | { ok?: false; value: ValidationError[] }\n | { ok: true; value: GenerateManifestOkResult };\nexport function generateManifest(sdl: SDLInput): GenerateManifestResult {\n const errors = validateSDL(sdl);\n if (errors) return { ok: false, value: errors };\n\n const endpointSequenceNumbers = computeEndpointSequenceNumbers(sdl.services);\n const groupsMap = new Map<string, {\n dgroup: GroupSpec;\n boundComputes: Record<string, number>;\n teeType?: string;\n }>();\n const resourceIds = new Map<string, number>();\n\n const deploymentsByPlacement = new Map<string, [string, { profile: string; count: number }][]>();\n for (const [svcName, placements] of Object.entries(sdl.deployment)) {\n for (const [placementName, deployment] of Object.entries(placements)) {\n let list = deploymentsByPlacement.get(placementName);\n if (!list) {\n list = [];\n deploymentsByPlacement.set(placementName, list);\n }\n list.push([svcName, deployment]);\n }\n }\n for (const list of deploymentsByPlacement.values()) {\n list.sort(([a], [b]) => compareStrings(a, b));\n }\n\n const services = Object.entries(sdl.services).sort(([a], [b]) => compareStrings(a, b));\n\n for (const [svcName, service] of services) {\n for (const [placementName, svcdepl] of Object.entries(sdl.deployment[svcName])) {\n const compute = sdl.profiles.compute[svcdepl.profile];\n const infra = sdl.profiles.placement[placementName];\n const pricing = infra.pricing[svcdepl.profile];\n const price = {\n denom: pricing.denom,\n amount: pricing.amount?.toString(),\n };\n\n let group = groupsMap.get(placementName);\n\n if (!group) {\n group = {\n dgroup: GroupSpec.fromPartial({\n name: placementName,\n resources: [],\n requirements: PlacementRequirements.fromPartial({\n attributes: buildResourceAttributes(infra.attributes),\n signedBy: SignedBy.fromPartial({\n allOf: infra.signedBy?.allOf,\n anyOf: infra.signedBy?.anyOf,\n }),\n }),\n }),\n boundComputes: {},\n teeType: undefined,\n };\n\n groupsMap.set(placementName, group);\n }\n\n const teeType = service.params?.tee;\n if (teeType && !group.teeType) {\n group.teeType = teeType;\n group.dgroup.requirements!.attributes.push({ key: \"tee/type\", value: teeType });\n group.dgroup.requirements!.attributes.sort((a, b) => compareStrings(a.key, b.key));\n }\n\n const profileKey = `${placementName}:${svcdepl.profile}`;\n const location = group.boundComputes[svcdepl.profile];\n\n if (location === undefined) {\n const resId = group.dgroup.resources.length > 0\n ? group.dgroup.resources.length + 1\n : 1;\n\n resourceIds.set(profileKey, resId);\n\n const resources = buildResources(resId, compute, service, endpointSequenceNumbers);\n\n group.dgroup.resources.push(\n ResourceUnit.fromPartial({\n resource: resources,\n count: svcdepl.count,\n price,\n }),\n );\n\n group.boundComputes[svcdepl.profile] = group.dgroup.resources.length - 1;\n } else {\n if (!resourceIds.has(profileKey)) {\n resourceIds.set(profileKey, group.dgroup.resources[location].resource!.id);\n }\n\n group.dgroup.resources[location].count += svcdepl.count;\n group.dgroup.resources[location].resource!.endpoints.push(\n ...buildServiceEndpoints(service, endpointSequenceNumbers),\n );\n\n // Go re-sorts only when it merges a second service into an already-bound\n // profile, and `Endpoints.Less` compares the sequence number alone \u2014 kind\n // is not part of the ordering, so equal-sequence endpoints keep the order\n // the services were merged in. Sorting on kind too, or sorting the\n // single-service case, produces a different group spec than the chain.\n group.dgroup.resources[location].resource!.endpoints.sort(\n (a, b) => a.sequenceNumber - b.sequenceNumber,\n );\n }\n }\n }\n\n const sortedGroupNames = [...groupsMap.keys()].sort();\n let groups: Group[] | undefined;\n let groupSpecs: GroupSpec[] | undefined;\n let reclamation: DeploymentReclamation | undefined;\n\n const manifest = {\n // reclamation is a `MsgCreateDeployment` field, not a manifest group, and is\n // not needed in every call \u2014 so it's lazy like `groups`/`groupSpecs`.\n // `validateSDL` (run above) already guaranteed `min_window` is valid, so\n // `minWindowToDuration` never throws here.\n get reclamation() {\n if (sdl.reclamation && !reclamation) {\n reclamation = DeploymentReclamation.fromPartial({\n minWindow: minWindowToDuration(sdl.reclamation.min_window),\n });\n }\n return reclamation;\n },\n get groups() {\n groups ??= sortedGroupNames.map((placementName) => {\n const deployments = deploymentsByPlacement.get(placementName)!;\n\n return Group.fromPartial({\n name: placementName,\n services: deployments.map(([svcName]) => {\n const service = sdl.services[svcName];\n const deployment = sdl.deployment[svcName][placementName];\n const compute = sdl.profiles.compute[deployment.profile];\n const resourceId = resourceIds.get(`${placementName}:${deployment.profile}`) || 1;\n\n return buildManifestService(\n resourceId,\n svcName,\n service,\n compute,\n deployment.count,\n endpointSequenceNumbers,\n );\n }),\n });\n });\n return groups;\n },\n get groupSpecs() {\n groupSpecs ??= sortedGroupNames.map((name) => groupsMap.get(name)!.dgroup);\n return groupSpecs;\n },\n };\n\n return { ok: true, value: manifest };\n}\n\nfunction buildResources(\n id: number,\n compute: SDLCompute,\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Resources {\n const res = compute.resources;\n const cpuAttributes = buildResourceAttributes(res.cpu.attributes);\n const gpuAttributes = res.gpu?.attributes ? transformGpuAttributes(res.gpu.attributes) : [];\n\n return Resources.fromPartial({\n id,\n cpu: CPU.fromPartial({\n units: { val: parseCpuUnits(res.cpu) },\n attributes: cpuAttributes,\n }),\n memory: Memory.fromPartial({\n quantity: { val: parseMemoryBytes(res.memory) },\n }),\n storage: castArray(res.storage).map((s) =>\n Storage.fromPartial({\n name: s.name || \"default\",\n quantity: { val: parseStorageBytes(s.size) },\n attributes: buildStorageAttributes(s.attributes),\n }),\n ),\n gpu: GPU.fromPartial({\n units: { val: parseGpuUnits(res.gpu) },\n attributes: gpuAttributes,\n }),\n endpoints: buildServiceEndpoints(service, endpointSequenceNumbers),\n });\n}\n\nfunction buildManifestService(\n resourceId: number,\n name: string,\n service: SDLService,\n compute: SDLCompute,\n count: number,\n endpointSequenceNumbers: Record<string, number>,\n): Service {\n const credentials = service.credentials\n ? ImageCredentials.fromPartial({\n host: service.credentials.host,\n email: service.credentials.email || \"\",\n username: service.credentials.username,\n password: service.credentials.password,\n })\n : undefined;\n\n const params = buildParams(service);\n\n // The interconnect group lives under gpu.attributes.interconnect (either\n // `[]` for the implicit `auto` group or `{ group: <name> }` for an\n // explicit name) and propagates to the off-chain manifest's\n // Service.interconnectGroup field so the provider's workload builder\n // can label pods for per-group anti-affinity. The same value is also\n // emitted into Resources.GPU.Attributes by transformGpuAttributes \u2014\n // both consumers (bid engine vs. workload builder) see it.\n const interconnectGroup = resolveInterconnectGroup(compute.resources.gpu?.attributes?.interconnect);\n\n return Service.fromPartial({\n name,\n image: service.image,\n command: service.command || [],\n args: service.args || [],\n env: service.env || [],\n resources: buildResources(resourceId, compute, service, endpointSequenceNumbers),\n count,\n expose: buildManifestExpose(service, endpointSequenceNumbers),\n params,\n credentials,\n interconnectGroup,\n });\n}\n\nfunction buildParams(service: SDLService): ServiceParams | undefined {\n if (!service.params) return undefined;\n\n const storage = service.params.storage || {};\n const storageNames = service.params.storage ? Object.keys(storage).sort() : [];\n const result = ServiceParams.fromPartial({\n storage: storageNames.map((name) => {\n const config = storage[name];\n return StorageParams.fromPartial({\n name,\n mount: config.mount || \"\",\n readOnly: config.readOnly || false,\n });\n }),\n });\n\n // Permissions are not in the protobuf type but need to be preserved\n if (service.params.permissions) {\n (result as unknown as Record<string, unknown>).permissions = service.params.permissions;\n }\n\n // Project TEE onto the manifest, mirroring Go's groupBuilder\n // (params.TEE = {Type, Attestation: true}). `attestation` is hard-coded true\n // (not an input knob); the provider injects the attestation sidecar.\n if (service.params.tee) {\n result.tee = TEEParams.fromPartial({ type: service.params.tee, attestation: true });\n }\n\n return result;\n}\n\nfunction buildManifestExpose(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): ServiceExpose[] {\n return sortedExposeTargets(service).map(({ expose, to }) =>\n ServiceExpose.fromPartial({\n port: expose.port,\n externalPort: expose.as,\n proto: parseServiceProto(expose.proto),\n service: to.service || \"\",\n global: to.global || false,\n hosts: expose.accept || [],\n httpOptions: buildHttpOptions(expose.http_options),\n ip: to.ip || \"\",\n endpoint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;AAAA,QACA,OAAO,OAAO,SAAS;AAAA,QACvB,UAAU,OAAO,YAAY;AAAA,MAC/B,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;AAGD,MAAI,QAAQ,OAAO,aAAa;AAC9B,IAAC,OAA8C,cAAc,QAAQ,OAAO;AAAA,EAC9E;AAKA,MAAI,QAAQ,OAAO,KAAK;AACtB,WAAO,MAAM,yBAAU,YAAY,EAAE,MAAM,QAAQ,OAAO,KAAK,aAAa,KAAK,CAAC;AAAA,EACpF;AAEA,SAAO;AACT;AAEA,SAAS,oBACP,SACA,yBACiB;AACjB,aAAO,0CAAoB,OAAO,EAAE;AAAA,IAAI,CAAC,EAAE,QAAQ,GAAG,MACpD,mCAAc,YAAY;AAAA,MACxB,MAAM,OAAO;AAAA,MACb,cAAc,OAAO;AAAA,MACrB,WAAO,wCAAkB,OAAO,KAAK;AAAA,MACrC,SAAS,GAAG,WAAW;AAAA,MACvB,QAAQ,GAAG,UAAU;AAAA,MACrB,OAAO,OAAO,UAAU,CAAC;AAAA,MACzB,iBAAa,uCAAiB,OAAO,YAAY;AAAA,MACjD,IAAI,GAAG,MAAM;AAAA,MACb,wBAAwB,wBAAwB,GAAG,EAAG;AAAA,IACxD,CAAC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,6 +23,8 @@ __export(manifestUtils_exports, {
|
|
|
23
23
|
buildResourceAttributes: () => buildResourceAttributes,
|
|
24
24
|
buildServiceEndpoints: () => buildServiceEndpoints,
|
|
25
25
|
buildStorageAttributes: () => buildStorageAttributes,
|
|
26
|
+
compareExposes: () => compareExposes,
|
|
27
|
+
compareStrings: () => compareStrings,
|
|
26
28
|
computeEndpointSequenceNumbers: () => computeEndpointSequenceNumbers,
|
|
27
29
|
isIngress: () => isIngress,
|
|
28
30
|
parseCpuUnits: () => parseCpuUnits,
|
|
@@ -31,6 +33,7 @@ __export(manifestUtils_exports, {
|
|
|
31
33
|
parseServiceProto: () => parseServiceProto,
|
|
32
34
|
parseStorageBytes: () => parseStorageBytes,
|
|
33
35
|
resolveInterconnectGroup: () => resolveInterconnectGroup,
|
|
36
|
+
sortedExposeTargets: () => sortedExposeTargets,
|
|
34
37
|
transformGpuAttributes: () => transformGpuAttributes
|
|
35
38
|
});
|
|
36
39
|
module.exports = __toCommonJS(manifestUtils_exports);
|
|
@@ -56,6 +59,10 @@ function computeEndpointSequenceNumbers(services) {
|
|
|
56
59
|
return result;
|
|
57
60
|
}, {});
|
|
58
61
|
}
|
|
62
|
+
function compareStrings(a, b) {
|
|
63
|
+
if (a === b) return 0;
|
|
64
|
+
return a < b ? -1 : 1;
|
|
65
|
+
}
|
|
59
66
|
function isIngress(proto, global, externalPort, port) {
|
|
60
67
|
const effectivePort = externalPort === 0 ? port : externalPort;
|
|
61
68
|
return global && proto === "TCP" && effectivePort === 80;
|
|
@@ -75,7 +82,7 @@ function transformGpuAttributes(attributes) {
|
|
|
75
82
|
const result = [];
|
|
76
83
|
const vendor = attributes.vendor;
|
|
77
84
|
if (vendor) {
|
|
78
|
-
Object.keys(vendor).sort(
|
|
85
|
+
Object.keys(vendor).sort(compareStrings).forEach((vendorName) => {
|
|
79
86
|
const models = vendor[vendorName];
|
|
80
87
|
if (!models) {
|
|
81
88
|
result.push({ key: `vendor/${vendorName}/model/*`, value: "true" });
|
|
@@ -93,7 +100,7 @@ function transformGpuAttributes(attributes) {
|
|
|
93
100
|
if (group !== "") {
|
|
94
101
|
result.push({ key: "interconnect/group", value: group });
|
|
95
102
|
}
|
|
96
|
-
result.sort((a, b) => a.key
|
|
103
|
+
result.sort((a, b) => compareStrings(a.key, b.key));
|
|
97
104
|
return result;
|
|
98
105
|
}
|
|
99
106
|
function buildHttpOptions(httpOptions) {
|
|
@@ -103,9 +110,26 @@ function buildHttpOptions(httpOptions) {
|
|
|
103
110
|
sendTimeout: normalizedHTTPTimeout(httpOptions?.send_timeout),
|
|
104
111
|
nextTries: httpOptions?.next_tries ?? 3,
|
|
105
112
|
nextTimeout: httpOptions?.next_timeout ?? 0,
|
|
106
|
-
nextCases: httpOptions?.next_cases ?? ["error", "timeout"]
|
|
113
|
+
nextCases: httpOptions?.next_cases ?? ["error", "timeout"],
|
|
114
|
+
proxy: buildProxyOptions(httpOptions?.proxy)
|
|
107
115
|
});
|
|
108
116
|
}
|
|
117
|
+
function buildProxyOptions(proxy) {
|
|
118
|
+
if (!proxy) return void 0;
|
|
119
|
+
const bufferingDisable = proxy.buffering_disable ?? false;
|
|
120
|
+
const bufferSize = proxy.buffer_size ?? 0;
|
|
121
|
+
const buffersNumber = proxy.buffers_number ?? 0;
|
|
122
|
+
const buffersSize = proxy.buffers_size ?? 0;
|
|
123
|
+
const busyBuffersSize = proxy.busy_buffers_size ?? 0;
|
|
124
|
+
const connectTimeout = proxy.connect_timeout ?? 0;
|
|
125
|
+
if (buffersNumber === 0 !== (buffersSize === 0)) {
|
|
126
|
+
throw new Error("proxy.buffers_number and proxy.buffers_size must be set together");
|
|
127
|
+
}
|
|
128
|
+
if (!bufferingDisable && bufferSize === 0 && buffersNumber === 0 && buffersSize === 0 && busyBuffersSize === 0 && connectTimeout === 0) {
|
|
129
|
+
return void 0;
|
|
130
|
+
}
|
|
131
|
+
return import_index_provider_akash_v2beta3.ProxyOptions.fromPartial({ bufferingDisable, bufferSize, buffersNumber, buffersSize, busyBuffersSize, connectTimeout });
|
|
132
|
+
}
|
|
109
133
|
function normalizedHTTPTimeout(value) {
|
|
110
134
|
const result = (0, import_httpTimeout.parseHTTPTimeout)(value ?? 6e4);
|
|
111
135
|
if (!result.ok) {
|
|
@@ -122,32 +146,48 @@ function buildStorageAttributes(attributes) {
|
|
|
122
146
|
if (attributes.class === "ram" && !("persistent" in attributes)) {
|
|
123
147
|
pairs.push({ key: "persistent", value: "false" });
|
|
124
148
|
}
|
|
125
|
-
pairs.sort((a, b) => a.key
|
|
149
|
+
pairs.sort((a, b) => compareStrings(a.key, b.key));
|
|
126
150
|
return pairs;
|
|
127
151
|
}
|
|
128
152
|
function parseServiceProto(proto) {
|
|
129
153
|
return proto?.toUpperCase() || "TCP";
|
|
130
154
|
}
|
|
155
|
+
function compareExposes(a, b) {
|
|
156
|
+
if (a.service !== b.service) return compareStrings(a.service, b.service);
|
|
157
|
+
if (a.port !== b.port) return a.port - b.port;
|
|
158
|
+
if (a.proto !== b.proto) return compareStrings(a.proto, b.proto);
|
|
159
|
+
if (a.global !== b.global) return a.global ? -1 : 1;
|
|
160
|
+
return 0;
|
|
161
|
+
}
|
|
162
|
+
function sortedExposeTargets(service) {
|
|
163
|
+
return (service.expose ?? []).flatMap((expose) => (expose.to ?? []).map((to) => ({ expose, to }))).sort((a, b) => compareExposes(exposeSortKey(a), exposeSortKey(b)));
|
|
164
|
+
}
|
|
165
|
+
function exposeSortKey({ expose, to }) {
|
|
166
|
+
return {
|
|
167
|
+
service: to.service || "",
|
|
168
|
+
port: expose.port,
|
|
169
|
+
proto: parseServiceProto(expose.proto),
|
|
170
|
+
global: to.global || false
|
|
171
|
+
};
|
|
172
|
+
}
|
|
131
173
|
function buildServiceEndpoints(service, endpointSequenceNumbers) {
|
|
132
|
-
return (service.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
);
|
|
174
|
+
return sortedExposeTargets(service).filter(({ to }) => to.global).flatMap(({ expose, to }) => {
|
|
175
|
+
const externalPort = expose.as || 0;
|
|
176
|
+
const proto = parseServiceProto(expose.proto);
|
|
177
|
+
const kind = isIngress(proto, !!to.global, externalPort, expose.port) ? import_index_akash_v1beta4.Endpoint_Kind.SHARED_HTTP : import_index_akash_v1beta4.Endpoint_Kind.RANDOM_PORT;
|
|
178
|
+
const defaultEp = import_index_akash_v1beta4.Endpoint.fromPartial({
|
|
179
|
+
kind,
|
|
180
|
+
sequenceNumber: 0
|
|
181
|
+
});
|
|
182
|
+
if (!to.ip?.length) {
|
|
183
|
+
return [defaultEp];
|
|
184
|
+
}
|
|
185
|
+
const leasedEp = import_index_akash_v1beta4.Endpoint.fromPartial({
|
|
186
|
+
kind: import_index_akash_v1beta4.Endpoint_Kind.LEASED_IP,
|
|
187
|
+
sequenceNumber: endpointSequenceNumbers[to.ip] ?? 0
|
|
188
|
+
});
|
|
189
|
+
return [defaultEp, leasedEp];
|
|
190
|
+
});
|
|
151
191
|
}
|
|
152
192
|
function parseCpuUnits(cpu) {
|
|
153
193
|
return typeof cpu.units === "string" ? (0, import_sizes.convertCpuResourceString)(cpu.units) : (0, import_sizes.convertCpuResourceString)(String(cpu.units));
|
|
@@ -165,6 +205,6 @@ function parseGpuUnits(gpu) {
|
|
|
165
205
|
}
|
|
166
206
|
function buildResourceAttributes(attributes) {
|
|
167
207
|
if (!attributes) return void 0;
|
|
168
|
-
return Object.keys(attributes).sort(
|
|
208
|
+
return Object.keys(attributes).sort(compareStrings).map((key) => ({ key, value: String(attributes[key]) }));
|
|
169
209
|
}
|
|
170
210
|
//# sourceMappingURL=manifestUtils.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/sdl/manifest/manifestUtils.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Attribute } from \"../../generated/protos/index.akash.v1.ts\";\nimport {\n Endpoint,\n Endpoint_Kind,\n} from \"../../generated/protos/index.akash.v1beta4.ts\";\nimport {\n ServiceExposeHTTPOptions,\n} from \"../../generated/protos/index.provider.akash.v2beta3.ts\";\nimport { parseHTTPTimeout } from \"../httpTimeout.ts\";\nimport { convertCpuResourceString, convertResourceString } from \"../sizes.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport type { StorageAttributesValidation } from \"../validateSDL/validateSDLInput.ts\";\n\ntype SDLService = SDLInput[\"services\"][string];\ntype SDLExpose = NonNullable<SDLService[\"expose\"]>[number];\ntype SDLExposeTo = NonNullable<SDLExpose[\"to\"]>[number];\ntype SDLHttpOptions = SDLExpose[\"http_options\"];\ntype SDLCompute = SDLInput[\"profiles\"][\"compute\"][string];\ntype SDLStorage = SDLCompute[\"resources\"][\"storage\"];\ntype SDLStorageVolume = SDLStorage extends (infer T)[] ? T : SDLStorage;\ntype SDLGpuAttributes = NonNullable<NonNullable<SDLCompute[\"resources\"][\"gpu\"]>[\"attributes\"]>;\n\nexport type { SDLCompute, SDLExpose, SDLExposeTo, SDLGpuAttributes, SDLHttpOptions, SDLService, SDLStorage, SDLStorageVolume };\n\nexport function computeEndpointSequenceNumbers(services: SDLInput[\"services\"]): Record<string, number> {\n const endpointNames: string[] = [];\n\n for (const service of Object.values(services)) {\n if (!service.expose) continue;\n for (const expose of service.expose) {\n if (!expose.to) continue;\n for (const to of expose.to) {\n if (to.global && to.ip && to.ip.length > 0) {\n endpointNames.push(to.ip);\n }\n }\n }\n }\n\n return endpointNames.sort().reduce<Record<string, number>>((result, name, seqNumber) => {\n result[name] = seqNumber + 1;\n return result;\n }, {});\n}\n\nexport function isIngress(proto: string, global: boolean, externalPort: number, port: number): boolean {\n const effectivePort = externalPort === 0 ? port : externalPort;\n return global && proto === \"TCP\" && effectivePort === 80;\n}\n\n// INTERCONNECT_GROUP_AUTO is the reserved name the SDL parser assigns to\n// every `interconnect: []` opt-in within one placement. Tenants cannot\n// write it explicitly under `interconnect: { group: ... }` \u2014 mirrors\n// `InterconnectGroupAuto` in go/sdl/gpu.go.\nexport const INTERCONNECT_GROUP_AUTO = \"auto\";\n\n// resolveInterconnectGroup returns the group string the parser derives\n// from gpu.attributes.interconnect:\n// - empty sequence `[]` \u2192 INTERCONNECT_GROUP_AUTO (\"auto\")\n// - mapping `{ group: <name> }` \u2192 <name>\n// - anything else / absent \u2192 \"\" (non-interconnect)\n// Both the on-chain attribute emitter and the off-chain manifest builder\n// route through this helper so they agree on the resolved value.\nexport function resolveInterconnectGroup(interconnect: SDLGpuAttributes[\"interconnect\"]): string {\n if (Array.isArray(interconnect)) {\n return interconnect.length === 0 ? INTERCONNECT_GROUP_AUTO : \"\";\n }\n if (interconnect && typeof interconnect === \"object\" && \"group\" in interconnect) {\n const g = (interconnect as { group?: unknown }).group;\n return typeof g === \"string\" ? g : \"\";\n }\n return \"\";\n}\n\nexport function transformGpuAttributes(attributes: SDLGpuAttributes): Attribute[] {\n const result: Attribute[] = [];\n\n const vendor = attributes.vendor;\n if (vendor) {\n Object.keys(vendor)\n .sort((a, b) => a.localeCompare(b))\n .forEach((vendorName) => {\n const models = vendor[vendorName as keyof typeof vendor];\n if (!models) {\n result.push({ key: `vendor/${vendorName}/model/*`, value: \"true\" });\n return;\n }\n for (const model of models) {\n let key = `vendor/${vendorName}/model/${model.model}`;\n if (model.ram) key += `/ram/${model.ram}`;\n if (model.interface) key += `/interface/${model.interface}`;\n result.push({ key, value: \"true\" });\n }\n });\n }\n\n // interconnect emits a single on-chain attribute `interconnect/group` \u2014\n // the group is the entire opt-in signal. Keep parity with the Go parser\n // in go/sdl/gpu.go: empty sequence `[]` resolves to the reserved literal\n // `auto`, the explicit mapping form `{ group: <name> }` carries the\n // tenant-chosen name. See docs/sdl-interconnect-spec.md.\n const group = resolveInterconnectGroup(attributes.interconnect);\n if (group !== \"\") {\n result.push({ key: \"interconnect/group\", value: group });\n }\n\n // Go SDL parser canonicalizes the slice via sort.Sort(res) before\n // returning. Mirror that here so the on-chain attribute order matches\n // byte-for-byte across both implementations.\n result.sort((a, b) => a.key.localeCompare(b.key));\n\n return result;\n}\n\nexport function buildHttpOptions(httpOptions?: SDLHttpOptions): ServiceExposeHTTPOptions {\n return ServiceExposeHTTPOptions.fromPartial({\n maxBodySize: httpOptions?.max_body_size ?? 1048576,\n readTimeout: normalizedHTTPTimeout(httpOptions?.read_timeout),\n sendTimeout: normalizedHTTPTimeout(httpOptions?.send_timeout),\n nextTries: httpOptions?.next_tries ?? 3,\n nextTimeout: httpOptions?.next_timeout ?? 0,\n nextCases: httpOptions?.next_cases ?? [\"error\", \"timeout\"],\n });\n}\n\nfunction normalizedHTTPTimeout(value: number | string | undefined): number {\n const result = parseHTTPTimeout(value ?? 60_000);\n if (!result.ok) {\n throw new Error(`Invalid HTTP timeout: ${result.message}`);\n }\n\n return result.milliseconds;\n}\n\nexport function buildStorageAttributes(attributes?: StorageAttributesValidation): Attribute[] {\n if (!attributes) return [];\n\n const pairs: Attribute[] = Object.entries(attributes).map(([key, value]) => ({\n key,\n value: String(value),\n }));\n\n if (attributes.class === \"ram\" && !(\"persistent\" in attributes)) {\n pairs.push({ key: \"persistent\", value: \"false\" });\n }\n\n pairs.sort((a, b) => a.key.localeCompare(b.key));\n return pairs;\n}\n\nexport function parseServiceProto(proto?: string): string {\n return proto?.toUpperCase() || \"TCP\";\n}\n\nexport function buildServiceEndpoints(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Endpoint[] {\n return (service.expose ?? []).flatMap((expose) =>\n (expose.to ?? [])\n .filter((to) => to.global)\n .flatMap((to) => {\n const externalPort = expose.as || 0;\n const proto = parseServiceProto(expose.proto);\n const kind = isIngress(proto, !!to.global, externalPort, expose.port)\n ? Endpoint_Kind.SHARED_HTTP\n : Endpoint_Kind.RANDOM_PORT;\n\n const defaultEp = Endpoint.fromPartial({\n kind,\n sequenceNumber: 0,\n });\n\n if (!to.ip?.length) {\n return [defaultEp];\n }\n\n const leasedEp = Endpoint.fromPartial({\n kind: Endpoint_Kind.LEASED_IP,\n sequenceNumber: endpointSequenceNumbers[to.ip] ?? 0,\n });\n\n return [defaultEp, leasedEp];\n }),\n );\n}\n\nexport function parseCpuUnits(cpu: SDLCompute[\"resources\"][\"cpu\"]): bigint {\n return typeof cpu.units === \"string\"\n ? convertCpuResourceString(cpu.units)\n : convertCpuResourceString(String(cpu.units));\n}\n\nexport function parseMemoryBytes(memory: SDLCompute[\"resources\"][\"memory\"]): bigint {\n return convertResourceString(memory.size);\n}\n\nexport function parseStorageBytes(size: string): bigint {\n return convertResourceString(size);\n}\n\nexport function parseGpuUnits(gpu?: SDLCompute[\"resources\"][\"gpu\"]): bigint {\n const value = gpu?.units;\n if (value === undefined || value === null) return 0n;\n return BigInt(value);\n}\n\nexport function buildResourceAttributes(attributes?: Record<string, unknown>): Attribute[] | undefined {\n if (!attributes) return undefined;\n return Object.keys(attributes)\n .sort((a, b) => a.localeCompare(b))\n .map((key) => ({ key, value: String(attributes[key]) }));\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iCAGO;AACP,
|
|
4
|
+
"sourcesContent": ["import type { Attribute } from \"../../generated/protos/index.akash.v1.ts\";\nimport {\n Endpoint,\n Endpoint_Kind,\n} from \"../../generated/protos/index.akash.v1beta4.ts\";\nimport {\n ProxyOptions,\n ServiceExposeHTTPOptions,\n} from \"../../generated/protos/index.provider.akash.v2beta3.ts\";\nimport { parseHTTPTimeout } from \"../httpTimeout.ts\";\nimport { convertCpuResourceString, convertResourceString } from \"../sizes.ts\";\nimport type { SDLInput } from \"../validateSDL/validateSDL.ts\";\nimport type { StorageAttributesValidation } from \"../validateSDL/validateSDLInput.ts\";\n\ntype SDLService = SDLInput[\"services\"][string];\ntype SDLExpose = NonNullable<SDLService[\"expose\"]>[number];\ntype SDLExposeTo = NonNullable<SDLExpose[\"to\"]>[number];\ntype SDLHttpOptions = SDLExpose[\"http_options\"];\ntype SDLHttpProxyOptions = NonNullable<SDLHttpOptions>[\"proxy\"];\ntype SDLCompute = SDLInput[\"profiles\"][\"compute\"][string];\ntype SDLStorage = SDLCompute[\"resources\"][\"storage\"];\ntype SDLStorageVolume = SDLStorage extends (infer T)[] ? T : SDLStorage;\ntype SDLGpuAttributes = NonNullable<NonNullable<SDLCompute[\"resources\"][\"gpu\"]>[\"attributes\"]>;\n\nexport type { SDLCompute, SDLExpose, SDLExposeTo, SDLGpuAttributes, SDLHttpOptions, SDLService, SDLStorage, SDLStorageVolume };\n\nexport function computeEndpointSequenceNumbers(services: SDLInput[\"services\"]): Record<string, number> {\n const endpointNames: string[] = [];\n\n for (const service of Object.values(services)) {\n if (!service.expose) continue;\n for (const expose of service.expose) {\n if (!expose.to) continue;\n for (const to of expose.to) {\n if (to.global && to.ip && to.ip.length > 0) {\n endpointNames.push(to.ip);\n }\n }\n }\n }\n\n return endpointNames.sort().reduce<Record<string, number>>((result, name, seqNumber) => {\n result[name] = seqNumber + 1;\n return result;\n }, {});\n}\n\n// Go orders every string it sorts in the SDL builder with a plain `<`:\n// `Attributes.Less` compares keys, `ServiceExposes.Less` compares service names,\n// and placement/service names go through `sort.Strings`. `localeCompare` is not\n// the same relation \u2014 it folds case and demotes punctuation, so e.g. \"a_b\" and\n// \"aB\" come out in the opposite order. Attribute keys carry \"/\" and placement,\n// service and volume names are unconstrained strings, so the two can genuinely\n// disagree, and the resulting group spec is signed. Every sort on this path uses\n// this comparator instead.\nexport function compareStrings(a: string, b: string): number {\n if (a === b) return 0;\n return a < b ? -1 : 1;\n}\n\nexport function isIngress(proto: string, global: boolean, externalPort: number, port: number): boolean {\n const effectivePort = externalPort === 0 ? port : externalPort;\n return global && proto === \"TCP\" && effectivePort === 80;\n}\n\n// INTERCONNECT_GROUP_AUTO is the reserved name the SDL parser assigns to\n// every `interconnect: []` opt-in within one placement. Tenants cannot\n// write it explicitly under `interconnect: { group: ... }` \u2014 mirrors\n// `InterconnectGroupAuto` in go/sdl/gpu.go.\nexport const INTERCONNECT_GROUP_AUTO = \"auto\";\n\n// resolveInterconnectGroup returns the group string the parser derives\n// from gpu.attributes.interconnect:\n// - empty sequence `[]` \u2192 INTERCONNECT_GROUP_AUTO (\"auto\")\n// - mapping `{ group: <name> }` \u2192 <name>\n// - anything else / absent \u2192 \"\" (non-interconnect)\n// Both the on-chain attribute emitter and the off-chain manifest builder\n// route through this helper so they agree on the resolved value.\nexport function resolveInterconnectGroup(interconnect: SDLGpuAttributes[\"interconnect\"]): string {\n if (Array.isArray(interconnect)) {\n return interconnect.length === 0 ? INTERCONNECT_GROUP_AUTO : \"\";\n }\n if (interconnect && typeof interconnect === \"object\" && \"group\" in interconnect) {\n const g = (interconnect as { group?: unknown }).group;\n return typeof g === \"string\" ? g : \"\";\n }\n return \"\";\n}\n\nexport function transformGpuAttributes(attributes: SDLGpuAttributes): Attribute[] {\n const result: Attribute[] = [];\n\n const vendor = attributes.vendor;\n if (vendor) {\n Object.keys(vendor)\n .sort(compareStrings)\n .forEach((vendorName) => {\n const models = vendor[vendorName as keyof typeof vendor];\n if (!models) {\n result.push({ key: `vendor/${vendorName}/model/*`, value: \"true\" });\n return;\n }\n for (const model of models) {\n let key = `vendor/${vendorName}/model/${model.model}`;\n if (model.ram) key += `/ram/${model.ram}`;\n if (model.interface) key += `/interface/${model.interface}`;\n result.push({ key, value: \"true\" });\n }\n });\n }\n\n // interconnect emits a single on-chain attribute `interconnect/group` \u2014\n // the group is the entire opt-in signal. Keep parity with the Go parser\n // in go/sdl/gpu.go: empty sequence `[]` resolves to the reserved literal\n // `auto`, the explicit mapping form `{ group: <name> }` carries the\n // tenant-chosen name. See docs/sdl-interconnect-spec.md.\n const group = resolveInterconnectGroup(attributes.interconnect);\n if (group !== \"\") {\n result.push({ key: \"interconnect/group\", value: group });\n }\n\n // Go SDL parser canonicalizes the slice via sort.Sort(res) before\n // returning. Mirror that here so the on-chain attribute order matches\n // byte-for-byte across both implementations.\n result.sort((a, b) => compareStrings(a.key, b.key));\n\n return result;\n}\n\nexport function buildHttpOptions(httpOptions?: SDLHttpOptions): ServiceExposeHTTPOptions {\n return ServiceExposeHTTPOptions.fromPartial({\n maxBodySize: httpOptions?.max_body_size ?? 1048576,\n readTimeout: normalizedHTTPTimeout(httpOptions?.read_timeout),\n sendTimeout: normalizedHTTPTimeout(httpOptions?.send_timeout),\n nextTries: httpOptions?.next_tries ?? 3,\n nextTimeout: httpOptions?.next_timeout ?? 0,\n nextCases: httpOptions?.next_cases ?? [\"error\", \"timeout\"],\n proxy: buildProxyOptions(httpOptions?.proxy),\n });\n}\n\nfunction buildProxyOptions(proxy?: SDLHttpProxyOptions): ProxyOptions | undefined {\n if (!proxy) return undefined;\n\n const bufferingDisable = proxy.buffering_disable ?? false;\n const bufferSize = proxy.buffer_size ?? 0;\n const buffersNumber = proxy.buffers_number ?? 0;\n const buffersSize = proxy.buffers_size ?? 0;\n const busyBuffersSize = proxy.busy_buffers_size ?? 0;\n const connectTimeout = proxy.connect_timeout ?? 0;\n\n if ((buffersNumber === 0) !== (buffersSize === 0)) {\n throw new Error(\"proxy.buffers_number and proxy.buffers_size must be set together\");\n }\n\n if (!bufferingDisable && bufferSize === 0 && buffersNumber === 0 && buffersSize === 0 && busyBuffersSize === 0 && connectTimeout === 0) {\n return undefined;\n }\n\n return ProxyOptions.fromPartial({ bufferingDisable, bufferSize, buffersNumber, buffersSize, busyBuffersSize, connectTimeout });\n}\n\nfunction normalizedHTTPTimeout(value: number | string | undefined): number {\n const result = parseHTTPTimeout(value ?? 60_000);\n if (!result.ok) {\n throw new Error(`Invalid HTTP timeout: ${result.message}`);\n }\n\n return result.milliseconds;\n}\n\nexport function buildStorageAttributes(attributes?: StorageAttributesValidation): Attribute[] {\n if (!attributes) return [];\n\n const pairs: Attribute[] = Object.entries(attributes).map(([key, value]) => ({\n key,\n value: String(value),\n }));\n\n if (attributes.class === \"ram\" && !(\"persistent\" in attributes)) {\n pairs.push({ key: \"persistent\", value: \"false\" });\n }\n\n pairs.sort((a, b) => compareStrings(a.key, b.key));\n return pairs;\n}\n\nexport function parseServiceProto(proto?: string): string {\n return proto?.toUpperCase() || \"TCP\";\n}\n\nexport interface ExposeSortKey {\n service: string;\n port: number;\n proto: string;\n global: boolean;\n}\n\n// Mirrors `ServiceExposes.Less` in go/manifest/v2beta3/serviceexposes.go.\nexport function compareExposes(a: ExposeSortKey, b: ExposeSortKey): number {\n if (a.service !== b.service) return compareStrings(a.service, b.service);\n if (a.port !== b.port) return a.port - b.port;\n if (a.proto !== b.proto) return compareStrings(a.proto, b.proto);\n if (a.global !== b.global) return a.global ? -1 : 1;\n return 0;\n}\n\n// Go expands a service's `expose` entries into one manifest expose per `to`\n// target and sorts the whole list before anything reads it \u2014 `toManifestExpose`\n// in go/sdl/expose.go. Both the manifest expose list and the resource endpoint\n// list are then built by walking it in that order, and the endpoint order is\n// part of the signed group spec, so ordering has to be decided once, here.\nexport function sortedExposeTargets(service: SDLService): { expose: SDLExpose; to: SDLExposeTo }[] {\n return (service.expose ?? [])\n .flatMap((expose) => (expose.to ?? []).map((to) => ({ expose, to })))\n .sort((a, b) => compareExposes(exposeSortKey(a), exposeSortKey(b)));\n}\n\nfunction exposeSortKey({ expose, to }: { expose: SDLExpose; to: SDLExposeTo }): ExposeSortKey {\n return {\n service: to.service || \"\",\n port: expose.port,\n proto: parseServiceProto(expose.proto),\n global: to.global || false,\n };\n}\n\nexport function buildServiceEndpoints(\n service: SDLService,\n endpointSequenceNumbers: Record<string, number>,\n): Endpoint[] {\n return sortedExposeTargets(service)\n .filter(({ to }) => to.global)\n .flatMap(({ expose, to }) => {\n const externalPort = expose.as || 0;\n const proto = parseServiceProto(expose.proto);\n const kind = isIngress(proto, !!to.global, externalPort, expose.port)\n ? Endpoint_Kind.SHARED_HTTP\n : Endpoint_Kind.RANDOM_PORT;\n\n const defaultEp = Endpoint.fromPartial({\n kind,\n sequenceNumber: 0,\n });\n\n if (!to.ip?.length) {\n return [defaultEp];\n }\n\n const leasedEp = Endpoint.fromPartial({\n kind: Endpoint_Kind.LEASED_IP,\n sequenceNumber: endpointSequenceNumbers[to.ip] ?? 0,\n });\n\n // Go emits [LEASED_IP, <kind>] then sorts this pair on its own\n // (`ServiceExpose.GetEndpoints`), which puts the lower kind first.\n return [defaultEp, leasedEp];\n });\n}\n\nexport function parseCpuUnits(cpu: SDLCompute[\"resources\"][\"cpu\"]): bigint {\n return typeof cpu.units === \"string\"\n ? convertCpuResourceString(cpu.units)\n : convertCpuResourceString(String(cpu.units));\n}\n\nexport function parseMemoryBytes(memory: SDLCompute[\"resources\"][\"memory\"]): bigint {\n return convertResourceString(memory.size);\n}\n\nexport function parseStorageBytes(size: string): bigint {\n return convertResourceString(size);\n}\n\nexport function parseGpuUnits(gpu?: SDLCompute[\"resources\"][\"gpu\"]): bigint {\n const value = gpu?.units;\n if (value === undefined || value === null) return 0n;\n return BigInt(value);\n}\n\nexport function buildResourceAttributes(attributes?: Record<string, unknown>): Attribute[] | undefined {\n if (!attributes) return undefined;\n return Object.keys(attributes)\n .sort(compareStrings)\n .map((key) => ({ key, value: String(attributes[key]) }));\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iCAGO;AACP,0CAGO;AACP,yBAAiC;AACjC,mBAAgE;AAgBzD,SAAS,+BAA+B,UAAwD;AACrG,QAAM,gBAA0B,CAAC;AAEjC,aAAW,WAAW,OAAO,OAAO,QAAQ,GAAG;AAC7C,QAAI,CAAC,QAAQ,OAAQ;AACrB,eAAW,UAAU,QAAQ,QAAQ;AACnC,UAAI,CAAC,OAAO,GAAI;AAChB,iBAAW,MAAM,OAAO,IAAI;AAC1B,YAAI,GAAG,UAAU,GAAG,MAAM,GAAG,GAAG,SAAS,GAAG;AAC1C,wBAAc,KAAK,GAAG,EAAE;AAAA,QAC1B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,cAAc,KAAK,EAAE,OAA+B,CAAC,QAAQ,MAAM,cAAc;AACtF,WAAO,IAAI,IAAI,YAAY;AAC3B,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACP;AAUO,SAAS,eAAe,GAA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