简体   繁体   English

CF上的Scala应用程序

[英]Scala application on CF

I tried to launch our Scala application on the Swisscom Cloud Foundry (CF) infrastructure. 我尝试在Swisscom Cloud Foundry(CF)基础架构上启动我们的Scala应用程序。 To do so, the matching Heroku buildpack was used: 为此,使用匹配的Heroku buildpack:

https://github.com/heroku/heroku-buildpack-scala https://github.com/heroku/heroku-buildpack-scala

As this did not work, I tried to deploy the 'hello-scala' example using this buildpack. 由于这不起作用,我尝试使用此buildpack部署'hello-scala'示例。 My fork to be able to build the slightly outdated example: 我的fork能够构建稍微过时的示例:

https://github.com/AlwinEgger/hello-scala https://github.com/AlwinEgger/hello-scala

I have to underline that I am fetching the port I have to use as env variable 'PORT'. 我必须强调我正在获取我必须用作env变量'PORT'的端口。

Unfortunately, there is not much on the log. 不幸的是,日志上没有多少。 "failed to accept connections within health check timeout" message indicates that there is no one listening... “未能接受健康检查超时内的连接”消息表明没有人听...

My questions: Did anyone succeed in deploying Scala apps on CF infrastructures (@ Swisscom)? 我的问题:有没有人成功在CF基础架构上部署Scala应用程序(@ Swisscom)?

A workaround I found: 我找到了一个解决方法:

I'm not using the scala- but the java-buildback. 我没有使用scala-但是java-buildback。 This with the major advantage and inconvenience that the project is not any more build on the instance. 这具有主要优点和不便之处,即项目不再基于实例构建。

  • Advantage: It speeds up the whole process considerably 优势:它大大加快了整个过程
  • Inconvenience: A build server is needed 不便:需要构建服务器

So what do we have to do? 那么我们该怎么办?

An example may be found here (this is the actual application): https://github.com/OpenOlitor/openolitor-server 这里可以找到一个例子(这是实际的应用程序): https//github.com/OpenOlitor/openolitor-server

  1. Add the sbt-native-packager to your project sbt-native-packager添加到项目中
  2. Execute the action 'universal:packageBin' building by hand or configure your build server to do so 手动执行动作'universal:packageBin'构建或配置构建服务器以执行此操作
  3. Change the buildpack in the manifest.yml and add some parameters, if necessary. 如有必要,更改manifest.yml中的buildpack并添加一些参数。 Configure the path of the artifact to deploy. 配置要部署的工件的路径。
  4. Run cf push or let the build server do so. 运行cf push或让构建服务器执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM