@@ -102,6 +102,28 @@ var (
102
102
goIntegTestTimeout = 2 * time .Hour
103
103
// goProvisionAndTestTimeout is the timeout used for both provisioning and running tests.
104
104
goProvisionAndTestTimeout = goIntegTestTimeout + 30 * time .Minute
105
+
106
+ // Map of binaries to download to their project name in the unified-release manager.
107
+ // The project names are used to generate the URLs when downloading binaries. For example:
108
+ //
109
+ // https://artifacts-snapshot.elastic.co/beats/latest/8.11.0-SNAPSHOT.json
110
+ // https://artifacts-snapshot.elastic.co/cloudbeat/latest/8.11.0-SNAPSHOT.json
111
+ // https://artifacts-snapshot.elastic.co/cloud-defend/latest/8.11.0-SNAPSHOT.json
112
+ // https://artifacts-snapshot.elastic.co/apm-server/latest/8.11.0-SNAPSHOT.json
113
+ // https://artifacts-snapshot.elastic.co/endpoint-dev/latest/8.11.0-SNAPSHOT.json
114
+ // https://artifacts-snapshot.elastic.co/fleet-server/latest/8.11.0-SNAPSHOT.json
115
+ // https://artifacts-snapshot.elastic.co/prodfiler/latest/8.11.0-SNAPSHOT.json
116
+ externalBinaries = map [string ]string {
117
+ "agentbeat" : "beats" ,
118
+ "cloudbeat" : "cloudbeat" , // only supporting linux/amd64 or linux/arm64
119
+ "cloud-defend" : "cloud-defend" ,
120
+ "apm-server" : "apm-server" , // not supported on darwin/aarch64
121
+ "endpoint-security" : "endpoint-dev" ,
122
+ "fleet-server" : "fleet-server" ,
123
+ "pf-elastic-collector" : "prodfiler" ,
124
+ "pf-elastic-symbolizer" : "prodfiler" ,
125
+ "pf-host-agent" : "prodfiler" ,
126
+ }
105
127
)
106
128
107
129
func init () {
@@ -1078,27 +1100,6 @@ func collectPackageDependencies(platforms []string, packageVersion string, requi
1078
1100
os .Setenv (agentDropPath , dropPath )
1079
1101
1080
1102
if devtools .ExternalBuild == true {
1081
- // Map of binaries to download to their project name in the unified-release manager.
1082
- // The project names are used to generate the URLs when downloading binaries. For example:
1083
- //
1084
- // https://artifacts-snapshot.elastic.co/beats/latest/8.11.0-SNAPSHOT.json
1085
- // https://artifacts-snapshot.elastic.co/cloudbeat/latest/8.11.0-SNAPSHOT.json
1086
- // https://artifacts-snapshot.elastic.co/cloud-defend/latest/8.11.0-SNAPSHOT.json
1087
- // https://artifacts-snapshot.elastic.co/apm-server/latest/8.11.0-SNAPSHOT.json
1088
- // https://artifacts-snapshot.elastic.co/endpoint-dev/latest/8.11.0-SNAPSHOT.json
1089
- // https://artifacts-snapshot.elastic.co/fleet-server/latest/8.11.0-SNAPSHOT.json
1090
- // https://artifacts-snapshot.elastic.co/prodfiler/latest/8.11.0-SNAPSHOT.json
1091
- externalBinaries := map [string ]string {
1092
- "agentbeat" : "beats" ,
1093
- "cloudbeat" : "cloudbeat" , // only supporting linux/amd64 or linux/arm64
1094
- "cloud-defend" : "cloud-defend" ,
1095
- "apm-server" : "apm-server" , // not supported on darwin/aarch64
1096
- "endpoint-security" : "endpoint-dev" ,
1097
- "fleet-server" : "fleet-server" ,
1098
- "pf-elastic-collector" : "prodfiler" ,
1099
- "pf-elastic-symbolizer" : "prodfiler" ,
1100
- "pf-host-agent" : "prodfiler" ,
1101
- }
1102
1103
1103
1104
// Only log fatal logs for logs produced using logrus. This is the global logger
1104
1105
// used by github.com/elastic/e2e-testing/pkg/downloads which can only be configured globally like this or via
@@ -1196,23 +1197,8 @@ func collectPackageDependencies(platforms []string, packageVersion string, requi
1196
1197
return archivePath , dropPath
1197
1198
}
1198
1199
1199
- func getIndAgentGlobExpr (versionedFlatPath string , packageVersion string ) string {
1200
- parsedPackageVersion , err := version .ParseVersion (packageVersion )
1201
- if err != nil {
1202
- panic (err )
1203
- }
1204
-
1205
- bumpedPatchNumber := parsedPackageVersion .Patch () + 1
1206
-
1207
- globExpr := filepath .Join (versionedFlatPath , fmt .Sprintf ("*%d.%d.[%d|%d]*" , parsedPackageVersion .Major (), parsedPackageVersion .Minor (), parsedPackageVersion .Patch (), bumpedPatchNumber ))
1208
-
1209
- return globExpr
1210
- }
1211
-
1212
1200
func fileHelperNoManifest (versionedFlatPath string , versionedDropPath string , packageVersion string ) map [string ]string {
1213
- log .Printf (">>>>>>>>>> XXX versionedFlatPath: [%s]" , versionedFlatPath )
1214
1201
globExpr := filepath .Join (versionedFlatPath , fmt .Sprintf ("*%s*" , packageVersion ))
1215
- //globExpr := getIndAgentGlobExpr(versionedFlatPath, packageVersion)
1216
1202
if mg .Verbose () {
1217
1203
log .Printf ("Finding files to copy with %s" , globExpr )
1218
1204
}
@@ -1221,8 +1207,8 @@ func fileHelperNoManifest(versionedFlatPath string, versionedDropPath string, pa
1221
1207
panic (err )
1222
1208
}
1223
1209
if mg .Verbose () {
1224
- log .Printf (" XXX Validating checksums for %+v" , files )
1225
- log .Printf ("--- XXX Copying into %s: %v" , versionedDropPath , files )
1210
+ log .Printf (" Validating checksums for %+v" , files )
1211
+ log .Printf ("--- Copying into %s: %v" , versionedDropPath , files )
1226
1212
}
1227
1213
1228
1214
checksums := make (map [string ]string )
@@ -1234,17 +1220,7 @@ func fileHelperNoManifest(versionedFlatPath string, versionedDropPath string, pa
1234
1220
Sync : true ,
1235
1221
}
1236
1222
if mg .Verbose () {
1237
- log .Printf ("> XXX prepare to copy %s into %s " , f , versionedDropPath )
1238
- }
1239
-
1240
- info , err := os .Stat (f )
1241
- if err != nil {
1242
- panic (err )
1243
- }
1244
- if info .IsDir () {
1245
- log .Printf (">>> XXX DIR!! [%s]" , f )
1246
- } else {
1247
- log .Printf (">>> XXX File! [%s]" , f )
1223
+ log .Printf ("> prepare to copy %s into %s " , f , versionedDropPath )
1248
1224
}
1249
1225
1250
1226
err = copy .Copy (f , versionedDropPath , options )
@@ -1254,13 +1230,13 @@ func fileHelperNoManifest(versionedFlatPath string, versionedDropPath string, pa
1254
1230
1255
1231
// copy spec file for match
1256
1232
specName := filepath .Base (f )
1257
- log .Printf (">>>> XXX specName: [%s]" , specName )
1258
1233
idx := strings .Index (specName , "-" + packageVersion )
1259
1234
if idx != - 1 {
1260
1235
specName = specName [:idx ]
1261
- log .Printf (">>>> XXX specName[:idx] [%s]" , specName )
1262
1236
}
1263
- log .Printf (">>>> XXX specName final: [%s]" , specName )
1237
+ if mg .Verbose () {
1238
+ log .Printf (">>>> Looking to copy spec file: [%s]" , specName )
1239
+ }
1264
1240
1265
1241
checksum , err := copyComponentSpecs (specName , versionedDropPath )
1266
1242
if err != nil {
@@ -1273,7 +1249,11 @@ func fileHelperNoManifest(versionedFlatPath string, versionedDropPath string, pa
1273
1249
return checksums
1274
1250
}
1275
1251
1276
- func getComponentVersion (componentName string , requiredPackage string , componentProject tools.Project , externalBinaries map [string ]string ) string {
1252
+ // This function is used when building with a Manifest. In that manifest, it's possible
1253
+ // for projects in an Independent Agent Release to have different versions since the opted-in
1254
+ // ones will be one patch version higher than the opted-out/previously released projects.
1255
+ // This function tries to find the versions from the package name
1256
+ func getComponentVersion (componentName string , requiredPackage string , componentProject tools.Project ) string {
1277
1257
var componentVersion string
1278
1258
for pkgName , _ := range componentProject .Packages {
1279
1259
log .Printf (">>>>>>>>>>> XXX getComponentVersion Package: %s <<<<" , pkgName )
@@ -1321,23 +1301,9 @@ func fixCloudDefendDirPath(dirPath string, componentVersion string, expectedArch
1321
1301
1322
1302
func fileHelperWithManifest (requiredPackage string , versionedFlatPath string , versionedDropPath string , manifestResponse tools.Build ) map [string ]string {
1323
1303
1324
- // Should move this elsewhere so there's only one location for it
1325
- externalBinaries := map [string ]string {
1326
- "agentbeat" : "beats" ,
1327
- "cloudbeat" : "cloudbeat" , // only supporting linux/amd64 or linux/arm64
1328
- "cloud-defend" : "cloud-defend" ,
1329
- "apm-server" : "apm-server" , // not supported on darwin/aarch64
1330
- "endpoint-security" : "endpoint-dev" ,
1331
- "fleet-server" : "fleet-server" ,
1332
- "pf-elastic-collector" : "prodfiler" ,
1333
- "pf-elastic-symbolizer" : "prodfiler" ,
1334
- "pf-host-agent" : "prodfiler" ,
1335
- }
1336
-
1337
1304
checksums := make (map [string ]string )
1338
1305
1339
1306
projects := manifestResponse .Projects
1340
- log .Printf (">>>>>>>> XXX in filehelperWithManifest" )
1341
1307
1342
1308
for componentName , _ := range projects {
1343
1309
@@ -1351,7 +1317,7 @@ func fileHelperWithManifest(requiredPackage string, versionedFlatPath string, ve
1351
1317
}
1352
1318
log .Printf (">>>>>>> XXX Pkg [%s] matches requiredPackage [%s]" , pkgName , requiredPackage )
1353
1319
1354
- componentVersion := getComponentVersion (componentName , requiredPackage , projects [componentName ], externalBinaries )
1320
+ componentVersion := getComponentVersion (componentName , requiredPackage , projects [componentName ])
1355
1321
log .Printf (">>>>>>> XXX [%s] [%s] version is [%s]" , componentName , requiredPackage , componentVersion )
1356
1322
1357
1323
fullPath := filepath .Join (versionedFlatPath , pkgName )
@@ -1395,10 +1361,6 @@ func fileHelperWithManifest(requiredPackage string, versionedFlatPath string, ve
1395
1361
1396
1362
info , err := os .Stat (dirToCopy )
1397
1363
if err != nil {
1398
- log .Printf (">>>>> SLEEPING" )
1399
- time .Sleep (60 * time .Second )
1400
- log .Printf (">>>>> DONE SLEEPING" )
1401
-
1402
1364
panic (err )
1403
1365
}
1404
1366
if info .IsDir () {
0 commit comments