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

CF Platform Specific Deployment for Service Broker Proxy module #30

Open
dzahariev opened this issue Mar 23, 2018 · 5 comments
Open

CF Platform Specific Deployment for Service Broker Proxy module #30

dzahariev opened this issue Mar 23, 2018 · 5 comments

Comments

@dzahariev
Copy link
Member

dzahariev commented Mar 23, 2018

Background

Service Broker Proxy need to be deployed on all platforms that want to use Service Manager.
We need to provide packages that allow deployment on K8S and CF as host platforms for Service Broker Proxy module.
The implementation is separated on 2 parts:
Service Broker Proxy Core module - that take cares for Business logic implementation including:

  • Initial configuration through environment
  • Generic client for controller API commands
  • Registration in to host platform using the Platform controller API
  • REST API implementation
  • Domain and Data model
  • Healthcheck endpoint
    Platform specific module - that take cares for packaging and platform specific configuration like:
  • Platform specific deployment details - CPU, RAM, Buildpack, VM type, …
  • Platform specific packaging details - archive or image preparation
  • Platform specific provisioning and deployment scripts ensuring HA and Blue/Green deployment
  • Platform specific health check requirements to the core module
  • oAuth client for platform controller API access
  • Implementation of the generic client for controller API
  • Registration of Custom URL for the deployed module

Example with Go Application packaging for CF can be seen on:
https://github.com/govau/cf-go-helloworld

Objective

Prepare CF Platform dependent module.

Acceptance Criteria

  • I can build (prepare deployable) with a script that is included in the repository
  • README document with deployment process including preconditions, installation steps and configuration details is included
  • Following the steps I can deploy and start the Service Broker Proxy Core module in CF environment
@poblin-orange
Copy link

The suggested service manager implementation deployment/cf/manifest.yml uses docker based deployement. Some cf platform dot not have docker feature enabled. A go buildpack deployment would be more portable ?

@dzahariev
Copy link
Member Author

The idea was to have deployable that allows deployments to be reproduced on different setups (test/val/prod) with already validated binaries.
Anyway, you may contribute this as alternative approach for deployment.

@poblin-orange
Copy link

Ok. im trying to do a deployment as cf app + go builpack to prepare a MR.

applications:
- name: peripli-osb-service-manager
  buildpacks:
  - https://github.com/cloudfoundry/go-buildpack.git
  disk_quota: 512M
  env:
    API_CLIENT_ID: cf
    API_SKIP_SSL_VALIDATION: "true"
    API_TOKEN_ISSUER_URL: https://uaa.xxx
    GOPACKAGENAME: github.com/Peripli/service-manager
    GOVERSION: go1.11
    LOG_FORMAT: json
    LOG_LEVEL: debug
    STORAGE_ENCRYPTION_KEY: zzz
    STORAGE_NAME: peripli-sm-db
    STORAGE_SKIP_SSL_VALIDATION: "true"
  instances: 1
  memory: 256M
  routes:
  - route: peripli-osb-service-manager.wwww
  services:
  - peripli-sm-db
  stack: cflinuxfs2
  timeout: 180

Cf staging compiles the application, but i have failure wrt .sql files location

   2018-11-28T00:03:59.06+0000 [CELL/0] OUT Starting health monitoring of container
   2018-11-28T00:03:59.15+0000 [APP/PROC/WEB/0] ERR time="2018-11-28T00:03:59Z" level=info msg="Service Manager Version:  ()"
   2018-11-28T00:03:59.15+0000 [APP/PROC/WEB/0] OUT {"component":"postgres/storage.go:173","correlation_id":"-","level":"debug","msg":"Updating database schema using migrations from file:///tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/storage/postgres/migrations","time":"2018-11-28T00:03:59Z"}
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] OUT {"component":"postgres/storage.go:175","correlation_id":"-","level":"panic","msg":"Could not update database schema: open /tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/storage/postgres/migrations: no such file or directory","time":"2018-11-28T00:03:59Z"}
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR panic: (*logrus.Entry) (0x560eaa8df0a0,0xc0001ea1e0)
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR goroutine 1 [running]:
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR github.com/Peripli/service-manager/vendor/github.com/sirupsen/logrus.Entry.log(0xc0001ea190, 0xc0001ba540, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x560e00000000, ...)
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR 	/tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/vendor/github.com/sirupsen/logrus/entry.go:126 +0x2a9
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR github.com/Peripli/service-manager/vendor/github.com/sirupsen/logrus.(*Entry).Panic(0xc0001ea140, 0xc000127c78, 0x1, 0x1)
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR 	/tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/vendor/github.com/sirupsen/logrus/entry.go:194 +0xb4
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR github.com/Peripli/service-manager/vendor/github.com/sirupsen/logrus.(*Entry).Panicln(0xc0001ea140, 0xc000127d28, 0x2, 0x2)
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR 	/tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/vendor/github.com/sirupsen/logrus/entry.go:289 +0xd7
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR github.com/Peripli/service-manager/storage/postgres.(*postgresStorage).Open(0xc00008dad0, 0xc000032f00, 0x560eaa47beba, 0x8)
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR 	/tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/storage/postgres/storage.go:175 +0x3e9
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR github.com/Peripli/service-manager/storage.Use(0x560eaa8f7260, 0xc000155ad0, 0x560eaa47beba, 0x8, 0xc000032f00, 0x0, 0x0, 0x0, 0x0)
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR 	/tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/storage/registry.go:56 +0xe6
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR github.com/Peripli/service-manager/pkg/sm.New(0x560eaa8f7260, 0xc000155ad0, 0xc00001f790, 0x560eaa8f7420, 0xc00000e0c8, 0x0)
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR 	/tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/pkg/sm/sm.go:98 +0x21e
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR main.main()
   2018-11-28T00:03:59.16+0000 [APP/PROC/WEB/0] ERR 	/tmp/gobuildpack.gopath255487720/.go/src/github.com/Peripli/service-manager/main.go:33 +0xae
   2018-11-28T00:03:59.17+0000 [APP/PROC/WEB/0] OUT Exit status 2
   2018-11-28T00:03:59.17+0000 [CELL/SSHD/0] OUT Exit status 0

@dzahariev
Copy link
Member Author

Usually resource files are not deployed when deploy SM with go build pack.
Only binary is provisioned and the SQL files that are needed for DB update/migrate are missing.

@dzahariev dzahariev reopened this Nov 28, 2018
@dzahariev
Copy link
Member Author

I close it by mistake. Reopening.

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

No branches or pull requests

2 participants