-
Notifications
You must be signed in to change notification settings - Fork 1
Added support for creating a marketplace image in Alibaba #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Russell Seymour <[email protected]>
attributes/alibaba.rb
Outdated
| 'support_email' => '[email protected]', | ||
| 'sales_email' => '[email protected]', | ||
| 'reporting_cron_enabled' => false, | ||
| 'doc_url' => 'https://docs.chef.io/aws_marketplace.html', |
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.
Should we create an Alibaba site for this?
|
How is the licence done here? Is it pulled in from the cookbook? Does it default to the 30 day Automate license? |
Added URLs to download products to attributes. A new packer file is created so that the Omnibus marketplace recipe reads it in to get the URLs for download Signed-off-by: Russell Seymour <[email protected]>
|
@jjasghar Not sure about that at the moment. I think it will default to the 30 day license. Still trying to work out how all of this hangs together. |
|
Added new |
Signed-off-by: Russell Seymour <[email protected]>
| packman: | ||
| version: 1.0.4 | ||
| checksums: | ||
| "1.0.4": 646da085cbcb8c666474d500a44d933df533cf4f1ff286193d67b51372c3c59e |
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.
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.
Agreed - did not want to assume upgrading the default version whilst I was getting the initial Alibaba work going
| @@ -0,0 +1,56 @@ | |||
| # frozen_string_literal: true | |||
| cred_dir = ::File.expand_path(::File.join('~', '.alibaba')) | |||
| credential_file = ::File.join(cred_dir, 'credentials') | |||
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.
I think we should probably move the alibaba credentials into the same data_bag that has the Azure, GCP, and AWS creds.
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.
I have used the same format as the data bag so it should just be a case of copying and paste from what I have. I do not know where the data bag for those is to update.
To get this working I used a local version of the data bag that kitchen could read.
attributes/alibaba.rb
Outdated
| default['marketplace_image']['alibaba']['public']['automate']['enabled'] = false | ||
|
|
||
| default['marketplace_image']['alibaba']['product_urls'] = { | ||
| 'marketplace' => 'http://chef-software.oss-cn-beijing.aliyuncs.com/chef-marketplace_0.2.5%2B20170911103840.git.2.1c6a67f-1_amd64.deb', |
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.
I suspect that there's a firewall preventing the instance from accessing our package mirrors? Do we want to require the full URL or just the version of packages? What's the process of uploading a new package version to the Alibaba mirror? That should at least be documented.
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.
It is not a preventing of getting to mirrors, it is throttling. It is so slow to download that most of the time things time out.
At the moment we need the full URL to the package that needs to be downloaded. It was the simplest way I could think to get it working.
Currently it is a case of logging into the Alibaba cloud with the account in LastPass and manually uploading. There are command line tools that allow you to this but I have not investigated thoe yet.
attributes/alibaba.rb
Outdated
| 'role' => 'automate', | ||
| 'platform' => 'alibaba', | ||
| 'user' => 'ubuntu', | ||
| 'support_email' => '[email protected]', |
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.
definitely don't want to use the aws alias for alibaba.
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.
Agreed - my mistake I missed this.
Have changed it to [email protected] (although it will need creating on our side).
attributes/alibaba.rb
Outdated
| 'support_email' => '[email protected]', | ||
| 'sales_email' => '[email protected]', | ||
| 'reporting_cron_enabled' => false, | ||
| 'doc_url' => 'https://docs.chef.io/aws_marketplace.html', |
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 should probably make this specific to alibaba as well.
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.
Have changed this to an Alibaba specific address - again it needs creating.
| 'sales_email' => '[email protected]', | ||
| 'reporting_cron_enabled' => false, | ||
| 'doc_url' => 'https://docs.chef.io/aws_marketplace.html', | ||
| 'disable_outbound_traffic' => false, |
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 probably want to set this to true. Right now there are several tools that expect to be able to hit outside mirrors. Since it appears that isn't the case we'll want to set this to 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.
As mentioned its not that we cannot get to external mirrors, they are just very slow.
When using the Alibaba mirrored Ubuntu repos everything is OK, packages install as expected. This is the default in the images.
attributes/alibaba.rb
Outdated
| 'reporting_cron_enabled' => false, | ||
| 'doc_url' => 'https://docs.chef.io/aws_marketplace.html', | ||
| 'disable_outbound_traffic' => false, | ||
| 'license_type' => 'flexible', |
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.
This should be fixed since we're not doing metered billing.
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.
Modified in latest changes
Signed-off-by: Russell Seymour <[email protected]>
Signed-off-by: Russell Seymour <[email protected]>
Signed-off-by: Russell Seymour <[email protected]>
Signed-off-by: Russell Seymour <[email protected]>
Changed URL for the marketplace image Signed-off-by: Russell Seymour <[email protected]>
* [CLOUD-262] packer > 0.10.1 uses its own `azure-arm` builder, obsoleting use of the `packer-azure` plugin. This requires new azure builder attributes in the `publishing_credentials.json` file. * packer >= 1.0.1 supports alicloud, enabling #43. Signed-off-by: Yvonne Lam <[email protected]>
…n Alibaba Added script to perform a dist-upgrade on Ubuntu 14.04 Signed-off-by: Russell Seymour <[email protected]>
Changes to the cookbook to allow Marketplace images to be created on the Alibaba platform.
As mentioned in chef-partners/omnibus-marketplace#93 packages need to b uploaded to the OSS service so that they can be downloaded without the danger of time out. A number of changes were required to the cookbook to support this and the Alibaba cloud. This will mean that when new version of Omnibus Marketplace, Automate and Chef Server are created they will need to be uploaded to OSS before a package can be created.
The kitchen file for Alibaba states that Packer version 1.0.4 is used. This version has the Alibaba provider contained within it. It is also now one binary instead of lots of little files.
A new attribute file for Alibaba (
alibaba.rb) has been created that holds the necessary configuration. It was in this file that I tried to pass the URL for the software packages that are held in OSS, but it would not pass them through to thechef-marketplacecookbook as attributes.There is also an attribute set here that states the URL for the Omnibus Marketplace debian file. There is a companion template
install_marketplace_oss.sh.erb, but although I tried to pass in the URL as a variable in_publish.rbusing thepacker_provisionerresource it would not render properly hence why it is hardcode at the moment. (I really do not now why this was the case and I will try it again).The necessary builders and products have been set for Alibaba, but in the case of the products only Automate has been configured.
The credentials for Alibaba can only be set as environment variables so this has been set in the
_packer.rbfile if a credential for Alibaba exists in the databag.The format for the databag item for Alibaba is:
{ "id": "publishing_credentials", "alibaba": { "access_key": "abcdefghijklm", "secret_key": "abcdefghijklm" } }I have created an image in Alibaba that has been created with this and the omnibus package.