-
Notifications
You must be signed in to change notification settings - Fork 21
Move JsonConfigurationJob to Jobs.Common / Migrate ArchivePackages to JsonConfig #515
Conversation
|
||
Source = CloudStorageAccount.Parse( | ||
JobConfigurationManager.GetArgument(jobArgsDictionary, JobArgumentNames.Source)); | ||
Configuration = _serviceProvider.GetRequiredService<InitializationConfiguration>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All command-line options for legacy jobs will be moved to a custom InitializationConfiguration
, from json config.
public string Version { get; set; } | ||
public string Hash { get; set; } | ||
public DateTime? LastEdited { get; set; } | ||
public DateTime? Published { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup - just moving classes into separate source files.
@@ -75,16 +82,14 @@ | |||
<PackageReference Include="Newtonsoft.Json"> | |||
<Version>9.0.1</Version> | |||
</PackageReference> | |||
<PackageReference Include="NuGet.Services.Sql"> | |||
<Version>2.27.0</Version> | |||
</PackageReference> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need direct dependency from Jobs.Common
now.
@@ -7,7 +7,7 @@ cd bin | |||
|
|||
title #{Jobs.archivepackages.Title} | |||
|
|||
start /w archivepackages.exe -VaultName "#{Deployment.Azure.KeyVault.VaultName}" -ClientId "#{Deployment.Azure.KeyVault.ClientId}" -CertificateThumbprint "#{Deployment.Azure.KeyVault.CertificateThumbprint}" -PackageDatabase "#{Jobs.archivepackages.PackageDatabase}" -Source "#{Jobs.archivepackages.Source}" -PrimaryDestination "#{Jobs.archivepackages.PrimaryDestination}" -SecondaryDestination "#{Jobs.archivepackages.SecondaryDestination}" -Sleep "#{Jobs.archivepackages.Sleep}" -InstrumentationKey "#{Jobs.archivepackages.ApplicationInsightsInstrumentationKey}" | |||
start /w archivepackages.exe -Configuration "#{Jobs.archivepackages.Configuration}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add "-Configuration" octopus config now, and remove old config after RI and prod deployments are complete.
|
||
namespace NuGet.Jobs.Validation | ||
namespace NuGet.Jobs | ||
{ | ||
public abstract class JsonConfigurationJob : JobBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old JsonConfigurationJob
is now split into Jobs.Common > JsonConfigurationJob
and Validation.Common.Job > ValidationJobBase
, based on needs of legacy / validation jobs.
"KeyVault_ValidateCertificate": true, | ||
"KeyVault_StoreName": "My", | ||
"KeyVault_StoreLocation": "LocalMachine" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job config could eventually move to NuGetDeployment
, as we do with Orchestrator. For now, I don't want to modify build / deployment infrastructure.
d41763d
to
10561f4
Compare
3eb249c
to
d40a88f
Compare
@@ -7,7 +7,7 @@ cd bin | |||
|
|||
title #{Jobs.archivepackages.Title} | |||
|
|||
start /w archivepackages.exe -VaultName "#{Deployment.Azure.KeyVault.VaultName}" -ClientId "#{Deployment.Azure.KeyVault.ClientId}" -CertificateThumbprint "#{Deployment.Azure.KeyVault.CertificateThumbprint}" -PackageDatabase "#{Jobs.archivepackages.PackageDatabase}" -Source "#{Jobs.archivepackages.Source}" -PrimaryDestination "#{Jobs.archivepackages.PrimaryDestination}" -SecondaryDestination "#{Jobs.archivepackages.SecondaryDestination}" -Sleep "#{Jobs.archivepackages.Sleep}" -InstrumentationKey "#{Jobs.archivepackages.ApplicationInsightsInstrumentationKey}" | |||
start /w archivepackages.exe -Configuration "#{Jobs.archivepackages.Configuration}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, so instrumentation key now comes through JSON configuration? I think some of the validation jobs need this fix right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted to keep -Sleep
and -InstrumentationKey
in Octopus... wasn't plumbed through to the JobRunner
. Can investigate more once I move onto job deployments.
It does look like the Revalidate
job has an "AppInsights" section, which could probably be extracted into Jobs.Common
and reused.
}, | ||
|
||
"GalleryDb": { | ||
"ConnectionString": "Data Source=tcp:#{Jobs.validation.GalleryDatabaseAddress};Initial Catalog=nuget-dev-0-v2gallery;Integrated Security=False;User ID=$$Dev-GalleryDBReadOnly-UserName$$;Password=$$Dev-GalleryDBReadOnly-Password$$;Connect Timeout=30;Encrypt=True" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix GalleryDatabaseAddress
prefix
base.ConfigureDefaultJobServices(services, configurationRoot); | ||
|
||
//services.AddSingleton(new TelemetryClient()); | ||
//services.AddTransient<ITelemetryClient, TelemetryClientWrapper>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove and keep in JsonConfigurationJob
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c63684d
to
1583750
Compare
Part of https://github.com/NuGet/Engineering/issues/1560. Depends on #505
Includes the following:
JsonConfigurationJob
intoNuGet.Jobs.Common
, for use by legacy jobsJsonConfigurationJob
registers databases whenGalleryDbConfiguration
orValidationDbConfiguration
is foundArchivePackages.Job
to descend fromJsonConfigurationJob
Testing should include the following jobs: