1
1
import { ObjectUtils } from "@batch-flask/utils" ;
2
2
import { List } from "immutable" ;
3
3
import { ImageInformation } from "./image-information" ;
4
- import { ImageReference } from "./image-reference" ;
5
4
6
5
const dataScienceVms = {
7
6
"linux-data-science-vm" : {
@@ -16,6 +15,9 @@ const dataScienceVms = {
16
15
"dsvm-windows" : {
17
16
osType : "windows" ,
18
17
} ,
18
+ "dsvm-win-2019" : {
19
+ osType : "windows" ,
20
+ } ,
19
21
} ;
20
22
21
23
const renderingPublisher = "batch" ;
@@ -28,6 +30,7 @@ const dockerContainer = {
28
30
"2019-datacenter-with-containers-smalldisk" ,
29
31
"2019-datacenter-core-with-containers" ,
30
32
"2019-datacenter-core-with-containers-smalldisk" ,
33
+ "datacenter-core-1903-with-containers-smalldisk" ,
31
34
] ,
32
35
"windowsserversemiannual" : [ "datacenter-core-1809-with-containers-smalldisk" ] ,
33
36
"centos-container-rdma" : true ,
@@ -66,51 +69,7 @@ export class PoolOsSkus {
66
69
// unverified images, or add some visual indicator to those which are unverified.
67
70
let targetOffers : StringMap < Offer > | null = null ;
68
71
images . forEach ( ( image : ImageInformation ) => {
69
- let imageReference = image . imageReference ;
70
- // Do some manual cleanup here as some images made breaking name changes
71
- // (causes UI to not collate same offer)
72
- if ( imageReference . offer . includes ( "dsvm-win" ) ) {
73
- imageReference = new ImageReference ( {
74
- publisher : imageReference . publisher ,
75
- sku : imageReference . sku ,
76
- offer : "dsvm-windows" ,
77
- version : imageReference . version ,
78
- virtualMachineImageId : imageReference . virtualMachineImageId ,
79
- } ) ;
80
- } else if ( imageReference . publisher === "microsoft-dsvm" && ( imageReference . offer . includes ( "ubuntu" ) ) ) {
81
- imageReference = new ImageReference ( {
82
- publisher : imageReference . publisher ,
83
- sku : imageReference . sku ,
84
- offer : "linux-data-science-vm-ubuntu" ,
85
- version : imageReference . version ,
86
- virtualMachineImageId : imageReference . virtualMachineImageId ,
87
- } ) ;
88
- } else if ( imageReference . offer === "windowsserversemiannual" ) {
89
- imageReference = new ImageReference ( {
90
- publisher : imageReference . publisher ,
91
- sku : imageReference . sku ,
92
- offer : "windowsserver" ,
93
- version : imageReference . version ,
94
- virtualMachineImageId : imageReference . virtualMachineImageId ,
95
- } ) ;
96
- } else if ( imageReference . offer === "debian-10" ) {
97
- imageReference = new ImageReference ( {
98
- publisher : imageReference . publisher ,
99
- sku : imageReference . sku ,
100
- offer : "debian" ,
101
- version : imageReference . version ,
102
- virtualMachineImageId : imageReference . virtualMachineImageId ,
103
- } ) ;
104
- }
105
- if ( imageReference . sku === "linuxdsvmubuntu" && image . nodeAgentSKUId . includes ( "16.04" ) ) {
106
- imageReference = new ImageReference ( {
107
- publisher : imageReference . publisher ,
108
- sku : "16.04" ,
109
- offer : imageReference . offer ,
110
- version : imageReference . version ,
111
- virtualMachineImageId : imageReference . virtualMachineImageId ,
112
- } ) ;
113
- }
72
+ const imageReference = image . imageReference ;
114
73
targetOffers = offers ;
115
74
if ( dockerContainer [ imageReference . offer ]
116
75
&& ( dockerContainer [ imageReference . offer ] === true
@@ -134,9 +93,10 @@ export class PoolOsSkus {
134
93
135
94
this . allOffers = ObjectUtils . values ( offers ) ;
136
95
this . renderingOffers = this . allOffers . filter ( x => x . publisher === renderingPublisher ) ;
137
- this . vmOffers = this . allOffers . filter ( x => ! ( x . name in dataScienceVms ) && x . publisher !== renderingPublisher ) ;
138
- this . dataScienceOffers = this . allOffers
139
- . filter ( x => ( x . name in dataScienceVms ) && x . publisher !== renderingPublisher ) ;
96
+ this . dataScienceOffers = this . allOffers . filter ( x =>
97
+ ( ( x . name in dataScienceVms ) || x . publisher === "microsoft-dsvm" ) && ! ( this . renderingOffers . includes ( x ) ) ) ;
98
+ this . vmOffers = this . allOffers . filter ( x =>
99
+ ! ( this . renderingOffers . includes ( x ) || this . dataScienceOffers . includes ( x ) ) ) ;
140
100
this . dockerOffers = ObjectUtils . values ( dockerOffers ) ;
141
101
}
142
102
}
0 commit comments