Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Enabling SUSE buildpacks on Cloud Controller #314

Merged
merged 14 commits into from
Jan 23, 2020

Conversation

bikramnehra
Copy link
Member

@bikramnehra bikramnehra commented Jan 14, 2020

Description

This PR intends to enable SUSE buildpacks(buildpacks built with SLE stemcell) on the Cloud Controller.

Motivation and Context

This change will make the SUSE buildpacks available to be used in kubecf.

How Has This Been Tested?

Locally on minikube.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code has security implications.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@f0rmiga f0rmiga self-assigned this Jan 16, 2020
@f0rmiga
Copy link
Member

f0rmiga commented Jan 16, 2020

In the current state, it fails to push an app with a SUSE buildpack, even though I'm able to see the buildpacks were installed "successfully".

bash-4.4# cf push -b suse_ruby_buildpack
Pushing from manifest to org demo / space demo as admin...
Using manifest file /12factor/manifest.yml
Deprecation warning: Use of 'buildpack' attribute in manifest is deprecated in favor of 'buildpacks'. Please see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future.

Getting app info...
Creating app with these attributes...
+ name:         12factor
  path:         /12factor
  buildpacks:
+   suse_ruby_buildpack
+ disk quota:   256M
+ memory:       64M
  routes:
+   12factor.kubecf-dev.susecap.net

Creating app 12factor...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
 788.74 KiB / 788.74 KiB [=============================================================================================================================================================================] 100.00% 1s

Waiting for API to complete processing files...

Staging app and tracing logs...
Unexpected Response
Response code: 500
CC code:       0
CC error code: 
Request ID:    85e73e02-b0cd-4ac7-7f92-4a0e77847732::74b9453e-b864-4851-8573-b7fc7b7ca5fe
Description:   {
  "description": "Stager error: Unsupported buildpack type: 'suse_ruby_buildpack'",
  "error_code": "CF-StagerError",
  "code": 170011
}

FAILED

Copy link
Member

@f0rmiga f0rmiga left a comment

Choose a reason for hiding this comment

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

Very nice! When I enable the SUSE buildpacks and SLE15 stack, I'm able to successfully deploy an app. If I disable the SUSE buildpacks, on the other hand, things start to fail. Should the SLE15 stack also be disabled if I disable the SUSE buildpacks? Are they tightly coupled? If so, we should control the together, not loosely like we currently have features.suse_buildpacks.enabled and features.sle15_stack.enabled.

Please, try with the features enabled/disabled.

@@ -292,5 +292,8 @@

{{- $root := . -}}
{{- range $path, $bytes := .Files.Glob "assets/operations/pre_render_scripts/api_*" }}
{{- if and (not $root.Values.features.suse_buildpacks.enabled) (regexMatch "api_suse-.*?-buildpack" $path ) }}
Copy link
Member

Choose a reason for hiding this comment

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

This is not very natural to read. How about we split that logic and make it clearer?

{{- if .Values.features.suse_buildpacks.enabled }}
  {{- range $path, $bytes := .Files.Glob "assets/operations/pre_render_scripts/api_*" }}
    {{- $root.Files.Get $path }}
  {{- end }}
{{- else }}
  {{- range $path, $bytes := .Files.Glob "assets/operations/pre_render_scripts/api_*" }}
    {{- if not (regexMatch "api_suse-.*?-buildpack" $path) }}
      {{- $root.Files.Get $path }}
    {{- end }}
  {{- end }}
{{- end }}

It's longer but easier to read.

@@ -159,7 +155,10 @@

{{- $root := . -}}
{{- range $path, $bytes := .Files.Glob "assets/operations/pre_render_scripts/diego-cell_*" }}
{{- if and (not $root.Values.features.suse_buildpacks.enabled) (regexMatch "diego-cell_sle15-rootfs-setup" $path) }}
Copy link
Member

Choose a reason for hiding this comment

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

The same idea here as the comment on the other similar code block.

@f0rmiga f0rmiga merged commit 6fabd84 into master Jan 23, 2020
@f0rmiga f0rmiga deleted the bisingh/add-suse-buildpacks branch January 23, 2020 07:03
bikramnehra pushed a commit that referenced this pull request Apr 21, 2020
Enabling SUSE buildpacks on Cloud Controller
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants