@@ -55,6 +55,32 @@ type RunningJobResources = {
5555} ;
5656
5757export const genericContainerTypes : ContainerOrWorkerType [ ] = [
58+ {
59+ id : 53 ,
60+ name : 'MICRO' ,
61+ jobType : 53 ,
62+ notes : 'No GPU' ,
63+ notesColor : 'red' ,
64+ monthlyBudgetPerWorker : 3 ,
65+ pricePerEpoch : 100_000n ,
66+ minimalBalancing : 2 ,
67+ cores : 0.25 ,
68+ ram : 0.5 ,
69+ storage : 2 ,
70+ } ,
71+ {
72+ id : 54 ,
73+ name : 'LITE' ,
74+ jobType : 54 ,
75+ notes : 'No GPU' ,
76+ notesColor : 'red' ,
77+ monthlyBudgetPerWorker : 5 ,
78+ pricePerEpoch : 166_666n ,
79+ minimalBalancing : 2 ,
80+ cores : 0.5 ,
81+ ram : 1 ,
82+ storage : 4 ,
83+ } ,
5884 {
5985 id : 1 ,
6086 name : 'ENTRY' ,
@@ -332,54 +358,49 @@ export const gpuMappings: {
332358export const getRunningJobResources = ( jobType : bigint ) : RunningJobResources | undefined => {
333359 const jobTypeN = Number ( jobType ) ;
334360
335- if ( jobTypeN <= 9 ) {
336- // Generic
337- const genericContainerType = genericContainerTypes . find ( ( type ) => type . jobType === jobTypeN ) ;
361+ const genericContainerType = genericContainerTypes . find ( ( type ) => type . jobType === jobTypeN ) ;
338362
339- if ( genericContainerType ) {
340- return {
341- containerOrWorkerType : genericContainerType ,
342- jobType : JobType . Generic ,
343- } ;
344- }
345- } else if ( jobTypeN >= 16 && jobTypeN <= 20 ) {
346- // Native
347- const nativeWorkerType = nativeWorkerTypes . find ( ( type ) => type . jobType === jobTypeN ) ;
363+ if ( genericContainerType ) {
364+ return {
365+ containerOrWorkerType : genericContainerType ,
366+ jobType : JobType . Generic ,
367+ } ;
368+ }
348369
349- if ( nativeWorkerType ) {
350- return {
351- containerOrWorkerType : nativeWorkerType ,
352- jobType : JobType . Native ,
353- } ;
354- }
355- } else if ( jobTypeN >= 50 && jobTypeN <= 52 ) {
356- // Service
357- const serviceContainerType = serviceContainerTypes . find ( ( type ) => type . jobType === jobTypeN ) ;
370+ const nativeWorkerType = nativeWorkerTypes . find ( ( type ) => type . jobType === jobTypeN ) ;
358371
359- if ( serviceContainerType ) {
360- return {
361- containerOrWorkerType : serviceContainerType ,
362- jobType : JobType . Service ,
363- } ;
364- }
365- } else {
366- const gpuMapping = gpuMappings [ jobTypeN ] ;
372+ if ( nativeWorkerType ) {
373+ return {
374+ containerOrWorkerType : nativeWorkerType ,
375+ jobType : JobType . Native ,
376+ } ;
377+ }
367378
368- if ( gpuMapping ) {
369- const gpuType = gpuTypes . find ( ( type ) => type . id === gpuMapping . gpuTypeId ) ;
379+ const serviceContainerType = serviceContainerTypes . find ( ( type ) => type . jobType === jobTypeN ) ;
370380
371- const containerOrWorkerType =
372- gpuMapping . jobType === JobType . Generic
373- ? genericContainerTypes . find ( ( type ) => type . id === gpuMapping . containerOrWorkerTypeId )
374- : nativeWorkerTypes . find ( ( type ) => type . id === gpuMapping . containerOrWorkerTypeId ) ;
381+ if ( serviceContainerType ) {
382+ return {
383+ containerOrWorkerType : serviceContainerType ,
384+ jobType : JobType . Service ,
385+ } ;
386+ }
387+
388+ const gpuMapping = gpuMappings [ jobTypeN ] ;
389+
390+ if ( gpuMapping ) {
391+ const gpuType = gpuTypes . find ( ( type ) => type . id === gpuMapping . gpuTypeId ) ;
375392
376- if ( gpuType && containerOrWorkerType ) {
377- return {
378- containerOrWorkerType,
379- gpuType,
380- jobType : gpuMapping . jobType ,
381- } ;
382- }
393+ const containerOrWorkerType =
394+ gpuMapping . jobType === JobType . Generic
395+ ? genericContainerTypes . find ( ( type ) => type . id === gpuMapping . containerOrWorkerTypeId )
396+ : nativeWorkerTypes . find ( ( type ) => type . id === gpuMapping . containerOrWorkerTypeId ) ;
397+
398+ if ( gpuType && containerOrWorkerType ) {
399+ return {
400+ containerOrWorkerType,
401+ gpuType,
402+ jobType : gpuMapping . jobType ,
403+ } ;
383404 }
384405 }
385406} ;
0 commit comments