Berkshelf-api和Chef Supermarket与传统工件仓库有什么不同? [英] What do Berkshelf-api and Chef Supermarket do differently than traditional artifact repositories?

查看:72
本文介绍了Berkshelf-api和Chef Supermarket与传统工件仓库有什么不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我熟悉Artifactory,Maven&关系.

I am familiar with artifact repositories such as Artifactory, Maven & Nexus.

Berkshelf-API/Chef超市与上述工件存储库有何不同?

What do Berkshelf-API / Chef Supermarket do differently than the above Artifact Repositories?

乍看之下,它们似乎是在已经存在的工件存储库中复制功能(不变性,可传递依赖项解析等).

On first glance it appears they are duplicating features in already existing artifact repositories (immutability, transitive dependency resolution, etc).

说明:这不是一个基于观点的问题,我正在寻求技术原因,为什么将Berkshelf-API/Chef超市用于Chef Cookbook,而不是其他典型的工件存储库.

Clarification: This is not an opinion-based question, I am seeking the technical reasons why Berkshelf-API / Chef Supermarket are used for Chef Cookbooks instead of other typical artifact repositories.

推荐答案

tl; dr-Berkshelf-API&厨师超市是Berkshelf用于下载食谱依赖项的工具.他们为Berkshelf提供了一种特殊格式的.JSON文档,用于确定食谱的依赖性.我没有发现为什么无法修改其他工件存储库以返回类似格式的.JSON文档的原因,但是据我所知,目前没有人这样做.

Berkshelf-API :该服务器对来自各种来源的食谱进行索引并将其托管在REST API"

Berkshelf-API: "A server which indexes cookbooks from various sources and hosts it over a REST API"

实际上,厨师超市使用Berkshelf-API.

In fact, Berkshelf-API is used by Chef Supermarket.

您可以通过在网址后附加"/universe"( https://supermarket.getchef.com/universe ).

You can manually pull the list of cookbooks from the Supermarket by appending "/universe" to the url (https://supermarket.getchef.com/universe).

使用Berkshelf解决依赖关系(使用"berks安装"或"berks更新")时,它将查找源条目(通常为'source" https://supermarket.getchef.com 在食谱的Berksfile顶部).

When Berkshelf is used to resolve dependencies (using 'berks install' or 'berks update'), it looks for the source entry (typically 'source "https://supermarket.getchef.com"' at the top of the cookbook's Berksfile).

Berksfile在源条目下也有元数据".这将加载cookbooks metadata.rb文件中列出的Cookbook依赖项.这些可以被Berksfile中元数据"条目下方列出的食谱依赖项覆盖.

The Berksfile also has 'metadata' below the source entry. This loads the cookbook dependencies listed in the cookbooks metadata.rb file. These can be overridden by cookbook dependencies listed below the 'metadata' entry in the Berksfile.

Berkshelf然后开始从源条目(在本例中为Supermarket)下载食谱依赖项.

Berkshelf then starts downloading cookbook dependencies from the source entry (in this case Supermarket).

但是,Berkshelf不会递归加载依赖项的metadata.rb或Berkshelf文件.

ex:如果Foo依赖于Bar,而Bar依赖于Baz

ex: if Foo depends on Bar which depends on Baz

Foo => Bar => Baz

Foo => Bar => Baz

Foo将在metadata.rb或Berksfile中指示Bar依赖项.

Foo will indicate the Bar dependency in either metadata.rb or Berksfile.

Bar将在metadata.rb或Berksfile中指示Baz依赖项.

Bar will indicate the Baz dependency in either metadata.rb or Berksfile.

但是,Berkshelf不会通过读取Bar的metadata.rb或Berksfile来确定Bar(在本例中为Baz)的依赖关系.取而代之的是,它使用Berkshelf-API的版本管理菜谱的缓存列表来确定Bar的依赖关系,该列表是从对源条目的调用中返回的.

However Berkshelf will not determine the dependencies for Bar (in this case Baz) by reading Bar's metadata.rb or Berksfile. It instead determines Bar's dependencies by using a cached list of versioned cookbooks from Berkshelf-API that is returned from the call to the source entry.

可以使用指向不同食谱存储库的多个端点(另一个Berkshelf-API服务器或Chef服务器)来设置私有Berkshelf-API服务器.

A private Berkshelf-API server can be set up with multiple endpoints pointing to different cookbook repositories (either another Berkshelf-API server or a Chef Server).

因此,常见用法是私有Berkshelf-API服务器同时指向私有Chef服务器(存储非公共食谱)和Chef Supermarket服务器(存储公共食谱).

So a common usage is a Private Berkshelf-API server pointing to both a Private Chef Server (storing non-public cookbooks) and the Chef Supermarket server (storing public cookbooks).

这篇关于Berkshelf-api和Chef Supermarket与传统工件仓库有什么不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆