-
Notifications
You must be signed in to change notification settings - Fork 643
Hosting nuget.org's v3 services
Loïc Sharma edited this page Jul 12, 2018
·
5 revisions
To setup nuget.org's v3 services you will need to:
- Setup an Azure Blob Storage account with the following containers:
- "index" - Hosts the service index
- "packages" - The Gallery's copy of NuGet packages, used by v3's ingestion pipeline
- "catalog" - This hosts the catalog resource
- "registration" - This hosts the metadata resource
- "flat-container" - This hosts the package content resource
- "auditing" - This stores package deletions from Gallery, used to populate the catalog
- Run the Gallery
- Build NuGet.Services.Metadata
- Deploy the built
ng.exe
and all of its DLLs to your machine - Run the
feed2catalog
job to populate the catalog resource:
Ng.exe feed2catalog ^
-gallery https://yourgalleryurl.com/api/v2 ^
-storageBaseAddress <https://azure.bob.storage.url.com>/catalog ^
-storageType azure ^
-storageAccountName <Blob Storage account name here> ^
-storageKeyValue <Azure Blob Storage account key here> ^
-storageContainer catalog ^
-storageTypeAuditing azure ^
-storageAccountNameAuditing <Blob Storage account name here> ^
-storageKeyValueAuditing <Azure Blob Storage account key here> ^
-storageContainerAuditing auditing ^
-storagePathAuditing package
-verbose true ^
-interval 30
- Run the
catalog2registration
job to populate the metadata resource
Ng.exe catalog2registration ^
-source <https://azure.bob.storage.url.com>/catalog/index.json ^
-contentBaseAddress <https://azure.blob.storage.url.com>/flat-container/ ^
-storageBaseAddress <https://azure.blob.storage.url.com>/registration/ ^
-storageType azure ^
-storageAccountName <Azure Blob Storage account name here> ^
-storageKeyValue <Azure Blob Storage account key here> ^
-storageContainer registration ^
-useCompressedStorage false ^
-verbose true ^
-interval 30
- Run the
catalog2dnx
job to populate the package content resource
Ng.exe catalog2dnx ^
-source <https://azure.blob.storage.url.com>/catalog/index.json ^
-contentBaseAddress <https://azure.blob.storage.url.com>/packages ^
-storageBaseAddress <https://azure.blob.storage.url.com>/flat-container ^
-storageType azure ^
-storageAccountName <Azure Blob Storage account name here> ^
-storageKeyValue <Azure Blob Storage account key here> ^
-storageContainer flat-container ^
-verbose true ^
-interval 30 ^
-httpClientTimeoutInSeconds 900
- Upload a file
index.json
to the "index" container containing the following JSON:
{
"version": "3.0.0",
"resources": [
{
"@id": "<https://azure.blob.storage.url.com>/registration",
"@type": "RegistrationsBaseUrl",
"comment": "Base URL of Azure storage where NuGet package registration info is stored"
},
{
"@id": "<https://azure.blob.storage.url.com>/flat-container/",
"@type": "PackageBaseAddress/3.0.0",
"comment": "Base URL of where NuGet packages are stored"
},
{
"@id": "https://yourgalleryurl.com/api/v2",
"@type": "LegacyGallery"
},
{
"@id": "https://yourgalleryurl.com/api/v2/package",
"@type": "PackagePublish/2.0.0"
},
{
"@id": "https://yourgalleryurl.com/packages/{id}/{version}/ReportAbuse",
"@type": "ReportAbuseUriTemplate/3.0.0-rc",
"comment": "URI template used by NuGet Client to construct Report Abuse URL for packages used by RC clients"
},
{
"@id": "<https://azure.blob.storage.url.com>/registration/{id-lower}/index.json",
"@type": "PackageDisplayMetadataUriTemplate/3.0.0-rc",
"comment": "URI template used by NuGet Client to construct display metadata for Packages using ID"
},
{
"@id": "<https://azure.blob.storage.url.com>/registration/{id-lower}/{version-lower}.json",
"@type": "PackageVersionDisplayMetadataUriTemplate/3.0.0-rc",
"comment": "URI template used by NuGet Client to construct display metadata for Packages using ID, Version"
},
{
"@id": "<https://azure.blob.storage.url.com>/catalog/index.json",
"@type": "Catalog/3.0.0",
"comment": "Index of the NuGet package catalog."
}
],
"@context": {
"@vocab": "http://schema.nuget.org/services#",
"comment": "http://www.w3.org/2000/01/rdf-schema#comment"
}
}
- Use the source
<https://azure.blob.storage.url.com/index/index.json
to restore packages. Done!