Skip to content
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

Added support for Alibaba cloud platform #93

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

russellseymour
Copy link

Updated the chef-marketplace cookbook to support the creation of marketplace images on the Alibaba Cloud Platform.

In order to support this the Automate and Chef-Server packages have been uploaded to the Object Storage Server (OSS) which is the Alibaba equivalent to AWS S3. This has been done because pulling packages from the packages.chef.io is so slow that the operation times out.

To get this working I have hardcoded the product_urls into the default attributes file because I could not work out how to pass additional configuration from Packer in the marketplace-image as attributes to this cookbook. Is it because they are nested because the platform comes through ok?

Then to install the packages I have added a remote_file resource to the _upgrade_automate.rb and _update_chef_server.rb that only triggers when the platform is "Alibaba" so that the DEB file is downloaded from OSS. The subsequent chfe-ingredient resource then has the package_source attribute set if the platform is "Alibaba".

A small modification was required to the _config_biscotti.rb file so that it did not try to return a table of instances using the ec2 attribute. Perhaps this should not be the default?

This has been done in conjunction with modifications to the marketplace_image cookbook.

Signed-off-by: Russell Seymour [email protected]

…omate and Chef Server packages

Added new helper to support this.
Updated to handle cloud-init installation properly and configure it for Alibaba machines

Signed-off-by: Russell Seymour <[email protected]>
@russellseymour
Copy link
Author

So that the URLs for the products to be downloaded are available to the omnibus-marketplace the file /tmp/product_download_urls.json (which is created by marketplace-image) is read by the relevant recipes.

Added options to modify the installation of cloud-init on Alibaba images. It needed the options to be passed that keep the old configuration file. Other options have been added that are meant to allow root access and password challenge but this does not appear to be working yet.

Added SSH settings for Aliabab in _security.rb recipe so that the root user can sign in
Removed Biscotti validation for Alibaba

Signed-off-by: Russell Seymour <[email protected]>
@@ -386,6 +391,16 @@ def biscotti_token_hmac
node["chef-marketplace"]["biscotti"]["token"],
node["chef-marketplace"]["biscotti"]["uuid"])
end

def download_url(product)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principal I like this idea assuming we're forced to put the packages in their cloud because of firewall issues. I think that we need to formarlize and unify our approach in this and the image generation.

  1. Both the upgrade and marketplace_image install should use the same mechanism for determining available package versions.
  2. Perhaps we should have a latest version that points to the latest version for each software package.
  3. Docs and/or code to upload packages and modify that config file should be present.

Alternatively, have we considered mirroring the repos in Alibaba?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a speed issue when downloading packages hence the reason for using their storage service.
For example when I did this manually it would take almost all day to download the marketplace image!

I agree with the same method for all scenarios - just trying to get it to work in the first place ;-)

The easiest approach would be to mirror into the Alibaba repos. This would keep everything as is for other cloud platforms - just need to take out the specifics for Alibaba that I have put in.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not mean the main Ubuntu repos, it would be good if we could get a packages repo in China.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schisamo, fyi about downloads from packages.chef.io in China.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yzl There should be no technical restriction on mirroring packages.chef.io data in China, it is not on our embargoed country list:
https://github.com/chef/es-package-router/blob/05f8910a7a77904e02b4ad40e7b493c717c3ce4f/.delivery/build-cookbook/recipes/_fastly.rb#L3-L9

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schisamo @ryancragun @yzl Interesting.

I am not sure what the issue is then, but there is very definite throttling going on when trying to get a package from packages.chef.io. It is so slow that it more often than not times out.

I am hoping to get some contact details for Alibaba as there is another issue I have with the approval of the image which has been rejected. (The error states that we running Windows Update will fix it!!!)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read about this a bit, and the possibilities that come to my mind are:

  1. The package isn't cached at whatever fastly POP is closest to Alibaba so they're actually downloading from the origin in the US,
  2. The package is cached locally, but we need some support from fastly, e.g. https://community.fastly.com/t/fastly-cdn-content-blocked-by-the-great-firewall-of-china/447
  3. The package is cached locally and fastly is set up for our particular use case, and something else is going on.

clout-init is not installed when running on Alibaba
Added logging to the chef-marketplace preconfigure script

Signed-off-by: Russell Seymour <[email protected]>
@russellseymour
Copy link
Author

russellseymour commented Sep 14, 2017

Marketplace image is now working after rolling back the cloud-init changes I had made.
The side effect of this is that we now have to login as ubuntu instead of root which is what people will expect.

I have added some simple logging to the preconfigure script for marketplace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants